Here's the current results:
Now you're (hopefully) thinking "that's a mighty fine looking 'a'", but the really neat part is how little resources it takes to draw it - a single 32x32 sprite on a single quad with a tiny ~25 line shader. [grin] Yup, even enlarged sixteen times it retains the smooth curves even though the actual texture data is miniscule. In fact I've found it can be enlarged pretty much indefinately and still look awesome.
The shader is a bit too complicated for my liking (two texture samples, a fwidth() screen-space derivative, three smoothstep() calls and a couple of branches) but compared to Ysaneya's 250+ line and 10+ texture sampling shader behemoths it's pretty light weight. I suspect I'm being a little too old-skool and worrying too much about it.
The fixed-function fallback is just done with an appropriate alpha-test value, and so won't give soft drop shadows or antialiasing but the shape is the same. And outlining can be done by drawing it twice with different alpha test values.
At the other end of the scale, small text isn't too bad either:
That's shrunk down to half size (16x16), and still comparable in quality to a bitmap font renderer at the same size. Drop shadows will work, but at that scale outlining tends to get pixely due to not having enough physical space to fit a proper outline into.
The Dilemma
Now I have a dilemma - do I write a proper text renderer using this and replace my current bitmap font rendering method? For people with shader capable cards (GF FX and up) it's better in all areas. For shaderless people (ie. people with those crappy intergrated intel chips) it means they'll get scalable aliased text instead of unscalable, antialiased text. I'm not sure that's a tradeoff I'm willing to make, as much as I'd love the greater flexibility.
Is it about time to say "screw it" to people with crappy graphics cards and just go for GL2.0 features as a baseline (FBOs, VBOs and proper GLSL shaders)? On the one hand that goes all the way back to the GeForce FX, which is five years old now - a long time in graphics hardware. On the other hand theres a lot of people with lousy intergrated intel chips (laptop people mostly), and I'm not sure if I want to shut them out. And I'd rather not try and maintain two completely different renderers for the different paths because I've only one pair of hands (and fundamentally, want to concentrate on writing games, not hardware specific workarounds).
So what do you people aim for, hardware-wise? As high as your development machine? An arbitrary base line spec? As low as possible? Comments highly appreciated.
I would personally go for Value's technique, with alpha-testing as an acceptable fallback for shaderless cards. Someone with an older card can't expect optimal image quality, including antialiasing IMHO.
I can't believe I went through the trouble of writing a cached FreeType scalable-text renderer only for it to be obsoleted by something as elegant as this.
[bawling]