mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 21:06:39 +00:00
Don't make a new osg::depth to alpha tested node
This commit is contained in:
parent
96f02ab32c
commit
ec0b36d21d
1 changed files with 0 additions and 9 deletions
|
@ -244,13 +244,10 @@ namespace Resource
|
|||
|
||||
void apply(osg::Node& node) override
|
||||
{
|
||||
bool osgDepthCreated(false);
|
||||
|
||||
if (node.getOrCreateStateSet()->getRenderingHint() == osg::StateSet::TRANSPARENT_BIN)
|
||||
{
|
||||
osg::ref_ptr<osg::Depth> depth = SceneUtil::createDepth();
|
||||
depth->setWriteMask(false);
|
||||
osgDepthCreated = true;
|
||||
|
||||
node.getOrCreateStateSet()->setAttributeAndModes(depth, osg::StateAttribute::ON);
|
||||
}
|
||||
|
@ -278,12 +275,6 @@ namespace Resource
|
|||
{
|
||||
if (descriptionParts.at(0) == "alphatest")
|
||||
{
|
||||
if (!osgDepthCreated)
|
||||
{
|
||||
osg::ref_ptr<osg::Depth> depth = SceneUtil::createDepth();
|
||||
node.getOrCreateStateSet()->setAttributeAndModes(depth, osg::StateAttribute::ON);
|
||||
}
|
||||
|
||||
osg::AlphaFunc::ComparisonFunction mode = getTestMode(descriptionParts.at(1));
|
||||
osg::ref_ptr<osg::AlphaFunc> alphaFunc (new osg::AlphaFunc(mode, std::stod(descriptionParts.at(2))));
|
||||
node.getOrCreateStateSet()->setAttributeAndModes(alphaFunc, osg::StateAttribute::ON);
|
||||
|
|
Loading…
Reference in a new issue