1
\$\begingroup\$

Should an object in a 3D-engine use different bounding volumes for collision-detection (broad-phase) and culling?

Basically class renderBounds and class physBounds versus class boundingVolume?

Each of this classes then could either contain the same type of volumes (AABB's, kDOP's, sphere's etc.) or a special fitting one for the particular object.

(note: without considering of using an external physics engine)

\$\endgroup\$
1
\$\begingroup\$

Usually I see AABB used for broadphase in a collision detection. For culling I usually see a depth buffer + frustum culling.

You can cull entire models from the frustum by computing an OBB of the model in model space. This can be transformed to world space and quickly tested against the frustum. Alternatively the frustum can be transformed to model space and tested against a model space OBB, or even model space AABB.

Whatever you do, it won't be worth the time unless you're cutting off the top portion of N in a large O( N^2 ) loop, or you're playing nice with the cache. Maybe it is for these reasons many people only do triangle to frustum checks, or let the driver do screen space culling.

\$\endgroup\$
0
\$\begingroup\$

A lot dependa on what an 'object' is and how complex its topology is. Consider a character model with 16 bones. Each bone has a physics volume used for hit detection in an fps. But when you render the object all you care about is the player. In this case thr physics representation is complex but visibility is a sphere-v-frustum which is cheap ans rotationally invariant. A tank with articulatef parts is the same. The key to effectice culling is to make sure the cpu cost of culling is cheaper than the cpu costs of drawing plus the gpu costs of drawing. Spend too much time culling and you lose. Often the AABB of an entity in the broadphase works as long as it is not a complex object - there is a one to one relationship between the physics entity and a draw call.

One additional thought is that sometimes you wany to use some kind of hierarchical structure to accelerate culling. In this case the broadphase aabb would need to be inserted into this structure or the frustum ia tested against the broadphase for overlaps. Finally some things have no physics such as particle systems ao you will want your culling system to support those things as well. Hope that helps.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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