Fix shadow sharpness processing

This commit is contained in:
Wojtek Figat
2024-06-17 18:59:13 +02:00
parent 6e0dd2064a
commit 87aa23107d
2 changed files with 1 additions and 5 deletions

View File

@@ -80,7 +80,7 @@ float CalculateSubsurfaceOcclusion(float opacity, float sceneDepth, float shadow
float PostProcessShadow(ShadowData lightShadow, float shadow)
{
// Apply shadow fade and sharpness
shadow = saturate((shadow - 0.5) * lightShadow.Sharpness + 0.5);
shadow = saturate((shadow - 0.51f) * lightShadow.Sharpness + 0.5f);
shadow = lerp(1.0f, shadow, lightShadow.Fade);
return shadow;
}

View File

@@ -284,10 +284,6 @@ ShadowSample SampleDirectionalLightShadow(LightData light, Buffer<float4> shadow
result.SurfaceShadow = PostProcessShadow(shadow, result.SurfaceShadow);
// Fix shadow intensity that got reduced by cascades sharpness stabilization (see above)
if (cascadeIndex != 0 && result.SurfaceShadow <= 0.1f)
result.SurfaceShadow += 0.01f;
return result;
}