Frustum issue on skinning mesh


I’ve got an issue when using animated skinned mesh and some parts of it is disappeared when zooming in due to frustum, i.e. if mesh is not animated it is standing (T-position), but when animated it is sitting… so when Orbitcontrol/camera is zoomed in to mesh from some angle to that mesh above it head is disappeared on sitting model due to frustum is calculated on standing static mesh and head is out of frustum in this case but model is sitting and head should be visible due to it is in frustum field. Is there a way to avoid this head disappearance without setting frustumCulled to false for that skinned mesh due to it can be painful for performance in case of many sitting models ?

Thanks in advance!

You can either make the boundingSphere and boundingBox on your models geometry larger or compute the bounding box+sphere per frame from all bones + some padding for a more accurate result if the animations cause heavy variations in how much space the mesh takes to enclose.

Usually just a increased bounding sphere should fix the problem good enough without extra computations for an accurate bounding sphere.

Also try to visualize the bounding sphere first by attaching a sphere with the dimensions from boundingSphere, making sure it isn’t just displaced, to see what’s going on and to try finding a better enclosing size.

1 Like

Thank you a lot!!! Work like a charm!!! :slight_smile:

p.s. I’ve reduced boundingSphere and Box of a mesh geometry by multiplyScalar(0.3) in my case it was enough