OpenGL shader based font rendering

Text on a transparent surface .... in Space!

An archive containing the source code can be found here.


This is small demo on OpenGL® shader based font rendering:

  • A low resolution integer texture is used to store text.
  • A fragment shader fetches the characters from the texture.
  • The shader decodes the characters to font map positions.
  • The shader then fetches font map texels and draws the glyphs for the
    characters.


The font map lookup benefits directly from mipmapping and trilinear
interpolation of texel values.
Only a single rectangle has to be drawn to render text, instead of drawing a
rectangle for each character.