Create a GPU Particle Effect

Describes how you can use your GPU to spawn millions of particles.

Windows
MacOS
Linux
Prerequisite Topics

This page assumes you have prior knowledge of the following topics. Please read them before proceeding.

On this page

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, create a Niagara Emitter by right-clicking in the Content Browser, and from the displayed menu select FX > Niagara Emitter. The Niagara Emitter wizard displays.
    SE_01.png

  2. Click the radio button next to Create a new emitter from an emitter template. Select the Fountain template. Then click OK to create a new Niagara Emitter in the Content Browser.
    NiagaraEmitter_FountainTemplate.png

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

  4. Expand the Emitter Spawn section. Locate Emitter Properties and expand it. Click the dropdown next to Sim Target. From the displayed list, select the GPUCompute Sim option.
    CreateGPUParticle_Steps_Step06-ChangeToGPU.png

This setting changes particle simulation from the CPU to the GPU. This enables the Engine to spawn more particles while maintaining performance.

  1. Expand the Emitter Update section. Locate the Spawn Rate module.

  2. In the Spawn Rate module, set the SpawnRate to a value of 5000.
    CreateGPUParticle_Steps_Step07-SpawnRate.png

  3. Next, locate the Set Variables module. Set the Particles.SpriteSize X and Y values to 5.
    CreateGPUParticle_SetVariablesParticleSpriteSize.png

  4. In the Sphere Location module, set the Sphere Radius to a value of 100.
    CreateGPUParticle_Steps_Step04-SphereRadius.png

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

  6. Right-click in the Content Browser, and from the displayed menu select FX > Niagara System. The Niagara System wizard displays.
    SE_16.png

  7. Click the radio button next to Create an empty system with no emitters. Then click OK to create a new Niagara System in the Content Browser.
    NiagaraSystem_EmptySystem.png

  8. Name the new Niagara System GPU
    NiagaraSystem_GPUIcon.png

  9. Double-click the GPU Niagara System to open it, then drag the FX_GPU Niagara Emitter from the Content Browser to the Timeline.
    CreateGPUParticle_Steps_Step10-AddEmitterToSystem.png

  10. Click the Compile and Save buttons to compile and save your work, and then close the GPU Niagara System. In the Content Browser, drag the GPU Niagara System into the Level Viewport. When that is completed, you should now see something like the image below.
    CreateGPUParticle_Steps_Step11-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.

Tags

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback