diff --git a/components/sceneutil/shadow.cpp b/components/sceneutil/shadow.cpp index a4079d1a00..21a0de89a3 100644 --- a/components/sceneutil/shadow.cpp +++ b/components/sceneutil/shadow.cpp @@ -321,6 +321,12 @@ namespace SceneUtil void MWShadow::cull(osgUtil::CullVisitor& cv) { + if (!enableShadows) + { + _shadowedScene->osg::Group::traverse(cv); + return; + } + OSG_INFO << std::endl << std::endl << "ViewDependentShadowMap::cull(osg::CullVisitor&" << &cv << ")" << std::endl; if (!_shadowCastingStateSet) diff --git a/components/sceneutil/shadow.hpp b/components/sceneutil/shadow.hpp index aa8085f0df..3c665bac79 100644 --- a/components/sceneutil/shadow.hpp +++ b/components/sceneutil/shadow.hpp @@ -11,7 +11,7 @@ namespace SceneUtil { public: static const int numberOfShadowMapsPerLight = 3; - static const int enableShadows = true; + static const bool enableShadows = true; static const bool debugHud = true; MWShadow();