CLOSED
I am creating a 2D game where I have this shader:
Shader " Library/Cull All"
{
SubShader
{
Tags {"Queue" = "Background"}
Blend SrcAlpha OneMinusSrcAlpha
Lighting Off
ZWrite On
ZTest Always
Pass
{
Color(0,0,0,0)
}
}
}
This shader culls everything behind the object this shader is on.
Then I have this shader:
Properties {
_Color ("Main Color", Color) = (0.5,0.5,0.5,1)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
Category {
Tags {"Queue"="Background-1" "IgnoreProjector"="True" "RenderType"="Transparent"}
ZWrite Off
Alphatest Greater 0
Blend SrcAlpha OneMinusSrcAlpha
SubShader {
Material {
Diffuse [_Color]
Ambient [_Color]
Emission [_Emission]
}
Pass {
ColorMaterial AmbientAndDiffuse
Lighting Off
Cull Off
SetTexture [_MainTex] {
Combine texture * primary, texture * primary
}
SetTexture [_MainTex] {
constantColor [_Color]
Combine previous * constant DOUBLE, previous * constant
}
}
}
}
It is created to ignore culling. But it only renders the background. Any other object with this shader on it doesn’t render at all.