]> git.lizzy.rs Git - minetest.git/commitdiff
Fix shadow mapping when PCF is disabled (#11888)
authorx2048 <codeforsmile@gmail.com>
Sun, 2 Jan 2022 21:45:55 +0000 (22:45 +0100)
committerGitHub <noreply@github.com>
Sun, 2 Jan 2022 21:45:55 +0000 (13:45 -0800)
client/shaders/nodes_shader/opengl_fragment.glsl

index b4a605b28e2cf11910263295af182cbbcac4052b..9ee88eb39fd84bd47b8e5d6c05e35bf791370b45 100644 (file)
@@ -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);