UE4.22 had some niagara upgrades. Could this get in VFX graph as well like curl field, exponential fallof for vector fields and collision system?
New: Niagara Vector Field Data Interface
The Vector Field Data Interface now works the same for both CPU and GPU particles! You can use the Sample Vector Field module to sample vector fields. It exposes three primary inputs:
- VectorField: This is the Vector Field Data Interface instance, containing the static vector field object itself, and per-axis tiling flags.
- SamplePoint: This is the point where the vector field is sampled. This defaults to Particles.Position, but this can be customized.
- Intensity: This scales the sampled vector.
There are also multiple optional inputs:
-
ApplyFalloff: Check this to apply a falloff function to the sampled vector, so the influence of the vector field approaches zero towards the edges of the vector field’s bounding box.
-
UseExponentialFalloff: Check this to make the falloff function be exponential instead of linear.
-
FalloffDistance: When applying a falloff function, this parameter determines how far from the bounding box edges the falloff applies.
-
FieldCoordinates: This makes it possible to override the Emitter’s Localspace parameter. It has three options:
-
Simulation: Uses the Emitter.Localspace parameter.
-
World: This overrides the position and transform of the vector field so that it is always relative to the world origin, regardless of the Emitter.Localspace parameter.
-
Local: This overrides the position and transform of the vector field so that it is always relative to the System itself, regardless of the Emitter.Localspace parameter.
-
FieldTranslate: This offsets the vector field relative to the origin as defined by FieldCoordinates.
-
FieldRotate: This reorients the vector field relative to the origin as defined by FieldCoordinates.
-
FieldScale: This rescales the vector field.
The SampleVectorField module provides a lot of utility functionality, and therefore it might include some overhead. You can use specialized vector field sampling, by including the SampleField node on a Vector Field Data Interface object in the script editor.
The input expected here will be relative to the volume of the vector field itself, as no transformations are applied for you.
An example for easily visualizing and using a vector field is included, called VectorFieldVisualizationSystem.
New: Niagara Curl Noise Data Interface
The Curl Noise Data Interface now generates procedural curl noise based on an underlying simplex noise function and the results are identical for both CPU and GPU emitters. It is recommended to use the SampleCurlNoiseField module to generate curl noise for your particles. This module has two primary inputs exposed:
- Strength: This scales the output vector generated by the module.
- Length Scale: This describes the approximate size of the vortices generated by the curl noise.
and three optional inputs:
- Offset: This is used to pan the noise field.
- Noise Field: This is the Data Interface object itself, primarily used for adjusting seeds.
- Sample Point: This specifies where to sample from. Defaults to Particles.Position, but other values can also be used.
The curl noise field does not inherently tile, and does not suddenly end due to its procedural nature. To get a tiling curl noise field, consider using the Vector Field Data Interface instead, with a periodic volume texture curl noise as a vector field.
New: Deterministic Random Number Generation in Niagara
We added support for deterministic random number generation for both CPU and GPU Niagara emitters. The behavior of the random number generated can be controlled globally from the Emitter Properties module, with the following options:
- Determinism: A flag to toggle between deterministic or non-deterministic random numbers for the entire emitter.
- Random Seed: A global seed used by the deterministic random number generator.
The RandomRange Niagara function is the recommended way to generate random numbers inside scripts. It now accepts the following:
-
Min: This defines the lower bound of the random numbers generated. It can be any integer or float type.
-
Max: This defines the upper bound of the random numbers generated. It can be any integer or float type.
-
RandomnessMode: This is an enum controlling the determinism mode of the random number generator, and it can be:
-
Simulation Defaults: This is the default behavior; it inherits the value of Emitter.Determinism.
-
Deterministic: Uses the deterministic random number generator.
-
Non-deterministic: Uses the non-deterministic random number generator.
-
OverrideSeed: This determines whether or not to override the seed specified by Emitter.GlobalSeed.
-
Seed: This value is used to override Emitter.GlobalSeed if OverrideSeed is enabled.
The last three, RandomnessMode, OverrideSeed and Seed are initially hidden, but they can be revealed by clicking the arrow at the bottom of the node.
New: Collision System for Niagara
Niagara collisions have been completely rewritten to support ray-trace-based CPU collisions, CPU+GPU analytical plane collisions, GPU scene depth, and distance field collisions.
Additional features include:
- Stability has been vastly improved across the board, in comparison to previous Niagara and Cascade implementations.
- CPU collisions support the incorporation of the scene’s physical material characteristics, such as restitution and friction coefficients, and offers several integration schemes.
- The system has been written as a single module to improve usability.
- Collisions now work in combination with all renderers.
- A configurable “rest” state allows particles to remain stable in particularly challenging situations.
- The equations are physically based/inspired, and work with mass and other system properties.
- A number of advanced options have been exposed, including static, sliding and rolling friction.
- Collision radii are automatically calculated for sprites and meshes. Optionally, you can specify this parameter directly.