Exploring SubShader and Pass tags
First of all, the shader tags are a list of one or more key-value pairs that allow you to custom-configure your SubShader
or your Pass
blocks. There are several built-in ones, and you can also define your own to then access them in your C# script using the Material.GetTag
API. Most of the time, however, the predefined ones are enough.
At the time of writing this book, Unity documents list a total of eight SubShader
tags. Some are very specific and rarely used, but there is one that is worth addressing: the Queue
tag. It defines in which render queue a geometry with this shader will be. This is one of the key options that determines in which order this geometry will be rendered compared to the others.
To have precise control over the render order of your shaders, Unity lets you choose between two types of queue values:
- Either you use one of the built-in queues, among
Background
,Geometry
,Alpha Test
,Transparent
, andOverlay
(from first...