Jump to content
  • Advertisement
Sign in to follow this  
Endurion

Anti-Aliased Filled Polygon Algo

This topic is 4975 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 all, i'm trying to implement a nice text effect in my painting app and i'm having difficulties getting a decent fast rendering done. If you don't know what i'm trying to achieve, look at DDTitle. It works with the installed fonts and renders the fonts pretty fast, even with all the effects done. My idea is this: I'm retrieving the glyphs/outlines via the windows GDI functions (BeginPath etc.), transform them and use the line lists to render filled polygons. I can draw simple aa-ed lines easily but what i'd really like to do would be filled polygons, but aa-ed on the border. Trouble arises, when letters have holes inside. I'm thinking that i'll need to tesselate (split up in triangles) the polygon. I don't want to use third party libs (like freetype) since i want to learn by doing that. My question in that case, any idea on how to implement that in a fast enough way? Any hints on what approach to take? Thanks in advance, Endurion

Share this post


Link to post
Share on other sites
Advertisement
Perhaps you could do it by capturing the background first, drawing the character with holes filled in (and edges antialiased), and then drawing the hole over the top (again, with edges antialiased) using the captured background as a source?

Share this post


Link to post
Share on other sites
Might work, i'd like to preserve the background though without capturing.

In addition to your suggestion, i could render the full area in a gray/alpha-image (8 bit ought to be enough) followed by the holes. Then use this alpha image to blend onto the background.

Share this post


Link to post
Share on other sites
Indeed. Personally I like that kind of thing because it allows you to use the result as a mask much more easily (allowing, for example, patterned/textured text).

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!