diff --git a/spine-ts/spine-phaser-v3/example/inline-loading.html b/spine-ts/spine-phaser-v3/example/inline-loading.html index 1e3c7fa17..c57e440ab 100644 --- a/spine-ts/spine-phaser-v3/example/inline-loading.html +++ b/spine-ts/spine-phaser-v3/example/inline-loading.html @@ -93,7 +93,7 @@ class BasicExample extends Phaser.Scene { async preload() { // manually add the text atlas to the game cache - this.game.cache.text.add(this.atlasKey, { data: atlasString, premultipliedAlpha: true }); + this.game.cache.text.add(this.atlasKey, atlasString); // manually add the json skeleton to the game cache this.game.cache.json.add("spineboy-data", skeletonJson); diff --git a/spine-ts/spine-phaser-v3/src/index.ts b/spine-ts/spine-phaser-v3/src/index.ts index 3ad594624..0db576eb0 100644 --- a/spine-ts/spine-phaser-v3/src/index.ts +++ b/spine-ts/spine-phaser-v3/src/index.ts @@ -48,7 +48,7 @@ declare global { export interface LoaderPlugin { spineJson (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; spineBinary (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; - spineAtlas (key: string, url: string, premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; + spineAtlas (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; } } diff --git a/spine-ts/spine-phaser-v4/example/inline-loading.html b/spine-ts/spine-phaser-v4/example/inline-loading.html index a9c1bca49..43e5a3790 100644 --- a/spine-ts/spine-phaser-v4/example/inline-loading.html +++ b/spine-ts/spine-phaser-v4/example/inline-loading.html @@ -93,7 +93,7 @@ class BasicExample extends Phaser.Scene { async preload() { // manually add the text atlas to the game cache - this.game.cache.text.add(this.atlasKey, { data: atlasString, premultipliedAlpha: true }); + this.game.cache.text.add(this.atlasKey, atlasString); // manually add the json skeleton to the game cache this.game.cache.json.add("spineboy-data", skeletonJson); diff --git a/spine-ts/spine-phaser-v4/src/index.ts b/spine-ts/spine-phaser-v4/src/index.ts index 3ad594624..0db576eb0 100644 --- a/spine-ts/spine-phaser-v4/src/index.ts +++ b/spine-ts/spine-phaser-v4/src/index.ts @@ -48,7 +48,7 @@ declare global { export interface LoaderPlugin { spineJson (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; spineBinary (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; - spineAtlas (key: string, url: string, premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; + spineAtlas (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; } } diff --git a/spine-ts/spine-pixi-v7/src/Spine.ts b/spine-ts/spine-pixi-v7/src/Spine.ts index eded67945..9a3cb4ec2 100644 --- a/spine-ts/spine-pixi-v7/src/Spine.ts +++ b/spine-ts/spine-pixi-v7/src/Spine.ts @@ -671,7 +671,6 @@ export class Spine extends Container { const skeletonColor = skeleton.color; const slotColor = pose.color; const alpha = skeletonColor.a * slotColor.a * attachmentColor.a; - // cannot premultiply the colors because the default mesh renderer already does that this.lightColor.set( skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, diff --git a/spine-ts/spine-player/example/dispose.html b/spine-ts/spine-player/example/dispose.html index 67c4d8168..397c90866 100644 --- a/spine-ts/spine-player/example/dispose.html +++ b/spine-ts/spine-player/example/dispose.html @@ -27,7 +27,6 @@ skeleton: "/assets/spineboy-pro.skel", atlas: "/assets/spineboy-pma.atlas", animation: "run", - premultipliedAlpha: true, backgroundColor: "#cccccc", viewport: { debugRender: true, diff --git a/spine-ts/spine-player/example/editor.html b/spine-ts/spine-player/example/editor.html index 670975f76..12d273ce9 100644 --- a/spine-ts/spine-player/example/editor.html +++ b/spine-ts/spine-player/example/editor.html @@ -15,7 +15,7 @@ diff --git a/spine-ts/spine-webgl/example/drag-and-drop.js b/spine-ts/spine-webgl/example/drag-and-drop.js index 393b12a03..4935d5e40 100644 --- a/spine-ts/spine-webgl/example/drag-and-drop.js +++ b/spine-ts/spine-webgl/example/drag-and-drop.js @@ -3,7 +3,6 @@ class App { this.skeleton = null; this.animationState = null; this.canvas = null; - this.pma = true; } loadAssets(canvas) { @@ -24,12 +23,6 @@ class App { this.animationState.setAnimation(0, animationSelectBox.value, true); } - // Setup listener for the PMA checkbox - let pmaCheckbox = document.body.querySelector("#pma"); - pmaCheckbox.onchange = () => { - this.pma = pmaCheckbox.checked; - } - // Setup the drag and drop listener new FileDragAndDrop(canvas.htmlCanvas, (files) => this.onDrop(files)) @@ -163,7 +156,7 @@ class App { renderer.begin(); renderer.line(-10000, 0, 10000, 0, spine.Color.RED); renderer.line(0, -10000, 0, 10000, spine.Color.GREEN); - renderer.drawSkeleton(this.skeleton, this.pma); + renderer.drawSkeleton(this.skeleton); renderer.end(); } } diff --git a/spine-ts/spine-webgl/example/dress-up.html b/spine-ts/spine-webgl/example/dress-up.html index 31c881cb0..469ea2e30 100644 --- a/spine-ts/spine-webgl/example/dress-up.html +++ b/spine-ts/spine-webgl/example/dress-up.html @@ -173,7 +173,7 @@ // Clear the canvas and render the skeleton canvas.clear(0.5, 0.5, 0.5, 1); renderer.begin(); - renderer.drawSkeleton(this.skeleton, true); + renderer.drawSkeleton(this.skeleton); renderer.end(); // Get the image data and convert it to an img element @@ -236,7 +236,7 @@ canvas.clear(0.2, 0.2, 0.2, 1); renderer.begin(); - renderer.drawSkeleton(this.skeleton, true); + renderer.drawSkeleton(this.skeleton); renderer.end(); } } diff --git a/spine-ts/spine-webgl/example/index.html b/spine-ts/spine-webgl/example/index.html index bdf0ec38f..36c40bb17 100644 --- a/spine-ts/spine-webgl/example/index.html +++ b/spine-ts/spine-webgl/example/index.html @@ -117,36 +117,36 @@ if (assetManager.isLoadingComplete()) { skeletons = { coin: { - Binary: loadSkeleton("coin-pro.skel", "animation", true), - JSON: loadSkeleton("coin-pro.json", "animation", true) + Binary: loadSkeleton("coin-pro.skel", "animation"), + JSON: loadSkeleton("coin-pro.json", "animation") }, goblins: { - Binary: loadSkeleton("goblins-pro.skel", "walk", true, "goblin"), - JSON: loadSkeleton("goblins-pro.json", "walk", true, "goblin") + Binary: loadSkeleton("goblins-pro.skel", "walk", "goblin"), + JSON: loadSkeleton("goblins-pro.json", "walk", "goblin") }, "mix-and-match-pro": { - Binary: loadSkeleton("mix-and-match-pro.skel", "dance", true, "full-skins/girl-blue-cape"), - JSON: loadSkeleton("mix-and-match-pro.json", "dance", true, "full-skins/girl-blue-cape") + Binary: loadSkeleton("mix-and-match-pro.skel", "dance", "full-skins/girl-blue-cape"), + JSON: loadSkeleton("mix-and-match-pro.json", "dance", "full-skins/girl-blue-cape") }, raptor: { - Binary: loadSkeleton("raptor-pro.skel", "walk", true), - JSON: loadSkeleton("raptor-pro.json", "walk", true) + Binary: loadSkeleton("raptor-pro.skel", "walk"), + JSON: loadSkeleton("raptor-pro.json", "walk") }, spineboy: { - Binary: loadSkeleton("spineboy-pro.skel", "run", true), - JSON: loadSkeleton("spineboy-pro.json", "run", true) + Binary: loadSkeleton("spineboy-pro.skel", "run"), + JSON: loadSkeleton("spineboy-pro.json", "run") }, stretchyman: { - Binary: loadSkeleton("stretchyman-pro.skel", "sneak", true), - JSON: loadSkeleton("stretchyman-pro.json", "sneak", true) + Binary: loadSkeleton("stretchyman-pro.skel", "sneak"), + JSON: loadSkeleton("stretchyman-pro.json", "sneak") }, tank: { - Binary: loadSkeleton("tank-pro.skel", "drive", true), - JSON: loadSkeleton("tank-pro.json", "drive", true) + Binary: loadSkeleton("tank-pro.skel", "drive"), + JSON: loadSkeleton("tank-pro.json", "drive") }, vine: { - Binary: loadSkeleton("vine-pro.skel", "grow", true), - JSON: loadSkeleton("vine-pro.json", "grow", true) + Binary: loadSkeleton("vine-pro.skel", "grow"), + JSON: loadSkeleton("vine-pro.json", "grow") } }; setupUI(); @@ -156,11 +156,11 @@ requestAnimationFrame(load); } - function loadSkeleton(name, initialAnimation, premultipliedAlpha, skin) { + function loadSkeleton(name, initialAnimation, skin) { if (skin === undefined) skin = "default"; // Load the texture atlas using name.atlas from the AssetManager. - let atlas = assetManager.require(name.replace(/(?:-ess|-pro)\.(skel|json)/, "") + (premultipliedAlpha ? "-pma" : "") + ".atlas"); + let atlas = assetManager.require(name.replace(/(?:-ess|-pro)\.(skel|json)/, "") + "-pma.atlas"); // Create an AtlasAttachmentLoader that resolves region, mesh, boundingbox and path attachments let atlasLoader = new spine.AtlasAttachmentLoader(atlas); @@ -219,7 +219,7 @@ }) // Pack everything up and return to caller. - return { skeleton: skeleton, state: animationState, bounds: bounds, premultipliedAlpha: premultipliedAlpha }; + return { skeleton: skeleton, state: animationState, bounds: bounds }; } function calculateSetupPoseBounds(skeleton) { @@ -318,7 +318,6 @@ let skeleton = skeletons[activeSkeleton][format].skeleton; let state = skeletons[activeSkeleton][format].state; let bounds = skeletons[activeSkeleton][format].bounds; - let premultipliedAlpha = skeletons[activeSkeleton][format].premultipliedAlpha; state.update(delta); state.apply(skeleton); skeleton.updateWorldTransform(spine.Physics.update); @@ -331,7 +330,6 @@ // Start the batch and tell the SkeletonRenderer to render the active skeleton. batcher.begin(shader); - skeletonRenderer.premultipliedAlpha = premultipliedAlpha; skeletonRenderer.draw(batcher, skeleton); batcher.end(); @@ -342,7 +340,6 @@ if (debug) { debugShader.bind(); debugShader.setUniform4x4f(spine.Shader.MVP_MATRIX, mvp.values); - debugRenderer.premultipliedAlpha = premultipliedAlpha; shapes.begin(debugShader); debugRenderer.draw(shapes, skeleton); shapes.end(); diff --git a/spine-ts/spine-webgl/example/mix-and-match.html b/spine-ts/spine-webgl/example/mix-and-match.html index 176f16652..6d00cdc4c 100644 --- a/spine-ts/spine-webgl/example/mix-and-match.html +++ b/spine-ts/spine-webgl/example/mix-and-match.html @@ -37,7 +37,7 @@ // Create the skeleton let skeletonBinary = new spine.SkeletonBinary(atlasLoader); - skeletonBinary.scale = 0.5; + skeletonBinary.scale = 1; let skeletonData = skeletonBinary.readSkeletonData(assetManager.require("mix-and-match-pro.skel")); this.skeleton = new spine.Skeleton(skeletonData); @@ -74,7 +74,7 @@ renderer.resize(spine.ResizeMode.Expand); canvas.clear(0.2, 0.2, 0.2, 1); renderer.begin(); - renderer.drawSkeleton(this.skeleton, true); + renderer.drawSkeleton(this.skeleton); renderer.end(); } } diff --git a/spine-ts/spine-webgl/example/physics.html b/spine-ts/spine-webgl/example/physics.html index 0116f77f9..35c5bf4a7 100644 --- a/spine-ts/spine-webgl/example/physics.html +++ b/spine-ts/spine-webgl/example/physics.html @@ -41,7 +41,7 @@ var skeletonBinary = new spine.SkeletonBinary(atlasLoader); // Set the scale to apply during parsing, parse the file, and create a new skeleton. - skeletonBinary.scale = 0.2; + skeletonBinary.scale = 0.4; var skeletonData = skeletonBinary.readSkeletonData(assetManager.require("/assets/sack-pro.skel")); this.skeleton = new spine.Skeleton(skeletonData); @@ -72,7 +72,7 @@ // Begin rendering. renderer.begin(); // Draw the skeleton - renderer.drawSkeleton(this.skeleton, true); + renderer.drawSkeleton(this.skeleton); // Complete rendering. renderer.end(); } diff --git a/spine-ts/spine-webgl/example/physics2.html b/spine-ts/spine-webgl/example/physics2.html index 38bb7692c..20e0c47a6 100644 --- a/spine-ts/spine-webgl/example/physics2.html +++ b/spine-ts/spine-webgl/example/physics2.html @@ -124,7 +124,7 @@ // Begin rendering. renderer.begin(); // Draw the skeleton - renderer.drawSkeleton(this.skeleton, true); + renderer.drawSkeleton(this.skeleton); // Complete rendering. renderer.end(); } diff --git a/spine-ts/spine-webgl/example/physics3.html b/spine-ts/spine-webgl/example/physics3.html index a892c20da..25995a6d2 100644 --- a/spine-ts/spine-webgl/example/physics3.html +++ b/spine-ts/spine-webgl/example/physics3.html @@ -42,7 +42,7 @@ var skeletonBinary = new spine.SkeletonBinary(atlasLoader); // Set the scale to apply during parsing, parse the file, and create a new skeleton. - skeletonBinary.scale = 0.5; + skeletonBinary.scale = 0.4; var skeletonData = skeletonBinary.readSkeletonData(assetManager.require("/assets/snowglobe-pro.skel")); this.skeleton = new spine.Skeleton(skeletonData); @@ -74,7 +74,7 @@ // Begin rendering. renderer.begin(); // Draw the skeleton - renderer.drawSkeleton(this.skeleton, true); + renderer.drawSkeleton(this.skeleton); // Complete rendering. renderer.end(); } diff --git a/spine-ts/spine-webgl/example/physics4.html b/spine-ts/spine-webgl/example/physics4.html index 5ddee02a2..f58656c21 100644 --- a/spine-ts/spine-webgl/example/physics4.html +++ b/spine-ts/spine-webgl/example/physics4.html @@ -73,7 +73,7 @@ // Begin rendering. renderer.begin(); // Draw the skeleton - renderer.drawSkeleton(this.skeleton, true); + renderer.drawSkeleton(this.skeleton); // Complete rendering. renderer.end(); }