aboutsummaryrefslogtreecommitdiff
path: root/client/shaders/object_shader
diff options
context:
space:
mode:
authorx2048 <codeforsmile@gmail.com>2021-10-01 16:21:53 +0200
committerGitHub <noreply@github.com>2021-10-01 16:21:53 +0200
commit982e03f60dc95cb2605a4a1c6520b604f85dd1d0 (patch)
tree748a4763dea169f7e983a602a1fc7d2e031c9849 /client/shaders/object_shader
parent21113ad4105dd3fb181b3d0638b907af94a352ab (diff)
downloadminetest-982e03f60dc95cb2605a4a1c6520b604f85dd1d0.tar.gz
minetest-982e03f60dc95cb2605a4a1c6520b604f85dd1d0.tar.bz2
minetest-982e03f60dc95cb2605a4a1c6520b604f85dd1d0.zip
Improvements to colored shadows (#11516)
Diffstat (limited to 'client/shaders/object_shader')
-rw-r--r--client/shaders/object_shader/opengl_fragment.glsl6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/shaders/object_shader/opengl_fragment.glsl b/client/shaders/object_shader/opengl_fragment.glsl
index 9a0b90f15..3390e7227 100644
--- a/client/shaders/object_shader/opengl_fragment.glsl
+++ b/client/shaders/object_shader/opengl_fragment.glsl
@@ -351,7 +351,11 @@ void main(void)
vec3 posLightSpace = getLightSpacePosition();
#ifdef COLORED_SHADOWS
- vec4 visibility = getShadowColor(ShadowMapSampler, posLightSpace.xy, posLightSpace.z);
+ vec4 visibility;
+ if (cosLight > 0.0)
+ visibility = getShadowColor(ShadowMapSampler, posLightSpace.xy, posLightSpace.z);
+ else
+ visibility = vec4(1.0, 0.0, 0.0, 0.0);
shadow_int = visibility.r;
shadow_color = visibility.gba;
#else