Make shadows disableable.

pull/1547/head
AnyOldName3 7 years ago
parent 0f1e770c53
commit 76f23c28b1

@ -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;

@ -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;
};
}

Loading…
Cancel
Save