Added support for occluders occluding other occluders, which helps reduce

the number of occluder that will be used in cull traversal to only the
ones that will be effective. Note. Holes in occluders arn't handled in
this occluder occlusion test, will implement this later.
This commit is contained in:
Robert Osfield
2002-06-18 22:35:48 +00:00
parent aa58ecae2f
commit 5e85cd59ab
6 changed files with 99 additions and 31 deletions

View File

@@ -341,9 +341,14 @@ void SceneView::cullStage(osg::Matrix* projection,osg::Matrix* modelview,osgUtil
cov.popProjectionMatrix();
cov.popViewport();
//std::cout << "finished searching for occluder"<<std::endl;
// sort the occluder from largest occluder volume to smallest.
cov.removeOccludedOccluders();
cullVisitor->setOccluderList(cov.getCollectedOccluderList());
//std::cout << "finished searching for occluder"<<std::endl;
cullVisitor->getOccluderList().clear();
std::copy(cov.getCollectedOccluderSet().begin(),cov.getCollectedOccluderSet().end(), std::back_insert_iterator<CullStack::OccluderList>(cullVisitor->getOccluderList()));
}