From 01593240ed1ff2a96caaf8a503e1c4783c0be200 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 21 Oct 2008 15:51:56 +0000 Subject: [PATCH] #if'd out an premature StateSet optimization that was causing problems with datasets that mixed multi-texture coord geometry with single texture coord geometries in a single scene graph. --- src/osgPlugins/OpenFlight/GeometryRecords.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/osgPlugins/OpenFlight/GeometryRecords.cpp b/src/osgPlugins/OpenFlight/GeometryRecords.cpp index b63f7c60c..055a15f13 100644 --- a/src/osgPlugins/OpenFlight/GeometryRecords.cpp +++ b/src/osgPlugins/OpenFlight/GeometryRecords.cpp @@ -392,12 +392,18 @@ protected: stateset->setRenderBinDetails(document.subfaceLevel(),"RenderBin"); } +#if 0 +// note from Robert Osfield, this "optimization" breaks multi-textured datasets that mix single texture +// and mulit-texture geometries as the Multitexture parsing can come after the below code, and accidentally +// polute the non multi-texture geometries StateSet. + // A simple share stateset optimization. static osg::ref_ptr lastStateset; if (lastStateset.valid() && (stateset->compare(*lastStateset,false)==0)) stateset = lastStateset; else lastStateset = stateset; +#endif _geode->setStateSet(stateset.get()); @@ -955,12 +961,18 @@ protected: stateset->setRenderBinDetails(document.subfaceLevel(),"RenderBin"); } +#if 0 +// note from Robert Osfield, this "optimization" breaks multi-textured datasets that mix single texture +// and mulit-texture geometries as the Multitexture parsing can come after the below code, and accidentally +// polute the non multi-texture geometries StateSet. + // A simple share stateset optimization. static osg::ref_ptr lastStateset; if (lastStateset.valid() && (stateset->compare(*lastStateset,false)==0)) stateset = lastStateset; else lastStateset = stateset; +#endif _geode->setStateSet(stateset.get());