Question by
ShabihDesperado · May 31, 2018 at 05:02 PM ·
shadersmaterialsglquadsonpostrender
GL QUADS are being painted with the wrong color
Im using this code to paint some geometry using GL.
void OnPostRender() {
GL.Begin(GL.QUADS);
mat.SetPass(0);
for (int i = 0; i < points.Count; i++) {
GL.Vertex (points [i].a);
GL.Vertex (points [i].b);
GL.Vertex (points [i].c);
GL.Vertex (points [i].d);
}
GL.End();
}
It works but when I hit an enemy and I change the material of the sprite (that shares the same shader with the material of the variable mat of the previous code) it change the color of the geometry that I'm drawing. I tried using another shader (a copy of the same shader with some changes) but it's not working. I figure out that maybe is related to the SetPass but it just works when I set it to 0;
I have no idea why this is happening, any clue will be welcome.
Comment