Shader - Change Tag based on Properties

Hello,

I’m trying to include on of my properties into the tag of my shader. I’m very new to writing shaders, so apologies.

I want to change the ‘Queue’ tag based on a property:

Properties {
	_Color ("Main Color", Color) = (1,1,1,1)
	_MainTex ("Base (RGB)", 2D) = "white" {}
	_TransparentQ ("Transparent Queue", Float) = 0
	_GeometryQ ("Geometry Queue", Float) = 0
}
SubShader {
	Tags { 
		"Queue"="Geometry+" _GeometryQ // ?
		"Queue"="Transparent+" _TransparentQ //?
		"IgnoreProjector"="True"
		"RenderType"="Transparent" 
	}

Where my queue tags are, I want to be able to place the variable float in the properties into them. Is this even possible?
Thanks

I have the same problem, are you resolved this?

1 Answer

1

To my knowledge, that is not possible - the values in the Properties block can only be evaluated within the CG program code of a shader, not to create dynamic subshader tag values.

However, you can override the renderqueue specified in the shader for a given material by using Material.renderQueue

Okay thanks