Add **Hardware Occlusion Culling** to models, foliage, particles, terrain and local light shadows

This commit is contained in:
2026-08-28 19:53:10 +02:00
parent 48b1931546
commit 97186f1970
31 changed files with 793 additions and 50 deletions
+3 -3
View File
@@ -1137,7 +1137,7 @@ void DrawEmitterGPU(RenderContextBatch& renderContextBatch, ParticleBuffer* buff
#endif
void Particles::DrawParticles(RenderContextBatch& renderContextBatch, ParticleEffect* effect)
void Particles::DrawParticles(RenderContextBatch& renderContextBatch, ParticleEffect* effect, DrawPass drawModes)
{
PROFILE_CPU();
PROFILE_MEM(Particles);
@@ -1153,7 +1153,7 @@ void Particles::DrawParticles(RenderContextBatch& renderContextBatch, ParticleEf
for (int32 i = 0; i < renderContextBatch.Contexts.Count(); i++)
{
const RenderView& view = renderContextBatch.Contexts.Get()[i].View;
const bool visible = (view.Pass & effect->DrawModes) != DrawPass::None && (view.IsCullingDisabled || view.CullingFrustum.Intersects(bounds));
const bool visible = (view.Pass & drawModes) != DrawPass::None && (view.IsCullingDisabled || view.CullingFrustum.Intersects(bounds));
if (visible)
{
drawAnyView = true;
@@ -1163,7 +1163,7 @@ void Particles::DrawParticles(RenderContextBatch& renderContextBatch, ParticleEf
}
if (drawAnyView == false)
return;
viewsDrawModes &= effect->DrawModes;
viewsDrawModes &= drawModes;
// Setup
ScopeReadLock systemScope(SystemLocker);