mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01: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