diff --git a/spine-ts/spine-construct3/spine-construct3-lib/src/AssetLoader.ts b/spine-ts/spine-construct3/spine-construct3-lib/src/AssetLoader.ts index 6439cdce2..12f52abb0 100644 --- a/spine-ts/spine-construct3/spine-construct3-lib/src/AssetLoader.ts +++ b/spine-ts/spine-construct3/spine-construct3-lib/src/AssetLoader.ts @@ -217,7 +217,6 @@ export class AssetLoader { static async createImageBitmapFromBlob (blob: Blob, pma: boolean): Promise { try { - // pma parameters seems to do not matter here. It matters in C3 Texture creation return createImageBitmap(blob, { premultiplyAlpha: pma ? "none" : "premultiply" }); } catch (e) { console.error("Failed to create ImageBitmap from blob:", e); diff --git a/spine-ts/spine-construct3/src/c3runtime/instance.ts b/spine-ts/spine-construct3/src/c3runtime/instance.ts index 0cc03330d..c933eecb7 100644 --- a/spine-ts/spine-construct3/src/c3runtime/instance.ts +++ b/spine-ts/spine-construct3/src/c3runtime/instance.ts @@ -184,13 +184,14 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase { vertices[dstIndex + 1] = y; vertices[dstIndex + 2] = 0; - // there's something wrong with the hand after adding the colors on spineboy portal animation const color = colors[i]; const colorDst = i * 4; - c3colors[colorDst] = (color >>> 16 & 0xFF) * inv255; - c3colors[colorDst + 1] = (color >>> 8 & 0xFF) * inv255; - c3colors[colorDst + 2] = (color & 0xFF) * inv255; - c3colors[colorDst + 3] = (color >>> 24 & 0xFF) * inv255 * this.opacity; + const alpha = (color >>> 24 & 0xFF) * inv255 * this.opacity; + const alphaInverse = inv255 * alpha; + c3colors[colorDst] = (color >>> 16 & 0xFF) * alphaInverse; + c3colors[colorDst + 1] = (color >>> 8 & 0xFF) * alphaInverse; + c3colors[colorDst + 2] = (color & 0xFF) * alphaInverse; + c3colors[colorDst + 3] = alpha; } renderer.setTexture(command.texture.texture);