diff options
author | x2048 <codeforsmile@gmail.com> | 2021-10-01 16:21:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 16:21:53 +0200 |
commit | 982e03f60dc95cb2605a4a1c6520b604f85dd1d0 (patch) | |
tree | 748a4763dea169f7e983a602a1fc7d2e031c9849 /client/shaders/object_shader | |
parent | 21113ad4105dd3fb181b3d0638b907af94a352ab (diff) | |
download | minetest-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.glsl | 6 |
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 |