mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-11 00:44:33 +00:00
Merge branch 'youwe' into 'master'
Fix unavailable UV set handling in NIF models See merge request OpenMW/openmw!1594
This commit is contained in:
commit
a0c0ea09b2
@ -1136,18 +1136,18 @@ namespace NifOsg
|
|||||||
|
|
||||||
const auto& uvlist = data->uvlist;
|
const auto& uvlist = data->uvlist;
|
||||||
int textureStage = 0;
|
int textureStage = 0;
|
||||||
for (const unsigned int uvSet : boundTextures)
|
for (std::vector<unsigned int>::const_iterator it = boundTextures.begin(); it != boundTextures.end(); ++it, ++textureStage)
|
||||||
{
|
{
|
||||||
|
unsigned int uvSet = *it;
|
||||||
if (uvSet >= uvlist.size())
|
if (uvSet >= uvlist.size())
|
||||||
{
|
{
|
||||||
Log(Debug::Verbose) << "Out of bounds UV set " << uvSet << " on shape \"" << name << "\" in " << mFilename;
|
Log(Debug::Verbose) << "Out of bounds UV set " << uvSet << " on shape \"" << name << "\" in " << mFilename;
|
||||||
if (!uvlist.empty())
|
if (uvlist.empty())
|
||||||
geometry->setTexCoordArray(textureStage, new osg::Vec2Array(uvlist[0].size(), uvlist[0].data()), osg::Array::BIND_PER_VERTEX);
|
continue;
|
||||||
continue;
|
uvSet = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
geometry->setTexCoordArray(textureStage, new osg::Vec2Array(uvlist[uvSet].size(), uvlist[uvSet].data()), osg::Array::BIND_PER_VERTEX);
|
geometry->setTexCoordArray(textureStage, new osg::Vec2Array(uvlist[uvSet].size(), uvlist[uvSet].data()), osg::Array::BIND_PER_VERTEX);
|
||||||
textureStage++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user