Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualBacterius

Posted 02 December 2012 - 05:56 AM

Hello,
I want to improve my path tracer by being able to add, remove, move and rotate meshes in real time (to add interactive physics). The geometry of the mesh will never be modified. But it would seem that every time I do any of those operations, I need to rebuild the BVH, which takes time and is annoying.

I was wondering if I could somehow avoid this by computing an intermediate BVH for every mesh (in object space, so it would be constant), and rotate the BVH (or the ray) using the mesh's object-to-world matrix for BVH traversal? And I could also then combine those multiple different BVH's into a single one somehow by translating and rotating the bounding boxes. This would cut down the cost of mesh manipulation to essentially zero, but it sounds too good to be true - can it be done?

Again, I only care about insertion, deletion, translation and rotation of meshes. I will not modify the geometry in any way, so I think this could be a sufficient condition for this optimization, since after all, each triangle in the mesh will be translated and rotated equally, so the bounding boxes will be too.

Thanks!

#1Bacterius

Posted 02 December 2012 - 05:55 AM

Hello,
I want to improve my path tracer by being able to add, remove, move and rotate meshes in real time (to add interactive physics). The geometry of the mesh will never be modified. But it would seem that every time I do any of those operations, I need to rebuild the BVH, which takes time and is annoying.

I was wondering if I could somehow avoid this by computing an intermediate BVH for every mesh (in object space, so it would be constant), and rotate the BVH (or the ray) using the mesh's object-to-world matrix for BVH traversal? And I could also then combine those multiple different BVH's into a single one somehow by translating and rotating the bounding boxes. This would cut down the cost of mesh manipulation to essentially zero, but it sounds too good to be true - can it be done?

Again, I only care about insertion, deletion, translation and rotation of meshes. I will not modify the geometry in any way.

PARTNERS