diff --git a/simgear/scene/model/ModelRegistry.cxx b/simgear/scene/model/ModelRegistry.cxx index 92a09bca..0b9789d7 100644 --- a/simgear/scene/model/ModelRegistry.cxx +++ b/simgear/scene/model/ModelRegistry.cxx @@ -359,6 +359,8 @@ ModelRegistry::readImage(const string& fileName, if (res.validImage()) { osg::ref_ptr srcImage = res.getImage(); int width = srcImage->s(); + //int packing = srcImage->getPacking(); + //printf("packing %d format %x pixel size %d InternalTextureFormat %x\n", packing, srcImage->getPixelFormat(), srcImage->getPixelSizeInBits(), srcImage->getInternalTextureFormat() ); bool transparent = srcImage->isImageTranslucent(); bool isNormalMap = false; bool isEffect = false; @@ -367,6 +369,11 @@ ModelRegistry::readImage(const string& fileName, */ bool can_compress = (transparent && compress_transparent) || (!transparent && compress_solid); + if (srcImage->getPixelSizeInBits() <= 16) { + SG_LOG(SG_IO, SG_INFO, "Ignoring " + absFileName + " for inclusion into the texture cache because pixel density too low at " << srcImage->getPixelSizeInBits() << " bits per pixek"); + can_compress = false; + } + int height = srcImage->t(); // use the new file origin to determine any special processing