Skip to content

Commit 42a8f25

Browse files
authored
Merge pull request avaraline#484 from rherriman/rendering-improvements
2 parents ae28076 + 96209a5 commit 42a8f25

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

rsrc/shaders/world_frag.glsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ vec3 spec_light(int i, vec3 viewDir) {
5656
vec3 lightDir = normalize(adjustedLightPos[i] - fragPos);
5757
vec3 halfwayDir = normalize(lightDir + viewDir);
5858
float spec = pow(max(dot(fragmentNormal, halfwayDir), 0.0), fragmentShininess);
59+
spec = spec * float(dot(fragmentNormal, lightDir) >= 0.0);
5960
return lightColor[i] * (spec * fragmentSpecular);
6061
}
6162

0 commit comments

Comments
 (0)