mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-15 07:17:46 -04:00
don't pingpong depth function on character preview update
This commit is contained in:
parent
6360bdc859
commit
a6c7fcd436
@ -132,6 +132,12 @@ namespace MWRender
|
|||||||
newStateSet->addUniform(mNoAlphaUniform);
|
newStateSet->addUniform(mNoAlphaUniform);
|
||||||
}
|
}
|
||||||
if (SceneUtil::getReverseZ() && stateset->getAttribute(osg::StateAttribute::DEPTH))
|
if (SceneUtil::getReverseZ() && stateset->getAttribute(osg::StateAttribute::DEPTH))
|
||||||
|
{
|
||||||
|
bool depthModified = false;
|
||||||
|
osg::Depth* depth = static_cast<osg::Depth*>(stateset->getAttribute(osg::StateAttribute::DEPTH));
|
||||||
|
depth->getUserValue("depthModified", depthModified);
|
||||||
|
|
||||||
|
if (!depthModified)
|
||||||
{
|
{
|
||||||
if (!newStateSet)
|
if (!newStateSet)
|
||||||
{
|
{
|
||||||
@ -139,8 +145,8 @@ namespace MWRender
|
|||||||
node.setStateSet(newStateSet);
|
node.setStateSet(newStateSet);
|
||||||
}
|
}
|
||||||
// Setup standard depth ranges
|
// Setup standard depth ranges
|
||||||
osg::Depth* depth = static_cast<osg::Depth*>(stateset->getAttribute(osg::StateAttribute::DEPTH));
|
|
||||||
osg::ref_ptr<osg::Depth> newDepth = new osg::Depth(*depth);
|
osg::ref_ptr<osg::Depth> newDepth = new osg::Depth(*depth);
|
||||||
|
|
||||||
switch (newDepth->getFunction())
|
switch (newDepth->getFunction())
|
||||||
{
|
{
|
||||||
case osg::Depth::LESS:
|
case osg::Depth::LESS:
|
||||||
@ -159,6 +165,8 @@ namespace MWRender
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
newStateSet->setAttribute(newDepth, osg::StateAttribute::ON);
|
newStateSet->setAttribute(newDepth, osg::StateAttribute::ON);
|
||||||
|
newDepth->setUserValue("depthModified", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
traverse(node);
|
traverse(node);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user