I’m using following code to overlay a black material (fading out)
public void OnPostRender()
{ ...
GL.PushMatrix();
GL.LoadOrtho();
// activate the first shader pass (in this case we know it is the only pass)
mat.SetPass(0);
// draw a quad over whole screen
GL.Begin(GL.QUADS);
GL.Vertex3(0, 0, -99);
GL.Vertex3(1, 0, -99);
GL.Vertex3(1, 1, -99);
GL.Vertex3(0, 1, -99);
GL.End();
GL.PopMatrix();
...}
The same camera is rendering some UI elements using transparency. The black layer respects this transparency and leaves a cut-out where the polygons of the UI elements are and I don’t understand why. Appreciate any insights. I’m using Sprites/Default Shader for the black overlay.