简体   繁体   中英

View frustum culling for animated meshes

I implemented frustum culling in my system, it tests the frustum planes on every object's bounding sphere, and it works great. (I find the PlaneVsAabb check unneeded)

However, the bounding sphere of the mesh is adjusted for its bind pose, so when the mesh starts moving (eg the player attacks with his sword) some vertices could go out of the sphere.

This often results in a mesh getting culled, although there are some vertices that should be rendered (eg the player's sword that went out of the sphere).

I could think of two possible solutions for this:

  1. For every mesh in every frame, calculate its new bounding sphere based on bone changes. (I have no idea how to start with this...) Could this be too inefficient?

  2. Add a fixed offset for every sphere radius (based on the entire mesh size maybe?), so there could be no chance of the mesh getting culled even when animated.

(1) would be inefficient in real-time yes. However you can do a mixture of both, by computing the largest possible bounding sphere statically ie when you load it. Using that in (2) would guarantee a better result than some arbitrary offset you make up.

(1) You can add locators to key elements (eg dummy bone on the tip of the sword) and transform their origin while animating. You can done it on CPU on each update and then calculate bounding box or bounding sphere. Or you can precompute bounding volumes for each frame of animation offline. Doom3 uses second approach.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM