glCompressedTexImage3D strange behavior

This topic is 3165 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

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);

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 ???

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
18

• 13
• 10
• 12
• 10
• 13
• Forum Statistics

• Total Topics
632998
• Total Posts
3009802
• Who's Online (See full list)

There are no registered users currently online

×