aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorx2048 <codeforsmile@gmail.com>2022-01-02 22:45:55 +0100
committerGitHub <noreply@github.com>2022-01-02 13:45:55 -0800
commit835524654ed95afd1c5584c398a78ac226d0f27e (patch)
treef0458613e85f1d23543ef4314a784dba266ee6e6
parente030d9cff08636a3c9ed301efb5e35b7642ac166 (diff)
downloadminetest-835524654ed95afd1c5584c398a78ac226d0f27e.tar.gz
minetest-835524654ed95afd1c5584c398a78ac226d0f27e.tar.bz2
minetest-835524654ed95afd1c5584c398a78ac226d0f27e.zip
Fix shadow mapping when PCF is disabled (#11888)
-rw-r--r--client/shaders/nodes_shader/opengl_fragment.glsl1
1 files changed, 1 insertions, 0 deletions
diff --git a/client/shaders/nodes_shader/opengl_fragment.glsl b/client/shaders/nodes_shader/opengl_fragment.glsl
index b4a605b28..9ee88eb39 100644
--- a/client/shaders/nodes_shader/opengl_fragment.glsl
+++ b/client/shaders/nodes_shader/opengl_fragment.glsl
@@ -185,6 +185,7 @@ float getPenumbraRadius(sampler2D shadowsampler, vec2 smTexCoord, float realDist
float baseLength = getBaseLength(smTexCoord);
float perspectiveFactor;
+ if (PCFBOUND == 0.0) return 0.0;
// Return fast if sharp shadows are requested
if (SOFTSHADOWRADIUS <= 1.0) {
perspectiveFactor = getDeltaPerspectiveFactor(baseLength);