Page 1 of 1

ParticleSystem::setVisible

Posted: Sat May 24, 2008 12:49 pm
by cdleonard
It seems that if you set a ParticleSystem to be invisible via ::setVisible(false) it will still update itself every frame; as long as it is in the scene. ParticleSystems DO have a nonvisible_update_timeout option; but that only works if the particle system is outside the camera frustum (even if setVisble(false)).

What this means is that if you create a lot invisible particle systems you will consume a VERY large amount of CPU time. I solved this by detaching particle systems instead of just setting them as invisible; but this seems like a hack to me.

Shouldn't ->setVisible work together with nonvisible_update_timeout? This behaviour should at least be documented with a big warning in the manual.

Posted: Sat May 24, 2008 3:44 pm
by sinbad
Yes, you're right. I will make sure that the 'non visible timer' starts counting up from the frame that a psys is made invisible through whatever means.

For now though, consider detaching the particle systems from their scene nodes instead. That's actually a more efficient solution anyway unless the psys is only invisible for a very short time.