PDA

View Full Version : Texture Formats?



Michael Steinberg
09-03-2001, 07:17 AM
Hi there!
Basically I've got these formats stored in my image files (they are tga):
bgra
bgr
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.

I'd be pleaseful for any insight!

zed
09-03-2001, 12:36 PM
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));

no need to get the extension pointers.

09-04-2001, 09:52 PM
Hehe I'm useing the opengl 1.1 and it doesn't conver extension either so it's not just the 1.0 book. Haven't look at the 1.2 book...

You'll probable have to download the glext.h to use the extension.

Michael Steinberg
09-05-2001, 02:35 AM
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... http://www.opengl.org/discussion_boards/ubb/smile.gif.