I had a first look at Niagara last night, following on from my big ramble about how hyped I am about it. Haven’t made anything proper yet, just made a module and looked at how variables are defined.
To enable Niagara, go into the plugin manager and enable it under FX. This gives you some new asset types.
Systems are collections of emitters than can be placed in world, emitters are components of particles that can be fit together to make systems and modules are scripts that can be used inside of emitters. Functions are bits of script that can be used within modules, and parameter collections allow you to define your own global params.
I really like this way of working. I can see in larger studios having FX artists responsible for emitter and system creation and TAs creating modules and functions for them to use.
I started by creating a test module with the aim of figuring out how to connect a couple different variables.
All the parameters are stored within the parameter map, and you can set and get variables from here. Namespace is important! To add a user input value, give it the Module namespace.
I allowed the user to set colour, and then multiplied it with another user input to let them define the emissive intensity.
I then added a size multiplier, so that the size gets larger as the particle ages. Initially, this didn’t work, as I was getting size, multiplying it, then setting it. This meant that because I was multiplying it by zero on the first frame, I always had a value of zero. Remembering execution type is really important here! To fix this I needed an initial value, set on spawn for performance, that was multiplied on update by the particle age.
I tried using custom parameter maps for this, but had a lot of trouble and couldn’t make it non constant. As it turns out I was looking for something too complicated – you can set a custom parameter inside the emitter itself, then use its name in any module in the emitter.
Another gotcha I found – there’s a “use in Niagra” tickbox on materials – important!
Here’s my particles in action! Not very exciting yet, but a nice intro to the tech.