bevyengine / bevyengine/bevy

SkinnedMesh Not supported with more than 256 bone index

Open
#10,522 5 comments 0 reactions 0 assignees View on GitHub
A-Animation A-Rendering C-Feature
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.