Graphics/RenderSystem: Add supports for partial culling

This commit is contained in:
Lynix
2018-08-31 21:45:35 +02:00
parent 5e6204fad4
commit b739965b1d
3 changed files with 37 additions and 5 deletions

View File

@@ -204,9 +204,11 @@ namespace Ndk
bool forceInvalidation = false;
const Nz::Frustumf& frustum = camComponent.GetFrustum();
std::size_t visibilityHash;
if (m_isCullingEnabled)
visibilityHash = m_drawableCulling.Cull(camComponent.GetFrustum(), &forceInvalidation);
visibilityHash = m_drawableCulling.Cull(frustum, &forceInvalidation);
else
visibilityHash = m_drawableCulling.FillWithAllEntries(&forceInvalidation);
@@ -220,9 +222,8 @@ namespace Ndk
for (const GraphicsComponent* gfxComponent : m_drawableCulling.GetFullyVisibleResults())
gfxComponent->AddToRenderQueue(renderQueue);
// FIXME: We should cull individual renderables here
for (const GraphicsComponent* gfxComponent : m_drawableCulling.GetPartiallyVisibleResults())
gfxComponent->AddToRenderQueue(renderQueue);
gfxComponent->AddToRenderQueueByCulling(frustum, renderQueue);
for (const Ndk::EntityHandle& light : m_lights)
{