

In the Scriptable Render Pipeline, you can use the SRPDefaultUnlit value to reference Passes without a LightMode tag. In the Built-in Render Pipeline, if you do not set a LightMode tag, Unity renders the Pass without any lighting or shadows this essentially the same as having a LightMode value of Always. For more information, see Syntax and valid values. Note: The LightMode tag is not related to the LightMode enum, which relates to lighting.Įvery render pipeline uses the LightMode tag, but the predefined values and their meanings vary. The LightMode tag is a predefined Pass tag that Unity uses to determine whether to execute the Pass during a given frame, when during the frame Unity executes the Pass, and what Unity does with the output. For more information, see Using the LightMode tag with C# scripts. Note: There are several APIs that work directly with the LightMode Pass tag. This works for Unity’s predefined Pass tags, and for custom Pass tags that you have created. More info See in Glossary, you can use the Shader.FindPassTagValue API. To access the value of a Pass tag from C# scripts A piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. To define SubShader tags, place the Tags block inside a SubShader block but outside a Pass block.įor information on assigning tags to a SubShader, see Assigning tags to a SubShader.To define Pass tags, place the Tags block inside a Pass block.The difference is where you put the Tags block: Assigning SubShader tags to a Pass has no effect, and vice versa. Note that both SubShaders and Passes use the Tags block, but they work differently. To assign Tags to a Pass in ShaderLab, you place a Tags block inside a Pass block. Render pipeline compatibility Feature name For predefined Pass tagss in the Universal Render Pipeline (URP), see URP Pass tags.For predefined Pass tags in the Built-in Render Pipeline, see Predefined Pass tags in the Built-in Render Pipeline.For more information, see the following pages: Unity lets you choose from pre-built render pipelines, or write your own.
#UNITY FORUM CODE TAGS SERIES#
Other Pass tags vary by render pipeline A series of operations that take the contents of a Scene, and displays them on a screen. The most commonly used predefined Pass tag is the LightMode tag this is used in all render pipelines. You can also create your own custom Pass tags with custom values, and access them from C# code. Unity uses predefined tags and values to determine how and when to render a given Pass.

Tags are key-value pairs of data that you can assign to a Pass. More info See in Glossary, SubShaders and Passes, see Shader object fundamentals. Use them with materials to determine the appearance of your scene.
#UNITY FORUM CODE TAGS HOW TO#
More info See in Glossary object works, and the relationship between Shader objects An instance of the Shader class, a Shader object is container for shader programs and GPU instructions, and information that tells Unity how to use them. It also contains information on using the LightMode tag.įor information on how a Shader A program that runs on the GPU. More info See in Glossary code to assign tags to a Pass. This page contains information on using a Tags block in your ShaderLab Unity’s language for defining the structure of Shader objects.
