Advertisement

wireframe over (glPolygonOffset)

Started by June 19, 2019 02:49 AM
1 comment, last by MJP 5 years, 7 months ago

Hi All

Now I use

glPolygonOffset(0.0f, -fabs(zFar - zNear) / 1024);

But it works bad, see "quadrangles" in the attached image. Setting bigger values can help with the actual model but rises probs with others. What am I doing wrong?

Also: I've read about other solutions (instead of glPolygonOffset) like setup projection matrix or use shader code. But I think with ortho (no perspective) they do same as glPolygonOffset. Is it correct?

Thank you

Picture 1.png

You're not doing anything wrong, there's just no good way to do this reliably due to issues with rasterizer and depth buffer precision. That's the reason why people have invested time coming up with alternative solutions like this one.

This topic is closed to new replies.

Advertisement