Course contentsShow
← Unity Game Development
Lesson 675 of 82810. VFX and Post-ProcessingFree lesson

Rendering Particles with Custom Shaders

Connect custom Shader Graph materials to VFX output nodes to achieve unique visual styles and lighting responses for your particles.

In this lesson, you will learn how to bridge the gap between custom Shader Graphs and the VFX Graph to unlock bespoke lighting and surface behaviors for your particle systems.

While standard particle shaders are convenient, they are often generic. By creating a custom Shader Graph, you can define exactly how a particle reacts to light, handles transparency, or behaves under specific camera conditions. Once your graph is ready, connecting it to your VFX Graph is the final step to elevating your visual style.

Connecting the Graph

To use a custom shader with a particle, you must first ensure your Shader Graph is set to the Visual Effect target. Within the Graph Settings of your Shader Graph, change the Pipeline to Universal (or your active pipeline) and the Asset Type to VFX.

Once compiled, you need to expose your properties. If you want the VFX Graph to pass data to the shader, ensure your Shader Graph properties (like Color, MainTex, or custom floats) are set to Exposed.

Applying to VFX Graph

Inside your VFX Graph, locate your Output node (e.g., Output Particle Quad or Output Particle Mesh). By default, these use built-in materials. To switch to your custom shader:

  1. Create a new Material in your Project window.
  2. Assign your custom Shader Graph to that material.
  3. In the VFX Graph, select your Output node and assign your new material to the Material slot.

When you do this, you might notice the VFX Graph exposes new property slots on the node based on your shader’s exposed variables. You can now use the Set Property nodes in the VFX Graph update block to drive your shader values dynamically—for example, piping the particle’s Age into a custom Dissolve shader property to make your particles fade out precisely when you want.

This workflow turns your particles from static sprites into responsive, dynamic surfaces that respect your project's unique art direction and lighting requirements.

Key Takeaway: By assigning a custom material to your VFX Output node, you can treat particles as sophisticated, programmable surfaces that accept real-time data from the VFX Graph.