I wanted to see the wireframe of my triangle mesh, so rather than constructing a whole new VBO I’m trying to use glPolygonMode and draw it again with the exact same draw call. This is because I can’t find a draw command that will let me make GL_LINE_LOOP primitives out of every 3 indices from my IBO.
But when I draw the wireframe, the insides of the triangles become black again. Is this because when a fragment is discarded, its color value is set to zero (black)? How could I set it so that a discarded fragment does not get written or blended? Are the fragments actually getting discarded?
I solved it. I set
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE)then neglected to set it back toGL_FILL, so all subsequent draws in my loop were wireframe. So it’s obvious why the polygons ended up not filled.