From 95a9d7a2298d16bfb8bf26bc36b699fbc30589a0 Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Mon, 2 Apr 2012 19:50:50 +0200 Subject: [PATCH] Revert "Disable LOD when rendering to the shadow map." This reverts commit b95fb48a162fcdea8ec1384c265dc799001c8bac. --- simgear/scene/material/EffectCullVisitor.cxx | 38 ++------------------ simgear/scene/material/EffectCullVisitor.hxx | 5 +-- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/simgear/scene/material/EffectCullVisitor.cxx b/simgear/scene/material/EffectCullVisitor.cxx index 8f7637c9..c44d8d69 100644 --- a/simgear/scene/material/EffectCullVisitor.cxx +++ b/simgear/scene/material/EffectCullVisitor.cxx @@ -20,7 +20,6 @@ #include #include -#include #include "EffectCullVisitor.hxx" @@ -35,23 +34,14 @@ namespace simgear using osgUtil::CullVisitor; -EffectCullVisitor::EffectCullVisitor() : - _ignoreLOD(false), - _collectLights(false) -{ -} - -EffectCullVisitor::EffectCullVisitor(bool ignoreLOD, bool collectLights) : - _ignoreLOD(ignoreLOD), +EffectCullVisitor::EffectCullVisitor(bool collectLights) : _collectLights(collectLights) { } EffectCullVisitor::EffectCullVisitor(const EffectCullVisitor& rhs) : osg::Referenced(rhs), - CullVisitor(rhs), - _ignoreLOD(rhs._ignoreLOD), - _collectLights(rhs._collectLights) + CullVisitor(rhs) { } @@ -60,30 +50,6 @@ CullVisitor* EffectCullVisitor::clone() const return new EffectCullVisitor(*this); } -void EffectCullVisitor::apply(osg::LOD& node) -{ - if (_ignoreLOD) { - if (isCulled(node)) return; - - // push the culling mode. - pushCurrentMask(); - - // push the node's state. - osg::StateSet* node_state = node.getStateSet(); - if (node_state) pushStateSet(node_state); - - if (_traversalMode==TRAVERSE_PARENTS) node.osg::Group::ascend(*this); - else if (_traversalMode!=TRAVERSE_NONE) node.osg::Group::traverse(*this); - // pop the node's state off the render graph stack. - if (node_state) popStateSet(); - - // pop the culling mode. - popCurrentMask(); - } - else - CullVisitor::apply(node); -} - void EffectCullVisitor::apply(osg::Geode& node) { if (isCulled(node)) diff --git a/simgear/scene/material/EffectCullVisitor.hxx b/simgear/scene/material/EffectCullVisitor.hxx index 341dfb02..c4d3c630 100644 --- a/simgear/scene/material/EffectCullVisitor.hxx +++ b/simgear/scene/material/EffectCullVisitor.hxx @@ -33,12 +33,10 @@ class EffectGeode; class EffectCullVisitor : public osgUtil::CullVisitor { public: - EffectCullVisitor(); - EffectCullVisitor(bool ignoreLOD, bool collectLights = false); + EffectCullVisitor(bool collectLights = false); EffectCullVisitor(const EffectCullVisitor&); virtual osgUtil::CullVisitor* clone() const; using osgUtil::CullVisitor::apply; - virtual void apply(osg::LOD& node); virtual void apply(osg::Geode& node); virtual void reset(); @@ -49,7 +47,6 @@ public: private: std::map > _bufferList; std::vector > _lightList; - bool _ignoreLOD; bool _collectLights; }; } -- 2.39.5