aboutsummaryrefslogtreecommitdiff
path: root/client/shaders/nodes_shader/opengl_fragment.glsl
diff options
context:
space:
mode:
authorDmitry Kostenko <codeforsmile@gmail.com>2021-11-10 00:31:02 +0100
committerx2048 <codeforsmile@gmail.com>2022-03-07 23:45:26 +0100
commita684a91bf5ef01dfeb05de517f3550b26ff45995 (patch)
tree9ad06bda711a52753a623d14e241a60ca60cc8af /client/shaders/nodes_shader/opengl_fragment.glsl
parent1175f48d05888fba705363729ecf5ef2c75f0c5d (diff)
downloadminetest-a684a91bf5ef01dfeb05de517f3550b26ff45995.tar.gz
minetest-a684a91bf5ef01dfeb05de517f3550b26ff45995.tar.bz2
minetest-a684a91bf5ef01dfeb05de517f3550b26ff45995.zip
Fix shadow rendering with filtering disabled
Diffstat (limited to 'client/shaders/nodes_shader/opengl_fragment.glsl')
-rw-r--r--client/shaders/nodes_shader/opengl_fragment.glsl3
1 files changed, 3 insertions, 0 deletions
diff --git a/client/shaders/nodes_shader/opengl_fragment.glsl b/client/shaders/nodes_shader/opengl_fragment.glsl
index d3194090c..55c3feac7 100644
--- a/client/shaders/nodes_shader/opengl_fragment.glsl
+++ b/client/shaders/nodes_shader/opengl_fragment.glsl
@@ -187,6 +187,9 @@ float getPenumbraRadius(sampler2D shadowsampler, vec2 smTexCoord, float realDist
if (PCFBOUND == 0.0) return 0.0;
// Return fast if sharp shadows are requested
+ if (PCFBOUND == 0.0)
+ return 0.0;
+
if (SOFTSHADOWRADIUS <= 1.0) {
perspectiveFactor = getDeltaPerspectiveFactor(baseLength);
return max(2 * length(smTexCoord.xy) * 2048 / f_textureresolution / pow(perspectiveFactor, 3), SOFTSHADOWRADIUS);