1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Make shadows disableable.

This commit is contained in:
AnyOldName3 2018-02-26 16:25:44 +00:00
parent 0f1e770c53
commit 76f23c28b1
2 changed files with 18 additions and 2 deletions

View File

@ -745,6 +745,16 @@ void MWShadowTechnique::cleanSceneGraph()
OSG_INFO<<"MWShadowTechnique::cleanSceneGraph()"<<std::endl;
}
void MWShadowTechnique::enableShadows()
{
_enableShadows = true;
}
void MWShadowTechnique::enableShadows()
{
_enableShadows = false;
}
MWShadowTechnique::ViewDependentData* MWShadowTechnique::createViewDependentData(osgUtil::CullVisitor* /*cv*/)
{
return new ViewDependentData(this);
@ -769,11 +779,11 @@ void MWShadowTechnique::update(osg::NodeVisitor& nv)
void MWShadowTechnique::cull(osgUtil::CullVisitor& cv)
{
/* TODO: if (!enableShadows)
if (!_enableShadows)
{
_shadowedScene->osg::Group::traverse(cv);
return;
}*/
}
OSG_INFO<<std::endl<<std::endl<<"MWShadowTechnique::cull(osg::CullVisitor&"<<&cv<<")"<<std::endl;

View File

@ -61,6 +61,10 @@ namespace SceneUtil {
/** Clean scene graph from any shadow technique specific nodes, state and drawables.*/
virtual void cleanSceneGraph();
virtual void enableShadows();
virtual void disableShadows();
class ComputeLightSpaceBounds : public osg::NodeVisitor, public osg::CullStack
{
public:
@ -221,6 +225,8 @@ namespace SceneUtil {
mutable OpenThreads::Mutex _accessUniformsAndProgramMutex;
Uniforms _uniforms;
osg::ref_ptr<osg::Program> _program;
bool _enableShadows;
};
}