Create a GPU Particle Effect

This document 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.

Steps

  1. First, create a Niagara Emitter by right-clicking in the Content Browser and select FX > Niagara Emitter. The Niagara Emitter wizard displays.

    Click image for full size.

  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.

    Click image for full size.

  3. Name the new Niagara Emitter FX_GPU and double-click to open it.

    CreateGPU_Steps_Step2-CreateEmitter.png

  4. In the System Overview, click Emitter Properties to open it in the Selection panel.

    Click image for full size.

  5. Click the dropdown next to Sim Target, and select the GPUCompute Sim option.

    Click image for full size.

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

  6. In the System Overview, click Emitter Update to open it in the Selection panel.

    Click image for full size.

  7. Expand the Spawn Rate module. Set the Spawn Rate to a value of 10,000.

    Click image for full size.

  8. In the System Overview, click Particle Spawn to open it in the Selection panel.

    Click image for full size.

  9. Expand the Initialize Particle module, and under Point Attributes locate Lifetime. Set the Minimum and Maximum to 5.0.

    Click image for full size.

  10. Locate Mass, and set the Minimum and Maximum to the following values.

    Click image for full size.

    Property

    Value

    Minimum

    1.0

    Maximum

    2.0

  11. Under Sprite Attributes, set the Sprite Size to X: 5.0, Y: 5.0. Make sure the Sprite Rotation box is unchecked.

    Click image for full size.

  12. Expand the Add Velocity module. For Velocity, set the Minimum and Maximum to the following values.

    Click image for full size.

    Property

    Value

    Minimum

    X: 10.0, Y: 10.0, Z: 400

    Maximum

    X: 50.0, Y: 50.0, Z: 800.0

  13. Expand the Sphere Location module. Set the Sphere Radius to 100.

    Click image for full size.

  14. In the System Overview, click Particle Update to open it in the Selection panel.

    Click image for full size.

  15. Expand Gravity Force. Set the Gravity to X: 0, Y: 0, Z: 500.

    Click image for full size.

    A negative Z value will make the Mesh particles go up briefly, and then fall down. A positive Z value will make the Mesh particles go up without falling.

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

    Click image for full size.

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

    Click image for full size.

  18. Click the radio button next to Create an empty system with no emitters. Click OK to create a new Niagara System in the Content Browser.

    Click image for full size.

  19. Name the new Niagara System GPU

    NiagaraSystem_GPUIcon.png

  20. Double-click the GPU Niagara System to open it, then drag the FX_GPU Niagara Emitter from the Content Browser to the system Timeline.

    Click image for full size.

    Instead of steps 17-20, you can also right-click on the emitter in the Content Browser and select Create Niagara System. This creates a system based on the emitter you selected, at which point you can name it and open it.

  21. 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.

    Click image for full size.

End Result

When all steps have been completed, you will have a particle effect that is larger and more complex but uses less resources. An example is shown in the video below.

Tags
Select Skin
Light
Dark

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