From a684a91bf5ef01dfeb05de517f3550b26ff45995 Mon Sep 17 00:00:00 2001 From: Dmitry Kostenko Date: Wed, 10 Nov 2021 00:31:02 +0100 Subject: Fix shadow rendering with filtering disabled --- client/shaders/object_shader/opengl_fragment.glsl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'client/shaders/object_shader/opengl_fragment.glsl') diff --git a/client/shaders/object_shader/opengl_fragment.glsl b/client/shaders/object_shader/opengl_fragment.glsl index 0dcbbd321..3cbf4347a 100644 --- a/client/shaders/object_shader/opengl_fragment.glsl +++ b/client/shaders/object_shader/opengl_fragment.glsl @@ -181,6 +181,9 @@ float getPenumbraRadius(sampler2D shadowsampler, vec2 smTexCoord, float realDist float perspectiveFactor; // 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); -- cgit v1.2.3