Frustum object AABB culling support

In the BGE there’s too many problems with frustum culling in case like:

  • replaced mesh
  • deformed mesh
  • skinned mesh
  • physics shape re-instanced (including soft body)

To solve it we can recompute the AABB in these same case, it will avoid culling error but for skinned or soft body object which are deformed each frame and recompute its AABB each frame too, it can spend too much time.
So to solve this we can implement a predefined AABB in the UI side which take the AABB of an other mesh, and in the python side expose to the user the AABB.

So in the UI 3 options will be added :

  • ignore activity culling (already half implemented) avoid culling for drastic case
  • update AABB : don’t update AABB, corresponding to the old behavior
  • predefined AABB (mesh) : mesh used as AABB, disable if ‘update AABB’ is enabled

In the python side:

  • KX_GameObject.cullingAabbMax/Min : the AABB r/w
  • ignoreActivityCulling : r/w
  • updateAabb : r/w
  • synchronizeAabbs() : recompute the object AABB, can be use to undo cullingAabbMax/Min

So the question is : it can be interesting or i’m in the wrong way ?

is a ‘precompute’ for deforming actions and armatures possible?
(calculate a table for all possible poses?)

have it kick in when its computed?

then FK action physics shapes could be animated right?

having the ability to disable culling,

and recompute the AABB would be very handy.

It sounds like pretty good idea! If it would be complete, I would be very happy!:slight_smile: