GlPolygonOffset () errors with lines

I have the following code:

glEnable(GL_POLYGON_OFFSET_LINE); glPolygonOffset(1,1); // or 40,40 etc... doesnt help at all 

But the lines are still a z-fight, is this a common mistake or something else ...? My lines have a thickness of 1.0 ft, and I draw the lines that are in the last scene.

I also disabled GL_ALPHA_TEST and GL_LINE_SMOOTH and enabled GL_BLEND and GL_COLOR_LOGIC_OP

Edit: I already tried GL_POLYGON_OFFSET_FILL, it does not help.

+5
source share
2 answers

GL_POLYGON_OFFSET_LINE only works for rendering polygons with glPolygonMode(GL_FRONT_AND_BACK, GL_LINE) . If you draw primitives using GL_LINES , this will not work. In this case, you will have to manually shift the vertices.

+12
source

Try enabling GL_POLYGON_OFFSET_FILL. (I believe that lines are a struggle for depth with previously completed polygons?)

+4
source

All Articles