Game Development Community

FIX: DDS textures not showing on Mac

by Daniel Delp · in Torque Game Engine Advanced · 03/29/2009 (4:35 pm) · 5 replies

I am told the model/textures I am using work fine on PC, however on my mac (GeForce 7300 GT) I just get black textures. I do find an error message in the console:
GFXCardProfiler (GL2.0) - Unknown capability 'GL::Workaround::noManualMips'.

Is this telling me my graphics card doesn't support DDS? Or is there more to it than that?

Thanks,
-Dan

#1
03/29/2009 (4:56 pm)
Dan

I have yet to find any textures that don't work on my mac . I do not have that line in my console either ...

My card is the AT X1600.
#2
04/14/2009 (5:13 pm)
Found the issue:

In gfxGLTextureManager.cpp the line:
Quote:
glCompressedTexSubImage2D(texture->getBinding(), i, 0, 0, dds->getWidth(i), dds->getHeight(i), GFXGLTextureInternalFormat[dds->mFormat], dds->getSurfaceSize(dds->getHeight(), dds->getWidth(), i), dds->mSurfaces[0]->mMips[i]);

was throwing a GL_INVALID_OPERATION error. The only reason we could see for throwing this error was the possibility that the extension definition does not recognize 0 (offset values) as being a multiple of 4.

Quote:CompressedTexSubImage2D will result in an INVALID_OPERATION error only if one of the following conditions occurs:
* <width> is not a multiple of four or equal to TEXTURE_WIDTH.
* <height> is not a multiple of four or equal to TEXTURE_HEIGHT.
* <xoffset> or <yoffset> is not a multiple of four.

Anyway, changing the line to
Quote:glCompressedTexImage2D(texture->getBinding(), i, GFXGLTextureInternalFormat[dds->mFormat], dds->getWidth(i), dds->getHeight(i), 0, dds->getSurfaceSize(dds->getHeight(), dds->getWidth(), i), dds->mSurfaces[0]->mMips[i]);

Fixed the problem. If we are assuming the offset values to be 0 anyway, is there any reason to use texSubImage?
#3
04/26/2009 (10:43 pm)
Can you send me the texture which was causing trouble?
#4
04/27/2009 (8:20 pm)
Emailed to your listed address.
#5
04/27/2009 (9:18 pm)
So... I suck. In gfxGLEnumTranslate.cpp change
GFXGLTextureFormat[GFXFormatDXT1] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
   GFXGLTextureFormat[GFXFormatDXT2] = GL_ZERO;
   GFXGLTextureFormat[GFXFormatDXT3] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
   GFXGLTextureFormat[GFXFormatDXT4] = GL_ZERO;
   GFXGLTextureFormat[GFXFormatDXT5] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
to
GFXGLTextureFormat[GFXFormatDXT1] = GL_RGB;
   GFXGLTextureFormat[GFXFormatDXT2] = GL_ZERO;
   GFXGLTextureFormat[GFXFormatDXT3] = GL_RGBA;
   GFXGLTextureFormat[GFXFormatDXT4] = GL_ZERO;
   GFXGLTextureFormat[GFXFormatDXT5] = GL_RGBA;
.

I missed that bit when merging over the code from Legions :(