Skinned mesh bounds are too small during animation (only track rootBone, not joint deformation)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 18/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- computer-graphics
Direzione di ricerca
Start from the load-time bounds code that PR #3027 changed and from the SkinnedMeshRenderer path that moves the cached box with rootBone. Decide first between an editor-side bake of animation-covering bounds and an opt-in runtime recompute, because the issue lists both without choosing. Done means an opt-in path that covers animated poses, with the current rootBone-space box as the fallback when no baked bounds exist.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
The local bounds of a SkinnedMeshRenderer are computed once at load time from mesh.bounds (the bind-pose POSITION AABB) and only follow the rootBone transform at runtime. This is correct and tight for the bind pose, but the bounding box does not track the deformation produced by the other joints during animation.
When an animation moves a joint far from its bind pose — large rotation, translation, or especially scale — the skinned vertices move outside the cached bounds, while the bounds stay frozen in the bind-pose shape. The box becomes too small and the renderer can be incorrectly frustum-culled (the character is on screen but disappears) or mis-picked.
Verified with a minimal repro: a mesh bound to a single joint, bind pose bounds [-1, 1]. After scaling that joint by 50 at runtime, the real skinned vertices reach [-50, 50], but renderer.bounds stays at [-1, 1] — 50x too small.
Note this is not a bug in the load-time computation (PR #3027 made the bind-pose bounds correct, including the case where rootBone is outside skin.joints). It is an inherent limitation of approximating the whole skinned mesh by a single rootBone-rigid box. Conformant bind-pose bounds are exact; the gap is purely the runtime/animated case.
Describe the solution you'd like
A way to make skinned bounds cover the animated range, opt-in so the default O(1) path is unaffected. Since we have an editor with an import/bake stage, the cleanest option is to bake an expanded local bounds offline (covering the mesh's animation poses) into the asset, and read it at runtime with no extra per-frame cost.
Describe alternatives you've considered
- Runtime per-frame recompute (opt-in flag): iterate skinned vertices each frame to produce an exact AABB. Most accurate, but O(vertices) per frame — only worth enabling for meshes that genuinely need it.
- Manual bounds extension: let the asset/author specify a positive/negative margin to inflate the bind-pose box enough to contain extreme poses. Cheapest, but the margin must be chosen by hand.
Additional context
- The accurate-but-expensive direction (covering animation) requires traversing skinned vertices — there is no cheap "look at bones only" estimate that is both tight and never-too-small, because the AABB is not preserved under the per-vertex skinning transform.
- Baking only the bind pose has no benefit for conformant assets: at bind pose
joint.world · IBM = I, so the skinned shape equalsmesh.boundsand a bind-pose bake reproduces the current result exactly. The value is specifically in covering animation poses. - Suggested scope: editor-side bake of an animation-covering local bounds, with the runtime falling back to the current rootBone-space box when no baked bounds are present.
Related: #3027 (load-time skin rootBone bounds fix — this issue is the follow-up runtime-accuracy work).
- Lingua principale
- TypeScript
- Stelle
- 5.9k
- Fork
- 413
- Merge medio
- 16h 17m
- PR unite (30g)
- 41
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di galacean/engine
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
-
RFC: Adopt Unity-style Collider components and hierarchical Rigidbody ownershipForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
I maintainer di solito rispondono entro 1 giorno
-
SkinnedMeshRenderer should derive default rootBone-space localBounds from mesh and skinForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di galacean/engine
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
redhat-developer/rhdh-plugin-export-overlays#4794 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
area: plugins documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
CatVinci-Studio/Textus#727 ·
I maintainer di solito rispondono entro 1 giorno