mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-25 20:41:29 +00:00
Handle multipass techniques in SetFilterSettingsVisitor
This commit is contained in:
parent
31988ca4cc
commit
71401aafe7
1 changed files with 18 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
#include <osg/Version>
|
#include <osg/Version>
|
||||||
|
|
||||||
#include <osgParticle/ParticleSystem>
|
#include <osgParticle/ParticleSystem>
|
||||||
|
#include <osgFX/Effect>
|
||||||
|
|
||||||
#include <osgUtil/IncrementalCompileOperation>
|
#include <osgUtil/IncrementalCompileOperation>
|
||||||
|
|
||||||
|
@ -153,12 +154,29 @@ namespace Resource
|
||||||
|
|
||||||
virtual void apply(osg::Node& node)
|
virtual void apply(osg::Node& node)
|
||||||
{
|
{
|
||||||
|
if (osgFX::Effect* effect = dynamic_cast<osgFX::Effect*>(&node))
|
||||||
|
apply(*effect);
|
||||||
|
|
||||||
osg::StateSet* stateset = node.getStateSet();
|
osg::StateSet* stateset = node.getStateSet();
|
||||||
if (stateset)
|
if (stateset)
|
||||||
apply(stateset);
|
apply(stateset);
|
||||||
|
|
||||||
traverse(node);
|
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)
|
virtual void apply(osg::Geode& geode)
|
||||||
{
|
{
|
||||||
osg::StateSet* stateset = geode.getStateSet();
|
osg::StateSet* stateset = geode.getStateSet();
|
||||||
|
|
Loading…
Reference in a new issue