The shadow frustum is not automatically updated with the skeleton animation

Hello, Babylon.js forum

When I have a skeleton model , the frustum position is not automatically updated with the skeleton animation.

Is that normal?or just because the model skeleton stucture is not valid?

And when I rotate the camera, the mesh will be cutted
image

You can manually refresh the boundingBox or give the generator a larger range value.
pg: https://playground.babylonjs.com/#Y5IZCF#81

1 Like

As @musk said, mesh.refreshBoundingInfo(true,true) is one way to recompute the bounding box each frame, but it’s a bit taxing on performance because it must calculate the animation on the CPU. Another way is to set a bounding box manually, which is big enough to encompass the whole animation.

3 Likes

@musk @Evgeni_Popov I tried the second way, give it large bouding box and it works!!!

But the mesh will be cutted when I zoom in the camera and rotate camera, Is there any way to solve this?

This is because of the camera’s frustum culling. You can mark meshes not to be culled.
pg:https://playground.babylonjs.com/#Y5IZCF#84

1 Like

Thank you very much for your reply, it really helped me a lot

1 Like

Or you can set the enlarged bounding box on all meshes, not only on the first:

2 Likes