|
|
|
@ -129,36 +129,28 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh, bool
|
|
|
|
|
mBounds[ptr.getCell()] = Ogre::AxisAlignedBox::BOX_NULL;
|
|
|
|
|
mBounds[ptr.getCell()].merge(bounds);
|
|
|
|
|
|
|
|
|
|
bool transparent = false;
|
|
|
|
|
for(size_t i = 0;!transparent && i < entities.mEntities.size();i++)
|
|
|
|
|
bool anyTransparency = false;
|
|
|
|
|
for(size_t i = 0;!anyTransparency && i < entities.mEntities.size();i++)
|
|
|
|
|
{
|
|
|
|
|
Ogre::Entity *ent = entities.mEntities[i];
|
|
|
|
|
for(unsigned int i=0;!transparent && i < ent->getNumSubEntities(); ++i)
|
|
|
|
|
for(unsigned int i=0;!anyTransparency && i < ent->getNumSubEntities(); ++i)
|
|
|
|
|
{
|
|
|
|
|
Ogre::MaterialPtr mat = ent->getSubEntity(i)->getMaterial();
|
|
|
|
|
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
|
|
|
|
|
while(!transparent && techIt.hasMoreElements())
|
|
|
|
|
{
|
|
|
|
|
Ogre::Technique* tech = techIt.getNext();
|
|
|
|
|
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
|
|
|
|
|
while(!transparent && passIt.hasMoreElements())
|
|
|
|
|
{
|
|
|
|
|
Ogre::Pass* pass = passIt.getNext();
|
|
|
|
|
transparent = pass->isTransparent();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
anyTransparency = ent->getSubEntity(i)->getMaterial()->isTransparent();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!mIsStatic || !Settings::Manager::getBool("use static geometry", "Objects") || transparent)
|
|
|
|
|
if(!mIsStatic || !Settings::Manager::getBool("use static geometry", "Objects") || anyTransparency)
|
|
|
|
|
{
|
|
|
|
|
for(size_t i = 0;i < entities.mEntities.size();i++)
|
|
|
|
|
{
|
|
|
|
|
Ogre::Entity *ent = entities.mEntities[i];
|
|
|
|
|
|
|
|
|
|
for(unsigned int i=0; i < ent->getNumSubEntities(); ++i)
|
|
|
|
|
{
|
|
|
|
|
Ogre::SubEntity* subEnt = ent->getSubEntity(i);
|
|
|
|
|
subEnt->setRenderQueueGroup(subEnt->getMaterial()->isTransparent() ? RQG_Alpha : RQG_Main);
|
|
|
|
|
}
|
|
|
|
|
ent->setRenderingDistance(small ? Settings::Manager::getInt("small object distance", "Viewing distance") : 0);
|
|
|
|
|
ent->setVisibilityFlags(mIsStatic ? (small ? RV_StaticsSmall : RV_Statics) : RV_Misc);
|
|
|
|
|
ent->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -203,7 +195,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh, bool
|
|
|
|
|
|
|
|
|
|
sg->setCastShadows(true);
|
|
|
|
|
|
|
|
|
|
sg->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
|
|
|
|
|
sg->setRenderQueueGroup(RQG_Main);
|
|
|
|
|
|
|
|
|
|
std::vector<Ogre::Entity*>::reverse_iterator iter = entities.mEntities.rbegin();
|
|
|
|
|
while(iter != entities.mEntities.rend())
|
|
|
|
|