This page contains information on using a Tags
block in your ShaderLabUnity’s language for defining the structure of Shader objects. More info
See in Glossary code to assign tags to a SubShader.
For information on defining SubShader, see ShaderLab: defining a SubShader. For information on how a ShaderA program that runs on the GPU. More info
See in Glossary object works, and the relationship between Shader objects, SubShaders and Passes, see Shader objectsAn 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. Use them with materials to determine the appearance of your scene. More info
See in Glossary.
Feature name | Universal 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 (URP) |
High Definition Render Pipeline (HDRP) | Custom SRP | Built-in Render Pipeline |
---|---|---|---|---|
ShaderLab: SubShader Tags block | Yes | Yes | Yes | Yes |
ShaderLab: RenderPipeline SubShader tag | Yes | Yes | No | No |
ShaderLab: Queue SubShader tag | Yes | Yes |
Yes Note: in a custom SRP, you can define your own rendering order and choose whether or not to use render queues. For more information, see DrawingSettings and SortingCriteria. |
Yes |
ShaderLab: RenderType SubShader tag | Yes | Yes | Yes | Yes |
ShaderLab: DisableBatching SubShader tag | Yes | Yes | Yes | Yes |
ShaderLab: ForceNoShadowCasting SubShader tag | Yes | Yes This disables regular shadows, but has no effect on contact shadows. |
Yes | Yes |
ShaderLab: CanUseSpriteAtlas SubShader tag | Yes | Yes | Yes | Yes |
ShaderLab: PreviewType SubShader tag | Yes | Yes | Yes | Yes |
Signature | Function |
---|---|
Tags { “[name1]” = “[value1]” “[name2]” = “[value2]”} | Applies the given tags to the SubShader. You can define as many tags as you like. |
Signature | Function |
---|---|
“RenderPipeline” = “[name]” | Tells Unity whether this SubShader is compatible with URP or HDRP. |
Parameter | Value | Function |
---|---|---|
[name] | UniversalPipeline |
This SubShader is compatible with URP only. |
HDRenderPipeline |
This SubShader is compatible with HDRP only. | |
(any other value, or not declared) | This SubShader is not compatible with URP or HDRP. |
Signature | Function |
---|---|
“Queue” = “[queue name]” | Use the named render queue. |
“Queue” = “[queue name] + [offset]” | Use an unnamed queue, at a given offset from the named queue. An example of when this is useful is in the case of transparent water, which you should draw after opaque objects but before transparent objects. |
Signature | Value | Function |
---|---|---|
[queue name] | Background | Specifies the Background render queue. |
Geometry | Specifies the Geometry render queue. | |
AlphaTest | Specifies the AlphaTest render queue. | |
Transparent | Specifies the Transparent render queue. | |
Overlay | Specifies the Overlay render queue. | |
[offset] | integer | Specifies the index at which Unity renders the unnamed queue, relative to the named queue. |
Signature | Function |
---|---|
“RenderType” = “[renderType]” | Set the RenderType value for this SubShader. |
Signature | Value | Function |
---|---|---|
[renderType] | String | There are no set values for this parameter. To identify the RenderType value for any SubShader that you want to replace, open its shader source file. The RenderType SubShader tags for Unity’s legacy built-in shaders are listed on the shader replacement page.You can also create your own values for your custom SubShaders. |
Signature | Function |
---|---|
“ForceNoShadowCasting” = “[state]” | Whether to prevent shadow casting (and sometimes receiving) for all geometry that uses this SubShader. |
Signature | Value | Function |
---|---|---|
[state] | True | Unity prevents the geometry in this SubShader from casting shadows. In the Built in Render Pipeline, with the Forward or Legacy Vertex Lit rendering paths, Unity also prevents the geometry in this SubShader from receiving shadows. In HDRP, this does not prevent the geometry from casting contact shadows. |
False | Unity does not prevent the geometry in this SubShader from casting or receiving shadows. This is the default value. |
Signature | Function |
---|---|
“DisableBatching” = “[state]” | Whether Unity prevents Dynamic BatchingAn automatic Unity process which attempts to render multiple meshes as if they were a single mesh for optimized graphics performance. The technique transforms all of the GameObject vertices on the CPU and groups many similar vertices together. More info See in Glossary for all geometry that uses this SubShader. |
Signature | Value | Function |
---|---|---|
[state] | True | Unity prevents Dynamic Batching for geometry that uses this SubShader. |
False | Unity does not prevent Dynamic Batching for geometry that uses this SubShader. This is the default value. | |
LODFading | Unity prevents Dynamic Batching for all geometry that is part of a LODGroup with a Fade Mode value that is not None. Otherwise, Unity does not prevent Dynamic Batching. |
Signature | Function |
---|---|
“IgnoreProjector” = “[state]” | Whether Unity ignores Projectors when rendering this geometry. |
Signature | Value | Function |
---|---|---|
[state] | True | Unity ignores Projectors when rendering this geometry. |
False | Unity does not ignore Projectors when rendering this geometry. This is the default value. |
The PreviewType
SubShader Tag tells the Unity Editor how to display a material that uses this SubShader in the Material 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.
Signature | Function |
---|---|
“PreviewType” = “[shape]” | Which shape the Unity Editor uses to display a preview of a material that uses this SubShader. |
Signature | Value | Function |
---|---|---|
[shape] | Sphere | Display the material on a sphere. This is the default value. |
Plane | Display the material on a plane. | |
SkyboxA special type of Material used to represent skies. Usually six-sided. More info See in Glossary |
Display the material on a skybox. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.