mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 18:09:39 +00:00
Make sure materials are built before trying to determine their transparency
This commit is contained in:
parent
c4e4a8fb57
commit
634a53211c
2 changed files with 3 additions and 0 deletions
|
@ -185,6 +185,7 @@ public:
|
||||||
for(unsigned int i = 0;i < numsubs;++i)
|
for(unsigned int i = 0;i < numsubs;++i)
|
||||||
{
|
{
|
||||||
Ogre::SubEntity* subEnt = entity->getSubEntity(i);
|
Ogre::SubEntity* subEnt = entity->getSubEntity(i);
|
||||||
|
sh::Factory::getInstance()._ensureMaterial(subEnt->getMaterial()->getName(), "Default");
|
||||||
subEnt->setRenderQueueGroup(subEnt->getMaterial()->isTransparent() ? mTransQueue : mSolidQueue);
|
subEnt->setRenderQueueGroup(subEnt->getMaterial()->isTransparent() ? mTransQueue : mSolidQueue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1188,6 +1189,7 @@ public:
|
||||||
unsigned int numsubs = ent->getNumSubEntities();
|
unsigned int numsubs = ent->getNumSubEntities();
|
||||||
for(unsigned int i = 0;i < numsubs;++i)
|
for(unsigned int i = 0;i < numsubs;++i)
|
||||||
{
|
{
|
||||||
|
sh::Factory::getInstance()._ensureMaterial(ent->getSubEntity(i)->getMaterial()->getName(), "Default");
|
||||||
if(ent->getSubEntity(i)->getMaterial()->isTransparent())
|
if(ent->getSubEntity(i)->getMaterial()->isTransparent())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -750,6 +750,7 @@ void NpcAnimation::preRender(Ogre::Camera *camera)
|
||||||
|
|
||||||
void NpcAnimation::applyAlpha(float alpha, Ogre::Entity *ent, NifOgre::ObjectScenePtr scene)
|
void NpcAnimation::applyAlpha(float alpha, Ogre::Entity *ent, NifOgre::ObjectScenePtr scene)
|
||||||
{
|
{
|
||||||
|
sh::Factory::getInstance()._ensureMaterial(ent->getSubEntity(0)->getMaterial()->getName(), "Default");
|
||||||
ent->getSubEntity(0)->setRenderQueueGroup(alpha != 1.f || ent->getSubEntity(0)->getMaterial()->isTransparent()
|
ent->getSubEntity(0)->setRenderQueueGroup(alpha != 1.f || ent->getSubEntity(0)->getMaterial()->isTransparent()
|
||||||
? RQG_Alpha : RQG_Main);
|
? RQG_Alpha : RQG_Main);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue