freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] anti-aliasing question


From: Dave Calkins
Subject: Re: [ft] anti-aliasing question
Date: Thu, 28 Jan 2010 08:34:21 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1

In this case, I'm rendering a 3D scene with OpenGL and then rendering 2D on top of that, also with OpenGL (setting up the matrices such that the coordinate system is aligned with the screen and world units == pixels).

I'm using FreeType/FreeTypeGL to render this 2D portion. FreeTypeGL uses FreeType via putting the rendered glyphs into textures.

So from my perspective, I'm loading a font, sizing it, and then rendering to GL.

I just have noticed that when comparing GL text rendering to GDI, the GL anti-aliasing seems much more aggressive.

Can you point me to which FreeType routines/parameters control the anti-aliasing it does? I can then test it and figure out how to access that from FreeTypeGL (or expose it if needed).

I understand its a lot more complicated than that, but if I knew where the parameters/calls where to control the anti-aliasing, I could at least experiment with it and see what happens in my particular case :)

I'll look at the interactive demo you mentioned and see if I can find it. If you happen to know what these calls are off the top of your head, I'd appreciate you pointing me toward them.

Thanks!

On 1/28/2010 7:39 AM, Massimo DZ8 wrote:
Side note:
... taking the output of FreeType and putting it in a texture ... note the removal of "3d" 3D textures are volumes with stp texture coordinates, GL_TEXTURE_3D (not to be confused with cube textures, as in GL_TEXTURE_CUBE_MAP, also using stp coords). for standard text, standard texturing with st texture coords is sufficient, to be drawn using GL_TEXTURE_2D.

*Yes, freetype allows to control antialiasing, there's an interactive demo about that;* however in a 3D pipeline you may have to take in consideration eventual non-standard blend modes and alpha test, which could shave off some pixels. Most GL applications will automatically linearly interpolate texels (as this is the default mode and most people don't mind setting GL_TEXTURE_NEAREST_MIPMAP_NEAREST as opposed to D3D9, where the default filtering is a NEAREST - blocky - one) and thus the effect of interpolating antialiased texture samples may result in overly blurry bounduaries: recall that 3d pipe texture samples are "points" as opposed to "pixels" as one (as the antialiaser) might expect/assume.

Embedding 2D text on 3D perspective-corrected surfaces? Then, you have nothing else to do than rely on texture interpolators, and just hope and pray everything is kept readable (all bets about constant sampling as intended by the antialiaser are off, as the texture domain is linearly deformed after AA operations). Don't worry, it's years texture interpolators are good enough to let you do this without much trouble.

Massimo


Dave Calkins ha scritto:
Werner, the more I think about this, I believe FreeType provides anti-aliased rendering doesn't it? I think the GL component is simply taking the output of FreeType and putting it in a 3D texture to be drawn by GL. But I think the anti-aliasing is something being done by FreeType.

Does FreeType allow you to control the degree of anti-aliasing?



_______________________________________________
Freetype mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freetype






reply via email to

[Prev in Thread] Current Thread [Next in Thread]