Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Triangularium

Easy, breezy, beautiful... Antialiasing...

This topic is 5856 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

My graphics card isn''t up to par. It supports GL_LINE_SMOOTH, but not GL_POLYGON_SMOOTH... I''ve seen several antialiasing tutorials that don''t work on my machine, so I figured out how to make the best of what I have. use glBlendFunc(GL_SRC_ALPHA, GL_ONE) for blending, and you need only enable GL_LINE_SMOOTH. Keep depth testing enabled. Draw your pretty polygons once as lines. This will obviously make them antialiased. Draw them a second time filled, and they''ll fill in all the areas inside the lines, which in turn make the edges antialiased. There are drawbacks to this method. Firstly, I''ve tested this on a single square before writing this topic, so there is a slight chance your object MIGHT not look quite right. Secondly, my blending specs may not be the best to use... Mess with those and find out what works for you. Lastly, it''s not very speed-effective. Large scenes will draw VERY slowly by drawing every polygon twice, so use this only if you''ve a small scene or you want to render a picture. Now, I''m off to play with it... Take care. -Triangularium

Share this post


Link to post
Share on other sites
Advertisement
Whoops... I was so excited, I got it backwards...

Draw the polygons filled first, then as antialiased lines...
Remember to have GL_CULL_FACE enabled to speed things up.

Share this post


Link to post
Share on other sites

  • 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!