Sign in to follow this  
_Flecko

Prerendered text antialiasing

Recommended Posts

_Flecko    196
I'm trying to get antialiased text by prerendering letters to a texture and storing their coordinates for later use. I do this by rendering a large font to one texture, then rendering that scaled down to my main texture. The problem is that it doesn't look too nice: That's a screenshot of the texture it outputs (it has a transparent background, but I've rendered it to a black background here). As you can see there are partially transparent pixels, but it just doesn't look good. I've tried many combinations of font sizes and texture filters, none of them come out too well. How is this generally done?

Share this post


Link to post
Share on other sites
MasterWorks    496
You should be getting better quality than that, maybe somebody could help you easier if you posted the actual texture that you are using and perhaps your texture creation code? It looks point filtered to me. Mipmaps can cause problems too but usually that results in textures that are too blurry, that's not your problem...

Share this post


Link to post
Share on other sites
SimmerD    1210
It really depends on how you scale it down.

If you are using StretchRect() or rendering a quad, you need to specify D3DFILTER_LINEAR.

Also, HW will only perform 2x2 bilinear filtering per stretchrect(), so if you want to scale it down more than this, you will need to do multiple stretchrects().

The same applies to doing it with quads, although with quads, there is a way to use anisotropic filtering to speed it up a bit. There is a paper on this on the nvidia site.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this