Skip to content

feat: spring bones#7582

Draft
daniele-dcl wants to merge 16 commits intodevfrom
feat/spring-bones
Draft

feat: spring bones#7582
daniele-dcl wants to merge 16 commits intodevfrom
feat/spring-bones

Conversation

@daniele-dcl
Copy link
Contributor

Summary

  • Replace hardcoded BONE_COUNT = 62 with BASE_BONE_COUNT = 62 and MAX_BONE_COUNT = 256 to support variable bone counts per avatar
  • Make BoneArray accept variable-length bone arrays within the valid range
  • Implement dynamic bone stride in AvatarTransformMatrixJobWrapper — automatically resizes when an avatar with more bones joins
  • Thread boneCount through the entire compute skinning pipeline: Initialize()SetupCounters()SetupBuffers()CopyAllBuffers()ComputeSkinning()
  • Store per-avatar BoneCount in AvatarCustomSkinningComponent and use boneStride from the job wrapper for correct GPU buffer offsets

Context

The avatar compute skinning pipeline hardcoded BONE_COUNT = 62 (the standard Decentraland skeleton). Spring bones (via UniVRM) add extra bones to wearables. This PR makes the bone count variable per avatar so wearables with spring bones can be skinned through the same GPU pipeline.

The approach uses a max-stride shared across all avatars in the parallel job array. When a new avatar exceeds the current stride, the buffers are reallocated and all avatars skip one frame (invisible stale pose). Most avatars still have 62 bones so wasted slots are minimal.

Prerequisite (not in this PR): AttachmentAssetUtility.RemoveBonesGameObjects() currently destroys all child GameObjects without a Renderer, which would delete spring bone transforms. That must be addressed separately.

Test plan

  • Project compiles with no references to deleted BONE_COUNT constant
  • All existing avatar instantiation tests pass (standard 62-bone path unchanged)
  • Manual test: equip a standard avatar → verify skinning renders correctly (regression)
  • Future: equip wearable with spring bones once AttachmentAssetUtility fix is in place

🤖 Generated with Claude Code

@daniele-dcl daniele-dcl added the shape-up It has been shaped and is awaiting the cycle. label Mar 16, 2026
@daniele-dcl daniele-dcl self-assigned this Mar 16, 2026
@github-actions
Copy link
Contributor

badge

New build in progress, come back later!

1 similar comment
@github-actions
Copy link
Contributor

badge

New build in progress, come back later!

# Conflicts:
#	Explorer/Assets/DCL/AvatarRendering/AvatarShape/Components/AvatarTransformMatrixJobWrapper.cs
#	Explorer/Assets/DCL/AvatarRendering/AvatarShape/ComputeShader/BoneMatrixCalculationJob.cs
#	Explorer/Assets/DCL/AvatarRendering/AvatarShape/Systems/AvatarInstantiatorSystem.cs
#	Explorer/Assets/DCL/AvatarRendering/AvatarShape/Systems/FinishAvatarMatricesCalculationSystem.cs
#	Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef
@daniele-dcl daniele-dcl reopened this Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shape-up It has been shaped and is awaiting the cycle.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant