fix tiny shadow issue with SSS

This commit is contained in:
Xonk
2025-03-11 00:27:23 -04:00
parent 8c3ed866c3
commit 74a0e0f0c8
2 changed files with 2 additions and 18 deletions

View File

@ -1010,23 +1010,9 @@ void main() {
vec3 projectedShadowPosition = mat3(shadowModelView) * shadowPlayerPos + shadowModelView[3].xyz;
projectedShadowPosition = diagonal3_old(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
#if OPTIMIZED_SHADOW_DISTANCE > 0
float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / (shadowDistance+16.0),0.0)*5.0,1.0));
float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / (shadowDistance+32.0),0.0)*5.0,1.0));
float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / shadowDistance,0.0)*5.0,1.0));
#else
vec3 shadowEdgePos = projectedShadowPosition * vec3(0.4,0.4,0.5/6.0) + vec3(0.5,0.5,0.12);
float fadeLength = max((shadowDistance/256)*30,10.0);
vec3 cubicRadius = clamp( min((1.0-shadowEdgePos)*fadeLength, shadowEdgePos*fadeLength),0.0,1.0);
float shadowmapFade = cubicRadius.x*cubicRadius.y*cubicRadius.z;
shadowmapFade = 1.0 - pow(1.0-pow(shadowmapFade,1.5),3.0);
float shadowMapFalloff = shadowmapFade;
float shadowMapFalloff2 = shadowmapFade;
#endif
if(isEyeInWater == 1){
shadowMapFalloff = 1.0;

View File

@ -532,8 +532,6 @@ void main() {
vec3 indirectLightColor = averageSkyCol / 1200.0;
vec3 indirectLightColor_dynamic = averageSkyCol_Clouds / 1200.0;
// indirectLightColor_dynamic += (MIN_LIGHT_AMOUNT * 0.01 * 0.2 + nightVision*0.02);
#if defined OVERWORLD_SHADER
// z0 = texture2D(depthtex0, tc + jitter/VL_RENDER_RESOLUTION).x;
// viewPos0 = toScreenSpace_DH(tc/RENDER_SCALE, z0, DH_z0);