docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License
    Show / Hide Table of Contents
    • Visual Effect Graph
    • Requirements
    • What's new
      • 10 / Unity 2020.​2
      • 11 / Unity 2021.​1
      • 12 / Unity 2021.​2
      • 13 / Unity 2022.​1
    • Getting Started
      • Visual Effect Graph Assets
      • Visual Effect Graph Window
      • Sample Content
    • Graph Logic & Philosophy
      • Systems
      • Contexts
      • Blocks
      • Operators
      • Properties
      • Events
      • Attributes
      • Subgraph
      • Blackboard
      • Sticky Notes
      • Project Settings
      • Preferences
      • Visual Effect Bounds
    • The Visual Effect Component
      • C# Component API
      • Using Visual Effects with Timeline
      • Property Binders
      • Event Binders
      • Output Event Handlers
    • Shader Graph Integration
      • Shader Graphs in Visual Effects
      • Visual Effect Target
    • Pipeline Tools
      • Representing Complex Shapes
        • Signed Distance Fields
          • SDF Bake Tool
            • SDF Bake Tool window
            • SDF Bake Tool API
        • Point Caches
          • Point Cache asset
          • Point Cache Bake Tool
      • Exposed​Property Helper
      • Vector Fields
      • Spawner Callbacks
    • Node Library
      • Context
        • Event
        • GPU Event
        • Initialize Particle
        • Output Mesh
        • Output Distortion
        • Output Decal
        • Output Line
        • Output Particle Mesh
        • Output Particle HDRP Lit Decal
        • Output Point
        • Output Primitive
        • Shared Output Settings
          • Global Settings
          • Lit Output Settings
        • Spawn
        • Update Particle
      • Block
        • Attribute
          • Curve
          • Derived
            • Calculate Mass from Volume
          • Map
          • Set
        • Collision
          • Collide with AABox
          • Collide with Cone
          • Collide with Depth Buffer
          • Collide with Plane
          • Collide with Signed Distance Field
          • Collide with Sphere
        • Flipbook
          • Flipbook Player
        • Force
          • Conform to Signed Distance Field
          • Conform to Sphere
          • Force
          • Gravity
          • Linear Drag
          • Turbulence
          • Vector Force Field
        • GPU Event
          • Trigger Event Always
          • Trigger Event On Die
          • Trigger Event Rate
        • Implicit
          • Integration : Update Position
          • Integration : Update Rotation
        • Kill
          • Kill (AABox)
          • Kill (Sphere)
        • Orientation
          • Connect Target
          • Orient
        • Output
          • Camera Fade
          • Subpixel Anti-Aliasing
        • Position
          • Set Position (Depth)
          • Position (Mesh)
          • Position (Signed Distance Field)
          • Position (Skinned Mesh)
          • Set Position (Sequential : Circle)
          • Set Position (Sequential : Line)
          • Set Position (Sequential : Three​Dimensional)
          • Set Position (Shape : AABox)
          • Set Position (Shape : Circle)
          • Set Position (Shape : Cone)
          • Set Position (Shape : Line)
          • Set Position (Shape : Sphere)
          • Set Position (Sequential)
          • Tile/Warp Positions
        • Size
          • Screen Space Size
        • Spawn
          • Constant Spawn Rate
          • Periodic Burst
          • Single Burst
          • Variable Spawn Rate
          • Attribute
            • Set Spawn Event \<attribute>
          • Custom
            • Increment Strip Index On Start
            • Set Spawn Time
            • Spawn Over Distance
        • Velocity
          • Velocity from Direction & Speed (Change Speed)
          • Velocity from Direction & Speed (New Direction)
          • Velocity from Direction & Speed (Random Direction)
          • Velocity from Direction & Speed (Spherical)
          • Velocity from Direction & Speed (Tangent)
      • Context
        • Event
        • GPU Event
        • Initialize Particle
        • Output Mesh
        • Output Distortion
        • Output Decal
        • Output Line
        • Output Particle Mesh
        • Output Point
        • Output Primitive
        • Shared Output Settings
          • Global Settings
          • Lit Output Settings
        • Spawn
        • Update Particle
      • Operator
        • Attribute
          • Age Over Lifetime
          • Get Attribute: age
          • Get Attribute: alive
          • Get Attribute: alpha
          • Get Attribute: angle
          • Get Attribute: angular​Velocity
          • Get Attribute: axis​X
          • Get Attribute: axis​Y
          • Get Attribute: axis​Z
          • Get Attribute: color
          • Get Attribute: direction
          • Get Attribute: lifetime
          • Get Attribute: mass
          • Get Attribute: old​Position
          • Get Attribute: particle​Count​In​Strip
          • Get Attribute: particle​Id
          • Get Attribute: particle​Index​In​Strip
          • Get Attribute: pivot
          • Get Attribute: position
          • Get Attribute: scale
          • Get Attribute: seed
          • Get Attribute: size
          • Get Attribute: spawn​Index
          • Get Attribute: spawn​Time
          • Get Attribute: strip​Index
          • Get Attribute: target​Position
          • Get Attribute: tex​Index
          • Get Attribute: velocity
          • Get Custom Attribute
        • Bitwise
          • And
          • Complement
          • Left Shift
          • Or
          • Right Shift
          • Xor
        • Builtin
          • Delta Time
          • Frame Index
          • Local to World
          • Main Camera
          • System Seed
          • Total Time
          • World to Local
        • Camera
          • Viewport to World Point
          • World to Viewport Point
        • Color
          • Color Luma
          • HSV to RGB
          • RBG to HSV
        • Inline
          • AABox
          • Animation​Curve
          • Arc​Circle
          • Arc​Cone
          • Arc​Sphere
          • Arc​Torus
          • bool
          • Camera
          • Circle
          • Color
          • Cone
          • Cubemap
          • Cubemap​Array
          • Cylinder
          • Direction
          • Flip​Book
          • float
          • Gradient
          • int
          • Line
          • Matrix4x4
          • Mesh
          • Oriented​Box
          • Plane
          • Position
          • Sphere
          • Terrain​Type
          • Texture2D
          • Texture2DArray
          • Texture3D
          • Torus
          • Transform
          • uint
          • Vector
          • Vector2
          • Vector3
          • Vector4
        • Logic
          • And
          • Branch
          • Compare
          • Nand
          • Nor
          • Not
          • Or
          • Probability Sampling
          • Switch
        • Math
          • Arithmetic
            • Absolute
            • Add
            • Divide
            • Fractional
            • Inverse Lerp
            • Lerp
            • Modulo
            • Multiply
            • Negate
            • One Minus
            • Power
            • Reciprocal
            • Sign
            • Smoothstep
            • Square Root
            • Step
            • Subtract
          • Clamp
            • Ceiling
            • Clamp
            • Discretize
            • Floor
            • Maximum
            • Minimum
            • Round
            • Saturate
          • Constants
            • Epsilon
            • Pi
          • Coordinates
            • Polar to Rectangular
            • Rectangular to Polar
            • Rectangular to Spherical
            • Spherical to Rectangular
          • Exp
            • Exp
          • Geometry
            • Area (Circle)
            • Change Space
            • Distance (Line)
            • Distance (Plane)
            • Distance (Sphere)
            • Invert​TRS (Matrix)
            • Transform (Direction)
            • Transform (Matrix)
            • Transform (Position)
            • Transform (Vector)
            • Transform (Vector4)
            • Transpose (Matrix)
            • Volume (Axis Aligned Box)
            • Volume (Cone)
            • Volume (Cylinder)
            • Volume (Oriented Box)
            • Volume (Sphere)
            • Volume (Torus)
          • Log
            • Log
          • Remap
            • Remap
            • Remap [0..​1] => [-1..​1]
            • Remap [-1..​1] => [0..​1]
          • Trigonometry
            • Acos
            • Asin
            • Atan
            • Atan2
            • Cosine
            • Sine
            • Tangent
          • Vector
            • Append Vector
            • Construct Matrix
            • Cross Product
            • Distance
            • Dot Product
            • Length
            • Look At
            • Normalize
            • Rotate 2D
            • Rotate 3D
            • Sample Bezier
            • Squared Distance
            • Squared Length
            • Swizzle
          • Wave
            • Sawtooth Wave
            • Sine Wave
            • Square Wave
            • Triangle Wave
        • Noise
          • Cellular Curl Noise
          • Cellular Noise
          • Perlin Curl Noise
          • Perlin Noise
          • Value Curl Noise
          • Value Noise
        • Random
          • Random Number
        • Sampling
          • Buffer Count
          • Get Texture Dimensions
          • Load Camera​Buffer
          • Mesh Index Count
          • Mesh Vertex Count
          • Load Texture2D
          • Load Texture2DArray
          • Load Texture3D
          • Position (Depth)
          • Sample Buffer
          • Sample Camera​Buffer
          • Sample Curve
          • Sample Gradient
          • Sample Mesh
          • Sample Mesh Index
          • Sample Skinned Mesh
          • Sample Skinned Mesh Renderer Index
          • Sample Signed Distance Field
          • Sample Texture2D
          • Sample Texture2DArray
          • Sample Texture3D
          • Sample Texture​Cube
          • Sample Texture​Cube​Array
          • Skinned Mesh Index Count
          • Skinned Mesh Vertex Count
        • Spawn
          • Spawn State
        • Utility
          • Point Cache
    • Reference
      • Standard Attributes
      • Types
        • AABox
        • Arc​Circle
        • Arc​Cone
        • Arc​Sphere
        • Arc​Torus
        • Camera
        • Camera​Buffer
        • Circle
        • Cone
        • Cylinder
        • Direction
        • Line
        • Oriented​Box
        • Plane
        • Position
        • Sphere
        • Terrain​Type
        • Torus
        • Transform
        • Vector
    • Manual
    • Shader Graph Integration
    • Shader Graphs in Visual Effects

    Working with Shader Graph in the Visual Effect Graph

    Visual Effect Graphs (VFX Graphs) can use compatible Shader Graphs to render particles. This enables you to build custom shaders to use in visual effects. This document explains:

    • How to make a Shader Graph compatible with Visual Effect Graphs
    • How to set up a Visual Effect Graph to use a Shader Graph to render particles
    • How to upgrade an existing project
    • Known limitations of the Visual Effect Graph

    Make a Shader Graph compatible with a Visual Effect Graph

    To make a Shader Graph compatible with the Visual Effect Graph:

    1. Open a shader in the Shader Graph window.
    2. In the Graph Settings tab, specify the render pipeline Target (HDRP or Universal).
    3. Enable Support VFX Graph.

    Graph Settings UI showing Target selection and VFX Graph Support

    A Shader Graph shader that is compatible with the Visual Effect Graph can also work as a regular shader. Most HDRP and URP Shader Graph shaders support the Visual Effect Graph. For exceptions, see Known Limitations.

    Note: VFX Graph support does not impact runtime performance but Shader Graphs which use Support VFX Graph take longer to compile.

    Upgrade your project

    Unity versions 2021.2, and earlier use the deprecated Visual Effect Target to integrate Shader Graphs with Visual Effect Graphs.

    The Visual Effect Target limits functionality and requires you to use the following:

    • Dedicated VFX shaders
    • The Metallic workflow

    To upgrade a project to use the new render pipeline Target:

    1. Go to Edit > Preferences > Visual Effects.
    2. Enable Improved Shader Graph Generation.
    3. In the Graph Settings tab of the shader add a HDRP or Universal Target.
    4. Enable Support VFX Graph.
    5. Remove the Visual Effect Target.

    Use a Shader Graph in a Visual Effect Graph

    To make a visual effect with Shader Graph:

    1. Go to Edit > Preferences > Visual Effects.
    2. Enable Experimental Operators/Blocks. This reveals a Shader Graph slot in the output.
    3. Open your Visual Effect Graph in the Visual Effect Graph window. If you do not have a Visual Effect Graph, go to Create > Visual Effects > Visual Effect Graph to create a new one.
    4. In the interface for output contexts, assign your compatible Shader Graph to the Shader Graph property. To do this, either search for the Shader Graph directly in the Asset Picker, or drag the Shader Graph sub-asset to the Shader Graph slot: Drag Shader the Graph sub-asset to VFX Shader Graph slot
    5. Click on the output context to view it in the Inspector.

    You can make changes to the Shader Graph's Surface Options in the output context.

    Note: Any edits you make to a Shader Graph in the VFX Graph are local to the VFX Graph and do not affect the Shader Graph asset.

    Visual Effect Graph output compatibility

    The following output contexts support Shader Graphs:

    • Particle Mesh (including Particle Lit Mesh)
    • Particle Primitive (including Particle Quad, Particle Triangle, Particle Octagon, Particle Lit Quad, Particle Lit Triangle, and Particle Lit Octagon)
    • Particle Strip Quad (including Particle Lit Strip Quad)

    Known limitations

    Visual Effect Graph does not support the following Blackboard features:

    • Diffusion Profile
    • Virtual Texture
    • Gradient
    • Keyword

    Shader Graph does not support some features in specific Targets.

    • The HDRP Target does not support the following:
      • Decal Shader Graph.
      • Motion vectors for vertex animation.
    • The URP target does not support the following:
      • Sprite Shader Graphs and Decal Shader Graphs.
    • The Visual Effect Target (deprecated) does not support:
      • HDRP or Universal material types.
      • Access to the shader's Vertex stage.
    In This Article
    • Make a Shader Graph compatible with a Visual Effect Graph
    • Upgrade your project
    • Use a Shader Graph in a Visual Effect Graph
      • Visual Effect Graph output compatibility
    • Known limitations
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023