From 59fc902cfbd3d4532c52373feacbcecb76739309 Mon Sep 17 00:00:00 2001
From: Tim Moore <timoore@redhat.com>
Date: Mon, 14 Dec 2009 06:52:00 +0100
Subject: [PATCH] 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.
---
 simgear/scene/material/EffectCullVisitor.cxx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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();
-- 
2.39.5