Game Development Community

TGEA 1.8.0 - DDS textures without mips assert Torque.

by Stefan Lundmark · in Torque Game Engine Advanced · 12/29/2008 (3:42 pm) · 2 replies

DDS textures without mip maps make you run into an assert.

bool GFXD3DxTextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dds)
{
[b][...][/b]
   if( !dds->mFlags.test( DDSFile::MipMapsFlag ) )
   {
      // Great, we have to generate our own mips.
      String fileName("<Unknown>");

      // Try to find a useful name
      if (dds->getSourcePath().getFullFileName().isNotEmpty())
         fileName = dds->getSourcePath().getFullFileName().c_str();
      else if (aTexture->mTextureLookupName.isNotEmpty())
         fileName = aTexture->mTextureLookupName.c_str();
#ifdef TORQUE_DEBUG
      else if (aTexture->mDebugDescription.isNotEmpty())
         fileName = aTexture->mDebugDescription.c_str();
#endif

      AssertISV(false, avar("DDS texture %s doesn't have mipmaps. You need to generate them as part of your .dds.", fileName.c_str()));
   }

Which of course is nonsense. Removing the assert call doesn't seem to break anything, but I haven't made any tests yet as we're still porting. Our Waterblocks rely on a DDS texture for depth effects and oil patches, and there's no reason to keep such a texture mipmapped AFAIK.

#1
12/30/2008 (9:28 pm)
Yea the assert is bogus... a DDS without mipmaps is a perfectly valid option.

In fact Torque should never autogenerate mipmaps for DDS files... if the artist didn't export a DDS with mipmaps you should assume thats what they wanted.
#2
12/31/2008 (7:45 am)
OMG I hated seeing this error in the early development of Lore Aftermath, of course back then it said something like " is lazy! Automatic MipMap Generation is not supported!"