Hi,
I’m trying to build a shader that has a text field for a custom render queue tag. I’d like this to be a number I can specify so that I don’t have to create a new copy of my shader every time I want to adjust the queue.
I’ve got the text field working, and I know where the number needs to go. I’m just not sure how to tell the shader to use the number, and now I’m wondering if this is a limitation of this in Unity.
I guess my question is, can I use a variable in my shader to define the render queue, and if so, how would I get that to work?
Shader "Render Queue" {
Properties {
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Alpha (A)", 2D) = "white"
_Depth ("Render Depth", Float) = 0 //This is what I'd like to add
}
Category {
Lighting Off
ZWrite Off
Cull back
Blend SrcAlpha OneMinusSrcAlpha
SubShader {
Tags {"Queue" = [_Depth]} //This line doesn't work, but it gives an idea of what I'm trying to do
Pass {
SetTexture [_MainTex] {
ConstantColor [_Color]
Combine Texture * constant
}
}
}
}
}