From eff5f84185c02fefc075d46e88cc3333fafd1ac8 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 2 Sep 2025 22:14:07 +0200 Subject: [PATCH] Improve shadow maps sharing in nested scene rendering --- Source/Engine/Renderer/ShadowsPass.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Renderer/ShadowsPass.cpp b/Source/Engine/Renderer/ShadowsPass.cpp index 19985f0be..0bf2f70d1 100644 --- a/Source/Engine/Renderer/ShadowsPass.cpp +++ b/Source/Engine/Renderer/ShadowsPass.cpp @@ -1368,10 +1368,11 @@ RETRY_ATLAS_SETUP: tile.LinkedRectTile = nullptr; auto& linkedTile = linkedAtlasLight->Tiles[tileIndex]; - // Check if both lights use the same projections - if (tile.WorldToShadow == linkedTile.WorldToShadow && linkedTile.RectTile) + // Link tile and use its projection + if (linkedTile.RectTile) { tile.LinkedRectTile = linkedTile.RectTile; + tile.WorldToShadow = linkedTile.WorldToShadow; } } }