Hello, is there a way to prevent a Niagara system from spawning more than one particle per frame?
I have a system that uses the ribbon renderer, and as long as I set the spawn rate to below frame rate it is fine, however in the hypothetical case that the framerate drops below the set spawn rate it starts to look very weird.
I can enable interpolated spawning; this does seem to fix the issue of it looking weird at low frame rates, but it comes at a performance cost. All I need is for the spawn rate to never exceed the frame rate.
Thanks!
Hello there @Perfect_Human_Interface!
Checking with my peers, there are a few ways to resolve this, the most effective one would be to tie the spawn/ticket to the frame rate itself.
To do so, open your Niagara system, go to the Emitter Update section, and add a float parameter “MaxSpawnRate”. Then, open the Rate module, and replace the constant value with the following:
Min(MaxSpawnRate, 1.0 / Engine.DeltaTime)
This should result in the spawn rate never going over the current framerate of your scene. Hope this helps!
Hi, first of all, fantastic! This is precisely what I need.
However I’m getting a compilation error when trying to use that expression. It says 'MaxSpawnRate' undeclared
Am I not adding the parameter correctly here? Thank you for your help!
Hello again!
If the value shows as undeclared, maybe it was not created, or not read by the engine. Please make sure the parameter was setup as seen below:
- Open your Niagara System
- In the System Overview panel, find User Parameters
- Click the + button next to User Parameters
- Find “Float” in the search bar
- Name it “MaxSpawnRate” (or any other name you prefer)
Hello, I was able to figure this out, it was just a couple errors in the syntax.
The correct syntax for this was:
min(Emitter.MaxSpawnRate, 1.0 / Engine.DeltaTime)
or
min(User.MaxSpawnRate, 1.0 / Engine.DeltaTime)
depending on where you defined the parameter.
It’s working great now. Thanks a lot for the help!
1 Like