Added setName("TileContent") on the subgraphs that represent the contents
of the tiles, this name is then searched for during the TileMapper pre cull traversal to help cut short traversals, and thereby improve its performance.
This commit is contained in:
@@ -66,6 +66,8 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::readNode(const std::string& fil
|
||||
return ReadResult::ERROR_IN_READING_FILE;
|
||||
|
||||
osg::ref_ptr<osg::Node> tileContent = getTileContent(info,x,y,lod,archive);
|
||||
|
||||
tileContent->setName("TileContent");
|
||||
|
||||
int numLods = archive->getNumLODs();
|
||||
if (lod < (numLods-1))
|
||||
@@ -124,6 +126,8 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::readNode(const std::string& fil
|
||||
|
||||
osg::ref_ptr<osg::Node> tileContent = getTileContent(info,tileX,tileY,tileLOD,archive);
|
||||
|
||||
tileContent->setName("TileContent");
|
||||
|
||||
if (tileLOD < (numLods-1))
|
||||
{
|
||||
char pagedLODfile[1024];
|
||||
|
||||
@@ -44,6 +44,12 @@ float TileMapper::getDistanceFromEyePoint(const osg::Vec3& pos, bool withLODScal
|
||||
|
||||
void TileMapper::apply(osg::Node& node)
|
||||
{
|
||||
if (node.getName()=="TileContent")
|
||||
{
|
||||
_containsGeode = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isCulled(node)) return;
|
||||
|
||||
// push the culling mode.
|
||||
@@ -57,6 +63,12 @@ void TileMapper::apply(osg::Node& node)
|
||||
|
||||
void TileMapper::apply(osg::Group& node)
|
||||
{
|
||||
if (node.getName()=="TileContent")
|
||||
{
|
||||
_containsGeode = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isCulled(node)) return;
|
||||
|
||||
// push the culling mode.
|
||||
@@ -348,7 +360,7 @@ void TileMapper::checkValidityOfAllVisibleTiles()
|
||||
|
||||
} while (!toRemoveList.empty());
|
||||
|
||||
if (!_blackListedNodeSet.empty()) std::cout<<"********** We have blacked list "<<_blackListedNodeSet.size()<<std::endl;
|
||||
// if (!_blackListedNodeSet.empty()) std::cout<<"********** We have blacked list "<<_blackListedNodeSet.size()<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user