don't render an EffectGeode if there is no valid technique

Normal geometry has a default effect; geometry with no default effect
is unlikely to look correct with no state set applied. This fixes the
problem of clouds being displayed as multi-colored rectangles when
shader effects are turned off.
This commit is contained in:
Tim Moore 2009-12-14 06:52:00 +01:00
parent e37c218c2a
commit 59fc902cfb

View File

@ -56,9 +56,11 @@ void EffectCullVisitor::apply(osg::Geode& node)
}
Effect* effect = eg->getEffect();
Technique* technique = 0;
if (!(effect && (technique = effect->chooseTechnique(&getRenderInfo())))) {
if (!effect) {
CullVisitor::apply(node);
return;
} else if (!(technique = effect->chooseTechnique(&getRenderInfo()))) {
return;
}
// push the node's state.
osg::StateSet* node_state = node.getStateSet();