Skip to content

Commit

Permalink
Revert a bad "optimization" I made in #18587
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Dec 25, 2023
1 parent c9e2697 commit 0f3dca5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GPU/Common/VertexShaderGenerator.cpp
Expand Up @@ -1072,7 +1072,7 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag
p.C(" if (comp == 0x1u && ldot > 0.0) {\n"); // do specular
p.C(" if (u_matspecular.a > 0.0) {\n");
p.C(" ldot = dot(normalize(toLight + vec3(0.0, 0.0, 1.0)), worldnormal);\n");
p.C(" ldot = pow(ldot, u_matspecular.a);\n");
p.C(" ldot = pow(max(ldot, 0.0), u_matspecular.a);\n");
p.C(" } else {\n");
p.C(" ldot = 1.0;\n");
p.C(" }\n");
Expand Down Expand Up @@ -1147,7 +1147,7 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag
p.C(" if (ldot >= 0.0) {\n");
p.C(" if (u_matspecular.a > 0.0) {\n");
p.C(" ldot = dot(normalize(toLight + vec3(0.0, 0.0, 1.0)), worldnormal);\n");
p.C(" ldot = pow(ldot, u_matspecular.a);\n");
p.C(" ldot = pow(max(ldot, 0.0), u_matspecular.a);\n");
p.C(" } else {\n");
p.C(" ldot = 1.0;\n");
p.C(" }\n");
Expand Down

0 comments on commit 0f3dca5

Please sign in to comment.