BVH instances support : approaches

Practical and theoretical implementation discussion.
spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

BVH instances support : approaches

Post by spectral » Thu Aug 29, 2013 1:29 pm

Hi,

What are the different techniques used for supporting instances in BVH ? Is there any paper somewhere about this ? (Mainly on the GPU !)

Thanks

graphicsMan
Posts: 167
Joined: Mon Nov 28, 2011 7:28 pm

Re: BVH instances support : approaches

Post by graphicsMan » Thu Aug 29, 2013 3:36 pm

I haven't been able to find a good source on this. I looked pretty extensively. Mostly I think people do the dumb obvious thing, which is to build BVHs over the mesh for the instances and then build a BVH of those.

I'd love to see research on good heuristics for instancing...

ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

Re: BVH instances support : approaches

Post by ingenious » Fri Aug 30, 2013 9:30 am

Ingo Wald's publications from the early 2000's discuss instancing for kd-trees, which is fairly straightforward to extend to BVHs.

@graphicsMan: What do you mean by heuristics for instancing?

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: BVH instances support : approaches

Post by spectral » Fri Aug 30, 2013 10:28 am

ingenious wrote:Ingo Wald's publications from the early 2000's discuss instancing for kd-trees, which is fairly straightforward to extend to BVHs.
Thanks, do you remember which one ?

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: BVH instances support : approaches

Post by spectral » Fri Aug 30, 2013 10:54 am

I have only find this one : http://gruenschloss.org/msbvh/msbvh.pdf

graphicsMan
Posts: 167
Joined: Mon Nov 28, 2011 7:28 pm

Re: BVH instances support : approaches

Post by graphicsMan » Fri Aug 30, 2013 4:49 pm

Hey. What I mean is this:

Let's say you have a dozen instances of a chair, and they are simply sitting on the ground in a room. Their bounding boxes do not overlap. The traditional way of instancing is great, and there will be practically no slowdown from building the acceleration structure over the triangle soup instead.

However, if you have a more complex scene where the chairs are stacked (like lawn chairs stack), all of their bounding boxes will overlap, and the resulting BVH will be really bad. An example for this that is not at all far fetched would be something like a bunch of nested bowls in a kitchen scene.

By heuristics, I mean is there a way to determine when to use basic dumb instancing, and when to build over their triangle soup instead. Maybe there are even more options that involve partial instances, etc... A good way to do these things has not been proposed so far as I know. If this has been looked at, please post a reference.

jbikker
Posts: 225
Joined: Mon Nov 28, 2011 8:18 am
Contact:

Re: BVH instances support : approaches

Post by jbikker » Fri Aug 30, 2013 10:23 pm

I use a scheme (not in Brigade2, but some experimental tech) where the top-level BVH is 'abused' for instancing: the leafs of the top-level BVH contain subtree indices. At the point where traversal proceeds from top-level BVH traversal to subtree traversal, a matrix is loaded. This allows for very efficient rigid motion as well as instancing. Of course this does not solve the overlap problem.

graphicsMan
Posts: 167
Joined: Mon Nov 28, 2011 7:28 pm

Re: BVH instances support : approaches

Post by graphicsMan » Fri Aug 30, 2013 10:37 pm

I think that's pretty close to the usual approach I mentioned before. I think a lot of people use it, and it probably makes for very fast build times.

I'm much more concerned with render time than build time because I may be tracing up to 100s of billions of rays for the lifetime of a single acceleration structure; however, when trees start getting super huge due to instancing, both the build time and the amount of memory required to run the scene do become a significant concern.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: BVH instances support : approaches

Post by spectral » Fri Sep 06, 2013 9:24 am

Me too... it is just surprising to find "nothing" when today we try to render so much hair, grass and other kind of instances...

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: BVH instances support : approaches

Post by spectral » Wed Sep 11, 2013 8:55 am

I use a SBVH (with spatial splitting to improve the traversal performance) and to support instancing I only see 2 methods:

1) Multiples BVH/SBVH
Create 2 BVH, a top-level tree that contains and handle all the instance (pointing to other trees) and several sub BVH, one per object/instance.
It seems to me that it will degrade to performance because on the top-level tree I cannot do spatial split !!

It will degrade the performance mainly when I have a lot of objects and a few instances only.

2) One main tree
Create one SBVH, where each instance is a leaf that contains a simple bounding box, for such leave I will not do any spatial-splitting.
The main problem is that the Instance-Leaf will contains an object_id and I should be able to traverse the tree only for this object_id.
But is it possible to do with a SBVH where we have a list of triangle (with duplicates etc...), they are not ordered by object, so it seems I
have to traverse the whole scene... and it will be expensive ?

Or do you have another idea / opinion ?

Thx

Post Reply