Jump to content

  • Log In with Google      Sign In   
  • Create Account

Wireframe Overlay - glPolygonOffset


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1   Members   -  Reputation: 194

Like
0Likes
Like

Posted 07 August 2014 - 04:02 AM

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



#2   Crossbones+   -  Reputation: 24449

Like
2Likes
Like

Posted 07 August 2014 - 04:36 AM

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




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS