Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


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 Tommato   Members   -  Reputation: 146

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



Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 17350

Like
1Likes
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