1
$\begingroup$

I'm not a computer graphics engineer. I'm more of a quality engineer (primary language is C++). I've just started learning by myself about acceleration structures in computer graphics, especially Binary Space Partitioning (BSP) vs. Bounding Volume Hierarchy (BVH).

I understand that a BSP kind of has a built-in visibility culling algorithm thanks to the way it's built. For example, given a node X in a BSP tree, all nodes in X's left subtree are in front of X, and all nodes in X's right subtree are behind X. On the other hand, a BVH is like an AABB tree whose nodes represent the hierarchical bounding boxes of objects. Unlike BSP, a BVH needs an explicit visibility culling algorithm.

After building a BSP/BVH for objects in a 3D scene, if I change the camera's position (by rotating the scene, for example), I feel like for rendering the updated scene, the BVH won't need to be rebuilt because the bounding boxes remain relatively unchanged. We'll just need to run the explicit visibility culling algorithm on it again with the new viewpoint. The BSP will need to be rebuilt though because the front/back of a node in the BSP is now different with the new viewpoint. Am I understanding it correctly? Thank you in advance!

$\endgroup$

1 Answer 1

0
$\begingroup$

you don't need to build the tree again! Even when you translate / rotate / scale the object. The trick is to use a transformation matrix for the object. When you want to check, if e.g. a ray is hitting your object, you only need to transform the ray to the object space by multiplying the ray with the inverse transformation matrix.

So the ray will be transformed relative to the objects position / rotation / scale. The tree always stays the same.

Same for a plain test or frustum test.

The tree only needs to be updated, when the mesh is deformed. (e.g. softbodies)

$\endgroup$
2
  • $\begingroup$ It is useful to have a bounding sphere around the object as well. So when the ray hits the sphere, you can transform the ray into the object space and perform the tree search $\endgroup$
    – Thomas
    Sep 21 at 10:05
  • $\begingroup$ "The tree only needs to be updated": or when there are several objects and motion. $\endgroup$
    – user1703
    Sep 21 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.