Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Are point and line not treated as polygon in GL?


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 smile55   Members   -  Reputation: 137

Like
0Likes
Like

Posted 04 March 2012 - 11:49 PM

Hi, in a program, I drew some something on the screen, in 2D, then I wanted to draw some points and lines above them. I didn't use a closer z value, so these points and lines counldn't pass the depth test. So I tried to use glPolygonOffset, but I met troubles.

I called glPolygonOffset like this:
glPolygonOffset(0.0f, -1.0f);

First I drew quads with PolgyonMode set to GL_FILL, enable GL_POLYGON_OFFSET_FILL, and everything is ok, the wireframe of the quads were displayed correctly on the screen.

To draw the points, with the same offset setting, I tried to enable GL_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_LINE, GL_POLYGON_OFFSET_POINT, but none of them worked.

I searched on google but didn't find the answer. I am thinking that whether point and line are not polygon in GL, so they are not affected by glPolygonOffset? If they were polygon, which type should I use, GL_POLYGON_OFFSET_FILL or GL_POLYGON_OFFSET_POINT?

Thanks.

Sponsor:

#2 Brother Bob   Moderators   -  Reputation: 4649

Like
0Likes
Like

Posted 05 March 2012 - 04:04 AM

The point and line depth offsets applies only to points and lines drawn as a result of setting the polygon fill mode. See glPolygonMode.




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