Revert "Disable LOD when rendering to the shadow map."

This reverts commit b95fb48a16.
This commit is contained in:
Frederic Bouvier 2012-04-02 19:50:50 +02:00
parent 2fed46e222
commit 95a9d7a229
2 changed files with 3 additions and 40 deletions

View File

@ -20,7 +20,6 @@
#include <osg/StateSet>
#include <osg/Texture2D>
#include <osg/LOD>
#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))

View File

@ -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<int,osg::ref_ptr<osg::Texture2D> > _bufferList;
std::vector<osg::ref_ptr<EffectGeode> > _lightList;
bool _ignoreLOD;
bool _collectLights;
};
}