Hello Forum,

I do have a problem with flickering, however I think this is not be a z-fighting problem. The Problem is when I draw triangles in the line-mode. I do this to get a wire-frame view from my scene. Because I do not want to see through the objects I render the triangles twice. First as white triangles. Then I set the polygon offset and then I render the same object again, but this time as black triangles in line-mode. My code looks something like this:
Code :
glDisableClientState(GL_COLOR_ARRAY); 
glDisable(GL_LIGHTING);
glShadeModel(GL_FLAT);
glEdgeFlag(GL_TRUE);
// draw white triangles
float colorWhite[4] = {1.0f, 1.0f, 1.0f, 1.0f};
glColor4fv(colorWhite);
glDrawArrays(GL_TRIANGLES, 0, ...);
// draw triangle lines
float colorBlack[4] = {0.0f, 0.0f, 0.0f, 1.0f};
glColor4fv(colorBlack);
glEnable(GL_POLYGON_OFFSET_LINE);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glPolygonOffset(-1.0f, -1.0f);
glDrawArrays(GL_TRIANGLES, 0, ...);
glPolygonOffset(0.0f, 0.0f);
// Restore parameter
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);  
glDisable(GL_POLYGON_OFFSET_LINE);
glEnable(GL_POLYGON_OFFSET_FILL);
glEnable(GL_LIGHTING);
The effect is that if I set the camera in parallel view to a face (normal from the face and the cameras view-direction are orthogonal), the lines from this face are flickering through the object that is in front of it. It seems that the z-buffer is not working in this case. But I think that this is not a general z-buffer-problem because it works in other perspectives as you can see in the screen-shot bellow.

I already checked the normal-pointer from my VBO and it seems to be OK. My Hardware is a NVIDIA GeForce GTS 450 on a Win7 but I saw this effect on other systems as well.

Has anybody a hint where I could have a look on it to solve this problem?

Many thanks!