]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/EffectCullVisitor.cxx
Improved tile cache priority scheme.
[simgear.git] / simgear / scene / material / EffectCullVisitor.cxx
index dec2b1bdef69c388d78da3f349d658eb009c815d..efac70b7e7809f6c808798a29ab12f8023e68464 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+#ifdef HAVE_CONFIG_H
+#  include <simgear_config.h>
+#endif
+
 #include <osg/StateSet>
 
 #include "EffectCullVisitor.hxx"
@@ -50,10 +54,13 @@ void EffectCullVisitor::apply(osg::Geode& node)
         CullVisitor::apply(node);
         return;
     }
-    Technique* technique = eg->getEffect()->chooseTechnique(&getRenderInfo());
-    if (!technique) {
+    Effect* effect = eg->getEffect();
+    Technique* technique = 0;
+    if (!effect) {
         CullVisitor::apply(node);
         return;
+    } else if (!(technique = effect->chooseTechnique(&getRenderInfo()))) {
+        return;
     }
     // push the node's state.
     osg::StateSet* node_state = node.getStateSet();