Revert "intial changes for commit #495"

This reverts commit 4869877f77.
This commit is contained in:
MikiP98
2024-11-16 21:39:26 +01:00
parent 51d696ea5f
commit 62be2ab097
56 changed files with 2279 additions and 3555 deletions

View File

@ -11,19 +11,16 @@ void GriAndEminShadowFix(
float MinimumValue = 0.05;
// give a tiny boost to the distance mulitplier when shadowmap resolution is below 2048.0
// float ResMultiplier = 1.0 + (shadowDistance/8.0)*(1.0 - min(shadowMapResolution,2048)/2048.0)*0.3;
float ResMultiplier = 1.0 + (shadowDistance/8.0)*(1.0 - min(shadowMapResolution,2048)/2048.0)*0.3;
// float DistanceMultiplier = max(1.0 - max(1.0 - length(WorldPos) / shadowDistance, 0.0), MinimumValue) * ResMultiplier;
float theDistance = max(1.0 - length(WorldPos) / shadowDistance,0.0);
float DistanceMultiplier = mix(0.5, 0.05, theDistance);
float DistanceMultiplier2 = mix(1.0, 0.02, theDistance);
vec3 Bias = (FlatNormal * DistanceMultiplier + WsunVec * DistanceMultiplier2);
float DistanceMultiplier = max(1.0 - max(1.0 - length(WorldPos) / shadowDistance, 0.0), MinimumValue) * ResMultiplier;
vec3 Bias = FlatNormal * DistanceMultiplier;
// stop lightleaking by zooming up, centered on blocks
vec2 scale = vec2(0.5); scale.y *= 0.5;
vec3 zoomShadow = scale.y - scale.x * fract(WorldPos + cameraPosition + Bias*scale.y*0.1);
if(SkyLightmap < 0.1 && isEyeInWater != 1 && VanillaAO > 0.0) Bias = zoomShadow;
vec3 zoomShadow = scale.y - scale.x * fract(WorldPos + cameraPosition + Bias*scale.y);
if(SkyLightmap < 0.1) Bias = zoomShadow;
WorldPos += Bias;
}