Improve shadow maps sharing in nested scene rendering

This commit is contained in:
Wojtek Figat
2025-09-02 22:14:07 +02:00
parent ad1163bccc
commit eff5f84185

View File

@@ -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;
}
}
}