summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-12-04 19:19:53 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-12-04 19:19:53 +0000
commite7492e532cb1f3474e34b87eb295edfd06c4204d (patch)
tree5593235eee5c80abd81c86ee9dcea9d7831579b0
parentGenerate and use a shadow map (diff)
downloadilt-e7492e532cb1f3474e34b87eb295edfd06c4204d.tar.bz2
ilt-e7492e532cb1f3474e34b87eb295edfd06c4204d.tar.xz
ilt-e7492e532cb1f3474e34b87eb295edfd06c4204d.zip
Do not unilluminate the back of objects
-rw-r--r--gfx/gl/shaders/directionalLight.fs2
1 files changed, 1 insertions, 1 deletions
diff --git a/gfx/gl/shaders/directionalLight.fs b/gfx/gl/shaders/directionalLight.fs
index 5350bf3..04715ce 100644
--- a/gfx/gl/shaders/directionalLight.fs
+++ b/gfx/gl/shaders/directionalLight.fs
@@ -23,5 +23,5 @@ main()
discard;
}
const vec3 Normal = texture(gNormal, TexCoords).rgb;
- FragColor = dot(-lightDirection, Normal) * lightColour;
+ FragColor = max(dot(-lightDirection, Normal) * lightColour, 0);
}