Speed up strategies for ray casting using vtkOBBTree?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Speed up strategies for ray casting using vtkOBBTree?

BBerco
This post was updated on .
Dear all,
I'm working on some ray casting applications with the help of vtkOBBTree. This class does a fine job as it is easy to use and does exactly what I want, but I was wondering if I could speed up the ray-casting process when large data sets are involved.

I am dealing with ray-tracing from a LIDAR focal plane comprised of 128 x 128 elements to a target potentially comprised of hundreds of thousands of vertices (833538 in my example). Illuminating it with each of the 128 x 128 = 16384 pixels in the focal plane takes more than 15 minutes (as my timer is still running!). Obviously this is a computationally intensive problem, but I was wondering if there were some alternative strategies that could speed up the process.

Specifically, because I am casting each ray by going through the focal plane rows by rows, the facet hit by the ray corresponding to pixel [i,j] should be pretty close  to the facet hit by the ray coming from pixel[i,j+1] (if not the same). So here's my first question: is their a way to restrict the ray-facet intersect search to the neighbors of a given facet? This way, only the very first pixel of the focal plane would require a global search through the vtkOBBTree: the rest of the intersects could be searched inside the neighbors of the impacted cells (and not inside the complete shape).

I guess I could somehow implement manually, but i'd rather not reinvent the wheel.

Besides this idea, is there any ray casting strategy using built-in VTK features more adapted to large datasets ?

Thanks!

Ben






Reply | Threaded
Open this post in threaded view
|

Re: Speed up strategies for ray casting using vtkOBBTree?

David Doria-2-3
On Fri, Nov 4, 2016 at 10:27 AM, BBerco <[hidden email]> wrote:
Dear all,
I'm working on some ray casting applications with the help of vtkOBBTree.
This class does a fine job as it is easy to use and does exactly what I
want, but I was wondering if I could speed up the ray-casting process when
large data sets are involved.

I am dealing with ray-tracing from a LIDAR focal plane comprised of 128 x
128 elements to a target potentially comprised of hundreds of thousands of
vertices (833538 in my example). Illuminating it with each of the 128 x 128
= 16384 pixels in the focal plane takes more than 15 minutes (as my timer is
still running!). Obviously this is a computationally intensive problem, but
I was wondering if there were some alternative strategies that could speed
up the process.

Specifically, because I am casting each ray by going through the focal plane
rows by rows, the facet hit by the ray corresponding to pixel [i,j] should
be pretty close  to the facet hit by the ray coming from pixel[i,j+1] (if
not the same). So here's my first question: is their a way to restrict the
ray-facet intersect search to the neighbors of a given facet? This way, only
the very first pixel of the focal plane would require a global search
through the vtkOBBTree: the rest of the intersects could be searched inside
the neighbors of the impacted cells (and not inside the complete shape).

I guess I could somehow implement manually, but i'd rather not reinvent the
wheel.

Besides this idea, if there any ray casting strategy using built-in VTK
features more adapted to large datasets such as those I am dealing with?

Thanks!

Ben

If you're intersecting rays with meshes, try vtkModifiedBSPTree - it is (or at least used to be) much faster.


David 

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Speed up strategies for ray casting using vtkOBBTree?

BBerco
This post was updated on .
David,

huge improvement indeed, thanks!

I am going to try to implement the method I mentioned earlier. I'm pretty sure I can get an even faster process by only retaining cells neighbouring the one impacted by the first ray.

Ben