UE5.0: Niagara Fluid Notes and Issues
What is Niagara fluid simulation
Currently, this plugin can only be found in Unreal Engine 5 or above. Testing has shown that it is capable of the following:
The Niagara fluid simulation is responsible for simulating and calculating dynamic fluid types, including smoke and water.
Niagara fluid can easily and quickly calculate simulations, have collision detection, and even be affected by two lights (raymarch).
However, there are limitations to what Niagara fluid can do, such as no shadows, only being able to be affected by two lights, and having performance issues in real-time playback.
One aspect that I find particularly appealing is that the fluid direction can be controlled through a particle system.
Emitter Hierarchy
Niagara Fluid is driven through modules inside the emitter. Each emitter inherits properties from its upstream actor, much like how C++ Actors inherit properties. The Grid3D_Gas_Emitter is the top-level actor that performs the simulation, and all its descendants inherit its properties.
The Grid3D_Gas_Controls_Base_Emitter inherits the simulation capabilities of the Grid3D_Gas_Emitter and adds debug functionality. It also lists all the simulation control features in the Emitter Summary.
The Grid3D_Gas_Controls_Emitter, which we will use in this example, adds the ability to source in particles.
The Grid3D_Gas_CONTROLS_CINE_Emitter is a slower but more accurate version for cinematic usage.
How to set up
Set up source emitter
There are several ways to set up fluid simulation, and now let's take a look at the most common method.
First, we need to set up a source emitter, which can be any type of particle system. Here, I set up a particle system with a vortex state and pointing downwards, as shown in the figure!
Next, we need to add a necessary module, "set fluid source dynamic!"
We can see that there are three main attributes that can be fed to the volume:
Sprite size for radius: can be understood as voxel size or grid size in Unreal's terminology.
Velocity for velocity: although the properties of volume and particle have the same name, please think of the velocity property of the volume as the velocity field of Houdini Volume field.
Color for additional source: since the color itself has no direct impact on the overall shape of the simulation, we need to assign it to the "additional source" here!
Overall, our source is now set up, and the next step is to assign it to our volume!
Set up simulation
Now that we have a source for our simulation, we also need a receiver. We're going to use the Grid3D_Gas_CONTROLS_Emitter
First, add it to our Niagara system (you can also copy the example file's emitter). If you're still in the source emitter stage, create a system to contain them. Remember that there will be two emitters in this system.
Next, click on the emitter summary of the Grid3D_Gas_Controls_Emitter.
Emitter Summary - There are many control options, but for now, let's focus on a few important ones.
Source - Here we can select the emitter to source, the attribute to source (density, temperature, etc.), and what action to take on it!
Simulation - We can adjust various properties such as dissipation, turbulence, collision, and vorticity!
Render - We can adjust the color and remapping of properties, and there is also an option to select a light source since it is a raymarching material!
Debug - We can see the flow of attributes between voxels!
In the Particle output parameters, we can adjust:
World space size - This is basically the range where the simulation occurs.
ResolutionMaxAxis - The resolution of the simulation.
DirectionalLight - The light source that the raymarching should use.
Collision Geometry - The geometry to collide with.
Once these things are set up, we should be able to see the smoke generated.
Notes:
With the ability to freely control the general direction of the smoke, I think it's worth trying to achieve a mesh smoke effect. After all, we can only use points as emitters, not meshes or primitives. There are still limitations!
The ability to combine with destroyed meshes is also a major advantage, as the small shattered pieces will leave trails!
Issues:
I found that particles moving too fast can cause a subframe shortage issue during volume sampling!
Currently, only two light sources can be used for lighting, which also needs to be considered when setting up the scene!
The current method of creating emitter sources is still too limited, which may not be able to handle emitters with special dynamics.
The smoke can appear low resolution when particles disappear.
Edit by Jimmy Chao, Yung Jie Huang
Last Update: April 25, 2022
Software: Unreal Engine 5.0
OS: Windows 10
Reference::