0
\$\begingroup\$

I'm having trouble with hidden line removal in OpenGL 4. I use a vertex/geometry/fragment shader to draw the lines. I call

glDepthRange(0.01, 1.0);

before I draw the lines, and it works, sort of. Attached is a screenshot. Is there a better method? I tried other methods, but they all suffer from the limitation that lines are stuck at 1 pixel wide.

What happens is that I draw the filled triangles, then I draw over top of that with lines (3 lines per triangle, one per edge). These edges show up when the view angle is almost parallel to the surface.

I don't want the black lines showing up.

Please let me know if you wish for more code.

enter image description here

\$\endgroup\$
0

1 Answer 1

0
\$\begingroup\$

It is heuristically derived that one must call glDepthRange(0.1, 1.0) before drawing the game board, and glDepthRange(0.01, 1.0) before drawing the character. Thanks to DMGregory for guidance.

enter image description here

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .