Occlusion Query in UE5 Niagara Tutorial

Occlusion Query in UE5 Niagara Tutorial | Download Files
Occlusion query particle visibility made in Unreal Engine 5 Niagara

Learn how to use the Occlusion Query node in Unreal Engine 5 Niagara to control particle visibility and color based on surface proximity. In this tutorial, you will set up a GPU-simulated Niagara emitter, sample visibility fractions against scene geometry, clamp values, and add curl noise while culling transparent particles.

Quick Overview

  • Engine: Unreal Engine 5 (UE5 Niagara)
  • Effect Type: Occlusion Query & Surface-Proximity Particle Visibility
  • Core Elements & Nodes: Niagara Emitter, Sprite Renderer (translucent/additive material), Sphere Location (200 units), GPU Simulation (2,000 particles), Occlusion Query node, Clamp, Color Adjustment, Curl Noise, Kill Particles
  • Best Used For: Surface-reactive particle effects, lens flares, glows, and sun effects that dynamically hide or change behind geometry
  • Project Files: Download on Patreon

Tutorial Breakdown & Chapters

  1. Creating the Emitter: Create a new Niagara Emitter and add a Sprite Renderer using an additive material adjusted for translucency and clear visibility.
  2. Adding Particles: Spawn 2,000 particles inside a 200-unit sphere with zero velocity and gravity, and enable GPU simulation for optimal performance.
  3. Color Adjustment: Assign red and green particle colors and configure color transitions based on each particle’s proximity to nearby surfaces.
  4. Using the Occlusion Query: Add the Occlusion Query node to evaluate surface proximity, return a visibility fraction, and switch particles to green near surfaces.
  5. Visibility Control: Clamp the visibility fraction to prevent negative values and maintain clean, predictable particle visibility across surfaces.
  6. Animation and Effects: Layer curl noise onto the particles for organic motion and kill transparent particles to keep the simulation clutter-free.

Frequently Asked Questions

What does the Occlusion Query node do in UE5 Niagara?

The Occlusion Query node in Unreal Engine 5 Niagara checks whether a particle is near or occluded by scene geometry and outputs a visibility fraction. In this tutorial, that visibility fraction drives particle color changes—turning particles green near surfaces—and controls whether particles remain visible or get culled.

Why enable GPU simulation for this Niagara occlusion query setup?

Enabling GPU simulation allows the Niagara emitter to handle 2,000 particles inside the 200-unit sphere efficiently with minimal performance overhead. With particle velocity and gravity set to zero, GPU simulation processes the occlusion query checks and color updates smoothly across dense particle counts in real time.

How do you prevent negative visibility values and clutter in the effect?

After the Occlusion Query node outputs a visibility fraction, apply a Clamp node to eliminate negative values and keep particle visibility bounded on surfaces. Finally, add curl noise for subtle animation and kill any transparent particles so invisible sprites do not accumulate and clutter the simulation.

CGHOW Resources


Discover more from CGHOW

Subscribe to get the latest posts sent to your email.

One response to “Occlusion Query in UE5 Niagara Tutorial”

  1. […] interactive effects: Occlusion Query in UE5 Niagara · Spawn Particles Near the Player · Emit Particles on Mesh […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.