Draft
Conversation
Contributor
1 similar comment
Contributor
…ones per wearable
…ustom spring bone component
80ae356 to
b5b815c
Compare
# 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BONE_COUNT = 62withBASE_BONE_COUNT = 62andMAX_BONE_COUNT = 256to support variable bone counts per avatarBoneArrayaccept variable-length bone arrays within the valid rangeAvatarTransformMatrixJobWrapper— automatically resizes when an avatar with more bones joinsboneCountthrough the entire compute skinning pipeline:Initialize()→SetupCounters()→SetupBuffers()→CopyAllBuffers()→ComputeSkinning()BoneCountinAvatarCustomSkinningComponentand useboneStridefrom the job wrapper for correct GPU buffer offsetsContext
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
BONE_COUNTconstantAttachmentAssetUtilityfix is in place🤖 Generated with Claude Code