- Type
- FLOAT
- Default
- 0.2
- Available in
- Blueprint + Niagara
- Group
- Root
Ninja tracks objects inside the sim area, writing their position data into a "Paint Buffer", like a brush leaving marks on a canvas.
"Field Buffer" is similar to paint buffer, except it is not for "point like" input data, but for distance fields (SDF),
object "shape" is painting marks in the field buffer.
Using this PERSISTENCY parameter, we can define how long paint-marks live in the paint and field buffer.
If PersistencyOfFieldAndPointData = 1, paint-marks live forever, objects leave PERMANENT marks.
This is ideal for footprints or wheel tracks when ninja is used in SimplePainterMode. If PersistencyOfFieldAndPointData < 1,
paint-marks eventually fade out. This is needed, when we use the paint and field buffers as input for fluid simulation,
for example objects interacting with water or smoke.
Names, values, and notes
- Niagara name
Painter.InputFeedback- Legacy name
InputFeedback
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Root
Inverting the Paint Buffer and the Field Buffer results an ERASER like effect - points (generated by object position)
and shapes (coming from object SDF) are being subtracted from simulation density (feels like objects are "cutting the fog").
Recommended usage: generate simulation density by using the inputs at the /LiveInputFields /Bitmaps param group,
also set the /LiveSimulation /DensityAccumulation param to a high value - so there will be "much density data to be erased".
NOTE: in case we are looking for "stirring the fog (or fluid)" effect instead of "cutting the fog", we should NOT use this inverter.
INSTEAD employ a method where incoming Paint Buffer and Field Buffer density is ignored, BUT incoming velocity is accepted.
Use these parameters: /LiveInputPoints /BrushKillers /SelectivelyKillBrushDensityKeepVelocity for point-like inputs
AND /LiveInputFields /MeshFields /UseAsVelocitySource for field-like inputs.
Names, values, and notes
- Notes
- internal niagara name, "EraserStrength"
- legacy internal niagara name, "EraserSwitch"
- legacy Preset Manager name, "Inv"
- Niagara name
Composite.InvertFieldAndPointDensity- Legacy name
EraserMode
- Type
- TEXTURE
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- VelocityDensityFieldFromTexture
Bitmaps can be used as sim density and sim velocity input. On this input, by default, only DENSITY is used,
and ninja looks for density data on the bitmap RED channel. IF TryToReadVelocityFromRGChannels = True,
VELOCITY is also being read on the RED and GREEN channels, and DENSITY on the BLUE channel.
NOTE: the bitmap based density input, by default, is "anchored" to World Space. In case we want the bitmap to MOVE together
with the simulation area (use Local Space), we need to set this variable: /LiveCore /WorldSpaceOffset /QuantizerStepSize = No SimBuffer Offset.
In order to make the bitmap input ROTATE together with the sim area we need to set /LiveCore /IgnoreSystemRotation = True.
Names, values, and notes
- Legacy name
OverwritePresetDensityInput
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- VelocityDensityFieldFromTexture
Using this switch, we can force ninja to read velocity information on the RED and GREEN channels of the input Bitmap.
In this case, density is being read from the BLUE channel.
Names, values, and notes
- Notes
- the bool value must be inverted when passed to niagara
- Niagara name
UseInputTextureOnlyAsDensity- Legacy name
UseRenderTargetAsInput
- Type
- FLOAT
- Default
- 0.5
- Available in
- Blueprint + Niagara
- Group
- VelocityDensityFieldFromTexture
Increase the amount of density coming from the input Bitmap.
Names, values, and notes
- Niagara name
Composite.DensityTxtMult
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- VelocityDensityFieldFromTexture
Make the input Bitmap constantly move (offset, pan, scroll) along the X axis.
Names, values, and notes
- Niagara name
Composite.DensityTxtOffsetX
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- VelocityDensityFieldFromTexture
Make the input Bitmap constantly move (offset, pan, scroll) along the Y axis.
Names, values, and notes
- Niagara name
Composite.DensityTxtOffsetY
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- VelocityDensityFieldFromTexture
Randomize density texture offset. Suggested use: in case you have multiple simulation containers placed nearby
and would like to avoid visual similarity, we should employ this randomizer.
Names, values, and notes
- Niagara name
Composite.DensityTxtRandomOffset- Legacy name
RandomizeDensityTextureOffset
P.3.1.1.7
DensityTxtScale
#- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- VelocityDensityFieldFromTexture
Scaling the Bitmap input.
Names, values, and notes
- Niagara name
Composite.DensityTxtScale
- Type
- RENDERTARGET
- Default
- -
- Available in
- Blueprint only
- Group
- VelocityDensityFieldFromTexture
RenderTargets can be used as sim density and sim velocity input. On this input, by default, only DENSITY is used,
and ninja looks for density data on the bitmap RED channel. IF TryToReadVelocityFromRGChannels = True,
VELOCITY is also being read on the RED and GREEN channels, and DENSITY on the BLUE channel.
NOTE: the bitmap based density input, by default, is "anchored" to World Space. In case we want the bitmap to MOVE together
with the simulation area (use Local Space), we need to set this variable: /LiveCore /WorldSpaceOffset /QuantizerStepSize = No SimBuffer Offset.
In order to make the bitmap input ROTATE together with the sim area we need to set /LiveCore /IgnoreSystemRotation = True.
- Type
- TEXTURE
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- VelocityFieldFromTexture
Bitmaps can be used as sim velocity input. On this input, by default, only VELOCITY is used, and ninja looks for
velocity on the RED and GREEN channels. NOTE: the bitmap based velocity input, by default, is "anchored" to World Space.
In case we want the bitmap to MOVE together with the simulation area (use Local Space),
we need to set this variable /LiveCore /WorldSpaceOffset /QuantizerStepSize = No SimBuffer Offset.
In order to make the bitmap input ROTATE together with the sim area we need to set /LiveCore /IgnoreSystemRotation = True.
Names, values, and notes
- Legacy name
OverwritePresetVelocityInput
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- VelocityFieldFromTexture
Multiply incoming Bitmap based velocity with existing sim velo.
Names, values, and notes
- Niagara name
Composite.MaskInputWithSimVelocity
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- VelocityFieldFromTexture
Make the input Bitmap diagonally move along the XY axis.
Names, values, and notes
- Niagara name
Composite.VeloInputOffsetSpeed
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- VelocityFieldFromTexture
Scaling the Bitmap input.
Names, values, and notes
- Niagara name
Composite.VeloInputTile
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- VelocityFieldFromTexture
Rotating the original velocity vectors, coming from the bitmap. The parameter is using the 0-1 range,
this is mapped to a 0-360 degree vector rotation.
Names, values, and notes
- Niagara name
Composite.VeloRotate
- Type
- RENDERTARGET
- Default
- -
- Available in
- Blueprint only
- Group
- VelocityFieldFromTexture
RenderTargets can be used as sim velocity input. On this input, by default, only VELOCITY is used, and ninja looks for
velocity on the RED and GREEN channels. NOTE: the bitmap based velocity input, by default, is "anchored" to World Space.
In case we want the bitmap to MOVE together with the simulation area (use Local Space),
we need to set this variable /LiveCore /WorldSpaceOffset /QuantizerStepSize = No SimBuffer Offset.
In order to make the bitmap input ROTATE together with the sim area we need to set /LiveCore /IgnoreSystemRotation = True.
- Type
- TEXTURE
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- CollisionMaskFromTexture
Collision Mask is a black and white texture. BLACK areas repel fluid currents and behave like an obstacle,
WHITE areas allow free flow. PREREQUISITE: /LiveSimulation /Bounds /SimEdgebounciness = 1.
NOTE: a Bitmap stored Collision Mask is ideal for masking static environmental objects (eg: an altair in the middle of a fog covered area).
Alternative solution: /LiveInputFields /MeshFields /UseAsCollisionMask.
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- CollisionMaskFromTexture
Inverts the original Collision Mask Bitmap brightness values: black turns white, white turns black.
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- CollisionMaskFromTexture
Using a value greater than 0, we can cut the lower end of the Collision Mask values, turning black areas into gray,
making them penetrable by the flow.
- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- CollisionMaskFromTexture
Using a value smaller than 1, we can cut the higher end of the Collision Mask values, turning white areas into gray,
making them less penetrable by the flow.
- Type
- LINEARCOLOR
- Default
- (0,0,1,0)
- Available in
- Blueprint + Niagara
- Group
- CollisionMaskFromTexture
This is a multi-functional controller for the collision mask. Apply Offset, Scale and Dynamic Offset using RGBA values.
RG: Static UV-offset, B: UV-scale, A: dynamic per-frame UV offset in WorldSpace. NOTE: Collision Mask UV is LOCAL by default.
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Unreal Engine automatically generates Signed Distance Fields (SDF) for Static Mesh type assets (including PhysicsBodies).
This field, called Mesh SDF, is a 3D representation of the mesh volume, it could be used to easily get information
about the surface and shape of the mesh, without having to deal with triangles and geometry.
Mesh SDF is fast and lightweight, if sampled on low resolution. Define SDF sampling resolution at:
/LiveCore /Performance /FieldBufferDownScaleFactor.
By enabling this switch, ninja can access Mesh SDF. Suggested mindset for usage: ninja is running a 2D sim - it is like a flat plane.
We can align this flat 2D plane with surfaces - so it becomes a warped surface. Where meshes inside the simulation area
OVERLAP with this warped surface, we get a cross section, a representation of the mesh shape.
USE CASE 1: objects leaving precise, shape-matching marks on the ground in SimplePainterMode.
USE CASE 2: objects generate shape-matching ripples as they submerge in water.
USE CASE 3: we can add MeshSDF field data on top of the Landscape height field - think smaller rocks (meshes) placed
in creekbed (a landscape surface) - and free flowing water avoiding rocks.
PREREQUISITE: /Project Settings /Engine / Rendering /SoftwareRayTracing /GenerateMeshDistanceFields = True.
NOTE: ninja also acquires surface velocity information when reading Mesh SDFs.
LIMITATION: Skeletal Meshes do not support Mesh SDF.
- Type
- NAME
- Default
- none
- Available in
- Blueprint only
- Group
- MeshFields
We TAG Actors with a StaticMesh Component, then quote the exact same TAG here.
Ninja collects all tagged Actors once, at start, and uses their Mesh Component as SDF source during the simulation.
Ideally, less than 100 meshes are collected.
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Ninja can periodically recollect Mesh SDF sources, following initialization.
Think spawned meshes or streaming levels where new meshes "pop in".
Recollection frequency is defined by this variable: /LiveEditorTools /ParamUpdateFrequency.
- Type
- BOOL
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
IF UseAsDensitySource = TRUE, Mesh SDFs will generate paint-marks in the Field Buffer and will inject density to the simulation.
USE CASE 1: we want our meshes to leave marks on a surface in SimplePainterMode.
USE CASE 2: when working with SPARSE water setups, we want our Meshes to generate both density and velocity
(density is used for whitewater in sparse water setups). IF UseAsDensitySource = FALSE, Mesh SDFs will NOT generate
paint-marks in the Field Buffer and will NOT inject density to the simulation.
USE CASE 3: when working with DENSE water setups, we want our Meshes to stir the fluid, but do not generate fluid
(make sure that UseAsVelocitySource = True).
USE CASE 4: we want our meshes to add height to an existing height field, but do not generate fluid - think Rock Meshes
in a Creek bed made of Landscape Components (make sure that AddMeshHeightToLandscapeHeight = 1).
Names, values, and notes
- Niagara name
SDF.UseAsDensitySource
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Fast objects generate more density. Slow objects generate less density. Still objects do not generate density at all.
USE CASE: we use density coming from Mesh SDF as whitewater in SPARSE water setups. Still objects to not generate whitewater.
Names, values, and notes
- Niagara name
SDF.ScaleDensityWithVelocity
- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Modifies the velocity-distribution for the "ScaleDensityWithVelocity" parameter.
Names, values, and notes
- Niagara name
SDF.ScaleDensityWithVelocityPow
- Type
- BOOL
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Ninja also acquires surface velocity information when reading Mesh SDFs.
In case we inject this velocity to the simulation, Meshes could push the fluid.
Names, values, and notes
- Niagara name
SDF.UseAsVelocitySource
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- MeshFields
A Collision Mask is defining spots in the simulation area, that repel fluid currents and behave like an obstacle.
By reading the SDF of moving meshes, we can create dynamic collision masking. For example, we can set up a floodgate,
stopping the fluid, then opening up. Of course, non-moving meshes could be used for static Collision Masking.
Alternative solution: static Collision Masking could be implemented with textures, too.
See this parameter group: /LiveInputFields /Bitmaps /CollisionMaskFromTexture.
PREREQUISITE: /LiveSimulation /Bounds /SimEdgeBounciness = 1.
Names, values, and notes
- Niagara name
SDF.UseAsCollisionMask
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- MeshFields
By increasing the value of this variable, we can turn masked areas gradually more penetrable by the flow.
Names, values, and notes
- Niagara name
Composite.WeakenCollisionMask
- Type
- BOOL
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
We can add MeshSDF field data on top of the Landscape height field - think smaller rocks (meshes)
placed in creek bed (a landscape surface) - and free flowing water avoiding rocks.
Names, values, and notes
- Niagara name
SDF.AddMeshHeightToLandscapeHeight
- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Multiplies the density generated by Mesh SDF. When using lower values: meshes leave weaker marks on surfaces,
weaker impacts when splashing into water. The value 0.01 is ideal for soft but still noticeable marks.
Names, values, and notes
- Niagara name
SDF.DistanceFieldMult
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- MeshFields
This value is added to the float output value coming from the Distance Filed Sampler.
Names, values, and notes
- Niagara name
SDF.DistanceFieldZOffset
- Type
- FLOAT
- Default
- 0.1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Contour is the outer region of the Mesh-Simulation cross section area. In most cases, we use this contour-band to mask velocity.
EXAMPLE 1: to mask velocity noise - so the fluid looks disturbed around the object.
EXAMPLE 2: to mask radial velocity that pushes the fluid away from the mesh center.
Names, values, and notes
- Niagara name
SDF.ContourMult
- Type
- FLOAT
- Default
- 10
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Contour thickness.
Names, values, and notes
- Niagara name
SDF.ContourZOffset
P.3.2.15
ContourNoiseMult
#- Type
- FLOAT
- Default
- 0.25
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Adding velocity noise on the mesh-contours, so the fluid looks disturbed around the object.
Names, values, and notes
- Niagara name
SDF.ContourNoiseMult
P.3.2.16
ContourNoiseFreq
#- Type
- FLOAT
- Default
- 0.02
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Define how fast the noise-pattern changes on the object contours. Larger values mean faster changes.
Names, values, and notes
- Niagara name
SDF.ContourNoiseFreq
- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Define the tiling of noise-pattern on the object contours. Smaller values mean larger tiles.
Names, values, and notes
- Niagara name
SDF.ContourNoiseScale
P.3.2.18
MeshVelocityMult
#- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
The amount of surface velocity coming from the sampled Mesh.
Names, values, and notes
- Niagara name
SDF.MeshVelocityMult
- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
The amount of radial velocity, pushing the fluid outward from the Mesh center.
Names, values, and notes
- Niagara name
SDF.OutwardVelocityMult
- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Similar to the "Puncture" parameter for point-like inputs:
in case the object moves perpendicular to the sim area, it could generate impact or shockwave.
Names, values, and notes
- Niagara name
SDF.ZvelocityMult
- Type
- BOOL
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- MeshFields
Distance Field inside and outside a Mesh is distinguished by the SIGN (hence the name: signed distance field).
For a Global Distance Field, both inside and outside field is useful. For Mesh Distance Fields, the outside field
is cropped by the mesh Bounding Box, it is practically useless.
Names, values, and notes
- Niagara name
SDF.LimitDistanceFieldInsideMesh
- Type
- FLOAT
- Default
- 20
- Available in
- Blueprint + Niagara
- Group
- MeshFields
This value is added to the Z component of Simulation.GridCell.World.XYZ Position,
going to the Distance Filed Sampler (this is a "sampling UVW offset" kind of operation).
Names, values, and notes
- Niagara name
SDF.SamplerVerticalOffset
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Root
Using this bool switch, we enable Surface Alignment. It is a KEY ninja feature: both interaction (the detection of objects)
and visualization (a mesh-surface or volume) aligns with the underlying surface.
For Surface Alignment, ninja needs a HEIGHTFIELD input: a grayscale (float) representation of World Space altitude
under the simulation area. There are four methods ninja can access a heightfield.
METHOD 1: When there is no heightfield available, ninja can generate a FLAT heightfield. Define a World Space altitude
via the "ClampingValue" parameter, then set ForciblyCreateHeightField = True.
METHOD 2: if there are Landscape Components under the sim area, ninja automatically detects them and samples the height.
No user action needed.
METHOD 3: we can set up top-down looking SceneCaptureCamera to sample elevation (scene depth),
and write the data to a RenderTarget. In case our elevation is static: we can bake the elevation to a Texture and use that as ninja
heightfield input. Key parameter: /LiveInputFields /HeightFields /ExternalHeightData /UseExternalHeightData = True.
METHOD 4: ninja can utilse RuntimeVirtualTextures (RVT) to access elevation data.
Key parameter: /LiveInputFields /HeightFields /RVTHeightData /UseRVTAsHeightSource = True.
Once we have accessed a HeightField using one of the four methods, ninja internally converts the incoming World Space data
(Absolute Height) to Local Space (Realtive Height): negative values below the simulation plane, positive values above it.
Ninja exposes heightfield for visualization Materials and Niagara Systems (Internal and External Renderers)
using the Paint Buffer ALPHA channel. On export, Relative Height is the default.
See this variable: /LiveOutputRenderTargets /PaintVelocityDensityAndElevation /ExposeRelativeHeight = True.
RECOMMENDATION: the four height sampling methods are demonstrated on this tutorial level:
/Content /FluidNinjaLive /Levels /_Starter /Tutorial03_KeyConcepts.umap, on STAGE 2A - 2D
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Root
This is a key, two function parameter.
FUNCTION 1: clamping a gradual, continuous heightfield on the lower end, with the intention to make
"a large flat body of water" like a lake, river or sea - at user defined height.
The clamping altitude is defined by the "ClampingValue" parameter. At clamping altitude, the heightfield is flat.
Above clamping altitude, the heightfield behaves normally, following the surfaces.
Use case 1: free flowing water (eg. a creek) above clamping altitude, surface aligned, flowing down on the surface,
until reaching clamping altitude, where a large flat body of water resides.
Use case 2: we are creating a sea or lake at clamping altitude with WAVES pushing towards the coastline,
and rolling up on the coast until becoming weak and starting to flow back down.
FUNCTION 2: If ClampHeightLowerValues = True, the sim area is being AUTO-FILLED with density at the altitude defined
by the "ClampingHeight" param. Why? Since we use this param to define big flat water-bodies anyway...
instantly filling them seems like a good idea. Extra advantage: at the sim area edges the density fill continues
over the passive "outside the sim" area. This is called "EXTENDING the sim area".
The technique enables us the have an infinitely large body of water, while simulating only a small area
(and the simulated area can move in world space). Extending the simulation area is explained on level:
/Content /FluidNinjaLive /Levels /_Starter /Tutorial03_KeyConcepts.umap, on STAGE 3.
Names, values, and notes
- Niagara name
RVT.ClampHeightLowerValues
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Root
Using this param, we can define the world space altitude (in centimeters = in Unreal units) where the continuous heightfield
is being clamped on the lower end, with the intention of creating a large flat body of water (e.g. a lake or sea).
IMPORTANT: in order to enable clamping, set ClampHeightLowerValues = True.
NOTE: when there is no heightfield available for sampling, ninja can GENERATE a flat heightfield. Set EnableHeightField = True,
set ForciblyCreateHeightField = True, set ClampHeightLowerValues = True
and define a World Space altitude for height clamping via this parameter.
Names, values, and notes
- Niagara name
RVT.ClampingValue
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Root
Add this value to the HeightField.
Names, values, and notes
- Niagara name
RVT.OffsetHeight
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Root
If EnableHeightField = True AND Landscape input is available: we can ignore landscape ELEVATION data
(not being added to the HeightField) while using landscape GRADIENT to generate velocity.
Names, values, and notes
- Legacy name
ForceIgnoreLandscapeElevation
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Root
Height values below "ClampingValue" are being filled white, the rest of the area is filled with black,
and the resulting 1 bit image is used as Collision Mask, with black areas behaving like an obstacle, blocking the fluid currents.
Names, values, and notes
- Niagara name
RVT.UseAsCollisionMask
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Root
When there is no way to read a HeightField by sampling objects on level, ninja can generate a FLAT heightfield.
This might be important for Surface Alignment (to align not only the visual output, but the INTERACTIONS with a given surface)!
P.3.3.0.8
LandscapeSample
#- Type
- DATAINTERFACE
- Default
- -
- Available in
- Niagara only
- Group
- Root
This is a Niagara Only User Parameter: not exposed to blueprints - but accessible at LiveComponent Details Panel, at:
/Live Component /User Parameters /DebugOnly /LiveInputFields /HeightFields /LandscapeSample DATAINTERFACE
The Niagara Landscape Data Interface (DI) is very convenient: auto-detects landscape surfaces under the simulation area.
Known issues with Landscape DI:
(A) in Large World Coordinate (LWC) range (outside the 10x10 kilometers area around the world-origin)
the Landscape auto-detect does not always work. Solution: we need to MANUALLY pick a landscape actor, under User Parameters.
SET Source Mode = Source
SET Source Landscape = arbitrary ACTOR from the actual level
(B) Landscape DI randomly returns NULL: rarely, there are frames when no landscape surface data is returned.
Solution: ninja automatically uses PREVIOUS FRAME data when Landscape DI fails.
- Type
- BOOL
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- FluidStability
We need this parameter enabled for surface aligned, free flowing, "dense" type water setups.
The "peak avoidance" function keeps the fluid in valleys, surface impressions and rims - away from peaks and plateaus.
MASKING: we can use masking to define areas that exclude the fluid. Using masking, we can set up the wall of a pool,
a dam that stops the fluid or objects that behave as an obstacle in a creek bed. See these two parameters:
(1) /LiveInputFields /MeshFields /UseAsCollisionMask
(2) /LiveInputFields /Bitmaps /CollisionMaskFromTexture
PREREQUISITE PARAM FOR MASKING:
/LiveSimulation /Bounds /SimEdgeBounciness = 1.
Masking example levels: /Content /FluidNinjaLive /Levels /Water_Dense_Creek2.umap
Check the yellow meshes with "CollisionMask" part in their name (eg. Boulder05_SDF02_CollisionMask) and DAM_CollisionMaskMesh.
An other level with a pool: Water_Sparse_Various.
OPTINAL READ ON LIVE-2 FLUID MODEL:
ninja is NOT using a "shallow water" fluid model for free flowing water - instead - a modified version of the Navier-Stokes fluid model.
The goal was to cover all use cases (gases, liquids) with a single fluid model, instead of employing multiple models.
This involves compromises. The Navier-Stokes fluid model was NOT meant to simulate free flowing,
surface aligned fluids - and ninja exploits the model by overdriving simulation density ( /LiveSimulation /DensityAccumulation > 1)
and splitting the sim area with a threshold value into "water covered / not water covered" zones.
As density constantly accumulates in a feedback loop, eventually, it would conquer the whole simulation area.
To avoid this, ninja adds "surface velocity" (derived from the landscape gradient) to the simulation velocity:
accelerating the fluid downhill and decelerating it uphill (see /LiveSimulation /VeloFromLandscapeGradient).
The fluid distribution caused by surface velocity resembles real liquids - still, the expanding fluid has a tendency
to creep up at rims and saddle-surfaces. "PeakAvoidance" is trying to eliminate fluid from these special zones.
Ninja also introduces mass (height of the fluid-column) in order to fill holes and gaps, while maintaining a smooth surface.
See "FluidGapFillingTendency" param.
While, the exploited Navier-Stokes model works most of the time, there are obvious problems:
while the fluid could be excluded from peaks and plateaus, this is not being the case with gaps and holes.
Once the fluid has conquered a gap, it will remain there through the simulation. The filled gaps occasionally leak water,
they function as a fluid source. These are the limitations of the generic-use fluid model. By carefully planning fluid source placement
and the beds where flow is allowed, we can set up the desired fluid distribution, optionally masking the fluid.
Names, values, and notes
- Niagara name
RVT.EnablePeakAvoidance
- Type
- FLOAT
- Default
- 1
- Available in
- Blueprint + Niagara
- Group
- FluidStability
The intensity of keeping the fluid away from peaks and plateaus.
Names, values, and notes
- Niagara name
RVT.FluidPeakAvoidance
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- FluidStability
Ninja is running a very basic model to imitate surface aligned fluids.
We need this parameter enabled in order to "fill gaps" - that is, to maintain a smooth surface despite the floor being uneven.
When EnableGapFilling = True, ninja uses an internal representation of mass (fluid-column height) in order to accumulate more water
at local lows. LIMITATION: the gap filling feature is designed to fill smaller holes and gaps, in the range of 0.5 - 5 meters.
To make a larger, low-lying are being filled with water, there is a dedicated parameter:
/LiveInputFields /HeightFields / ClampHeightLowerValues = True.
Names, values, and notes
- Niagara name
RVT.EnableGapFilling
- Type
- FLOAT
- Default
- 0.5
- Available in
- Blueprint + Niagara
- Group
- FluidStability
The larger the gap we would like to fill, the larger this value should be. Recommended max: 1.18
Above this value: visual glitches during water accumulation.
LIMITATION: the gap filling feature is designed to fill smaller holes and gaps, in the range of 0.5 - 5 meters.
To make a larger, low-lying are being filled with water, there is a dedicated parameter:
/LiveInputFields /HeightFields / ClampHeightLowerValues = True.
Names, values, and notes
- Niagara name
RVT.FluidGapFillingTendency
P.3.3.1.5
FluidRepelBySDF
#- Type
- FLOAT
- Default
- 0.5
- Available in
- Blueprint + Niagara
- Group
- FluidStability
Ninja by default adds the height data coming from Mesh SDF on top of the height data coming from other sources
like LandscapeComponents (see this param: /LiveInputFields /MeshFields /AddMeshHeightToLandscapeHeight).
By adjusting this param, we can define how much the fluid tries to escape the area where Mesh Distance Fields are present.
This param is optimal for tweaking dynamic behavior, like meshes emerging from fluid - and fluid is flowing down from their surfaces.
Names, values, and notes
- Niagara name
RVT.FluidRepelBySDF
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- FluidStability
By using this bool switch, we can further increase the amount of water that accumulates on top of Meshes,
when they emerge from water or stick out of water.
Names, values, and notes
- Niagara name
RVT.SoftenSDFRepelMask
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- ExternalHeightData
Height data could be generated with arbitrary methods, independently from ninja, the goal is to write it a RenderTarget
or Texture, so ninja could read it. For example, we can set up a top-down looking SceneCaptureCamera to sample elevation
(scene depth) and write the data to a RenderTarget in user defined intervals (eg.: once in a second),
then reading the RenderTarget on the ninja side. This setup is dynamic, moving objects result changing elevation map.
In case the landscape or objects do not change, we can bake the elevation to a static Texture and use that as ninja input.
Advantage: following the baking, we could remove the SceneCaptureCamera - no resources consumed during game-time!
NOTE: in the ninja project, there is a modified SceneCaptureCamera with height BAKING feature included:
/Content /FluidNinjaLive /Utilities /SceneCaptureCameraUtility.uasset
Names, values, and notes
- Niagara name
RVT.UseExternalHeightData
- Type
- TEXTURE RENDERTARGET
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- ExternalHeightData
Input to read dynamic elevation maps.
Names, values, and notes
- Niagara name
ExternalHeightData
- Type
- TEXTURE 2D
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- ExternalHeightData
Input to read static elevation maps.
Names, values, and notes
- Notes
- both (3.3.2.2) and (3.3.2.3) feeds the SAME niagara var
- Niagara name
ExternalHeightData
- Type
- FLOAT
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- ExternalHeightData
The World Space Z coordinate at which the height-map capturing took place - the null reference point of the elevation map.
SceneCaptureCamera Z-position comes here. Make sure that the XY position of Capture Camera is the same as ninja XY.
Names, values, and notes
- Niagara name
RVT.ExternalHeightDataNullPoint
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- RVTHeightData
Ninja can sample Runtime Virtual Textures (RVT) to access height data. On the other side, we need to set up RVT writing.
Three steps:
(1) create a Runtime Virtual Texture (RVT) asset in Content Browser,
(2) place a Runtime Virtual Texture Volume on Level, set RVT asset as write target, make sure that sampled objects are inside the volume,
(3) select the objects that should write height:
Actor Details Panel /Virtual Texture /DrawInVirtualTextures: set RVT asset as write target.
- Type
- OBJECT
- Default
- RVT asset
- Available in
- Blueprint + Niagara
- Group
- RVTHeightData
A Runtime Virtual Texture asset with height data comes here. Ninja is going to sample this asset as height source.
- Type
- DATAINTERFACE
- Default
- -
- Available in
- Niagara only
- Group
- RVTHeightData
This is a Niagara Only User Parameter: not exposed to blueprints - but accessible at LiveComponent Details Panel, at:
/LiveComponent /User Parameters /DebugOnly /LiveInputFields /HeightFields /RVTHeightData /RVTSample DATAINTERFACE
At the User Parameter settings, we can re-define the Input Object User Parameter, if needed:
SET Texture User Parameter = User.RVTAsset OBJECT
By default, ninja feeds the input object with an RVT Data Asset, if a valid asset is defined at:
/LiveComponent /LiveInputFields /HeightFields /RVTHeightData /RVTAsset
Names, values, and notes
- Notes
- this DI samples "RVTAsset"
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- SplineFields
Splines generate a directional field. This could be used to determine flowing direction along the spline.
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- SplineFields
Ninja tries to determine spline-height (World Z), comparing this against the height of underlying heightfield
(typically from a Landscape Component) and generate a collision mask where SplineHeight < LandscapeHeight.
If the operation is successful, fluid advection gets blocked at the (river) coastline.
PREREQUISITE for Landscape-Spline intersection detection:
/LiveInputFields /HeightFields / UseHeightAsCollisionMask = True.
Names, values, and notes
- Niagara name
Spline.TryToGenerateCollisionMaskUsingRVT
- Type
- FLOAT
- Default
- 0.25
- Available in
- Blueprint + Niagara
- Group
- SplineFields
Making the blocking zone softer.
Names, values, and notes
- Niagara name
Spline.SoftenCollisionMask
- Type
- FLOAT
- Default
- 20
- Available in
- Blueprint + Niagara
- Group
- SplineFields
Optionally define spline-mesh-width in METERS to help ninja generate a better collision mask.
Very useful for meandering (curly) rivers where curves are spatially close to each other.
Names, values, and notes
- Niagara name
Spline.SplineWidth
- Type
- OBJECT
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- SplineFields
User defined Actor with Spline Component.
Names, values, and notes
- Notes
- both (3.4.5 and 3.4.6 feeds the SAME niagara var
- Niagara name
User.SplineMeshActor
- Type
- NAME
- Default
- none
- Available in
- Blueprint only
- Group
- SplineFields
Ninja collects all Actors with Spline Component using THIS TAG - and picks the closest one for sampling.
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint only
- Group
- SplineFields
Ninja can handle only a single spline in the simulation area. In case the sim area moves (eg. attached to player),
we might cross new splines. Using this feature ninja periodically monitors tagged spline-sources and picks the one
that is closest to the sim area. Ideal for large levels with multiple, distant splines.
Recollection frequency is defined by this variable: /LiveEditorTools /ParamUpdateFrequency.
- Type
- DATAINTERFACE
- Default
- -
- Available in
- Niagara only
- Group
- SplineFields
This is a Niagara Only User Parameter: not exposed to blueprints - but accessible at LiveComponent Details Panel, at:
/LiveComponent /User Parameters /DebugOnly /LiveInputFields /SplineFields /Spline DATAINTERFACE
WARNING: this is a complex Data Interface type User Parameter - referencing an other, "input object" type User Parameter.
As a result of an Unreal Bug, the Spline Data Interface tends to forget the referenced "input object" User Parameter when
we copy-paste setups. As a result, ninja can not access input objects and sample spline-data.
FIX: look up the Spline DATAINTERFACE at User Parameters,
SET Spline User Parameter = User.SplineMeshActor OBJECT,
SET Use LUT = TRUE,
SET Num LUT Steps = 4096
- Type
- PLACEHOLDER
- Default
- -
- Available in
- Blueprint only
- Group
- Destructibles
This bool switch is only a PLACEHOLDER for the TOOLTIP - please read carefully!
Geometry Collections are typically Destructibles with precalculated fracture chunks. The chunks could be sampled
as a type of Mesh SDF. To access them, SET /LiveInputFields /MeshFields /EnableMeshDistanceFieldReader = True.
WARNING: Chaos destructibles also could be accessed as POINTS (via Chaos DI, under LiveInputPoints /InteractionWithDestructibles).
Set up one method EXCLUSIVELY and DISABLE the other method (SDF input vs POINT input).
- Type
- OBJECT
- Default
- -
- Available in
- Blueprint only
- Group
- Destructibles
WARNING: this param is TEMPORARILY NOT SAFE TO USE - until EPIC fixes a memory-leak bug,
corrupting the Niagara GeometryCollection sampler node.
WORKAROUND:
(A) instead of directly defining a Geometry Collection Actor, use "GetGeometryCollectionFromTaggedActor"
(B) make sure that "RecollectGeoCollectionsDuringGameTime" is set to TRUE
Names, values, and notes
- Notes
- both 3.5.2 and 3.5.3 feeds the SAME niagara var
- Niagara name
User.GeometryCollectionActor
- Type
- NAME
- Default
- none
- Available in
- Blueprint only
- Group
- Destructibles
Geometry Collections are typically Destructibles with precalculated fracture chunks.
Ninja collects all Actors with Geometry Collection Component using THIS TAG.
- Type
- BOOL
- Default
- 1
- Available in
- Blueprint only
- Group
- Destructibles
Ninja can handle only a single GeometryCollection in the simulation area.
Once the tracked GeoCollection breaks, ninja removes the GeoCollection after a user defined time interval (default = 3 seconds)
and a new collection could be picked up (if available).
Optimal for sequentially tracking spawned destructibles that eventually break.
Recollection frequency is defined by this variable: /LiveEditorTools /ParamUpdateFrequency.
- Type
- FLOAT
- Default
- 3
- Available in
- Blueprint only
- Group
- Destructibles
In case we read destructibles as SDF, the sampled Destructible Mesh is being ignored (not sampled) after n-seconds,
defined by this variable. Once a Destructible SDF is ignored, a "removal debug message" could be generated by setting
/LiveCore /Debug /ShowDestructibleRemovals = True.
- Type
- DATAINTERFACE
- Default
- -
- Available in
- Niagara only
- Group
- Destructibles
This is a Niagara Only User Parameter: not exposed to blueprints - but accessible at LiveComponent Details Panel, at:
/LiveComponent /User Parameters /DebugOnly /LiveInputFields /Destructibles /GeometryCollection DATAINTERFACE
WARNING: this is a complex Data Interface type User Parameter - referencing an other, "input object" type User Parameter.
As a result of an Unreal Bug, the GeometryCollection Data Interface tends to forget the referenced "input object" User Parameter
when we copy-paste setups. As a result, ninja can not access input objects and sample GeometryCollection data.
FIX: look up the Spline DATAINTERFACE at User Parameters,
SET Geometry Collection User Parameter = User.GeometryCollectionActor OBJECT
- Type
- BOOL
- Default
- 0
- Available in
- Blueprint + Niagara
- Group
- Cache
We can save a single-frame snapshot of the simulation buffers while the game is running - and initialize the simulation
from the snapshot at next start. We call this CACHING. Advantage: we don't have to wait until the desired fluid state builds up.
NOTE 1: the function to save buffers is located at /LiveEditorTools /SaveSimBuffers.
NOTE 2: the saved buffers should be loaded to the three input fields under /LiveInputFields /Cache.
- Type
- TEXTURE
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- Cache
Load a Paint Buffer here, with painter Velocity, painter Density and Surface Elevation data on RGBA channels.
Names, values, and notes
- Niagara name
CachedPainter
- Type
- TEXTURE
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- Cache
Load a Simulation Buffer here, with sim Velocity, sim Density and Wetmap data on RGBA channels.
- Type
- TEXTURE
- Default
- -
- Available in
- Blueprint + Niagara
- Group
- Cache
Load a Simulation Buffer here, with sim Pressure and sim Divergence data on RG channels.