perf: Only render particles if in frustum

This commit is contained in:
Vsevolod Kremianskii 2021-01-12 09:33:17 +07:00
parent 899f4be6cd
commit f761cb1c89

View file

@ -143,7 +143,7 @@ void SceneGraph::refreshNodeLists() {
_lights.push_back(light);
} else if (g_emittersEnabled) {
auto particle = dynamic_cast<ParticleSceneNode *>(node);
if (particle) {
if (particle && _activeCamera->isInFrustum(particle->absoluteTransform()[3])) {
_particles.push_back(particle);
}
}