Basically I’ve got these formats stored in my image files (they are tga):
alpha or luminance
what I did so far was to convert them to RGB or RGBA as needed (all GL_UNSIGNED_BYTE). Now I read about BGR/BGRA format to be the fastest at least on nVidia hardware. Am I right that these formats are no part of the standard OpenGL 1.1 specification? They would help me as well, because I wouldn’t have to reorder the tga data anymore.
Is specifying the internal format of any use, or will the driver chose the best anyway? Will I have to check for the vendor to use the best formats???
I’m a bit curious about which formats to use, especially because my OpenGL book gets outdated a bit (it’s 1.0 with a special 1.1 chapter… but it’s german) and it doesn’t cover any extensions.
Michael, BGR became part of opengl 1.2 , yet i believe even the ms software 1.1 version can recoginze it (dont quote me on that), so its pretty supported. u can check with glGetExtensions
using it is a piece of piss eg
glTexImage2D(GL_TEXTURE_2D,0, GL_RGB, width, height,0, GL_BGR_EXT, GL_UNSIGNED_BYTE, (GLvoid *)(image));
Je… thanks guys! I decided to check wether EXT_bgra is supported and use BGR/BGRA/LUMINANCE as uploading format then, which saves me to swap the components, and which causes faster texture upload. So it’s a win/win thing… .