glCompressedTexImage3D strange behavior

Recommended Posts

Hi everyone, I have a problem using a compressed DDS 3D image. Here is the code I use :
// Create the texture
glGenTextures( 1, &axID ) ;
glBindTexture( GL_TEXTURE_3D, axID );
// Linear Filtering
glTexParameteri(GL_TEXTURE_3D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
// Limit texture coordinates to [0;1]
glTexParameteri(GL_TEXTURE_3D,GL_TEXTURE_WRAP_S,GL_CLAMP);
glTexParameteri(GL_TEXTURE_3D,GL_TEXTURE_WRAP_T,GL_CLAMP);

// Load the image
int vW = axWidth = pData->mWidth ;
int vH = axHeight = pData->mHeight ;

glCompressedTexImage3D(	GL_TEXTURE_3D,
0,
pData->mFormat,
vW,vH,
pData->mDepth,
0,
pData->mSize,
pData->mpPixels ) ;

GLenum vError = glGetError() ;
if( vError )
{
string vErr = (char*)gluErrorString( vError ) ;
delete pData ;
return false ;
}


What I get when I display the image into a plane is a strange image, which is actually the good one but that is reduced by 4... I can see 16 small pictures instead of 1 big. Could it be a mipmap problem, since in the header of the DDS file the mipmap level is set to 0 ? EDIT : This should be a mipmap problem since the flag DDSD_MIPMAPCOUNT is not set in the DDSURFACEDESC2 header of the DDS file... so I guess I have 4 mipmaps, but how do I calculate the size taken by each ???

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• Partner Spotlight

• Forum Statistics

• Total Topics
627665
• Total Posts
2978523

• 10
• 10
• 12
• 22
• 13