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

Created: 2026-02-05

Learn how to use Unity's VFX Graph. A GPU-based visual effect creation tool that displays massive amounts of particles with high performance. Covers basic structure, differences from the legacy Particle System, and practical usage.

Overview

"I want to display tons of particles..." "I want to create explosion and magic effects..." "I need more advanced visual effects..."

In game development, you often face these kinds of visual effect challenges. VFX Graph is Unity's official visual effect creation tool. It uses node-based visual logic to create effects and leverages a GPU-based particle system to display massive amounts of particles with high performance.

Differences from Legacy Particle System

Particle System (Shuriken)

  • CPU-based particle system
  • Has been in Unity since the early days
  • Configured via the Inspector
  • Module-based design
  • Supports collision detection
  • Easy to set up, extensive documentation available
  • Performance degrades with high counts (limited to a few thousand)

VFX Graph

  • GPU-based particle system
  • Configured via a node-based graph
  • Can display massive amounts of particles (millions possible)
  • Limited collision detection
  • Steeper learning curve
  • Integrates with Shader Graph
  • Enables more advanced visual effects

Performance Comparison

ScenarioRecommended System
Displaying massive particles in a single systemVFX Graph (significantly lighter)
Displaying many different effects simultaneouslyParticle System (can be lighter)
Placing many instances of the same effectVFX Graph (light with instancing)

When to Use Which

Use VFX Graph when:

  • You need massive particle counts (explosions, fire, smoke, magic, etc.)
  • Advanced visual effects are required
  • You want to integrate with Shader Graph
  • You need many instances of the same effect

Use Particle System when:

  • Collision detection is needed
  • You want quick setup
  • Simple effects are sufficient
  • You need many different effects simultaneously

VFX Graph Basic Structure

Two Core Elements

VFX Graph consists of two elements.

ElementDescription
Visual Effect ComponentAttached to a GameObject
Visual Effect AssetStores the effect configuration

Four Context Nodes

Data flows from top to bottom through VFX Graph nodes.

1. Spawn Context Node

Determines the number of particles to generate per frame and passes them to Initialize Particle.

  • Constant Spawn Rate - Issues Spawn events at a constant rate
  • Burst - Generates a large number of particles at once

Other Spawn blocks: Periodic Burst (bursts at regular intervals), Variable Spawn Rate (dynamically varying spawn rate), and more are also available.

2. Initialize Particle Context Node

Initializes particles.

  • Capacity - Maximum number of particles that can exist simultaneously (see guidelines below)

Platform-specific Capacity Guidelines:

PlatformPractical Capacity RangeNotes
High-end PC1M - 5MHighly dependent on GPU performance
Mid-range PC100K - 500K
Console100K - 1MVaries by platform
Mobile10K - 50KAlso consider heat and battery

Estimating Capacity: Capacity is the "maximum simultaneous count." Estimate the actual display count from spawn rate x lifetime. Setting it too high wastes VRAM.

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

3. Update Particle Context Node

Handles per-frame particle updates.

  • Gravity - Applies gravity
  • Linear Drag - Applies drag
  • Force - Applies force
  • Collision - Collision detection (limited)

4. Output Particle Context Node

Configures the final rendering of particles.

Output types:

OutputUsage
Output Particle QuadBillboard quad (most common)
Output Particle MeshUses a 3D mesh
Output Particle StripTrail/ribbon effects
Output Particle PointPoint sprites

Key blocks:

  • Orient - Particle orientation (billboard, etc.)
  • Set Size Over Life - Size change over lifetime
  • Set Color Over Life - Color change over lifetime
  • Main Texture - Texture to use
  • Blend Mode - Alpha blending settings

Installation

  1. Open Window > Package Manager
  2. Select Unity Registry
  3. Select Visual Effect Graph
  4. Click the Install button

Additional Setup for URP Projects

Version note: In URP 14+ (Unity 2023.1+), VFX Graph works without special configuration. The following steps are for earlier versions.

For URP projects, you may need to configure the URP Asset.

  1. Select the URP Asset (Universal Render Pipeline Asset)
  2. Select the Renderer you're using from Renderer List
  3. Verify that VFX Graph is enabled under Renderer Features

Basic Usage

Creating an Effect

  1. Select GameObject > Visual Effects > Visual Effect
  2. A game object with a Visual Effect component is created
  3. Click the "New" button on the Visual Effect component
  4. Select a template (Simple Loop, Burst, Continuous, etc.)
  5. Save with a file name

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 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. Various templates are added

