Disable contact shadows on low shadows quality mode and fix step count for high setting

This commit is contained in:
Wojtek Figat
2025-03-08 19:46:35 +01:00
parent 5bdbbb6d38
commit baf28382a8
2 changed files with 6 additions and 6 deletions

BIN
Content/Shaders/Shadows.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -30,7 +30,7 @@ float RayCastScreenSpaceShadow(GBufferData gBufferData, GBufferSample gBuffer, f
{
#if SHADOWS_QUALITY == 3
const uint maxSteps = 16;
#elif SHADOWS_QUALITY == 3
#elif SHADOWS_QUALITY == 2
const uint maxSteps = 12;
#else
const uint maxSteps = 8;
@@ -92,7 +92,7 @@ float4 PS_PointLight(Model_VS2PS input) : SV_Target0
// Sample shadow
ShadowSample shadow = SamplePointLightShadow(Light, ShadowsBuffer, ShadowMap, gBuffer);
#if CONTACT_SHADOWS
#if CONTACT_SHADOWS && SHADOWS_QUALITY > 0
// Calculate screen-space contact shadow
shadow.SurfaceShadow *= RayCastScreenSpaceShadow(gBufferData, gBuffer, gBuffer.WorldPos, normalize(Light.Position - gBuffer.WorldPos), ContactShadowsLength);
#endif
@@ -119,7 +119,7 @@ float4 PS_DirLight(Quad_VS2PS input) : SV_Target0
// Sample shadow
ShadowSample shadow = SampleDirectionalLightShadow(Light, ShadowsBuffer, ShadowMap, gBuffer, TemporalTime);
#if CONTACT_SHADOWS
#if CONTACT_SHADOWS && SHADOWS_QUALITY > 0
// Calculate screen-space contact shadow
shadow.SurfaceShadow *= RayCastScreenSpaceShadow(gBufferData, gBuffer, gBuffer.WorldPos, Light.Direction, ContactShadowsLength);
#endif
@@ -149,7 +149,7 @@ float4 PS_SpotLight(Model_VS2PS input) : SV_Target0
// Sample shadow
ShadowSample shadow = SampleSpotLightShadow(Light, ShadowsBuffer, ShadowMap, gBuffer);
#if CONTACT_SHADOWS
#if CONTACT_SHADOWS && SHADOWS_QUALITY > 0
// Calculate screen-space contact shadow
shadow.SurfaceShadow *= RayCastScreenSpaceShadow(gBufferData, gBuffer, gBuffer.WorldPos, normalize(Light.Position - gBuffer.WorldPos), ContactShadowsLength);
#endif