1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-01 08:09:46 +00:00

Fix applying of filter settings on terrain textures

This commit is contained in:
scrawl 2016-02-07 05:53:56 -08:00
parent 8b981ab507
commit c3ad4dad75

View file

@ -139,15 +139,16 @@ osg::ref_ptr<osg::Node> TerrainGrid::buildTerrain (osg::Group* parent, float chu
std::vector<osg::ref_ptr<osg::Texture2D> > layerTextures; std::vector<osg::ref_ptr<osg::Texture2D> > layerTextures;
for (std::vector<LayerInfo>::const_iterator it = layerList.begin(); it != layerList.end(); ++it) for (std::vector<LayerInfo>::const_iterator it = layerList.begin(); it != layerList.end(); ++it)
{ {
osg::ref_ptr<osg::Texture2D> tex = mTextureCache[it->mDiffuseMap]; osg::ref_ptr<osg::Texture2D> texture = mTextureCache[it->mDiffuseMap];
if (!tex) if (!texture)
{ {
tex = new osg::Texture2D(mResourceSystem->getImageManager()->getImage(it->mDiffuseMap)); texture = new osg::Texture2D(mResourceSystem->getImageManager()->getImage(it->mDiffuseMap));
tex->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);
tex->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);
mTextureCache[it->mDiffuseMap] = tex; mResourceSystem->getSceneManager()->applyFilterSettings(texture);
mTextureCache[it->mDiffuseMap] = texture;
} }
layerTextures.push_back(tex); layerTextures.push_back(texture);
textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(dummyTextureCounter++, layerTextures.back()); textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(dummyTextureCounter++, layerTextures.back());
} }
@ -161,7 +162,6 @@ osg::ref_ptr<osg::Node> TerrainGrid::buildTerrain (osg::Group* parent, float chu
texture->setResizeNonPowerOfTwoHint(false); texture->setResizeNonPowerOfTwoHint(false);
texture->getOrCreateUserDataContainer()->addDescription("dont_override_filter"); texture->getOrCreateUserDataContainer()->addDescription("dont_override_filter");
blendmapTextures.push_back(texture); blendmapTextures.push_back(texture);
mResourceSystem->getSceneManager()->applyFilterSettings(texture);
textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(dummyTextureCounter++, blendmapTextures.back()); textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(dummyTextureCounter++, blendmapTextures.back());
} }