Have come across a problem with texture compression in OpenGL that i can’t get my head round.
I’m trying to load a DXT3 texture. The system finds the texture and loads it without error but it is rendered ‘white’.
I created the dds file from a .tga using NVDIA texture tools and and ATI TheCompressonator and the issue is the same in both cases.
This is the code I use to define the texture. in_pCompressedTextureFile is a pointer to my dds file reader. The dds file contains only the main texture, with no mipmaps.
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); int iWidth = in_pCompressedTextureFile->GetWidth(); int iHeight = in_pCompressedTextureFile->GetHeight(); int iSize = ( ( iWidth + 3 ) / 4 ) * ( ( iHeight + 3 ) / 4 ) * 16; glCompressedTexImage2D( GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, iWidth,iHeight , 0, iSize, in_pCompressedTextureFile->GetData() );
I’ve attached 2 images. The first is the tga ( with alpha channel ), the compressed file and the difference file; all in The Compressonator. The second is the result in my OpenGL program.
Any help would be nice