- Home /
 
Drawing shape with GL but Shader is drawing over every oject
I am having and issue with the shader. Im drawing a shape with GL . but I want a transparency effect My current version of the shader is
 public static Color color = new Color(0,0,0,0.3f);
 static void CreateLineMaterial(){
             if( !lineMaterial ) {
                 lineMaterial = new Material( "Shader \"Lines/Colored Blended\" {" +
                                             "SubShader { Tags { \"RenderType\"=\"Transparent\" } Pass { " +
                                             "    Blend SrcAlpha OneMinusSrcAlpha " +
                                             "    ZWrite On ZTest LEqual Cull Off Fog { Mode Off } " +
                                             "    BindChannels {" +
                                             "      Bind \"vertex\", vertex Bind \"color\", color }" +
                                             "} } }" );
                 lineMaterial.hideFlags = HideFlags.HideAndDontSave;
                 lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
             }
         }
 
               IF i remove the blend line in the pass tag. it draws an opaque shape. the two version are below first with the line and second without the blend line in the pass tag. 

I want the the effect like the first image but it draws over everything. I want it to be over the groudn and some other objects. I change the ZWrite to on and Ztest To LEqual. Still its the same. Any Idea whats wrong ?
Your answer
 
             Follow this Question
Related Questions
Lighting and lightmapping - OpenGL ES 1.1? 3 Answers
Texture3D does not work after alt+tab 0 Answers
what the difference between model_View_Matrix and Model_Matrix 1 Answer
Can someone explain to me how to use GL_VERTEX_PROGRAM_POINT_SIZE to make points bigger 0 Answers
Lower-level way to find NEARBY TRIANGLES on the mesh? (Answered.) 4 Answers