In this tutorial, you build a Niagara system that reads splats from two Gaussian Splat assets and blends between them. Each particle represents one splat from each asset. Every frame, a Scratch Pad module blends each particle's position, rotation, scale, and color from one asset to the other, then back again.
Before You Begin
Enable the Gaussian Splats experimental setting. See Enable Gaussian Splats.
Import two object splats as Gaussian Splat assets, such as two objects of similar size. See Import a Splat File.
This tutorial assumes basic familiarity with the Niagara Editor. If you're new to Niagara, start with Creating Fireworks Using Niagara in Unreal Editor for Fortnite.
1. Create the Niagara System
In the Content Browser, right-click in the folder where you want to save the effect, and select Niagara System.
In the Create Niagara System window, click Create Empty Niagara System.
Name the system NS_SplatMorph, then double-click it to open the Niagara Editor.
In the System Overview, right-click an empty area of the graph, and select Add minimal emitter.
Rename the emitter Morph.
In the Morph emitter, select Particle State under Particle Update. In the Details panel, clear Kill Particles When Lifetime Has Elapsed, so the particles aren't killed after a few seconds.
The list of groups and modules in the Morph emitter, such as Emitter Update, Particle Spawn, and Render, is called the emitter stack. When you select the emitter, the same stack appears in the Details panel.
2. Set Up the Emitter
Select the Morph emitter. Its Emitter Properties appear at the top of the Details panel.
Set Sim Target to GPUCompute Sim.
Select Local Space. The Reader returns splat positions relative to each asset, so a local-space emitter keeps the effect aligned with the Niagara actor in your level.
Set Calculate Bounds Mode to Fixed.
Set Fixed Bounds to a box large enough to contain both Gaussian Splat assets. For example, set Min to (-500, -500, -500) and Max to (500, 500, 500) for objects up to about 10 meters across.
GPU emitters require fixed bounds. If the bounds are too small, the effect can disappear when the edges of the bounds leave the camera view.
3. Add User Parameters
User parameters appear on the Niagara actor when you place the system in a level, so you can change their values without editing the system.
In the Niagara Editor, open the User Parameters tab at the bottom left, next to Parameters and Local Modules.
Click Add (+), and select Data Interface > Gaussian Splat Reader. Name the parameter ReaderA.
Add another Gaussian Splat Reader parameter, and name it ReaderB.
Add a float parameter, name it MorphSpeed, and set its value to 0.2 (one morph cycle every five seconds).
Add an int32 parameter, name it MaxSplats, and set its value to 100000.
Expand ReaderA, and set Gaussian Splat to your first Gaussian Splat asset.
Expand ReaderB, and set Gaussian Splat to your second Gaussian Splat asset.
MaxSplats sets the number of particles. Each particle represents one splat from each asset, spread evenly across both assets. A value lower than the assets' splat counts keeps the effect within Niagara's maximum particle counts and reduces cost. See Maximum particle counts.
Lower-end platforms and lower quality settings allow fewer particles per emitter. If the effect looks clipped, with part of an object missing, lower MaxSplats for those platforms. The morph still spans both objects, with fewer, more widely spaced splats.
4. Spawn the Particles
The effect spawns all of its particles once, when the system starts. The particles aren't killed, so they stay for as long as the system runs.
In the Morph emitter, click Add (+) next to Emitter Update, and add Spawn Burst Instantaneous.
Select Spawn Burst Instantaneous. Click the dropdown next to Spawn Count, and link it to User.MaxSplats.
Enable Loop Count Limit by selecting the checkbox to the left of it, and keep the value at 1, so the burst happens only once.
Loop Count Limit has no effect until it is enabled, even though its value already shows 1. If it isn't enabled, the burst repeats every time the emitter loops, and particles accumulate until the effect stops rendering.
Don't add modules that set a lifetime or kill particles. Positions are set every frame by the morph module in section 6.
5. Add the Splat Renderer
In the Morph emitter, select Sprite Renderer under Render, and delete it.
Click Add (+) next to Render, and select Splat Renderer.
Leave the bindings at their defaults. The morph module writes the particle attributes that the Splat Renderer uses: Particles.Position, Particles.Scale, Particles.MeshOrientation, and Particles.Color.
6. Build the Morph Module
In this section, you create a Scratch Pad module that calculates each particle's values every frame. The module has four inputs, and builds the blend in stages.
Create the Module
In the Morph emitter, click Add (+) next to Particle Update, then select New Scratch Pad Module. The module graph opens in a new tab.
Rename the module MorphSplats.
A new Scratch Pad module contains a Map Get node, which reads values such as module inputs and particle attributes, and a Map Set node, which writes values to the particles.
On the Map Get node, click Add (+) to add each of the following module inputs. Enter only the name shown. The INPUT tag on each pin shows that it's a module input.
Name Type ReaderA
Gaussian Splat Reader
ReaderB
Gaussian Splat Reader
MorphSpeed
float
MaxSplats
int32
On the same Map Get node, click Add (+) again, and add UniqueID (tagged PARTICLES) and Time (tagged ENGINE). These already exist, so select them from the list instead of creating new inputs.
UniqueID counts up from 0 as particles spawn, so each particle has a different value that it uses to choose its splats.
Choose a Splat in each Asset
Each particle reads splat UniqueID × NumSplats / MaxSplats from each asset. This spreads the particles evenly across both assets. For example, with an asset of 1,000,000 splats and a MaxSplats of 100,000, the particles read every tenth splat.
Drag from the ReaderA pin, and add a Get Num Splats node. Its NumSplats output is an integer.
Convert NumSplats, MaxSplats, and UniqueID to floats. For each one, drag from the pin, search for float, and select Make > float.
Add a Divide node, and divide the converted NumSplats by the converted MaxSplats.
Add a Multiply node, and multiply the result by the converted UniqueID.
Drag from the result, search for int32, and select Make > int32. This is IndexA.
Repeat steps 1–5 with ReaderB to calculate IndexB. You can reuse the converted MaxSplats and UniqueID.
The calculation uses floats because multiplying large integer values, such as a particle ID by a splat count, can exceed the range of an integer.
Read Both Splats
From the ReaderA pin, add a Get Base Data node, and connect IndexA to its Index input.
From the ReaderB pin, add a Get Base Data node, and connect IndexB to its Index input.
Each Get Base Data node outputs the splat's Position, Rotation, Scale, and Opacity.
Calculate the Blend Amount
The blend amount, t, moves smoothly from 0 to 1 and back again. It's calculated as 0.5 − 0.5 × cos(2π × MorphSpeed × Time).
Add a Multiply node, and multiply Time by MorphSpeed.
Add a Cosine node, connect the result to its Angle input, and leave Period at 1.0. The Cosine node includes the 2π factor, so an angle of 1 is one full cycle.
Add a Multiply node, and multiply the Cosine output by -0.5. To enter a constant, drag from the empty input, search for float, select Make > float, and set its Value.
Add an Add node, and add 0.5 to the result, using another Make float node. This is t.
With a MorphSpeed of 0.2, t completes one cycle from 0 to 1 and back every five seconds.
Blend Position and Scale
Add a Lerp node. Connect the Position output of ReaderA's Get Base Data to A, the Position output of ReaderB's Get Base Data to B, and t to Alpha.
Add another Lerp node, and connect the two Scale outputs and t the same way.
Blend Rotation
Rotations are quaternions. To blend between them smoothly:
Add a Slerp Quaternion node. Connect the Rotation output of ReaderA's Get Base Data to Quat A, the Rotation output of ReaderB's Get Base Data to Quat B, and t to Lerp Factor.
Blend Color and Opacity
From the ReaderA pin, add a Calculate Color node. Connect IndexA to Index, and leave Direction at (0, 0, 0). A direction of (0, 0, 0) returns the splat's base color.
From the ReaderB pin, add a Calculate Color node. Connect IndexB to Index, and leave Direction at (0, 0, 0).
Add a Lerp node, and blend the two Color outputs using t.
Add a Lerp node, and blend the two Opacity outputs from the Get Base Data nodes using t.
Add a Make Linear Color node to combine the blended color, which is a vector, and the blended opacity into a linear color. Search for Linear Color, and select it under Make.
Drag the blended color output onto the Add (+) pin at the bottom left of the Make Linear Color node. This adds a vector input to the node.
Connect the blended opacity to the A input.
Click the arrow at the top right of the Make Linear Color node to expand it. Under the new vector input, connect X to R, Y to G, and Z to B. Check that A is still connected to its Value.
Write the Particle Attributes
On the Map Set node, click Add (+) and add the following attributes. Select each one from the list.
Connect each attribute to the node output shown in the table.
Attribute Connect from Particles.Position
The output of the position Lerp node
Particles.Scale
The output of the scale Lerp node
Particles.MeshOrientation
The Quaternion output of the Slerp Quaternion node
Particles.Color
The output of the Make Linear Color node
Click Apply & Save.
When you save, UEFN reports that the Gaussian Splat Reader and the Splat Renderer are experimental and must be removed before publishing. These messages are expected while Gaussian Splats are Experimental.
Connect the module inputs
Return to the System Overview tab, and select the Morph Splats module under Particle Update in the Morph emitter. Its inputs appear in the Details panel.
For each module input, click the arrow at the far right of the input's row, and link the input to the matching user parameter:
Module input Link to ReaderA
User.ReaderA
ReaderB
User.ReaderB
MorphSpeed
User.MorphSpeed
MaxSplats
User.MaxSplats
Compile and save the system.
The morph is visible in the Niagara Editor preview.
7. Place the System in Your Level
Drag NS_SplatMorph from the Content Browser into the viewport.
With the Niagara actor selected, find the user parameters in the Details panel, and check that ReaderA and ReaderB reference the Gaussian Splat assets you want to morph between.
Adjust MorphSpeed and MaxSplats as needed.
Both assets are drawn relative to the Niagara actor. If the two objects are different sizes or aren't centered the same way, the morph also moves and resizes the splats. For the cleanest result, use assets with a similar size and center.
8. Test the Effect
Click Launch Session, or Push Changes if a session is already running, and view the effect in game.
If you don't see the effect, check that:
The Fixed Bounds contain both assets.
Both ReaderA and ReaderB reference Gaussian Splat assets.
MaxSplats is greater than 0.
If part of an object is missing at lower quality settings, the effect has more particles than those settings allow. Lower MaxSplats on the Niagara actor.
Next Steps
Morph on demand: Replace the blend amount calculation with a float user parameter, such as MorphAmount, from 0 to 1. Change it from Verse or a device to control the morph.
Run on all platforms: This effect uses a GPU simulation, which doesn't currently run on Android. To create a CPU version, see Run the examples on all platforms.
Support lower-end platforms: Lower quality settings allow fewer particles per emitter. Test the effect at the lowest quality level you target, and lower MaxSplats if part of an object is missing. See Platforms and Performance.
Learn more about the Reader: See Gaussian Splat Reader for all of the functions you can use in your own effects.