#include "Effect.hxx"
#include "Technique.hxx"
+#include <scene\util\RenderConstants.hxx>
+
namespace simgear
{
using osgUtil::CullVisitor;
-EffectCullVisitor::EffectCullVisitor()
+EffectCullVisitor::EffectCullVisitor(bool collectLights) :
+ _collectLights(collectLights)
{
}
CullVisitor::apply(node);
return;
}
+ if (_collectLights && ( eg->getNodeMask() & MODELLIGHT_BIT ) ) {
+ _lightList.push_back( eg );
+ }
Effect* effect = eg->getEffect();
Technique* technique = 0;
if (!effect) {
}
+void EffectCullVisitor::reset()
+{
+ _lightList.clear();
+
+ osgUtil::CullVisitor::reset();
+}
+
void EffectCullVisitor::clearBufferList()
{
_bufferList.clear();
namespace simgear
{
+class EffectGeode;
class EffectCullVisitor : public osgUtil::CullVisitor
{
public:
- EffectCullVisitor();
+ EffectCullVisitor(bool collectLights = false);
EffectCullVisitor(const EffectCullVisitor&);
virtual osgUtil::CullVisitor* clone() const;
using osgUtil::CullVisitor::apply;
virtual void apply(osg::Geode& node);
+ virtual void reset();
void clearBufferList();
void addBuffer(int i, osg::Texture2D* tex);
private:
std::map<int,osg::ref_ptr<osg::Texture2D> > _bufferList;
+ std::vector<osg::ref_ptr<EffectGeode> > _lightList;
+ bool _collectLights;
};
}
#endif