Texture Quality

Has anyone had this problem before?

I used to be able to load up my nice 24bit textures using the following functions…

// load the texture
AUX_RGBImageRec *pTex = auxDIBImageLoad( full_path );

// upload it video memory
glGenTextures( 1, &m_ID );
glBindTexture( GL_TEXTURE_2D, m_ID );
gluBuild2DMipmaps( GL_TEXTURE_2D, GL_RGB, pTex->sizeX, pTex->sizeY, GL_RGB, GL_UNSIGNED_BYTE, pTex->data );

now whenever i bind the texture and render some triangle strips the quality looks 8bit. it is not the 24bit that i expected…

any ideas?

It’s probably because you are not specifying a specific internal pixelformat. It’s the second parameter in gluBuild2DMipmaps() thats causing the problem. You are only telling OpenGL to use RGB format, but not how may bits in each element, and therefore the driver chooses a default one, probably RGB5 (5 bits for each element) or something similar. Try set the second parameter to something like RGB8, which tells OpenGL that you want 8 bits per element.

i done a demo a few days ago that shows the internal formats http://members.nbci.com/myBollux