I am experiencing some odd problems with different ATI cards: The second time I set the image data of a texture (using glTexImage2D) and texture compression is used together with automatic mipmap generation, the texture becomes all white!
It doesn’t happen the first time I set it, nor does it happen if either texture compression or automatic mipmapping is disabled, or if the size of the new texture is unchanged.
So far I have tried with 3 different ATI cards (2x mobility and one 9700), and different driver versions, each time with the same result. I’ve also tried with several different nVidia cards (TNT2, GF1, GF2, GF3, GF4 and GF2Go), without experiencing any problems.
So my question is, am I doing something wrong, which for some reason is accepted on nVidia cards, or is this a bug in ATI’s drivers?
The code below shows the problem.
glBindTexture( GL_TEXTURE_2D, TexId);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, true);
glTexImage2D( GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, data );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 128, 128, 0, GL_RGB, GL_UNSIGNED_BYTE, data );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
GLenum err = glGetError();
printf("OpenGl Error: %s
Please note that no error is printed!
Any suggestions? Do I really have to delete the texture and recreate it to change it’s size?
P.S. The reason I want to change the texture size is LOD. Most of my textures are huge (1024x1024x32 or 2048x2048x32), but most of the time I only need one or two of them at full resolution (determined at runtime). So initially I only load thumbnails, and then change the size of the textures when I need the higher resolution.
[This message has been edited by abrodersen (edited 12-04-2002).]