Jump to content

Pixi Spine problem


pavelgramen
 Share

Recommended Posts

In case you use premultiplied alpha in png textures, specify it for pixi: dig out which baseTexture it uses and specify "mySpineResource.spineAtlas.pages[0].baseTexture.pmaMode = PIXI.ALPHA_MODES.PMA"

We added this feature to pixi but didn't propagate it to pixi-spine.

Edited by ivan.popelyshev
Link to comment
Share on other sites

OK, confirmed, it works in latest spine-ts but not in pixi-spine.

Maybe I can look at it in weekend, maybe not.

There's an issue https://github.com/pixijs/pixi-spine/issues/318 with skins, maybe the same problem appears in your case. Yes, I couldn't fix it since november, it requires a total rewrite of "Spine.js" "update" function.

If you want to investigate yourself, clone https://github.com/EsotericSoftware/spine-runtimes/tree/3.8/spine-ts and put your demo in webgl/examples. They dont have JSON by default there, so I had to modify loadSkeleton method a bit:

// .. load

function init () {
   //...
	assetManager.loadText("assets/Down.json");
	assetManager.loadTextureAtlas("assets/Down.atlas");
    //...
}

function load() { 

  //...
    skeletons["Down"] = loadSkeleton("Down", "run", false, undefined, true);
}

function loadSkeleton (name, initialAnimation, premultipliedAlpha, skin, isJson) {
    //...

	var skeletonBinary = new spine.SkeletonBinary(atlasLoader);
	var skeletonJson = new spine.SkeletonJson(atlasLoader);

	var skeletonData = isJson ?  skeletonJson.readSkeletonData(assetManager.get("assets/" + name + ".json"))
					: skeletonBinary.readSkeletonData(assetManager.get("assets/" + name + ".skel"));
    //...
}

 

Edited by ivan.popelyshev
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...