mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 12:09:41 +00:00
Don't use a shared Material in AlphaFader
This commit is contained in:
parent
16b8ef3164
commit
1f755a2bc0
1 changed files with 7 additions and 0 deletions
|
@ -705,6 +705,13 @@ public:
|
||||||
mAlpha = alpha;
|
mAlpha = alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void setDefaults(osg::StateSet* stateset)
|
||||||
|
{
|
||||||
|
// need to create a deep copy of StateAttributes we will modify
|
||||||
|
osg::Material* mat = static_cast<osg::Material*>(stateset->getAttribute(osg::StateAttribute::MATERIAL));
|
||||||
|
stateset->setAttribute(osg::clone(mat, osg::CopyOp::DEEP_COPY_ALL), osg::StateAttribute::ON);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void apply(osg::StateSet* stateset, osg::NodeVisitor* nv)
|
virtual void apply(osg::StateSet* stateset, osg::NodeVisitor* nv)
|
||||||
{
|
{
|
||||||
osg::Material* mat = static_cast<osg::Material*>(stateset->getAttribute(osg::StateAttribute::MATERIAL));
|
osg::Material* mat = static_cast<osg::Material*>(stateset->getAttribute(osg::StateAttribute::MATERIAL));
|
||||||
|
|
Loading…
Reference in a new issue