Add variable rate update for shadow maps atlas based on distance to light

This commit is contained in:
Wojtek Figat
2024-04-08 00:04:57 +02:00
parent 7d92779e99
commit 708fba5136
11 changed files with 328 additions and 151 deletions

View File

@@ -80,7 +80,7 @@ bool RenderLocalLightData::CanRenderShadow(const RenderView& view) const
const float fadeDistance = Math::Max(ShadowsFadeDistance, 0.1f);
const float dstLightToView = Float3::Distance(Position, view.Position);
const float fade = 1 - Math::Saturate((dstLightToView - Radius - ShadowsDistance + fadeDistance) / fadeDistance);
return fade > ZeroTolerance && RenderLightData::CanRenderShadow(view);
return fade > ZeroTolerance && Radius > 10 && RenderLightData::CanRenderShadow(view);
}
void RenderSpotLightData::SetShaderData(ShaderLightData& data, bool useShadow) const