From: Tim Moore Date: Mon, 14 Dec 2009 05:52:00 +0000 (+0100) Subject: don't render an EffectGeode if there is no valid technique X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=59fc902cfbd3d4532c52373feacbcecb76739309;p=simgear.git 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. --- diff --git a/simgear/scene/material/EffectCullVisitor.cxx b/simgear/scene/material/EffectCullVisitor.cxx index 62952a9f..efac70b7 100644 --- a/simgear/scene/material/EffectCullVisitor.cxx +++ b/simgear/scene/material/EffectCullVisitor.cxx @@ -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();