I have around ~100 particle systems active in the scene. When set scale to 1, profiler shows 15ms / frame on mobile. When changing the scale to 2x, it’s 50-60ms / frame. Doubling the particle systems at 1x scale doesn’t lead to such a dramatic performance decrease as scaling up does.
So what is happening here? Why is increasing the scale of particle systems to 2x + leading to such dramatic performance loss? Should you not be increasing particle scaling that much?
There are three main factors (like literal multiplicators) that result in the rendering-time required:
- Draw calls (how many different meshes)
- Vertices
- Rendered pixels
Draw calls for 2D particles are luckily one per particle-system (but otherwise unless you use gpu instancing, it’s one per 3D mesh).
The more vertices (and thus triangles) the more often the GPU has to reset its rendering matrix (think that’s what it’s called in this context, not sure) which entails VRAM access.
Finally the larger the triangles on the screen (even if they are covered!), the more pixels have to be actually rasterized.
Edit: Texture resolution is also a factor.
Thanks for putting me on the right track, I have a lot of glow particles which seems to be the culprit. I changed all the glow particles to just be an animated blurred circle sprite and that significantly improved performance.
As the others are already getting at, if the particles were already the slowest thing in your scene then ~15ms to 50~60ms is exactly what I’d expect from doubling their scale. That doubles both the width and the height, so it covers four times as many pixels, and 15 x 4 = 60.
Every GPU has what’s known as a “fill rate”, which is basically how many simple pixels it can draw each frame. Drawing to pixels multiple times eats up more fill rate, and anything which is transparent requires writing to a pixel more than once. Particles are a common culprit for chewing through oodles of fill rate because it’s easy to end up with loads of large, overlapping sprites, thus writing to many pixels many times each.
A few considerations with particle effects:
- Have as few particles as you can.
- Have each particle be as small you can.
- Have the shader (Material) on your particles be as simple as possible.
1 Like