|
|
> put simply it's a fast way of finding what objects occupy a given region of
> 3d space irregardless of the origin and direction of the ray being shot. each
> leaf node of a tree represents a particular (possibly overlapping) volume and
> contains a list of all objects that potentially occupy that volume (in terms
> of their bounding boxes).
>
> so, if we have a start and end point of a ray, and then determine which nodes
> the ray crosses through, we have available a list of all objects that it can
> possibly intersect. as a general rule, the fewer objects per node the better,
> though there would be a point where the time taken to iterate a deep tree may
> exceed the time taken to test the bounds of each of the objects in a higher-
> level node with multiple objects.
So is traversing a BSP tree faster than testing a ray against some
arbitrary bounding box then? Because at the moment, I'm having
difficulty seeing how dividing space into smaller and smaller "halves"
is drastically different from just having bounding boxes inside bounding
boxes...
If you have some insane isosurface object, it's going to take forever to
trace it no matter what bounding algorithm you use. As I see it, there
are two main cases where bounding makes things faster:
* You have some object that's slow to do intersection tests on, but
doesn't take up much of the scene (i.e., you ought to be able to skip
the intersection test for most rays)
* You have millions of tiny objects. (Most rays will only hit a few of
them, but testing them all would take forever. A good bounding algorithm
would skip most of these tests.)
As I understand it, the BVH intersection algorithm goes something like this:
+ Test the ray against the top-level BBs. (Hopefully there are few of
those.)
+ If any are intersected, test the ray against the BBs they contain.
Recurse until actual object surfaces are tested. Keep all intersections
found.
Presumably, the BSP algorithm would go
+ Test ray against the left and right halfs of the top-level box.
+ If either is hit, recurse into sub-boxes (as with BVH).
I'm clearly missing something, because those two don't look
significantly different. (Obviously, the performance of each is going to
depend on how well the algorithm that builds the bounding structure does
its job.)
Post a reply to this message
|
|