Skip to content

Commit

Permalink
Skeleton: Compute a small texture dimension (#27211)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson authored Nov 19, 2023
1 parent 0582b00 commit aee3a57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/objects/Skeleton.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class Skeleton {
// 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)

let size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix
size = MathUtils.ceilPowerOfTwo( size );
size = Math.ceil( size / 4 ) * 4;
size = Math.max( size, 4 );

const boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel
Expand Down

0 comments on commit aee3a57

Please sign in to comment.