To create the effect, you’ll work from the outside in. This determines how big the completed effect will be. This tutorial starts with the outside ring of the portal. You’ll learn how to create particles that loosely flow in one direction inside a large ring.
Creating the Niagara System
A Niagara System executes a state, or a visual effect (VFX). To create a Niagara System, you use an emitter to stack nodes and modules that define the Niagara particles and how they behave. To edit the emitter stack, you open the Niagara System editor (Niagara editor). Inside the Niagara editor, you can add and delete modules and define how the modules affect the particle effects.
You will create a Niagara System in the Content Browser to begin building your mystic portal. Place your visual effects (VFX) into a folder to easily find them while you’re working on your project.
Inside your VFX folder:
Right-click In the Content Browser to open the context menu.
Select Niagara System from the context menu.
The Niagra System window opens.
From the Niagara System window, select an Empty emitter and click Create.
Name the thumbnail NS_Mystic_Portal. The NS designates the thumbnail as a Niagara System.
Double-click the Niagara System thumbnail to open the Niagara editor.
Creating Particles
The empty emitter is where you’ll build a custom particle emitter that creates sparks flying around in a torus (donut-like) shape. When you open the empty Niagara System, a basic emitter is available in the Niagara Editor.
Click to enlarge image.
To begin:
Press F2 to rename the emitter Emitter_Particles.
On the emitter, click the Add icon on the Emitter Update node.
Select Spawn Rate in the module search window. The Spawn Rate module options appear in the Details panel.
In the Details panel, change the SpawnRate option to 1000.0. This creates 1000 particles when they spawn.
On the emitter, select the Initialize Particle module from the Particle Spawn node stack. The Initialize Particle options appear in the Details panel.
In the Details panel, change the following Initialize Particle options:
Lifetime = 3.0
Sprite Size Mode = Uniform
Uniform Sprite Size = 3.0
This causes the particles to spawn and die over a three-second period, and the size of the particles to be the same sprite size during their lifetime.
On the emitter, click the Add icon on the Particle Spawn node and select Shape Location from the module search window.
The Shape Location options appear in the Details panel.
In the Details panel, change the following Shape Location options:
Shape Primitive = Torus
Large Radius = 125.0
Rotation Mode = Axis Angle
This determines the shape the particles are born into and rotates the angle of the torus so it stands on the Z-axis rather than lying on the Y-axis.
The default rotation axis settings do not need to change for the torus to stand up.
Making the Effect Performant
A high particle count can shuffle well on the GPU, but may not show on low-end platforms or mobile devices when using the CPU property. To make the particles more performant, you will need to switch the emitter stack to GPU.
Click the Properties node on the emitter stack. The Properties options open in the Details panel.
In the Details panel, set the following Properties options:
Sim Target = GPUCompute Sim
Calculate Bounds Mode = Fixed
Determining the Velocity and Look
To create the outer look of the portal, edit the particles to fly slowly in the same direction, and to materialize to a certain size, then die over a short amount of time.
On the emitter, click the Add icon on the Particle Update node and select Vortex Force from the module search window. The Vortex Force options appear in the Details panel.
In the Details panel, a Vortex Force dependency warning appears. Click the Fix Issue button and the Niagara System will fix the issue.
Once resolved, you will see the vortex force in the viewport.
In the Details panel, change the following Vortex Force options:
Vortex Force Amount = 100
Vortex Axis = X 1.0, Y 0.0, Z 0.0
This causes the particles to flow in one direction.
Particles flowing forward and backward from the torus is not how the outer ring should to behave. (convert:false)
Particles flowing in one direction is how the outer ring should to behave. (convert:false)
On the emitter, click the Add icon on the Particle Update node and select Drag from the search module window.
The Drag options appear in the Details panel.
On the emitter, select Vortex Force and the Vortex Force options open in the Details panel.
In the Details, change the following Vortex Force options:
Vortex Force Amount = 100.0
Vortex Axis = X 1.0, Y 0.0, and Z 0.0
The particles will now spin closer to the torus shape.
On the emitter, click the Add icon on the Particle Update node and select Scale Sprite Size from the search module window. The Scale Sprite Size options appear in the Details panel.
This controls the size of the particles over time. At this point, the particles are born visible and die abruptly. To get a different particle effect, change the sprite size that particles are born and die at, as well as the curve they’re produced on.
In the Details panel, right-click in the Scale Sprite Size graph in between the two keys and select Add Key from the context menu.
Move the new key to the 1 position and move the last key down to the 0 position, creating a sharp triangular curve in the graph.
The particles are now born invisible and slowly scale up to their full size then slowly scale down as they die out.
In the Scale Sprite Size graph, use Ctrl A to select all key frames, then press 1 to make the line curved and smooth rather than sharp. This makes the particles look more mystical in the torus.
On the emitter, click the Add icon on the Particle Update node and select Collision from the search module window. The Collision options appear in the Details panel.
The particles flow loosely in a circular pattern.
Adding Color
Add a color to your portal that matches the experience you’re creating.
On the emitter, click the Add icon on the Particle Spawn node and select Color from the module search window. The Color options appear in the Details panel.
From the Details panel, select the Color option and choose a color for your portal particles from the Color Picker.
Click Compile > Save to save your emitter.
Your emitter has the shape of a portal and the particles look like magic dust flying around the torus. In the next section of this tutorial, you’ll add a ring to the inside of the torus to create the source of the particle dust.
\