<div dir="ltr">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.<div><br></div><div>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.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 5, 2018 at 9:18 AM Andrea Martini <<a href="mailto:martini.andrea@gmail.com">martini.andrea@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Robert,<br>
thank you for your suggestion.<br>
After using of :  <br>
<br>
osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::Options::BUILD_KDTREES);<br>
<br>
and <br>
<br>
osgUtil::IntersectionVisitor iv(intersector.get());<br>
iv.setUseKdTreeWhenAvailable(true);<br>
<br>
intersector visitor performances are good again.<br>
<br>
Now, the code:<br>
<br>
subgraph->accept(iv);<br>
<br>
requires (in the same scenes yesterday described) only 0.01 ms. <br>
<br>
<br>
Thank you <br>
<br>
Cheers,<br>
Andrea<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=75279#75279" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=75279#75279</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div style="text-align:center">Chris 'Xenon' Hanson, omo sanza lettere. Xenon@AlphaPixel.com <a href="http://www.alphapixel.com/" target="_blank">http://www.alphapixel.com/</a></div><div style="text-align:center">Training • Consulting • Contracting</div><div style="text-align:center">3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL</div><div style="text-align:center"><span style="font-size:12.8000001907349px">Legal/IP •</span><span style="font-size:12.8000001907349px"> </span><span style="font-size:12.8000001907349px">Forensics •</span><span style="font-size:12.8000001907349px"> </span>Imaging <span style="font-size:12.8px">•</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">UAVs </span><span style="font-size:12.8px">• GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android</span></div><div style="text-align:center"><a href="https://twitter.com/alphapixel" target="_blank">@alphapixel</a> <a href="http://facebook.com/alphapixel" target="_blank">facebook.com/alphapixel</a> (775) 623-PIXL [7495]<br></div></div></div></div></div></div>