mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-28 20:36:42 +00:00
Do not recreate shaders to update transparency
This commit is contained in:
parent
adb96bf569
commit
5ec28e09c9
2 changed files with 1 additions and 17 deletions
|
@ -1798,17 +1798,13 @@ namespace MWRender
|
||||||
material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,alpha));
|
material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,alpha));
|
||||||
material->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
material->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
||||||
stateset->setAttributeAndModes(material, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);
|
stateset->setAttributeAndModes(material, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);
|
||||||
|
stateset->addUniform(new osg::Uniform("colorMode", 0), osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);
|
||||||
mObjectRoot->setStateSet(stateset);
|
mObjectRoot->setStateSet(stateset);
|
||||||
|
|
||||||
mResourceSystem->getSceneManager()->recreateShaders(mObjectRoot);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mObjectRoot->setStateSet(nullptr);
|
mObjectRoot->setStateSet(nullptr);
|
||||||
|
|
||||||
mResourceSystem->getSceneManager()->recreateShaders(mObjectRoot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setRenderBin();
|
setRenderBin();
|
||||||
|
|
|
@ -649,9 +649,6 @@ void NpcAnimation::updateParts()
|
||||||
|
|
||||||
if (wasArrowAttached)
|
if (wasArrowAttached)
|
||||||
attachArrow();
|
attachArrow();
|
||||||
|
|
||||||
if (mAlpha != 1.f)
|
|
||||||
mResourceSystem->getSceneManager()->recreateShaders(mObjectRoot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -918,9 +915,6 @@ void NpcAnimation::showWeapons(bool showWeapon)
|
||||||
attachArrow();
|
attachArrow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Note: we will need to recreate shaders later if we use weapon sheathing anyway, so there is no point to update them here
|
|
||||||
if (mAlpha != 1.f && !mWeaponSheathing)
|
|
||||||
mResourceSystem->getSceneManager()->recreateShaders(mObjectRoot);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -932,10 +926,6 @@ void NpcAnimation::showWeapons(bool showWeapon)
|
||||||
|
|
||||||
updateHolsteredWeapon(!mShowWeapons);
|
updateHolsteredWeapon(!mShowWeapons);
|
||||||
updateQuiver();
|
updateQuiver();
|
||||||
|
|
||||||
// Recreate shaders for invisible actors, otherwise sheath nodes will be visible
|
|
||||||
if (mAlpha != 1.f && mWeaponSheathing)
|
|
||||||
mResourceSystem->getSceneManager()->recreateShaders(mObjectRoot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NpcAnimation::showCarriedLeft(bool show)
|
void NpcAnimation::showCarriedLeft(bool show)
|
||||||
|
@ -953,8 +943,6 @@ void NpcAnimation::showCarriedLeft(bool show)
|
||||||
if (iter->getTypeName() == typeid(ESM::Light).name() && mObjectParts[ESM::PRT_Shield])
|
if (iter->getTypeName() == typeid(ESM::Light).name() && mObjectParts[ESM::PRT_Shield])
|
||||||
addExtraLight(mObjectParts[ESM::PRT_Shield]->getNode()->asGroup(), iter->get<ESM::Light>()->mBase);
|
addExtraLight(mObjectParts[ESM::PRT_Shield]->getNode()->asGroup(), iter->get<ESM::Light>()->mBase);
|
||||||
}
|
}
|
||||||
if (mAlpha != 1.f)
|
|
||||||
mResourceSystem->getSceneManager()->recreateShaders(mObjectRoot);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
removeIndividualPart(ESM::PRT_Shield);
|
removeIndividualPart(ESM::PRT_Shield);
|
||||||
|
|
Loading…
Reference in a new issue