glTexImage2D question.

Hi !

If I am going to render text using textures, I don’t need many bits for color depth, but are there any prefered formats to use with glTexImage2D that will render faster then others (or are there any special format that I can assume is handled in hardware in fastest possible way on most OpenGL implementations) ?

Mikael

You can’t say that X is faster than Y. It differs from implementation to implementation. But if your font doesn’t use multiple colors per letter, you can get away with the GL_LUMINANCE format. It’s a greyscale format, and you can use the primary color to set the color of the text. It will occupy less memory per texel, and might be slightly faster because less memory bandwidth is needed.

You might also try GL_LUMINANCE_ALPHA format. So you can cut out the text background and let the scene show through.

You might want to try only ALPHA format, and set the color of the text using color, material and/or lighting.