[osg-users] osgUtil::IntersectionVisitor slow with huge geometry
Gianni Ambrosio
g.ambrosio+osg at gmail.com
Tue Jul 18 07:50:31 PDT 2017
Just an update.
OSG KdTree works great!
Computational time for "camera->accept(intersectionVisitor)":
before it was about 10M microseconds
with KdTree it is about 25 microseconds!
This is the code I modified in my example:
Code:
osg::Node* createScene() {
osg::Geode* geode = new osg::Geode;
osg::KdTree* kdtree = new osg::KdTree;
osg::Geometry* geometry = buildGeometry();
osg::KdTree::BuildOptions buildOptions;
kdtree->build(buildOptions, geometry);
geometry->setShape(kdtree);
geode->addDrawable(geometry);
return geode;
}
Gianni
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71284#71284
More information about the osg-users
mailing list