Quality and Speed on Font rendering


I finished a abstract code to render a “console” like quake, counter strike, unreal and etc. But whats the best way to render fonts on opengl? I tested:

texture map: faster then bitmapping, slow with a lot of char and very poor quality.

bitmap: use windows fonts, slow… very slow

Texture mapped fonts can be very high-quality if used and implemented correctly.

texture map fonts is the way to go IMO.

Did you try FTGL? It’s based on the freetype lib, and offers high quality glyphs. (Side note : Warcraft3 uses freetype (and it has quite a lot of text to display)).

Texture mapped fonts can be very high-quality, yes. But the size of textures must be very high too. This very far from a commercial-quality development.

This very far from a commercial-quality development.
I pointed out that texture mapped fonts are used by Warcraft 3 : its a commercial game, sold millions of copies all over the world; its development took several years.

When I wrote “commercial-quality” I mean softwares that need a very high performance(GIS, etc), warcraft3 its just a PC game(very good game), I read some docs on opengl.org, writing fonts on video board framebuffer directly its faster than any other method.

note that warcraft3 uses both texture mapped and bit mapped font rendering, freetype just loads glyphs, adjust kerning, etc


The size of the texture shouldn’t be that high, the charactes should be almost as big on the texture ans they are shown on the screen, that makes the best quality…
http://mazy.annat.nu/files/Applications/Fonture/ if you want to make textures

writing fonts on video board framebuffer directly its faster than any other method.
The only way I know to write “directly” in the framebuffer with OpenGL is glDrawPixels. And this method is slow. Search the forum, you’ll see plenty of posts complaining about glRead/glDrawPixels being slow. The reason why glDrawPixels is slow is that it reads data from client memory each time it is called. If you create a font texture, chances are that this texture will be resident in host memory, and access will be significantly faster.

Note about games : IMHO, producing a game that must run at decent framerate on the latest P4 3GHz w/ GF4 and an old machine like a P3 600MHz w/ a crappy video controler is a challenge. Well-coded games (I think W3 is one of them) are extremely optimized : the more computers able to run the soft, the more potential customers.

Back to your question : I still think that texture mapped font are better than blitting your glyphs directly. IMHO, you should try both, time each method, and see what best fits your needs.