mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
Don't use a shared Material in AlphaFader
This commit is contained in:
parent
16b8ef3164
commit
1f755a2bc0
@ -705,6 +705,13 @@ public:
|
||||
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)
|
||||
{
|
||||
osg::Material* mat = static_cast<osg::Material*>(stateset->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
|
Loading…
x
Reference in New Issue
Block a user