Index: [thread] [date] [subject] [author]
  From: teunis <teunis@computersupportcentre.com>
  To  : ggi-develop@eskimo.com
  Date: Mon, 21 Sep 1998 13:43:26 -0700 (MST)

Re: OpenGL and fonts... umm. could anyone use this?

On Mon, 21 Sep 1998, Christian Reiniger wrote:

> teunis wrote:
> 
> >I've just finished (more or less) writing a bit of code that creates and
> >uses a font in OpenGL... in 3D :)
> >[ie it maps it into a texture and displays it using OpenGL textured
> >triangles...]
> 
> .... and could be used to display a console on a cube?? ;)

yes :)
Currently got it going semitranslucent white-on-blue to emulate that cool
cube effect on "Hackers" :)

> But, really, I think that could be useful for us at PenguinPlay for
> displaying text on arbitrary 3d objects... I'm not sure about the details
> yet, but it would be nice if you could send me the code.

Shall do - just trying a few tricks out first :)
[like changing text into a bitmap/stencil.  Should drop it back down to a
nice efficient 8K-ish per font :]

I'll clean it up a bit and send out the current code later tonight... :)

> >This is -not- memory-efficient code - it takes 262K for a 256 character
> >8x16 font.  (it'd take less but OpenGL requires the width and height to be
> >a multiple of 2: ie 256x256x4bytes-per-pixel).  Oh - for some reason under
> 
> ?? 16x16x4bytes-per-pixel also has width and height as multiples of 2. Or
> doesn't OpenGL allow very small textures?

There's a limit on number of textures.  So I made it one large texture....
....  though there's sorta font-page support so eventually this can
support Unicode :)
[and the unicode-mapping code is still in development :]
(as in the ISO standard Unicode not the 16-bit cr** that Java&co try to
pass off as unicode)

G'day, eh? :)
	- Teunis

Index: [thread] [date] [subject] [author]