Index: OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/GeometryRecords.cpp
===================================================================
--- OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/GeometryRecords.cpp (revision 9041)
+++ OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/GeometryRecords.cpp (revision 10084)
@@ -24,6 +24,4 @@
 #include <osg/Texture2D>
 #include <osg/CullFace>
-#include <osg/PolygonOffset>
-#include <osg/Depth>
 #include <osg/BlendFunc>
 #include <osgUtil/TransformAttributeFunctor>
@@ -384,25 +382,9 @@
         if (document.subfaceLevel() > 0)
         {
-            static osg::ref_ptr<osg::PolygonOffset> polygonOffset = new osg::PolygonOffset(-10.0f, -40.0f);
-            stateset->setAttributeAndModes(polygonOffset.get(), osg::StateAttribute::ON);
-
-            static osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LESS, 0.0, 1.0,false);
-            stateset->setAttribute(depth.get());
+            stateset->setAttributeAndModes(document.getSubSurfacePolygonOffset(document.subfaceLevel()), osg::StateAttribute::ON);
+            stateset->setAttribute(document.getSubSurfaceDepth());
 
             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<osg::StateSet> lastStateset;
-        if (lastStateset.valid() && (stateset->compare(*lastStateset,false)==0))
-            stateset = lastStateset;
-        else
-            lastStateset = stateset;
-#endif
 
         _geode->setStateSet(stateset.get());
@@ -953,25 +935,9 @@
         if (document.subfaceLevel() > 0)
         {
-            static osg::ref_ptr<osg::PolygonOffset> polygonOffset = new osg::PolygonOffset(-10.0f, -40.0f);
-            stateset->setAttributeAndModes(polygonOffset.get(), osg::StateAttribute::ON);
-
-            static osg::ref_ptr<osg::Depth> depth = new osg::Depth(osg::Depth::LESS, 0.0, 1.0,false);
-            stateset->setAttribute(depth.get());
+            stateset->setAttributeAndModes(document.getSubSurfacePolygonOffset(document.subfaceLevel()), osg::StateAttribute::ON);
+            stateset->setAttribute(document.getSubSurfaceDepth());
 
             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<osg::StateSet> lastStateset;
-        if (lastStateset.valid() && (stateset->compare(*lastStateset,false)==0))
-            stateset = lastStateset;
-        else
-            lastStateset = stateset;
-#endif
 
         _geode->setStateSet(stateset.get());
