To set the render pipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary and render order for a subshader or a shaderA program that runs on the GPU. More info
See in Glossary pass, add a Tag block.
Add a Tag block to a SubShader block or a Pass block. For example:
Shader "TagsExample"
{
SubShader
{
// Add a subshader tag
Tags { "TagName" = "Value" }
Pass
{
// Add a pass tag
Tags { "TagName" = "Value" }
...
}
}
}
For more information about tag names and values, refer to SubShader tags in ShaderLab reference and Pass tags in ShaderLab reference. Not all Tag blocks are compatible with both subshaders and passes.
You can also add your own custom tags and read them from a C# script.
To make a subshader compatible with the Universal Render Pipeline (URP) or the High Definition Render Pipeline (HDRP), add a RenderPipeline tag to the SubShader block:
"RenderPipeline" = "UniversalPipeline"
"RenderPipeline" = "HDRenderPipeline"
Unity uses two tags to determine when to execute a shader:
LightMode tag: Sets which stage of the render pipeline a shader pass runs during. For example, drawing opaque geometry, or drawing post-processingA process that improves product visuals by applying filters and effects before the image appears on screen. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. More info post processing, postprocessing, postprocessQueue tag: Sets which group of objects a subshader belongs to. Unity draws each render queue in a specific order.Each LightMode stage usually renders a specific Queue range. Unity warns you if you use a Queue tag that the LightMode stage doesn’t render.
Note: The LightMode tag isn’t related to the light modeA Light property that defines the use of the Light. Can be set to Realtime, Baked and Mixed. More info
See in Glossary parameter in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary window of a Light component.
LightMode tagAdd a LightMode tag to the Pass block. For example, to execute the shader during the forward renderingA rendering path that renders each object in one or more passes, depending on lights that affect the object. Lights themselves are also treated differently by Forward Rendering, depending on their settings and intensity. More info
See in Glossary pass in the Universal Render Pipeline (URP) that renders the Geometry queue, use Tags { "LightMode" = "UniversalForward" }.
For a list of LightMode values, refer to LightMode tag valid values and ShaderLab Pass tags in URP reference.
To enable or disable a shader pass by its LightMode tag, use the Material.SetShaderPassEnabled API.
Add a Queue tag to the SubShader block. Use one of the following approaches:
"Queue" = "RenderQueueName". For example "Queue" = "Transparent"."Queue" = "RenderQueueName-Offset" or "Queue" = "RenderQueueName+Offset". For example, "Queue" = "Geometry+1".You can also use queue values instead of names. For example, "Queue" = "3000" instead of "Queue" = "Transparent", or "Queue" = "2001" instead of "Queue" = "Geometry+1".
You can also set the queue in the Inspector window of the material using the Render Queue property, or in a C# script using the Material.renderQueue API.
For more information, refer to Render queues and sorting behaviours.
To read tags from a C# script, use the following:
Material.GetTag API.Shader.FindPassTagValue API.Queue tag, use the Shader.renderQueue API.