Sorry if this is the wrong forum for this question. If it is let me know and I will post it there.
I am making a single level for a simple platformer game where players hop around on platforms and try not to fall and touch the floor that which kills them.
Now my question is this: I want the floor (a plane) to emit small embers scattered throughout it. I plan to do this with the particles. The level is rather large and, thus, so is the floor. I am wondering what is the best way to go about making a particle effect system cover the whole floor area?
I could make a particle effect in a box shape and set it’s size to cover the entire plane. I don’t plan on emitting many particles from it at any given time and when I do they will have a very short lifespan but I don’t know if this is going to be to expensive on the system.
It’s worth mentioning that this is a student project so it’s ok if the solution isn’t the best way to go about things. That said, I have little experience with particle effects and would love to learn best practices with them for future projects outside of school
You can just make one big one, but that means most of the time it’ll be spawning particles outside of your view which you’re still paying the cost to spawn and update even if you can’t see them. An alternative is to have multiple particle systems setup that are maybe a screen width wide and put several of them in the level side by side. This way they can be culled if they’re not in view and won’t be updated.
An even better method, depending on how fast the camera moves and how long the particles it spawns are alive, is to have a single emitter that’s slightly wider than the screen that spawns particles in world space, but moves with the camera. That way there’s only ever one particle system and you can be relatively sure any particle it spawns will be in view. The particles being in world space mean when the particle system moves the particles don’t move with it.
Thank you so much for taking the time to reply in such detail. I greatly appreciate it. I didn’t think about the fact of particles spawning outside of my view. I’ve heard of the term culling in Unity but I don’t know what it is - still have so much to learn about the Unity engine. This is my last school project involving Unity so for the sake of a deadline I am just going to do one large one but I finish in a couple weeks and that’s when I’m really going to dive into Unity and start experimenting and learning everything I can. Definitely going to attempt the better methods you suggested when I do this.
Culling is simply not trying to draw something that is unlikely to be visible, either because it’s not in the view frustum (i.e. Off to the sides of the camera’s view) or perhaps too far away, or behind something. By default Unity will try to not tell the GPU to render things outside the view of the camera and you can enable not trying to draw stuff behind other stuff with occlusion and not trying to draw stuff that’s too small or far away with LOD groups (Level of Detail).
None of this is unique to Unity btw, though every engine does it a little different.