Don't disable depth writes when blending is enabled

actorid
Chris Robinson 12 years ago
parent 1f24763881
commit 1168f15361

@ -42,8 +42,7 @@ ActivatorAnimation::ActivatorAnimation(const MWWorld::Ptr &ptr)
while (passIt.hasMoreElements() && !transparent)
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
if(pass->getSourceBlendFactor() != Ogre::SBF_ONE || pass->getDestBlendFactor() != Ogre::SBF_ZERO)
transparent = true;
}
}

@ -43,8 +43,7 @@ CreatureAnimation::CreatureAnimation(const MWWorld::Ptr &ptr)
while (passIt.hasMoreElements() && !transparent)
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
if(pass->getSourceBlendFactor() != Ogre::SBF_ONE || pass->getDestBlendFactor() != Ogre::SBF_ZERO)
transparent = true;
}
}

@ -118,7 +118,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor
while (passIt.hasMoreElements())
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
if(pass->getSourceBlendFactor() != Ogre::SBF_ONE || pass->getDestBlendFactor() != Ogre::SBF_ZERO)
transparent = true;
}
}

@ -148,8 +148,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh, bool
while (passIt.hasMoreElements())
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
if(pass->getSourceBlendFactor() != Ogre::SBF_ONE || pass->getDestBlendFactor() != Ogre::SBF_ZERO)
transparent = true;
}
}

@ -716,8 +716,6 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
blend_mode += getBlendFactor((alphaFlags>>1)&0xf);
blend_mode += " ";
blend_mode += getBlendFactor((alphaFlags>>5)&0xf);
instance->setProperty("depth_write", sh::makeProperty(new sh::StringValue("off")));
instance->setProperty("scene_blend", sh::makeProperty(new sh::StringValue(blend_mode)));
}
else

Loading…
Cancel
Save