From f761cb1c8999d1f885bd1d2932c1a47c88dcb64e Mon Sep 17 00:00:00 2001 From: Vsevolod Kremianskii Date: Tue, 12 Jan 2021 09:33:17 +0700 Subject: [PATCH] perf: Only render particles if in frustum --- src/scene/scenegraph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scene/scenegraph.cpp b/src/scene/scenegraph.cpp index 19bcc867..fcc60b4a 100644 --- a/src/scene/scenegraph.cpp +++ b/src/scene/scenegraph.cpp @@ -143,7 +143,7 @@ void SceneGraph::refreshNodeLists() { _lights.push_back(light); } else if (g_emittersEnabled) { auto particle = dynamic_cast(node); - if (particle) { + if (particle && _activeCamera->isInFrustum(particle->absoluteTransform()[3])) { _particles.push_back(particle); } }