Put groundcover alphafunc where shader visitor can see it

I'd already made this change so don't know why it disappeared instead of
being included in b8ee32e3
pull/593/head
AnyOldName3 4 years ago
parent 46a1715d8a
commit f09b0fc1bd

@ -1,5 +1,6 @@
#include "groundcover.hpp"
#include <osg/AlphaFunc>
#include <osg/Geometry>
#include <osg/VertexAttribDivisor>
@ -265,6 +266,9 @@ namespace MWRender
group->addChild(node);
}
// Force a unified alpha handling instead of data from meshes
osg::ref_ptr<osg::AlphaFunc> alpha = new osg::AlphaFunc(osg::AlphaFunc::GEQUAL, 128.f / 255.f);
group->getOrCreateStateSet()->setAttributeAndModes(alpha.get(), osg::StateAttribute::ON);
group->getBound();
group->setNodeMask(Mask_Groundcover);
mSceneManager->recreateShaders(group, "groundcover", false, true);

@ -3,7 +3,6 @@
#include <limits>
#include <cstdlib>
#include <osg/AlphaFunc>
#include <osg/Light>
#include <osg/LightModel>
#include <osg/Fog>
@ -312,10 +311,6 @@ namespace MWRender
groundcoverRoot->setName("Groundcover Root");
sceneRoot->addChild(groundcoverRoot);
// Force a unified alpha handling instead of data from meshes
osg::ref_ptr<osg::AlphaFunc> alpha = new osg::AlphaFunc(osg::AlphaFunc::GEQUAL, 128.f/255.f);
groundcoverRoot->getOrCreateStateSet()->setAttributeAndModes(alpha.get(), osg::StateAttribute::ON);
mGroundcoverUpdater = new GroundcoverUpdater;
groundcoverRoot->addUpdateCallback(mGroundcoverUpdater);

Loading…
Cancel
Save