PDA

View Full Version : Optimized ray intersection algorithm



debonair
05-18-2016, 11:02 PM
i am implementing ray intersection algorithm in my project, basically i want to get the list of all objects intersected by the ray and list will be sorted according to distance. I have hundreds of objects and i will be doing this per frame. What algorithm or data structure I should look for to get faster result? Even if I use bounding boxes for this calculation, my application is CPU bound.

__bob__
05-19-2016, 03:05 AM
i am implementing ray intersection algorithm in my project, basically i want to get the list of all objects intersected by the ray and list will be sorted according to distance. I have hundreds of objects and i will be doing this per frame. What algorithm or data structure I should look for to get faster result? Even if I use bounding boxes for this calculation, my application is CPU bound.

Are all of your objects meshes (triangles only)?. In this case, you should use an octree or a KD-tree.