Fix rendering of custom actors lists in Editor viewports

This commit is contained in:
Wojtek Figat
2022-11-16 09:57:17 +01:00
parent 20661fc902
commit 16ebc72099
26 changed files with 118 additions and 178 deletions

View File

@@ -264,12 +264,16 @@ void SceneRenderTask::OnCollectDrawCalls(RenderContextBatch& renderContextBatch,
// Draw actors (collect draw calls)
if ((ActorsSource & ActorsSources::CustomActors) != 0)
{
if (_customActorsScene == nullptr)
_customActorsScene = New<SceneRendering>();
else
_customActorsScene->Clear();
for (Actor* a : CustomActors)
AddActorToSceneRendering(_customActorsScene, a);
if (category == SceneRendering::DrawCategory::PreRender)
{
if (_customActorsScene == nullptr)
_customActorsScene = New<SceneRendering>();
else
_customActorsScene->Clear();
for (Actor* a : CustomActors)
AddActorToSceneRendering(_customActorsScene, a);
}
ASSERT_LOW_LAYER(_customActorsScene);
_customActorsScene->Draw(renderContextBatch, (SceneRendering::DrawCategory)category);
}
if ((ActorsSource & ActorsSources::Scenes) != 0)