Fix CSM shadows intensity due to sharpness trick

This commit is contained in:
Wojtek Figat
2024-06-02 22:38:46 +02:00
parent bba14d265a
commit a08954f7db

View File

@@ -283,6 +283,11 @@ ShadowSample SampleDirectionalLightShadow(LightData light, Buffer<float4> shadow
#endif
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;
}