Performance of passing data via Niagara user parameters?

Hi :waving_hand: ,

I’m building a GPU Niagara system using custom HLSL in a Niagara scratch pad, which is doing a bit math per particle using data from five vector arrays I pass to Niagara from c++. The arrays contain data for each particle that doesn’t change during the simulation (loaded and calculated in c++). There can be many thousands (even over a million on PC) of particles, so I want it optimised as possible as it needs to run on lower end hardware like a Quest 3. It runs quite well, but I can’t find much documentation on how User parameters are processed and I’m wondering if this could be slowing it down. Does anyone know if I would get performance gains using a different method to pass and read data, such as niagara data interfaces and structured buffers or texture lookups? Here is a simplified example of what I’m doing:

TArray<FVector> SomeData; // per particle data saved as vector
UNiagaraDataInterfaceArrayFunctionLibrary::SetNiagaraArrayVector(NiagaraComponent, FName("ArrayVector"), SomeData); // pass data to niagara user paramter

thanks!

1 Like

Hi there @Evman!

I did a lot of digging in the Cpp files to double check, and while my Cpp understanding is not perfect, it looks like you’re good.

It looks like while the Niagara parameters are technically their own class, it’s really just some metadata and a variable.

Fron NiagaraTypes.h:

I would suggest checking out this header for yourself, as you will probably be able to understand it better than me.

Overall, if you want to save performance, there are probably better places to be looking. I suggest starting with this page:

1 Like