[osg-users] osgUtil::LineSegmentIntersector performance issues

Chris Hanson xenon at alphapixel.com
Wed Dec 5 06:22:39 PST 2018


Do you only need drawable-level discrimination? You can spend a lot of
effort intersection testing each polygon on the CPU. You can also offload a
lot of the work onto the GPU, but OSG doesn't do this for you. If you only
need the ray hit closest to the Eye, you can also use a variant of Picking
-- set a 1x1 pixel viewport around the ray frustum and shovel the geometry
through the rasterizer to record which fragment is closest. With various
techniques you can assign fragment IDs on whatever granularity (Drawable,
polygon, or something else) you wish. This can be quite quick because the
GPU is optimized to do this and you can rasterize to an FBO.

Maybe explain better what you are trying to ACCOMPLISH, rather than just
the current technique you are trying to use to accomplish it. Many times
people don't even know the right question to ask to get the best solution.

On Wed, Dec 5, 2018 at 9:18 AM Andrea Martini <martini.andrea at gmail.com>
wrote:

> Hi Robert,
> thank you for your suggestion.
> After using of :
>
>
> osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::Options::BUILD_KDTREES);
>
> and
>
> osgUtil::IntersectionVisitor iv(intersector.get());
> iv.setUseKdTreeWhenAvailable(true);
>
> intersector visitor performances are good again.
>
> Now, the code:
>
> subgraph->accept(iv);
>
> requires (in the same scenes yesterday described) only 0.01 ms.
>
>
> Thank you
>
> Cheers,
> Andrea
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=75279#75279
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
Chris 'Xenon' Hanson, omo sanza lettere. Xenon at AlphaPixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20181205/1d6c094e/attachment.html>


More information about the osg-users mailing list