SkinnedMesh Not supported with more than 256 bone index
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
`0.12.0`
## What you did
I imported a model with over 600 bones, but some of the bones were bound incorrectly. After investigation, it was found that all bone indexes greater than or equal to 256 cannot be move.
`Mesh::ATTRIBUTE_JOINT_INDEX` claim that it uses `Uint16x4` but does not support more than 256 bones.
## What went wrong
The bone matrix seems to be stored in a uniform buffer and hard coded to 256, which I believe is the root cause of the problem.
`bevy_pbr-0.12.0\src\render\mesh_types.wgsl`
```
struct SkinnedMesh {
data: array, 256u>,
};
```
## Additional information
The buffer is truncated before it is passed in, simply changing the length in the shader will cause panic. I am currently learning this engine, so I have not yet located where the truncation occurs.
Contributor guide
Assessment
This issue has not been assessed yet.