[osg-users] Update Optimization

John Burgess john.burgess at rocketmail.com
Tue Jul 15 03:33:05 PDT 2008

Hi Robert,
Thanks for the advice, after using KdTree and LineSegmentIntersector, my update traversal rate reduce from 700ms to 60ms.

----- Original Message ----
From: Robert Osfield <robert.osfield at gmail.com>
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Sent: Tuesday, July 15, 2008 5:33:35 PM
Subject: Re: [osg-users] Update Optimization

Hi John,

On Tue, Jul 15, 2008 at 2:48 AM, John Burgess
<john.burgess at rocketmail.com> wrote:
> I've tried the KdTree but my update traversal rate is still the same as
> before. Below is my code snippet to enable KdTree, am I doing the right
> thing?
> osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Options::BUILD_KDTREES);
> // Load the terrain
> osg::Node* _terrain = osgDB::readNodeFile(terrainFile);

You have to use osgUtil::IntersectionVisitor + LineSegmentIntersector
to take advantage of the new KdTree intersections, the old (and
deprecated) osgUtil::IntersectVisitor does not support KdTree

osg-users mailing list
osg-users at lists.openscenegraph.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080715/fe27a23c/attachment-0003.htm>

More information about the osg-users mailing list