Jump to content
  • Advertisement
Sign in to follow this  
smile55

Are point and line not treated as polygon in GL?

This topic is 2476 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
The point and line depth offsets applies only to points and lines drawn as a result of setting the polygon fill mode. See glPolygonMode.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!