- Home /
ParticleSystem/MeshParticleEmitter Optimisation and Culling.
Hi,
This is a great community and this is my first post. I apologise in advance if I made any mistakes in posting this here.
In my project I'm using a MeshParticleEmitter with Particle Renderer and Animator on almost all of my objects. I would like to turn these emitters off when they are not seen in the camera view. The way I dealt with this was as follows: I attached a script "A" to every object that had an emitter. Through script "A" I can manage all my particles and shut them off when they are outside of a BoxCollider attached to my camera.
Now, I have a bunch of questions about this:
Is it more efficient to use the new ParticleSystem?
Is there an automatic/built-in way of turning these particles off without the script I have. Did someone write a script for this already? Does Unity have a box I can check for this?
When I use my method I have to either check the objects on TriggerEnter/Exit and turn them on/off or I have to check and go through all the objects I saved in a list with a CoRoutine every t seconds, checking if they are colliding with the box. Which way is more efficient?
Would it be more efficient to deactivate the object that carries the ParticleEmitter or put the emit to false?
Am I capable of manipulating the new ParticleSystem the same way I did with the old one through scripting? Which one should I rely on?
I have a background object that emits particles everywhere and encapsulates the camera... If I stop it's emitter by making it false, it stops altogether. Is it possible to cull the particles that stay outside of the camera view?
In a nutshell is there a better way to optimize the performance when using particles?
Thanks!
Answer by zombience · Feb 06, 2013 at 06:35 PM
I realize this is an old topic, but in case you haven't sorted this out yet, or in case anyone sees this post in the future, you may want to check into OnBecameVisible()
http://docs.unity3d.com/Documentation/ScriptReference/Renderer.OnBecameVisible.html
I have the same issue. I was wondering how do actually you make the Particle System visible? I know OnBecameVisible and OnBecameInvisible tell us when this happens, but I don't know how to make the actual particles visible after that. I tried setting the enabled variable to true, but this still does not work.
Your answer
![](https://koobas.hobune.stream/wayback/20220613070233im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Particles do not appear on play but do on emit 0 Answers
Mesh properties greyed out 1 Answer
Particle Emitter Toggle ON/OFF 1 Answer
resize particle emitter 1 Answer
Particle emitter detection 1 Answer