Add support for CanRender in postFx to depend on specific render setup

This commit is contained in:
Wojciech Figat
2023-01-06 13:45:36 +01:00
parent b753b18682
commit c011e8af62
2 changed files with 12 additions and 3 deletions

View File

@@ -238,13 +238,13 @@ void SceneRenderTask::OnCollectDrawCalls(RenderContextBatch& renderContextBatch,
{
for (PostProcessEffect* fx : GlobalCustomPostFx)
{
if (fx && fx->CanRender())
if (fx && fx->CanRender(renderContext))
postFx.Add(fx);
}
}
for (PostProcessEffect* fx : CustomPostFx)
{
if (fx && fx->CanRender())
if (fx && fx->CanRender(renderContext))
postFx.Add(fx);
}
if (const auto* camera = Camera.Get())
@@ -252,7 +252,7 @@ void SceneRenderTask::OnCollectDrawCalls(RenderContextBatch& renderContextBatch,
for (Script* script : camera->Scripts)
{
auto* fx = Cast<PostProcessEffect>(script);
if (fx && fx->CanRender())
if (fx && fx->CanRender(renderContext))
postFx.Add(fx);
}
}