PDA

View Full Version : 1bit textures



stil
03-26-2001, 12:28 AM
hi, this is not really an advanced topic, but i have never seen it used : i would like to store some textures (fonts) using 1bit per pixel into the video card memory - that would allow me to store a lot of fonts http://www.opengl.org/discussion_boards/ubb/smile.gif
I've tried to do that using
glTeximage2D (GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_COLOR_INDEX, GL_BITMAP, bitmap1bit);
but all it does is giving me a black texture (all works well when i use a 8bit texture with glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA8, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, bitmap8bit)).
I've been playing a bit with the glPixelMap settings, but i can't see any difference...
Thank you

zed
03-26-2001, 12:22 PM
maybe try GL_LUMINANCE4 for the texture internal format but most likely most drivers will give you GL_LUMINANCE8 instead http://www.opengl.org/discussion_boards/ubb/frown.gif.
see the texture internal formats demo on my site. (in profile)

ribblem
03-26-2001, 03:22 PM
I think you want to use bitmaps not textures.

stil
03-26-2001, 11:21 PM
I find bitmaps a bit slow, and that don't allow me to do some special effects.
Thanks, i'm gonna try luminance instead.