Anti-Aliased Filled Polygon Algo
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
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?
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.
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.
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).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement