Skip to content

SkinnedMesh culling is wrong and PointLightShadow gets clipped for SkinnedMesh #11991

Description

@gogiii
Description of the problem

Not sure if this is the same bug or two different.

  1. Whenever SkinnedMesh origin is out of camera frustum, the mesh gets culled even if its actual transformed geometry must be visible on the screen.
    Seems like the bounding box used for clipping is not updated with animation.

  2. Same happens for shadows.
    When the SkinnedMesh moves away from its origin in light space, its shadow gets clipped/partially clipped by pointlight's perspectivecamera (I guess).

Here's an example in jsfiddle:
https://jsfiddle.net/vtb6z50j/
Sorry for inline json. The example was dependent of viewport dimensions. Fixed.

And its not light.shadow.camera.far, light.shadow.radius bug.
Actually the use case for this was to make a complete animation in any 3d editor (blender in my case) just to play it as is in three.js. So the character isn't moved by mesh.position, there is no need to sync movement/animation and hardcode movement positions.
It just plays baked animation!

Update: yes, making frustumCulled = false does fix both problems (which is enough for me to continue),
but most engines update object bbox with root motion/transforms.
Update2: actual temporary fix #11991 (comment)

Three.js version
  • r87
  • r85
Browser
  • Firefox
OS
  • Windows
Hardware Requirements (graphics card, VR Device, ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions