Getting Started with Unity VFX Graph: A High-Performance GPU-Based Particle System

Created: 2026-02-05Last updated: 2026-10-10

Learn how to use Unity's VFX Graph, a visual effect authoring tool that renders massive numbers of particles with high performance on the GPU. This guide covers the basic structure, how it differs from the classic Particle System, and practical usage.

You build a cherry-blossom flurry with the Particle System (Shuriken), and the moment you crank up the count, the frame rate tanks. A starry sky, a blizzard over a snowfield—right when you want "one more order of magnitude of particles," the CPU cries uncle. When you hit that wall of sheer volume, that's VFX Graph's cue.

VFX Graph is Unity's official node-based visual effect authoring tool. Because it runs the particle calculations on the GPU, it can drive particles at a scale of hundreds of thousands to millions—far past the few thousand that are typical for Shuriken.

VFX Graph concept art: operating a node graph panel makes countless particles swirl up into a huge vortex

What You'll Learn

  • How VFX Graph differs from the Particle System (Shuriken) and when to use each
  • The basic structure of VFX Graph (Spawn / Initialize / Update / Output)
  • Basic usage and controlling effects from scripts
  • System requirements and caveats on mobile
  • Practical: spawning tens of thousands of fireflies in a night forest

Sponsored

Differences from the Classic Particle System

Volume comparison of the Particle System and VFX Graph. The Particle System (CPU) tops out at a few thousand particles and supports collision detection; VFX Graph (GPU) renders millions of particles at overwhelming density

Particle System (Shuriken)

  • CPU-based particle system
  • Available since Unity's early days
  • Configured in the Inspector
  • Modular design
  • Supports collision detection
  • Easy to set up, lots of learning resources
  • Tends to be CPU-heavy (a few thousand particles is the typical scale)

VFX Graph

  • GPU-based particle system
  • Configured through a node-based graph
  • Can render massive numbers of particles (even millions)
  • Collision uses shapes and the depth buffer, not Colliders
  • Steeper learning curve
  • Integrates with Shader Graph
  • Enables more advanced visuals

Performance Comparison

ScenarioRecommended System
Huge numbers of particles in a single systemVFX Graph (dramatically cheaper)
Many different effects playing at onceParticle System (can be cheaper)
The same effect placed many timesVFX Graph (cheap thanks to instancing)

When to Use Which

Use VFX Graph when:

  • You want massive particle counts (explosions, fire, smoke, magic, etc.)
  • You need advanced visuals
  • You want to integrate with Shader Graph
  • You place the same effect many times

Use the Particle System when:

  • You need collision detection
  • You want to set things up quickly
  • Simple effects are enough
  • You play many different effects at once
Sponsored

Basic Structure of VFX Graph

Two Components

A VFX Graph setup consists of two parts.

ComponentDescription
Visual Effect componentAttached to a GameObject
Visual Effect AssetStores the effect's configuration

The Four Context Nodes

Data in a VFX Graph flows from top to bottom through the nodes. It's the same idea as Shuriken's "life of a particle", turned directly into a vertical graph.

The four contexts of VFX Graph. Spawn (how many to spawn?) → Initialize (state at the moment of birth) → Update (per-frame changes) → Output (how to draw), flowing from top to bottom

1. Spawn Context

Determines how many particles to spawn each frame and passes that to Initialize Particle.

  • Constant Spawn Rate - Emits spawn events at a constant rate
  • Single Burst - Spawns a large number of particles at once

Other Spawn blocks: Periodic Burst (bursts at fixed intervals) and Variable Rate (a spawn rate that changes dynamically) are also available.

2. Initialize Particle Context

Initializes each particle.

  • Capacity - The maximum number of particles alive at once (see the guidelines below). It's a setting on the Initialize Particle context itself, not a block, and new particles beyond it are simply not spawned

Capacity guidelines by platform:

PlatformPractical Capacity rangeNotes
High-end PC1M-5MHeavily dependent on GPU performance
Mid-range PC100K-500K
Console100K-1MVaries by platform
Mobile10K-50KWatch out for heat and battery drain

Estimating Capacity: Capacity is the maximum number of particles alive at the same time. Estimate the actual on-screen count as spawn rate x lifetime — setting Capacity too high reserves extra GPU memory.

  • Set LifeTime - Particle lifetime
  • Set Position Shape - Initial particle position (spawned from a shape)
  • Set Velocity - Initial particle velocity

3. Update Particle Context

Runs per-frame updates on each particle.

  • Gravity - Applies gravity
  • Linear Drag - Applies drag
  • Force - Applies a force
  • Collide with Plane, etc. - Collision against shapes such as planes, spheres, and boxes, or the depth buffer

4. Output Particle Context

Configures how the particles are finally rendered.

Output types:

OutputPurpose
Output Particle QuadFlat quads (the most common)
Output Particle MeshUses a 3D mesh
Output Particle StripTrails and ribbons
Output Particle PointPoint sprites
Look comparison of the four Output types. Quad = a camera-facing flat quad (the most common); Mesh = 3D-model particles (rocks, debris); Strip = a connected trail/ribbon (slashes, trails); Point = tiny point sprites (stardust, dust)

In VFX Graph 17, the actual node names include how they draw (Unlit or Lit), such as "Output Particle Unlit Quad" and "Output ParticleStrip Quad."

Key blocks:

  • Orient - Particle orientation (billboarding with Face Camera Plane, etc.)
  • Set Size over Life - Size change over the particle's lifetime
  • Set Color over Life - Color change over the particle's lifetime
  • Main Texture - The texture to use
  • Blend Mode - Alpha blending settings

Installation

  1. Open Window > Package Management > Package Manager (in Unity 6.0, Window > Package Manager)
  2. Select Unity Registry
  3. Select Visual Effect Graph
  4. Click the Install button

Using It in URP Projects

In Unity 6 (URP 17), VFX Graph works in URP projects without any special setup. Keep the Color Space in Project Settings at Linear (the default for new Unity 6 projects). Gamma isn't supported, and colors come out wrong.

Sponsored

Basic Usage

Creating an Effect

  1. Select GameObject > Visual Effects > Visual Effect
  2. A GameObject with a Visual Effect component attached is created
  3. Click the "New" button on the Visual Effect component
  4. Choose a template (Simple Loop, Simple Burst, Minimal System, etc.)
  5. Name the file and save it

Editing the Graph

  1. Double-click the Visual Effect Asset in the Project window
  2. The VFX Graph window opens
  3. Add and edit nodes to customize the effect

Using the Learning Templates

You can learn from Unity's official learning templates.

  1. Select Assets > Create > Visual Effects > Visual Effect Graph
  2. In the Create New VFX Asset window, click "Install Learning Templates"
  3. A variety of templates are added

Controlling Effects from Scripts

Sending Events

using UnityEngine;
using UnityEngine.VFX;

public class VFXController : MonoBehaviour
{
    VisualEffect visualEffect;

    void Start()
    {
        visualEffect = GetComponent<VisualEffect>();
    }

    public void Play()
    {
        // Default events
        visualEffect.SendEvent(VisualEffectAsset.PlayEventName);  // OnPlay
    }

    public void Stop()
    {
        visualEffect.SendEvent(VisualEffectAsset.StopEventName);  // OnStop
    }

    public void SendCustomEvent()
    {
        // Custom event
        visualEffect.SendEvent("CustomEventName");
    }
}

The High-Performance Approach (Using IDs)

public static readonly int CustomEventID = Shader.PropertyToID("CustomEventName");

void SendEvent()
{
    visualEffect.SendEvent(CustomEventID);
}

Setting Properties

You can set properties defined in the VFX Graph's Blackboard from a script.

// Setting various properties
visualEffect.SetFloat("SpawnRate", 100f);
visualEffect.SetVector3("EmitterPosition", transform.position);
visualEffect.SetTexture("MainTexture", myTexture);
visualEffect.SetGradient("ColorGradient", myGradient);

// Getting a property
float rate = visualEffect.GetFloat("SpawnRate");

// Debugging: check the current particle count
// aliveParticleCount is retrieved via GPU readback,
// so it can lag by a few frames.
// If particles have no Lifetime set,
// every particle stays alive forever.
int aliveCount = visualEffect.aliveParticleCount;

Exposed properties: When you create a property in the Blackboard, it is not accessible from scripts unless you check Exposed.

Performance: If you call these frequently, cache the ID up front with Shader.PropertyToID() and use SetFloat(int id, float value).

Sending Events with Parameters

Using VFXEventAttribute, you can pass parameters such as position and color dynamically.

public void SpawnAtPosition(Vector3 position, Color color)
{
    VFXEventAttribute eventAttribute = visualEffect.CreateVFXEventAttribute();
    eventAttribute.SetVector3("position", position);
    eventAttribute.SetVector3("color", new Vector3(color.r, color.g, color.b)); // color is RGB only
    eventAttribute.SetFloat("alpha", color.a);                                 // alpha is a separate attribute
    visualEffect.SendEvent("OnSpawn", eventAttribute);
}

On the VFX Graph side: In the Initialize Particle context, use a Get Attribute operator with its Location set to Source to read the position, color, and so on passed from the event.

Keeping the Effect Stopped Initially

Use one of the following approaches:

  1. Set Initial Event Name to empty - Disables auto-play
  2. Set Initial Event Name to a custom event name - The effect will not start until you send the event manually

Common Use Cases

Large-Scale Particle Effects

  • Explosions, fire, smoke
  • Magic effects
  • Rain, snow
  • Starry skies, fireworks

Environment Effects

  • Fog
  • Leaves blowing in the wind
  • Dust
  • Fireflies

UI Effects

  • Button particles
  • Transitions
  • Background effects

System Requirements

Supported Render Pipelines

PipelineSupport
Universal Render Pipeline (URP)Yes
High Definition Render Pipeline (HDRP)Yes
Built-in Render Pipeline× (not supported)

Built-in RP is not supported: VFX Graph is URP/HDRP-only (the same conclusion as the feature table in the render pipeline article). If a Built-in project needs massive particle counts, consider migrating to URP. This article was verified on Unity 6 (6000.0) with Visual Effect Graph 17.x.

Supported Platforms

  • PC (Windows, Mac, Linux)
  • Consoles (PlayStation, Xbox)
  • Mobile (iOS, Android) - some limitations
  • Web - doesn't run on WebGL (some versions run with WebGPU)

GPU Requirements

  • A GPU that supports Compute Shaders
  • DirectX 11 or later, Vulkan, Metal (OpenGL ES isn't supported)

Caveats on Mobile

ItemRecommendation
Minimum requirementsVulkan (Android) / Metal (iOS); OpenGL ES isn't supported
Particle countVaries a lot by device, so start small and measure
Capacity settingKeep it as low as possible

Mobile optimization: On mobile, set Capacity low and avoid complex node graphs. Older devices may not support Compute Shaders at all.

The "hundreds of thousands to millions" particle counts are rough figures that depend heavily on GPU performance. Don't take the numbers at face value—increase Capacity step by step on your target device, measure the frame rate, and find your own game's real limit. Watching the Profiler as you go from 100k → 300k → 1M is itself one of VFX Graph's most fun experiments.

Main limitations on mobile:

  • Does not run on older devices without Compute Shader support
  • The Sample Gradient node may have reduced precision
  • Device heat makes GPU throttling more likely

Shader Graph Integration

VFX Graph integrates with Shader Graph, letting you render particles with custom shaders.

Integration Steps

  1. Create a Shader Graph: Create a regular Shader Graph (Lit or Unlit in URP) and enable Support VFX Graph in its Graph Settings (there's no dedicated "VFX Shader Graph" menu)
  2. Configure the Output: Select the Shader Graph option in the Output Particle context
  3. Assign the shader: Drag and drop the Shader Graph you created

Use cases: Distortion, custom lighting, special warp effects — anything the standard blend modes cannot achieve.

Working with SDFs (Signed Distance Fields)

A distinctive VFX Graph feature: SDFs let you spawn particles along a mesh's shape and use it for collision detection.

You can generate an SDF texture from a mesh via Window > Visual Effects > Utilities > SDF Bake Tool.

Output Event

With an Output Event context, the graph can send events to the C# side at a timing you decide in the graph (such as on spawn). On the C# side, receive them with visualEffect.outputEventReceived, for example to trigger sounds. It isn't a way to get notified each time a particle dies.

Caveats

Limited Collision Detection

VFX Graph collides against shapes such as planes, spheres, and boxes, the depth buffer, or SDFs, and it doesn't hit your game's Colliders. If you need particles to hit Colliders, use the Particle System instead.

Learning Curve

Because it is node-based, the initial learning curve is steep. If you are used to the Particle System, it may feel disorienting at first. We recommend learning with the Learning Templates.

Render Pipeline

Use it with URP or HDRP (the Built-in Render Pipeline is not supported).

Practical: Spawning Fireflies in a Night Forest

Fireflies drifting through the night forest of an open world, a cherry-blossom flurry in a Japanese-style game, dust dancing through a dungeon—"unassuming but present in huge numbers" environment effects are where VFX Graph is at its tastiest. Here we'll build fireflies from a template as quickly as possible.

Night-forest firefly effect. Across a wide space, countless small glowing motes drift and flicker gently
  1. Start from a template: Create an object via "GameObject > Visual Effects > Visual Effect" and pick a Simple Loop-style template from "New".
  2. Spawn: set Constant Spawn Rate to around 200. Fireflies aren't born all at once—they keep welling up continuously—so use Rate, not Burst.
  3. Initialize: set Capacity to 10,000 (estimated from spawn rate x lifetime). Set the shape of Set Position Shape to a Box (Oriented Box in VFX Graph 17) scaled to cover the whole forest, and Set Lifetime to a random 20-40 seconds (its name changes to Set Lifetime Random Uniform). Also make the Initialize Bounds a little larger than the Box (if they stay small, all the particles can vanish at once depending on where the camera looks).
  4. Update: add a Turbulence block so they drift softly and irregularly. If they fly in straight lines, they look like bullets, not bugs.
  5. Output: keep the size small (0.02-0.05), make the color a faint HDR yellow-green, set the Blend Mode to Additive, and let the Bloom from post-processing make it glow. Adding a flicker (on and off) with Set Color over Life instantly makes it feel like fireflies. The gradient is stretched over the whole lifetime (20-40 seconds), so draw it as on-off-on-off many times over.

To finish, create a SpawnRate (Float, Exposed) on the Blackboard and wire it to Constant Spawn Rate. Then, with the visualEffect.SetFloat("SpawnRate", ...) from earlier, you can tie it to the time of day—0 by day, 200 by night.

There are two key points: the "environment effects = Spawn Rate + wide Shape + long lifetime" design (the exact opposite of a hit effect—keep them quiet, wide, and long-lived), and "connect to the game through Exposed properties" (rather than rewriting the graph internals, leave a knob you can turn from outside, and you can react to day/night, weather, and events freely). When you want to craft the look of the particles further, move on to Shader Graph integration.

Summary

VFX Graph is a high-performance, GPU-based particle system.

  • GPU-based - Renders massive numbers of particles with high performance (even millions)
  • Node-based - Build effects with visual logic
  • Shader Graph integration - Works with custom shaders
  • Four contexts - Composed of Spawn, Initialize, Update, and Output
  • Connect to the game with Exposed properties + SetFloat, "turning a knob from outside"
Use CaseRecommended System
Massive particle counts, advanced visualsVFX Graph
Collision detection, simple effectsParticle System

Choose the particle system that fits your project's requirements. Your game's atmosphere—what would change if you could add one more order of magnitude of particles?

Read nextNext in the learning path
VFX

Fixing "My Attacks Don't Feel Like They Hit": A Game Feel Primer with Hit Stop, Flash, Shake, and Sound

Read this note
Unity Notes in this section100