Fix incorrect directional light shadows influence on secondary render views

#1758
This commit is contained in:
Wojtek Figat
2023-11-06 14:20:30 +01:00
parent 1e9ded55b0
commit 9a9e32d4c5
3 changed files with 11 additions and 1 deletions

View File

@@ -549,10 +549,17 @@ void ShadowsPass::Dispose()
SAFE_DELETE_GPU_RESOURCE(_shadowMapCube);
}
void ShadowsPass::Prepare()
{
// Clear cached data
_shadowData.Clear();
LastDirLightIndex = -1;
LastDirLightShadowMap = nullptr;
}
void ShadowsPass::SetupShadows(RenderContext& renderContext, RenderContextBatch& renderContextBatch)
{
PROFILE_CPU();
_shadowData.Clear();
auto& view = renderContext.View;
// Update shadow map