Skip to main content
gamedev.net
🔒 Locked

Wireframe Overlay - glPolygonOffset

Started by Tommato 0 replies 4.1k views
Original Post
Tommato
Tommato

Hi All

I need to draw wireframe over solid object. As I've understood from google, glPolygonOffset is a standard solution for this - but I can't get it to work. With first argument negative it has effect - wireframe disappears. But my wireframe still "blinks" with any view change, no matter what values are passed to glPolygonOffset. I've also tried different draw order and wireframe drawn as lines - no luck. What am I doing wrong?

Thanks

Tommato

L. Spiro
L. Spiro
If the wireframe comes from the came vertex data as the model then all you need to do is set the depth mode to GL_EQUAL and draw the wireframe.

Or you can always modify gl_FragDepth, setting it to a value slightly smaller than gl_FragCoord.z, such as gl_FragCoord.z - (1.0f / 16000000.0) (this takes experimentation as well).

Otherwise you need to experiment with ::glPolygonOffset().


L. Spiro
I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.