I am running into trouble with drawing a simple line to test the gl.line technique. How is this method used?
I used code in the documentation to draw a simple line, but nothing shows up.
I am also confused as to what the material is used for that it asked for.
What are the requirements to set up this material?
Where do i have to use this material for my lines to show up?
Here is my code attached to an empty object:
void OnPostRender() {
if (!mat) {
Debug.LogError("Please Assign a material on the inspector");
return;
}
GL.PushMatrix();
mat.SetPass(0);
GL.LoadPixelMatrix();
GL.Color(Color.yellow);
GL.Begin(GL.LINES);
GL.Vertex3(0, 0, 3);
GL.Vertex3(Screen.width, Screen.height, 3);
GL.End();
GL.PopMatrix();
}
Can i set a transparency of the lines? Why doesnt my line show up?
Do i have to call this method somewhere, i assumed it is called in the draw procedure as it draws these last…
Any ideas?