Files
Bombaleila/Library/PackageCache/com.unity.shadergraph@c8830f61858d/Documentation~/Sub-graphs.md
2026-03-03 00:39:30 +05:00

1.6 KiB

Sub Graphs

A Sub Graph is a type of shader graph that you include in other shader graphs. Use a Sub Graph to perform the same operations multiple times within a single shader graph, or across multiple shader graphs. It's similar to a reusable function in programming.

Topic Description
Introduction to Sub Graphs Learn about how a Sub Graph differs from a regular shader graph, and refer to example Sub Graphs.
Create a Sub Graph Create a Sub Graph from existing nodes, or create an empty Sub Graph.
Add a Sub Graph to a shader graph Add a Sub Graph node to a shader graph.
Add inputs and outputs to a Sub Graph To pass data in and out of a Sub Graph, create input and output ports.
Set default inputs for a Sub Graph Add default values for the inputs of a Sub Graph.
Change the behavior of a Sub Graph with a dropdown Add a Dropdown node to change the behavior of a Sub Graph using a dropdown menu.
Expose a Sub Graph property in the Inspector window Set a property or keyword as belonging to the main shader instead of a Sub Graph. This process is known as promoting the property, or creating a nested property.
Sub Graph asset Learn about the Sub Graph asset.

Additional resources