]> git.mxchange.org Git - simgear.git/commitdiff
The chunked stuff is no longer needed for the ground tiles.
authorfrohlich <frohlich>
Sat, 14 Mar 2009 11:08:43 +0000 (11:08 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 18 Mar 2009 06:53:50 +0000 (07:53 +0100)
... I (Mathias Froehlich), believe that it is more performant (for the GPU) to
build the biggest indexed sets possible at the expense of tight culling.
I (Mathias Froehlich) also know that the CPU is more performant on smaller chunks
building the old flat groundcache on such tiles. :)
So this code *was* to balance these two contrary requirements to some degree.

Now we have optimized datastructures for drawing and differently optimized
datastructures for intersection tests.

Modified Files:
simgear/scene/tgdb/obj.cxx

simgear/scene/tgdb/obj.cxx

index d5964815e1bcd588016a42c58952fc2380e28776..ebcb3167cc8a78acb643cbc9280c83e7f8b0c710 100644 (file)
@@ -368,32 +368,11 @@ struct SGTileGeometryBin {
     osg::Geode* geode = new osg::Geode;
     SGMaterialTriangleMap::const_iterator i;
     for (i = materialTriangleMap.begin(); i != materialTriangleMap.end(); ++i) {
-      // CHUNCKED (sic) here splits up unconnected triangles parts of
-      // the mesh into different Geometry sets, presumably for better
-      // culling. I (timoore) believe it is more performant to build
-      // the biggest indexed sets possible at the expense of tight
-      // culling.
-//#define CHUNCKED
-#ifdef CHUNCKED
-      SGMaterial *mat = matlib->find(i->first);
-
-      std::list<SGTexturedTriangleBin::TriangleVector> connectSets;
-      i->second.getConnectedSets(connectSets);
-
-      std::list<SGTexturedTriangleBin::TriangleVector>::iterator j;
-      for (j = connectSets.begin(); j != connectSets.end(); ++j) {
-        osg::Geometry* geometry = i->second.buildGeometry(*j);
-        if (mat)
-          geometry->setStateSet(mat->get_state());
-        geode->addDrawable(geometry);
-      }
-#else
       osg::Geometry* geometry = i->second.buildGeometry();
       SGMaterial *mat = matlib->find(i->first);
       if (mat)
         geometry->setStateSet(mat->get_state());
       geode->addDrawable(geometry);
-#endif
     }
     return geode;
   }