Hi everyone,
ParticleSystems keep rendering even if you look away: https://playground.babylonjs.com/#0K3AQ2#3646
Is it possible to enable culling for CPU particles?
Alternatively, what would be the best way to enable/disable a CPU ParticleSystem? (I mean disable when not seen, re-enable when seen again)
This looks like it is working: https://playground.babylonjs.com/#0K3AQ2#3647 (tl;dr: particleSystem.particles.length = 0) But it is not documented how to pause/resume+hide/show a particle system (maybe for a good reason idk). Will this have any side effects? Any caches left, cleanup skipped, etc…?
N.B. We can pause the system [1], but it will still be drawn.
Edit: there is a particleSystem.reset function which does essential that. So this should be alright then.
Edit2: In case it is not possbile with current Babylon: It is not actually too bad to do this yourself. There is Camera.isInFrustum(Mesh). So you need a probe mesh, link this (somehow) to the particle system, and finally use that probe onCameraViewChanged. Etc…
Best wishes
Joe