View Full Version : packed pixel extension and internal texture format
02-26-2003, 12:58 AM
If I specify one of the packed pixel formats (e.g. GL_UNSIGNED_BYTE_3_3_2) for my texture data held in user memory what internal texture format should I specify (e.g. the third argument of glTexImage2D(...))? The generic GL_RGB or the specialized GL_R3G3B2?
02-26-2003, 09:02 AM
I don't think RG3B2 is supported for internal format (but I could be wrong). I'm pretty sure that no card would actually honor that request.
If you want small texture sizes, I suggest you look into the s3tc texture compression extension, and the .DDS texture file format.
02-26-2003, 09:20 AM
The 332 was only one example; I need for certain perposes (e.g. smoother color transitions) something like 4444 or 5651 or 2222 or perhaps 332, and sometimes S3TC. My question is, if I specify a packed pixel format, should I specify the generic GL_RGB or GL_RGBA internal formats, or the more specific GL_R3G3B2, GL_RGB5_A1, and so on...
02-26-2003, 09:44 AM
You actually want to put GL_UNSIGNED_BYTE_3_3_2_EXT in the second-to-last parameter (the 'type' parameter)
courtously provided by SGI... http://oss.sgi.com/projects/ogl-sample/registry/EXT/packed_pixels.txt
02-26-2003, 09:51 AM
OK, lets make an example:
glTexImage2D(GL_TEXTURE_2D, 0u, ???, 256u, 256u, 0u, GL_RGB, GL_UNSIGNED_BYTE_3_3_2, imagePtr);
What should I use for ???: GL_RGB or GL_R3G3B2
02-26-2003, 09:54 AM
??? should either be the number 0x03 or the GL_RGB as far as I can tell. ??? is the 'components' parameter of glTexImage2D. And if it is an RGB image, then you have 3 components, right?!
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.