Particles optimizations

In my game, I have a grid of 72 spots. Every spot might have particles-like animation, but I would like to discuss the edge-case when every spot has such particles animation. A particle, in this case, is a simple texture. There must be at least 40 particles per spot for the animation to be nice. In general, particles are hard to render in large numbers, especially for mobile devices. And my game is exactly the case. In general, when not so many spots having this animation playing, its okay. The more instances, the more draw calls I get, and the worse performance gets. There is no option to batch particles. And there is no option to batch sprites either (technically you could, but it acts really weird and unpredictable). I thought to make the particles from actual plane meshes (they can be batched). However, it does not help as animating 40*72 entities at every frame also hits hard, just the cpu instead of the gpu this time. So it seems to me there is no way to achieve good performance on mobile with a large number of particles emitters? Or am I missing something?

Possibly such a large paragraph is scary.

In short, is the a way to optimise rendering a large number of particles emitters?

Its not that it is a large paragraph, but rather a difficult question :slight_smile:

The solution for this would be a particle system, that allows multiple independent emitters. Unfortunately, it is not (yet?) supported. You would have to create your own system, possibly extending the current one. There is an open ticket with a feature request that should answer this. Feel free to upvote it:

1 Like

Could you please explain how exactly that would solve my problem? I see this new feature might allow to use one particles system for all emitters, but I do not see how it allows to reduce draw calls, only CPU load probably. Even within one emitter, the more particles you have, the more draw calls you have.

Not sure I understand the question correctly, but particles of the same emitter are instanced. You don’t get a new draw call per each new particle. You can check this example - number of draw calls can be seen at bottom left:

https://playcanvas.github.io/#/graphics/particles-spark

1 Like

You’re right. Thank you!
I will try to write my own solution, and share if I succeed.

1 Like

I have found a nice solution to my problem
This is dumb but it gives me the result I wanted
This is a single particles system, single emitter, but placed among 25 different points at every frame
So we have an illusion of 25 emitters at a cost of a single draw call
The only problem with this is obviously that the emitter gets thiner with the increased number of points
So having more points while preserving good density will require creating a few more particle systems and split the points among them
This is not a good solution, but it works in my case. Plus I don’t have time to write a better one. Hope you could get that feature request done.

1 Like

This looks better than I was expecting it would :slight_smile: Good find.