From aee3a570c2582296b770f9160f28493626796f3d Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Sun, 19 Nov 2023 18:33:20 +0900 Subject: [PATCH] Skeleton: Compute a small texture dimension (#27211) --- src/objects/Skeleton.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objects/Skeleton.js b/src/objects/Skeleton.js index 865a03975cacdf..23abe42b09be41 100644 --- a/src/objects/Skeleton.js +++ b/src/objects/Skeleton.js @@ -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