This is a forum thread about building and using BVH(Bounding Volume Hierarchy) in OCCT.

jianbaoxia

CAD master
I recently read some articles about constructing BVH and can't wait to implement it myself.
In lesson 17 on Quoar, I found the code for constructing BVH and calculating the intersection points of rays and triangles using the BVH_PrimitiveSet class in OCCT. This is exactly the code I want to learn.
I understand the "ModelBvh" class in general, but I want to learn specifically about how the OCCT BVH_BinnedBuilder is implemented in the next step. I encountered some difficulties when reading the "MeshDist" class, mainly because I'm not familiar with the algorithm used in it. It's difficult for me to understand the algorithm principles by reading the code. So I would like to ask what algorithm is used in it. I want to understand the algorithm first and then learn how to implement the code. Are there any related books, literature, or posts that I can refer to?
I found that although OCCT has implemented BVH, there is very little information available on the topic. I hope to discuss and learn about this area with those who share the same interest.
 

jianbaoxia

CAD master
I found a paper of the creater of "BVH_BinnedBuilder" Denis BOGOLEPOV, it's about SAH BVH, share with you.
 

Attachments

  • [J_11](OCCT_BVH)Real-Time SAH BVH Construction for Ray Tracing Dynamic Scenes.pdf
    214.7 KB · Views: 8

jianbaoxia

CAD master
I find the Möller Trumbore Algorithm to get the intersect point bettwen ray and triangle.
But I'm still curious about what algorithm is used in MeshDist::intersectTriangle() on lesson 17, but I lack relevant knowledge to determine it. o_O
1680597179062.png
 

Quaoar

Administrator
Staff member
Denis Bogolepov is exactly the author of BVH implementation in OpenCascade, and you're referring to the right paper (well, to the right author). He has got PhD in ray tracing, and his implementation of BVH is performant and accurate, although it's indeed quite hard to comprehend as it usually happens with highly optimized code.
 

calciffer

Active CAD practitioner
I recently read some articles about constructing BVH and can't wait to implement it myself.
In lesson 17 on Quoar, I found the code for constructing BVH and calculating the intersection points of rays and triangles using the BVH_PrimitiveSet class in OCCT. This is exactly the code I want to learn.
I understand the "ModelBvh" class in general, but I want to learn specifically about how the OCCT BVH_BinnedBuilder is implemented in the next step. I encountered some difficulties when reading the "MeshDist" class, mainly because I'm not familiar with the algorithm used in it. It's difficult for me to understand the algorithm principles by reading the code. So I would like to ask what algorithm is used in it. I want to understand the algorithm first and then learn how to implement the code. Are there any related books, literature, or posts that I can refer to?
I found that although OCCT has implemented BVH, there is very little information available on the topic. I hope to discuss and learn about this area with those who share the same interest.
https://blog.csdn.net/weixin_441766...og-2~default~CTRLIST~default-4.no_search_link

There is a link of both normal BVH and SAH BVH used for ray tracing.
And in In lesson 17 on Quoar, for each point that generates three random rays, the majority rule applies. If there is an even number of intersections between the rays and the box, the point is considered to be outside the box.
 
Top