Important: The Built-In Render Pipeline is deprecated and will be made obsolete in a future release.
It remains supported, including bug fixes and maintenance, through the full Unity 6.7 LTS lifecycle.
For more information on migration, refer to Migrating from the Built-In Render Pipeline to the Universal Render Pipeline and Render pipeline feature comparison.
This page contains information on using a Tags block in your ShaderLab code to assign tags to a Pass. It also contains information on using the LightMode tag, which determines when Unity runs the pass during rendering.
For information on how a Shader object works, and the relationship between Shader objects, SubShaders and Passes, see Shader object fundamentals.
| Feature name | Universal Render Pipeline (URP) | High Definition Render Pipeline (HDRP) | Custom SRP | Built-in Render Pipeline |
|---|---|---|---|---|
| ShaderLab: Pass Tags block | Yes | Yes | Yes | Yes |
| ShaderLab: LightMode Pass tag | Yes | Yes | Yes | Yes |
| Signature | Function |
|---|---|
Tags {"<name1>" = "<value1>" "<name2>" = "<value2>"} |
Applies the given tags to the Pass. You can define as many tags as you like. |
| Signature | Function |
|---|---|
| “LightMode” = “[value]” | Sets the LightMode value for this Pass. |
The LightMode tag determines when Unity executes the pass.
Valid values for this tag depend on the render pipeline. For more information, refer to:
LightMode tag values in the Universal Render PipelineLightMode tag values in the Built-In Render PipelineIn the Built-in Render Pipeline, use the PassFlags Pass tag to specify what data Unity provides to the Pass.
| Value | Function |
|---|---|
| OnlyDirectional | Valid only in the Built-in Render Pipeline, when the rendering path is set to Forward, in a Pass with a LightMode tag value of ForwardBase.Unity provides only the main directional light and ambient/light probe data to this Pass. This means that data of non-important lights is not passed into vertex-light or spherical harmonics shader variables. See Forward rendering path for details. |
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags { "LightMode" = "ForwardBase" "PassFlags" = "OnlyDirectional" }
// The rest of the code that defines the Pass goes here.
}
}
}
In the Built-in Render Pipeline, the RequireOptions Pass tag enables or disables a Pass based on project settings.
| Value | Function |
|---|---|
SoftVegetation |
Render this Pass only if QualitySettings-softVegetation is enabled. |