mirror of
https://github.com/minetest/minetest.git
synced 2024-09-12 00:26:50 +02:00
Fix shadow rendering with filtering disabled
This commit is contained in:
parent
1175f48d05
commit
a684a91bf5
@ -187,6 +187,9 @@ float getPenumbraRadius(sampler2D shadowsampler, vec2 smTexCoord, float realDist
|
|||||||
|
|
||||||
if (PCFBOUND == 0.0) return 0.0;
|
if (PCFBOUND == 0.0) return 0.0;
|
||||||
// Return fast if sharp shadows are requested
|
// Return fast if sharp shadows are requested
|
||||||
|
if (PCFBOUND == 0.0)
|
||||||
|
return 0.0;
|
||||||
|
|
||||||
if (SOFTSHADOWRADIUS <= 1.0) {
|
if (SOFTSHADOWRADIUS <= 1.0) {
|
||||||
perspectiveFactor = getDeltaPerspectiveFactor(baseLength);
|
perspectiveFactor = getDeltaPerspectiveFactor(baseLength);
|
||||||
return max(2 * length(smTexCoord.xy) * 2048 / f_textureresolution / pow(perspectiveFactor, 3), SOFTSHADOWRADIUS);
|
return max(2 * length(smTexCoord.xy) * 2048 / f_textureresolution / pow(perspectiveFactor, 3), SOFTSHADOWRADIUS);
|
||||||
|
@ -181,6 +181,9 @@ float getPenumbraRadius(sampler2D shadowsampler, vec2 smTexCoord, float realDist
|
|||||||
float perspectiveFactor;
|
float perspectiveFactor;
|
||||||
|
|
||||||
// Return fast if sharp shadows are requested
|
// Return fast if sharp shadows are requested
|
||||||
|
if (PCFBOUND == 0.0)
|
||||||
|
return 0.0;
|
||||||
|
|
||||||
if (SOFTSHADOWRADIUS <= 1.0) {
|
if (SOFTSHADOWRADIUS <= 1.0) {
|
||||||
perspectiveFactor = getDeltaPerspectiveFactor(baseLength);
|
perspectiveFactor = getDeltaPerspectiveFactor(baseLength);
|
||||||
return max(2 * length(smTexCoord.xy) * 2048 / f_textureresolution / pow(perspectiveFactor, 3), SOFTSHADOWRADIUS);
|
return max(2 * length(smTexCoord.xy) * 2048 / f_textureresolution / pow(perspectiveFactor, 3), SOFTSHADOWRADIUS);
|
||||||
|
Loading…
Reference in New Issue
Block a user