mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 14:45:39 +00:00
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
This commit is contained in:
parent
46a1715d8a
commit
f09b0fc1bd
2 changed files with 4 additions and 5 deletions
|
@ -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…
Reference in a new issue