Handle multipass techniques in SetFilterSettingsVisitor

coverity_scan
scrawl 9 years ago
parent 31988ca4cc
commit 71401aafe7

@ -6,6 +6,7 @@
#include <osg/Version>
#include <osgParticle/ParticleSystem>
#include <osgFX/Effect>
#include <osgUtil/IncrementalCompileOperation>
@ -153,12 +154,29 @@ namespace Resource
virtual void apply(osg::Node& node)
{
if (osgFX::Effect* effect = dynamic_cast<osgFX::Effect*>(&node))
apply(*effect);
osg::StateSet* stateset = node.getStateSet();
if (stateset)
apply(stateset);
traverse(node);
}
void apply(osgFX::Effect& effect)
{
for (int i =0; i<effect.getNumTechniques(); ++i)
{
osgFX::Technique* tech = effect.getTechnique(i);
for (int pass=0; pass<tech->getNumPasses(); ++pass)
{
if (tech->getPassStateSet(pass))
apply(tech->getPassStateSet(pass));
}
}
}
virtual void apply(osg::Geode& geode)
{
osg::StateSet* stateset = geode.getStateSet();

Loading…
Cancel
Save