Optimizing dozens of niagara systems

Hi! I have a question on whether it is possible to optimize multiple niagara systems. I am making a programmable firewoks display, and every firework is a separate system. This means that sometimes I need to spawn dozens or even hundreds of systems in under a second. At the moment, doing this causes two problems:

  1. A significant lag spike (basically about a half-second freeze) when spawning the systems
  2. Much lower fps when running 100 small systems then when running one massive system with a much higher computational cost

I am wondering if there are any good ways to optimize either of these problems? Combining emitters between systems isn’t really an option, as all the effects need to be independent, parametrized and have multiple interacting emitters, as well as sampling positions back into code. I intend to try pooling systems and resetting them once they are finished to combat the first problem (though I don’t yet know if this is possible), but would also be glad to know any other options

First pass would be to optimize the systems themselves.

Second pass would be spawn a pool of particle systems, make them inactive, then move, show, hide them when needed. This is quite a common way to optimize particle systems or other transient objects since allocating and deallocating memory is expensive.

Finally you could have “LOD” in your particle systems where they adjust their parameters based on distance from the player when activated.

2 Likes

To directly reduce the overhead of system creation, you can look in to leveraging Niagara Data Channels (NDC)

This will allow you to use one system per “cell” and have the data sent in batch.

Here is a discussion:

1 Like