rendering: stabilize single-map directional shadow fitting

This commit is contained in:
2026-04-13 03:13:30 +08:00
parent 82c55b3999
commit 95edf0435f
3 changed files with 99 additions and 9 deletions

View File

@@ -16,9 +16,11 @@ namespace Rendering {
// fitting and the default sampling / caster bias values emitted into the
// runtime shadow contract.
struct DirectionalShadowPlanningSettings {
uint32_t mapDimension = 1024u;
// Keep the single-map MainLight shadow at a higher baseline so the current
// non-cascaded implementation has enough texel density to be usable.
uint32_t mapDimension = 2048u;
float minFocusDistance = 5.0f;
float maxFocusDistance = 64.0f;
float maxFocusDistance = 32.0f;
float perspectiveFocusFactor = 1.0f;
float orthographicFocusFactor = 2.0f;
float minDepthRange = 20.0f;

View File

@@ -286,7 +286,7 @@ DirectionalShadowRenderPlan BuildDirectionalShadowRenderPlan(
gameObject->GetComponent<Components::MeshRendererComponent>();
if (meshRenderer == nullptr ||
!meshRenderer->IsEnabled() ||
(!meshRenderer->GetCastShadows() && !meshRenderer->GetReceiveShadows())) {
!meshRenderer->GetCastShadows()) {
continue;
}