1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 20:53:50 +00:00

Merge remote-tracking branch 'scrawl/master'

This commit is contained in:
Marc Zinnschlag 2013-03-04 19:36:58 +01:00
commit ac810faa7e
6 changed files with 28 additions and 81 deletions

View file

@ -30,24 +30,13 @@ ActivatorAnimation::ActivatorAnimation(const MWWorld::Ptr &ptr)
{ {
Ogre::Entity *ent = mEntityList.mEntities[i]; Ogre::Entity *ent = mEntityList.mEntities[i];
bool transparent = false; for(unsigned int j=0; j < ent->getNumSubEntities(); ++j)
for(unsigned int j=0;!transparent && j < ent->getNumSubEntities(); ++j)
{ {
Ogre::MaterialPtr mat = ent->getSubEntity(j)->getMaterial(); Ogre::SubEntity* subEnt = ent->getSubEntity(j);
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator(); subEnt->setRenderQueueGroup(subEnt->getMaterial()->isTransparent() ? RQG_Alpha : RQG_Main);
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();
}
}
} }
ent->setVisibilityFlags(RV_Misc); ent->setVisibilityFlags(RV_Misc);
ent->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
} }
setAnimationSource(mesh); setAnimationSource(mesh);
} }

View file

@ -31,23 +31,11 @@ CreatureAnimation::CreatureAnimation(const MWWorld::Ptr &ptr)
Ogre::Entity *ent = mEntityList.mEntities[i]; Ogre::Entity *ent = mEntityList.mEntities[i];
ent->setVisibilityFlags(RV_Actors); ent->setVisibilityFlags(RV_Actors);
bool transparent = false; for(unsigned int j=0; j < ent->getNumSubEntities(); ++j)
for(unsigned int j=0;!transparent && j < ent->getNumSubEntities(); ++j)
{ {
Ogre::MaterialPtr mat = ent->getSubEntity(j)->getMaterial(); Ogre::SubEntity* subEnt = ent->getSubEntity(j);
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator(); subEnt->setRenderQueueGroup(subEnt->getMaterial()->isTransparent() ? RQG_Alpha : RQG_Main);
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();
}
}
} }
ent->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
} }
std::vector<std::string> names; std::vector<std::string> names;

View file

@ -107,23 +107,11 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor
if (mVisibilityFlags != 0) if (mVisibilityFlags != 0)
base->setVisibilityFlags(mVisibilityFlags); base->setVisibilityFlags(mVisibilityFlags);
bool transparent = false; for(unsigned int j=0; j < base->getNumSubEntities(); ++j)
for(unsigned int j=0;!transparent && j < base->getNumSubEntities();++j)
{ {
Ogre::MaterialPtr mat = base->getSubEntity(j)->getMaterial(); Ogre::SubEntity* subEnt = base->getSubEntity(j);
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator(); subEnt->setRenderQueueGroup(subEnt->getMaterial()->isTransparent() ? RQG_Alpha : RQG_Main);
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();
}
}
} }
base->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
} }
std::vector<std::string> skelnames(1, smodel); std::vector<std::string> skelnames(1, smodel);
@ -326,23 +314,11 @@ NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, int
if (mVisibilityFlags != 0) if (mVisibilityFlags != 0)
parts[i]->setVisibilityFlags(mVisibilityFlags); parts[i]->setVisibilityFlags(mVisibilityFlags);
bool transparent = false; for(unsigned int j=0; j < parts[i]->getNumSubEntities(); ++j)
for(unsigned int j=0;!transparent && j < parts[i]->getNumSubEntities();++j)
{ {
Ogre::MaterialPtr mat = parts[i]->getSubEntity(j)->getMaterial(); Ogre::SubEntity* subEnt = parts[i]->getSubEntity(j);
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator(); subEnt->setRenderQueueGroup(subEnt->getMaterial()->isTransparent() ? RQG_Alpha : RQG_Main);
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();
}
}
} }
parts[i]->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
} }
if(entities.mSkelBase) if(entities.mSkelBase)
{ {

View file

@ -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()] = Ogre::AxisAlignedBox::BOX_NULL;
mBounds[ptr.getCell()].merge(bounds); mBounds[ptr.getCell()].merge(bounds);
bool transparent = false; bool anyTransparency = false;
for(size_t i = 0;!transparent && i < entities.mEntities.size();i++) for(size_t i = 0;!anyTransparency && i < entities.mEntities.size();i++)
{ {
Ogre::Entity *ent = entities.mEntities[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(); anyTransparency = ent->getSubEntity(i)->getMaterial()->isTransparent();
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();
}
}
} }
} }
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++) for(size_t i = 0;i < entities.mEntities.size();i++)
{ {
Ogre::Entity *ent = entities.mEntities[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->setRenderingDistance(small ? Settings::Manager::getInt("small object distance", "Viewing distance") : 0);
ent->setVisibilityFlags(mIsStatic ? (small ? RV_StaticsSmall : RV_Statics) : RV_Misc); ent->setVisibilityFlags(mIsStatic ? (small ? RV_StaticsSmall : RV_Statics) : RV_Misc);
ent->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
} }
} }
else else
@ -203,7 +195,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh, bool
sg->setCastShadows(true); sg->setCastShadows(true);
sg->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main); sg->setRenderQueueGroup(RQG_Main);
std::vector<Ogre::Entity*>::reverse_iterator iter = entities.mEntities.rbegin(); std::vector<Ogre::Entity*>::reverse_iterator iter = entities.mEntities.rbegin();
while(iter != entities.mEntities.rend()) while(iter != entities.mEntities.rend())

View file

@ -100,7 +100,8 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
mFactory->loadAllFiles(); mFactory->loadAllFiles();
// Set default mipmap level (NB some APIs ignore this) // Set default mipmap level (NB some APIs ignore this)
TextureManager::getSingleton().setDefaultNumMipmaps(Settings::Manager::getInt("num mipmaps", "General")); // Mipmap generation is currently disabled because it causes issues on Intel/AMD
//TextureManager::getSingleton().setDefaultNumMipmaps(Settings::Manager::getInt("num mipmaps", "General"));
// Set default texture filtering options // Set default texture filtering options
TextureFilterOptions tfo; TextureFilterOptions tfo;

View file

@ -52,7 +52,8 @@ texture filtering = anisotropic
anisotropy = 4 anisotropy = 4
# Number of texture mipmaps to generate # Number of texture mipmaps to generate
num mipmaps = 5 # This setting is currently ignored due to mipmap generation problems on Intel/AMD
#num mipmaps = 5
shader mode = shader mode =