Rendering of text with LWJGL

Started by Qu0ll, February 15, 2010, 10:38:01

Previous topic - Next topic

Qu0ll

What are the options for displaying "reasonable" quality text within a LWJGL game?  Of course it would be nice if subpixel antialiasing were possible but is there a way to display fairly crisp text anyway?

princec

I use large bitmap fonts rendered out beforehand, mipmapped, and then scaled down to size.

Cas :)

kappa

I'd go for bitmap fonts too as they are so easy to do, just write a parser to support a tool like http://www.angelcode.com/products/bmfont/ and you should be ready to go.

Alternatively you could use AWT fonts see following post for some example code http://lwjgl.org/forum/index.php/topic,1258.0.html

ryanm

Also check out distance field rendering. It allows high quality output even with very low-resolution font textures. Requires a fragment shader though. There's code in the Slick library.

edit: Also code and test webstart linked from this post.

princec

You don't need frag shaders for distance rendering; the simple algorithm works with just the alpha test.

Cas :)

ryanm

That's true - you only need the shader if you want anti-aliasing or transparency or the spiffy border/glow/shadow effects.