Hi, I made a grid (like we can see in Unity) with GL.Lines, using this shader:
static void CreateLineMaterial()
{
if( lineMaterial == null )
{
lineMaterial = new Material( "Shader \"Lines/Colored Blended\" {" +
"SubShader {Tags { \"RenderType\"=\"Overdraw\" } Pass { " +
"ZWrite Off ZTest Always Cull Off Fog { Mode Off } " +
"BindChannels {" +
"Bind \"vertex\", vertex Bind \"color\", color }" +
"} } }");
lineMaterial.hideFlags = HideFlags.HideAndDontSave;
lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
}
}
The problem is that the grid is always over the others game objects, i.e, the lines that I draw overwrite the others item in the scene. I believe this is cause of the shader, but I don’t understand much about it…
What do I have to do to stop this behavior?
Thanks in advance.
Thank you very much! It works the way I expected!
– paulaceccon