Can I use Optix(or maybe non-Optix) acceleration structures to query “closest point on a mesh to specified position” or “closest N points in kd-tree to specified position” ?
The RTX hardware is really designed for ray-surface intersection queries. If you think of that as an intersection primitive, you can build other types of queries out of it by being clever and/or combining multiple ray queries. This paper is an example of using ray queries in OptiX to build KNN queries: https://arxiv.org/pdf/2201.01366.pdf As you can see, it’s a bit complicated, and it might not end up being the most direct or efficient way to do KNN queries. At the moment, it’s more of an interesting research problem and novelty to hack the RT cores for other purposes than line intersections. If you only want an approximate answer quickly, and not an exact answer, then that might be a good reason & approach for adapting RT cores to the approximate-closest-point problems. Otherwise, using a more direct data structure for KNN queries or closest point on mesh queries using general CUDA might be a more practical way to go for now. Here’s an example paper on using CUDA for KNN queries: https://readingxtra.github.io/docs/ml-gpu/practical-knn-gpu.pdf
Thank you, David.
Great food for thought.