Simple C / C ++ Library for Triangle Intersection Acceleration Patterns

I am raytracing and would like to speed it up with some kind of acceleration structure (kd-tree, BVH, whatever). I do not want to code this myself. What I have tried so far:

  • Removes a kd tree from pbrt. There are so many dependencies that I could not achieve this without pulling all pbrt into my code.

  • CGAL AABB tree. Disappointingly, this seems to return only the intersection point. Not knowing which triangle the point originated from, I cannot effectively interpolate the color above the triangle. I would just like to expand the concept of “dot” with color, but this is not possible without writing a lot of template code from scratch.

  • Writing your own. Ok, so I wrote my own grid acceleration class, and it works, but it's nasty and inefficient.

So, if anyone can suggest a simple library that I can use for this purpose, I would really appreciate it! All I need to do is get the soup and triangle triangle, find the nearest intersection and return the index of this triangle.

+3
source share
2 answers

Jaco Bikker wrote this series of tutorials: http://www.devmaster.net/articles/raytracing_series/part7.php

They are very useful, and it includes the code at the end for the ray tracer using the kd tree.

You may be able to use this.

+1

G3D . , . Tree .

0

Source: https://habr.com/ru/post/1751014/


All Articles