Fix incorrect directional light shadows influence on secondary render views
#1758
This commit is contained in:
@@ -343,6 +343,7 @@ void RenderInner(SceneRenderTask* task, RenderContext& renderContext, RenderCont
|
||||
// Prepare
|
||||
renderContext.View.Prepare(renderContext);
|
||||
renderContext.Buffers->Prepare();
|
||||
ShadowsPass::Instance()->Prepare();
|
||||
|
||||
// Build batch of render contexts (main view and shadow projections)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -94,6 +94,8 @@ public:
|
||||
LightShadowData LastDirLight;
|
||||
|
||||
public:
|
||||
void Prepare();
|
||||
|
||||
/// <summary>
|
||||
/// Setups the shadows rendering for batched scene drawing. Checks which lights will cast a shadow.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user