Refactor SceneRendering to simplify actors impl of drawing flow at high level

This commit is contained in:
Wojciech Figat
2022-02-22 17:06:19 +01:00
parent 8c075c78cb
commit 3fe1e2c763
43 changed files with 191 additions and 617 deletions

View File

@@ -81,6 +81,7 @@ Actor::Actor(const SpawnParams& params)
, _physicsScene(nullptr)
, HideFlags(HideFlags::None)
{
_drawNoCulling = 0;
}
SceneRendering* Actor::GetSceneRendering() const
@@ -1221,45 +1222,6 @@ void Actor::Draw(RenderContext& renderContext)
{
}
void Actor::DrawGeneric(RenderContext& renderContext)
{
// Generic drawing uses only GBuffer Fill Pass and simple frustum culling (see SceneRendering for more optimized drawing)
if (renderContext.View.Pass & DrawPass::GBuffer)
{
Draw(renderContext);
}
}
void Actor::DrawHierarchy(RenderContext& renderContext)
{
// Draw actor itself
DrawGeneric(renderContext);
// Draw children
if (renderContext.View.IsOfflinePass)
{
for (int32 i = 0; i < Children.Count(); i++)
{
auto child = Children[i];
if (child->GetIsActive() && child->GetStaticFlags() & renderContext.View.StaticFlagsMask)
{
child->DrawHierarchy(renderContext);
}
}
}
else
{
for (int32 i = 0; i < Children.Count(); i++)
{
auto child = Children[i];
if (child->GetIsActive())
{
child->DrawHierarchy(renderContext);
}
}
}
}
#if USE_EDITOR
void Actor::OnDebugDraw()