Jump to content
  • Advertisement
Sign in to follow this  
sfx81

simple antialiasing question

This topic is 3590 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. I was going through antialiasing tutorial, and drew two lines. Now I cant see any difference, when antialiasing is turned on or off. Here is what I am doing //init() glEnable( GL_LINE_SMOOTH ); glEnable( GL_BLEND ); glShadeModel( GL_SMOOTH ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glHint( GL_LINE_SMOOTH_HINT, GL_NICEST ); glLineWidth(3.5f); //display() //draw line 1 glBegin( GL_LINES ); glVertex2f( 0.5f, 0.5f ); glVertex2f( -0.5f, -0.5f ); glEnd(); //draw line 2 glBegin( GL_LINES ); glVertex2f( -0.5f, 0.5f); glVertex2f( 0.5f, -0.5f ); glEnd(); Any idea what I am missing ? Any help will be appreciated. Regards

Share this post


Link to post
Share on other sites
Advertisement
You didn't miss anything. The reason why you can't see any difference is that your lines are both diagonal. Just increase/decrease the pitch of your line a little, then you'll notice the difference.

Share this post


Link to post
Share on other sites
Yes, it is. But for diagonal lines (45 degree pitch), there is no need to smooth them because they already appear smooth (more or less ;)). But if you disable blending you'll notice that the lines'll appear much heavier whether GL_LINE_SMOOTH is enabled.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!