Language:
Page Info
Skill Level:
Engine Version:

Create a GPU Particle Effect

Choose your OS:

For some effects, you may need to spawn tens of thousands of particles. However, using the standard CPU to generate this many particles can cause the game to slow down. In the following How-To we will demonstrate how to spawn particles using the GPU instead of the CPU.

GPU_Banner_01-1.png

Steps

  1. First, we will need to create a particle effect. Right-click in the Content Browser, and from the displayed menu select FX > Niagara Emitter to create a new Niagara Emitter.
    SE_01.png

  2. Name the newly created Niagara Emitter FX_GPUParticle and then double-click it to open it.
    CreateGPU_Steps_Step2-CreateEmitter.png

  3. With the Niagara Editor now open, go to the Selected Emitter panel and locate the Render section.

  4. Expand the Particle Spawn section. Locate the Sphere Location section.

  5. In the Sphere Location section, set the Sphere Radius to a value of 100.
    CreateGPUParticle_Steps_Step05-SphereRadius.png

  6. Locate the Set Variables section and then set the following parameters with the following values: CreateGPUParticle_Steps_Step06-SetVariables.png

    Particle Module Name

    Value

    Particles.Lifetime

    5

    Particles.SpriteSize

    X: 5, Y: 5

  7. Locate the Emitter Properties section and click the dropdown next to Sim Target. From the displayed list, select the GPUCompute Sim option.
    CreateGPUParticle_Steps_Step07-ChangeToGPU.png

This is where you are changing from the CPU to the GPU. You should see an increase in the number of particles generated.

CreateGPUParticle_Steps_Step08-SpawnRate.png

  1. Click the Compile, Apply and Save buttons to compile and save your work. Then close the FX_GPUParticle emitter.
    ME_09.png

  2. Now right-click in the Content Browser, and select FX > Niagara System, giving the new Niagara System the name GPUParticle.
    SE_16.png

  3. Double-click the GPUParticle Niagara System to open it. Then drag the FX_GPUParticle Niagara Emitter to the Timeline.
    CreateGPUParticle_Steps_Step11-AddEmitterToSystem.png

  4. Click the Compile and Save buttons to compile and save your work, and then close the Particle Light Niagara System. In the Content Browser, drag the Mesh Niagara System into the level viewport.
    CreateGPUParticle_Steps_Step12-AddSystemToLevel.png

End Result

When all steps have been completed, you will have a particle effect that is larger and more complex than the same particle effect using the CPU. An example is shown in the video below.