-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
animationAll things related to animationsAll things related to animationsenhancementNew feature or requestNew feature or requestlambda-rsIssues pertaining to the core frameworkIssues pertaining to the core framework
Description
Overview
Add GPU-based mesh skinning that deforms vertex positions based on bone
transforms for rendering animated characters.
Current State
No response
Scope
Goals:
- Vertex shader skinning
- Support up to 4 bone influences per vertex
- Skin matrix uniform buffer
- Integrate with existing pipeline system
Non-Goals:
- CPU skinning
- Morph targets/blend shapes
- Dual quaternion skinning
Proposed API
ub struct SkinnedMesh {
mesh: Mesh,
joint_indices: Vec<[u8; 4]>, // per-vertex bone indices
joint_weights: Vec<[f32; 4]>, // per-vertex bone weights
}
pub struct SkinningData {
matrices: Vec<[[f32; 4]; 4]>, // MAX_BONES matrices
}
impl SkinningData {
pub fn from_pose(pose: &Pose, skeleton: &Skeleton) -> Self;
pub fn to_buffer(&self) -> Vec;
}
// Vertex shader receives joint_indices and joint_weights as attributes
// Uniform buffer contains skin matrices
### Acceptance Criteria
- [ ] Skinned mesh deforms with bone movement
- [ ] Multiple bone influences blend correctly
- [ ] Skin matrices uploaded each frame
- [ ] Shader correctly transforms vertices
- [ ] Example rendering animated character
### Affected Crates
lambda-rs
### Notes
- MAX_BONES typically 64-256
- Joint indices packed as u8 or u16
- Weight normalization (should sum to 1.0)
Metadata
Metadata
Assignees
Labels
animationAll things related to animationsAll things related to animationsenhancementNew feature or requestNew feature or requestlambda-rsIssues pertaining to the core frameworkIssues pertaining to the core framework