Script Control

Sending Events

using UnityEngine;
using UnityEngine.VFX;

public class VFXController : MonoBehaviour
{
    VisualEffect visualEffect;

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

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

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

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

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 Blackboard from scripts.

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

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

// Debug: Check current particle count
// aliveParticleCount uses GPU Readback,
// so there is a 1-2 frame delay.
// If particles don't have a Lifetime set,
// all particles remain alive permanently.
int aliveCount = visualEffect.aliveParticleCount;

Exposed Property: When creating a property in the Blackboard, it must have Exposed checked to be accessible from scripts.

Performance: For frequently called properties, pre-cache the ID with Shader.PropertyToID() and use SetFloat(int id, float value).

Sending Events with Parameters

Use VFXEventAttribute to dynamically pass parameters like position and color.

public void SpawnAtPosition(Vector3 position, Color color)
{
    VFXEventAttribute eventAttribute = visualEffect.CreateVFXEventAttribute();
    eventAttribute.SetVector3("position", position);
    eventAttribute.SetVector4("color", new Vector4(color.r, color.g, color.b, color.a));
    visualEffect.SendEvent("OnSpawn", eventAttribute);
}

VFX Graph side setup: In the Initialize Particle context, add Get Source Attribute blocks (position, color, etc.) to receive parameters passed from the Event.

Preventing Auto-Play on Start

Use one of the following methods:

  1. Set Initial Event Name to empty - Disables auto-play
  2. Set Initial Event Name to a custom event name - Won't start until you manually send the event

Common Use Cases

Large-Scale Particle Effects

  • Explosions, fire, smoke
  • Magic effects
  • Rain, snow
  • Starfields, fireworks

Environmental 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 PipelinePartial (limited support from Unity 6+)

Built-in RP support: From Unity 6 onward, VFX Graph can be used with the Built-in Render Pipeline, though some features have limitations. URP/HDRP is recommended for new projects.

Supported Platforms

  • PC (Windows, Mac, Linux)
  • Consoles (PlayStation, Xbox)
  • Mobile (iOS, Android) - with some limitations
  • WebGL - with some limitations

GPU Requirements

  • GPU with Compute Shader support
  • DirectX 11+, OpenGL ES 3.1+, Vulkan, Metal

Mobile Considerations

ItemRecommended Value
Minimum requirementOpenGL ES 3.1+ (Android) / Metal (iOS)
Particle count10K-50K is a practical upper limit
Capacity settingKeep to the minimum necessary

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

Key mobile limitations:

  • Output Particle Strip may not be supported
  • Won't work on older devices without Compute Shader support
  • SampleGradient node precision may be lower
  • GPU throttling is more likely due to device heat

Shader Graph Integration

VFX Graph integrates with Shader Graph, allowing particles to be rendered with custom shaders.

Integration Steps

  1. Create a Shader Graph: Create a VFX Graph-specific Shader Graph
    • URP: Create > Shader Graph > URP > VFX Shader Graph
    • HDRP: Create > Shader Graph > HDRP > VFX Shader Graph
  2. Configure Output: Select the Shader Graph option in the Output Particle context
  3. Assign the shader: Drag and drop the VFX Shader Graph

Use cases: Distortion, custom lighting, special warp effects, and other expressions that can't be achieved with standard blend modes.

Using SDF (Signed Distance Field)

A distinctive VFX Graph feature is the ability to use SDFs for particle generation and collision detection that follow mesh shapes.

Use Window > Visual Effects > Utilities > SDF Bake Tool to generate SDF textures from meshes.

Output Event

You can send events to C# when particles are destroyed. Use this for displaying damage numbers, triggering sound playback, etc.

Important Notes

Collision Detection Limitations

VFX Graph's collision detection is limited. Use Particle System when complex collision is required.

Learning Curve

Being node-based, there's a steep initial learning curve. If you're used to Particle System, it may feel unfamiliar at first. Learning Templates are recommended for getting started.

Render Pipeline

URP or HDRP is recommended. While Built-in Render Pipeline has limited support from Unity 6 onward, some features have restrictions.

Summary

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

  • GPU-based - Display massive particles with high performance (millions possible)
  • Node-based - Create effects with visual logic
  • Shader Graph integration - Works with custom shaders
  • Four contexts - Composed of Spawn, Initialize, Update, and Output
Use CaseRecommended System
Massive particles, advanced visualsVFX Graph
Collision detection, simple effectsParticle System

Choose the appropriate particle system based on your project's requirements.