The chunked stuff is no longer needed for the ground tiles.

... 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
This commit is contained in:
frohlich
2009-03-14 11:08:43 +00:00
committed by Tim Moore
parent 0e35168bdb
commit 679db5a22b

View 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;
}