diff --git a/SDK/src/NDK/Components/GraphicsComponent.cpp b/SDK/src/NDK/Components/GraphicsComponent.cpp index a90853d1d..8a8516e16 100644 --- a/SDK/src/NDK/Components/GraphicsComponent.cpp +++ b/SDK/src/NDK/Components/GraphicsComponent.cpp @@ -161,7 +161,11 @@ namespace Ndk NazaraUnused(node); // Our view matrix depends on NodeComponent position/rotation + InvalidateBoundingVolume(); InvalidateTransformMatrix(); + + for (VolumeCullingEntry& entry : m_volumeCullingEntries) + entry.listEntry.ForceInvalidation(); //< Force invalidation on movement } /*! diff --git a/SDK/src/NDK/Systems/RenderSystem.cpp b/SDK/src/NDK/Systems/RenderSystem.cpp index 7b83ca1af..806a45e8c 100644 --- a/SDK/src/NDK/Systems/RenderSystem.cpp +++ b/SDK/src/NDK/Systems/RenderSystem.cpp @@ -183,10 +183,14 @@ namespace Ndk graphicsComponent.EnsureBoundingVolumeUpdate(); } - bool forceInvalidation = !m_particleGroups.empty(); //< Always regenerate renderqueue if particle groups are present for now (FIXME) + bool forceInvalidation = false; std::size_t visibilityHash = m_drawableCulling.Cull(camComponent.GetFrustum(), &forceInvalidation); + // Always regenerate renderqueue if particle groups are present for now (FIXME) + if (!m_particleGroups.empty()) + forceInvalidation = true; + if (camComponent.UpdateVisibility(visibilityHash) || m_forceRenderQueueInvalidation || forceInvalidation) { renderQueue->Clear(); diff --git a/src/Nazara/Graphics/ForwardRenderQueue.cpp b/src/Nazara/Graphics/ForwardRenderQueue.cpp index 2de6b66e4..2ffa45208 100644 --- a/src/Nazara/Graphics/ForwardRenderQueue.cpp +++ b/src/Nazara/Graphics/ForwardRenderQueue.cpp @@ -527,6 +527,24 @@ namespace Nz layers.erase(it++); else { + for (auto& pipelinePair : layer.billboards) + { + auto& pipelineEntry = pipelinePair.second; + + if (pipelineEntry.enabled) + { + for (auto& matIt : pipelinePair.second.materialMap) + { + auto& entry = matIt.second; + auto& billboardVector = entry.billboards; + + billboardVector.clear(); + } + } + + pipelineEntry.enabled = false; + } + for (auto& pipelinePair : layer.basicSprites) { auto& pipelineEntry = pipelinePair.second; diff --git a/src/Nazara/Graphics/ForwardRenderTechnique.cpp b/src/Nazara/Graphics/ForwardRenderTechnique.cpp index 959ef2f03..659261bf4 100644 --- a/src/Nazara/Graphics/ForwardRenderTechnique.cpp +++ b/src/Nazara/Graphics/ForwardRenderTechnique.cpp @@ -469,8 +469,6 @@ namespace Nz Renderer::DrawPrimitivesInstanced(renderedBillboardCount, PrimitiveMode_TriangleStrip, 0, 4); } while (billboardCount > 0); - - billboardVector.clear(); } } } @@ -562,8 +560,6 @@ namespace Nz Renderer::DrawIndexedPrimitives(PrimitiveMode_TriangleList, 0, renderedBillboardCount * 6); } while (billboardCount > 0); - - billboardVector.clear(); } } } @@ -773,7 +769,6 @@ namespace Nz } } } - instances.clear(); } } }