Enable old-style texture compression

Thanks to Dany for tracking this down!
This commit is contained in:
James Turner 2020-05-05 20:40:29 +01:00
parent 635f460dd5
commit 96618a2e26
2 changed files with 23 additions and 31 deletions

View File

@ -113,9 +113,6 @@ protected:
}
};
// disabling old-syle texture compression in favour of the
// texture-cache
#if 0
class SGTexCompressionVisitor : public SGTextureStateAttributeVisitor {
public:
virtual void apply(int, StateSet::RefAttributePair& refAttr)
@ -146,7 +143,6 @@ public:
}
}
};
#endif
class SGTexDataVarianceVisitor : public SGTextureStateAttributeVisitor {
public:
@ -644,12 +640,8 @@ osg::Node* OptimizeModelPolicy::optimize(osg::Node* node,
SGTexDataVarianceVisitor dataVarianceVisitor;
node->accept(dataVarianceVisitor);
// disabling old-syle texture compression in favour of the
// texture-cache
#if 0
SGTexCompressionVisitor texComp;
node->accept(texComp);
#endif
return node;
}

View File

@ -69,11 +69,11 @@ SGSceneFeatures::instance()
void
SGSceneFeatures::applyTextureCompression(osg::Texture* texture) const
{
// disable older texture-compression, since it interacts confusingly
// with the the runtime texture-cache. We always want to use
// 'USE_IMAGE_DATA_FORMAT' when the texture-cache is active, since we
// decided whether to compress (or not) prior to this point.
#if 0
// if the texture cache is active, always use the file data format
if (_TextureCacheActive && _TextureCacheCompressionActive) {
texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
} else {
// keep the older texture compression working, some people need it
switch (_textureCompression) {
case UseARBCompression:
texture->setInternalFormatMode(osg::Texture::USE_ARB_COMPRESSION);
@ -91,7 +91,7 @@ SGSceneFeatures::applyTextureCompression(osg::Texture* texture) const
texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
break;
}
#endif
}
}
bool