Added Specular map to the shader

This commit is contained in:
2019-12-10 13:47:08 +02:00
parent 26a7e48784
commit 8b1546cb54
2 changed files with 13 additions and 14 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ void triangle( Vec4f* pts, IShader &shader)
float frag_depth = 0;
for (int i = 0; i < 3; i++)
frag_depth += pts3[i][2] * bc_coord[i];
if (bc_coord.x < 0 || bc_coord.y < 0 || bc_coord.z < 0 || z_buffer[ P.x + P.y * screen_width ]>frag_depth || frag_depth < 0) continue;
if (bc_coord.x < 0 || bc_coord.y < 0 || bc_coord.z < 0 || z_buffer[ P.x + P.y * screen_width ]>frag_depth) continue;
TGAColor color;
bool discard = shader.fragment(bc_coord, color);
if (!discard) {