Graphics/CullingList: Improve culling list

- Now supports box culling
- Removed branch
- Removed complex hash combination and replaced it with a much faster algorithm
- It now supports partial visibility
This commit is contained in:
Jérôme Leclercq
2018-08-31 17:26:50 +02:00
parent 56873b92b0
commit 7bb6c84752
4 changed files with 205 additions and 168 deletions

View File

@@ -217,7 +217,10 @@ namespace Ndk
if (camComponent.UpdateVisibility(visibilityHash) || m_forceRenderQueueInvalidation || forceInvalidation)
{
renderQueue->Clear();
for (const GraphicsComponent* gfxComponent : m_drawableCulling)
for (const GraphicsComponent* gfxComponent : m_drawableCulling.GetFullyVisibleResults())
gfxComponent->AddToRenderQueue(renderQueue);
for (const GraphicsComponent* gfxComponent : m_drawableCulling.GetPartiallyVisibleResults())
gfxComponent->AddToRenderQueue(renderQueue);
for (const Ndk::EntityHandle& light : m_lights)