Hi all- I’m looking for tips to get a lot of particles moving on screen as efficiently as possible in Unity.
I’m working on a top down (e.g. 2.5d) space game and want a star field of sorts. It needs to be performant on IOS. The trouble is that the game area zooms in and out, so to create enough stars to cover the game area, I’m looking at thousands of particles. This works fine in the editor, but on the device, it’s naturally too slow to really work. The stars are important part of the gameplay as they add a sense of movement (see this videoclip of my play area & camera style to get a sense of what I mean by zooming in and out [Dark Quadrant] working cameras - YouTube)
Some things that make this different from the standard particle question:
- I’m trying to fill a space, 4000x4000x4000, where in one view, you may see as much as 2000x2000x4000 of it. Because it zooms in and out, I can’t see a way of improving performance by culling what’s not in view.
- There is practically no overdraw as they’re tiny discrete stars.
I’ve tried various other ways to get stars in there (the most disasterous was 3 x full-screen single transparent planes with starfield texture, attempting to give a sense of depth)
Some subquestions:
-
Assuming a starfield of say 500 stars-- would it be better to give them high energy (so they stay around permanently), or a min/max energy range (to potentially halve the number of particles drawn on screen at a given point in time)
-
I’m currently using an additive mobile shader- presumably this is my best bet?
-
Is there some sort of camera trick I could do to better manage the need for lots of stars to be visible when zoomed in, but, relative to the area visible, less stars visible when zoomed out?
-
Would it be worth trying to individually manipulate / recycle 100-150 particles to redistribute them based on how zoomed in you are?