mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Add a dont_override_filter description for textures that should be left alone
This commit is contained in:
parent
e8662bea31
commit
31988ca4cc
2 changed files with 8 additions and 0 deletions
|
@ -189,6 +189,13 @@ namespace Resource
|
||||||
osg::Texture* tex = attr->asTexture();
|
osg::Texture* tex = attr->asTexture();
|
||||||
if (tex)
|
if (tex)
|
||||||
{
|
{
|
||||||
|
if (tex->getUserDataContainer())
|
||||||
|
{
|
||||||
|
const std::vector<std::string>& descriptions = tex->getUserDataContainer()->getDescriptions();
|
||||||
|
if (std::find(descriptions.begin(), descriptions.end(), "dont_override_filter") != descriptions.end())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tex->setFilter(osg::Texture::MIN_FILTER, mMinFilter);
|
tex->setFilter(osg::Texture::MIN_FILTER, mMinFilter);
|
||||||
tex->setFilter(osg::Texture::MAG_FILTER, mMagFilter);
|
tex->setFilter(osg::Texture::MAG_FILTER, mMagFilter);
|
||||||
tex->setMaxAnisotropy(mMaxAnisotropy);
|
tex->setMaxAnisotropy(mMaxAnisotropy);
|
||||||
|
|
|
@ -151,6 +151,7 @@ osg::ref_ptr<osg::Node> TerrainGrid::buildTerrain (osg::Group* parent, float chu
|
||||||
texture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
|
texture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
|
||||||
texture->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
|
texture->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
|
||||||
texture->setResizeNonPowerOfTwoHint(false);
|
texture->setResizeNonPowerOfTwoHint(false);
|
||||||
|
texture->getOrCreateUserDataContainer()->addDescription("dont_override_filter");
|
||||||
blendmapTextures.push_back(texture);
|
blendmapTextures.push_back(texture);
|
||||||
|
|
||||||
textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(dummyTextureCounter++, blendmapTextures.back());
|
textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(dummyTextureCounter++, blendmapTextures.back());
|
||||||
|
|
Loading…
Reference in a new issue