graphics
[VFX] Drive Shader Graph Properties with Particle Attributes
Solution
Unity 2019.3.x - Unity 6.3.x
Published 9 days ago
Accessing internal VFX Graph attributes like color or custom data within a Shader Graph is necessary for advanced particle effects and per-particle rendering logic.
Communication between a Shader Graph and a VFX Graph is established by mapping Exposed properties to specific particle data streams. This allows particle-specific attributes, such as color or texIndex, to drive the visual output of custom shaders.
- Open your
Shader Graphand define new properties in theBlackboard. - In the
Graph Inspector, ensure that the Exposed checkbox is enabled for every property intended forVFX Graphcontrol. - Save your
Shader Graphasset to update its metadata. - Open your
VFX Graphand select theOutput Particlecontext. - Assign your
Shader Graphto theShaderproperty slot within that context. - Create a
Get Attributenode or drag an attribute directly from theVFX GraphBlackboardinto the graph. - Connect the attribute output to the corresponding Exposed property port appearing on the
Output Particleblock.
Additional Tips
- Dragging an attribute from the
Blackboardin Unity 6 automatically generates the correctGet Attributenode for a faster workflow. - Ensure data types match between systems; for example, a
Vector4attribute should map to aVector4Exposed property to avoid conversion errors. - Use the
Property Overridessection in theVFX Graphif you need to apply global constants to the shader instead of per-particle data.
TL;DR
Map Exposed shader properties to particle attributes using Get Attribute nodes in the VFX Graph to sync data between systems.
Related Posts Haven't quite found a solution to your problem? We think these posts might help you.
[VFX Graph] Fix Performance Drops from Transparent Fog Overdraw[HDRP Water] Eliminate Visual Glitches: Subsurface Control with UnderwaterMask[URP] Implement Native Output Decal Support in VFX Graph
Content inspired by a Unity discussion post.