I wrote the following shader which purpose is to force draw a mesh over the rest, regardless z-depth :
Shader "Custom/AlwaysOnTop"
{
SubShader
{
Tags { "Queue"="Overlay" "RenderType"="Overlay" }
ZTest Always
CGPROGRAM
#pragma surface surf Lambert
struct Input
{
float4 color : COLOR;
};
void surf (Input IN, inout SurfaceOutput o)
{
o.Albedo = 1;
}
ENDCG
}
Fallback "Diffuse"
}
It works great, however transparent objects still get draw over it. Setting the queue as Overlay should have solved the problem.
- White = AlwaysOnTop shader
- Green = Transparent diffuse
- Blue = Diffuse
The left face of the white cube should be white, no tinted in green.