Niagara Component: How to avoid FPS drop for first-time activation?

I have a Niagara Actor Component that I turn on/off at different times during my game.

The first time I use the “Activate” blueprint node on my Niagara Component, my game has a brief drop in FPS, but then quickly recovers. For the remainder of the game, calling “Activate” or “Deactivate” subsequent times does not produce any noticeable FPS drops. It is only the first time I call “Activate” that I experience the FPS drop.

Is there any way I can prevent the FPS drop that occurs for first-time Activation of my Niagara component? Is there a way I can pre-allocate the needed Niagara resources during game startup, so when I first call “Activate” to display my particles, I don’t experience an FPS drop?

Extra Details:
To turn on the Niagara particle system I use the “Activate” blueprint node, and to turn off the particle system I use the “Deactivate” blueprint node. The Niagara Component has “Auto activate” set to off.

3 Likes

Hey there,
I’m very new here so I’m sorry for any faults in advance.
I have the same problem without using any “acitvate” or “deactivate” features.
I have a simple level with a looped niagara actor in it.
The fps drops every time the niagara particles are shown and the loop is active.
It seems to me that the Niagara Plugin is source of the Problem.

Thank you for any ideas or hints.

The problem you are experiencing sounds like the Niagara particle system you are using is too processor intensive for the computer hardware you are using. To remedy this, you will need to try simplifying your particle system by spawning less particles, using less geometry, using less intensive materials, trying using GPU compute instead of CPU, etc.

The problem I am having is not what you describe. My particle system is able to run just fine on my computer (Oculus Quest 2), but the first time I launch the particle system, it causes a 1-2 second FPS drop in the rendering engine. This FPS drop is likely due to Niagara allocating some resources for Unreal’s rendering engine. I want to find a way to force this resource allocation to happen at the start of my app so it does not cause a frame drop later when the Niagara particle system is actually activated.

I have tried many solutions to solve this issue and nothing was successful.

I would love to know if anyone knows how to force Niagara to preallocate rendering resources during the Niagara component construction instead of the first time the Niagara particle system is actually rendered on screen.

Thank you very much for your answer. I solved the Problem by decreasing the particle number from 160.000 to 16.000.
Now my system is stable. I hope someone can help you to solve your problem.
I’m very new to unreal and I’m not able to help you. Sorry.

Glad I could help resolve your problem! I wish there were more people active on the forum to help with these kinds of things. My personal experience with the Unreal forums (and the old Unreal AnswerHub) for the last couple years has been that I rarely find help :frowning: . Very different from my experience on the JUCE C++ forum (another development tool I use).

If anyone else finds this thread, here is a restatement of the problem I am looking to solve:
I would like to know how to force Niagara to preallocate rendering resources during the Niagara component construction (or some sort of initialization stage) instead of allocating rendering resources first time the Niagara particle system is rendered visible on-screen. For my use case, I would like the rendering resources of some select Niagara particle systems to persist the entirety of the game’s runtime.

There isn’t really a good solution for this at the moment, but here are some things to consider:

  1. Set up a PSO cache. Some gpu drivers need to recompile shaders on load, resulting in a notable hitch. With the cache set up, the hitch is gone.
  2. Preload the textures that your materials use. If you know you’re about to fire off an effect in the next few seconds, load the required assets via the streaming manager.
  3. Bute force - you can just place all effects you want to work without delay somewhere hidden into the level. This guarantees that all the shader and texture work is done when the level is loaded.

Hello, Tim! I have the exact same problem for Niagara VFX for firing system. Did you figure out how to allocate resources ahead of VFX calls?

I fixed it with PSO caching. Just follow this video

1 Like

Amazing, thank you for sharing this, I will try this!

it worked?? I have the same problem

Now I just got here… Did you get the PSO stuff to work? Any other solution?

Would need more details about your NIagara System to provide help! The answer varies greatly depending on its complexity!

Hi InverseLerp_, I’m really asking about whether any of these posters got the PSO fix to work. I don’t think the complexity of my niagara systems are too relevant- I get the exact behavior as the OP but there was never a follow up as to whether the PSO fix worked.