Jump to content

pixi-spine plugin WIP GPU patch


ivan.popelyshev
 Share

Recommended Posts

IK Constraints for spine v3 are fixed, please test it : https://github.com/pixijs/pixi-spine/blob/master/bin/pixi-spine.js . 

SkinnedMeshPatch: https://github.com/pixijs/pixi-spine/blob/master/gpupatch/SkinnedMeshPatch.js

UPD. Linked mesh is ready, but I didnt test it yet. Skew - may be , try it!

Link to comment
Share on other sites

@ivan.popelyshev hi ivan

//skew is good, following link is example with new pix-spine.js

http://jsfiddle.net/gbear/Lc8zcsuo/6/

 

/this looks good too, /this is flip with ik example with new pixi-spine.js

http://jsfiddle.net/gbear/dLo9qxb1/26/

 

great.. :D


 

Quote

Im afraid that this problem persists in ALL spine runtimes. Flip + IK = pain.

Try not to use skeleton.flipX and skeleton.flipY, instead just change the scale of entire spine object. I spent 4 hours on it and i cant find the issue, and I dont have more time on it, sorry :(

what's this meaning?  
Can't I use flipX with new pixi-spine.js?

 

 

 

Link to comment
Share on other sites

@GBear Yes, FPS is a problem, its abnormal, I'm going to look at it.

UPD. 18FPS vs 15FPS only because you have very simple example, only 1 FFD animation in it. Try it when you have 50 bones and a lot of weighted meshes on it :) Im afraid we need webgl2 support to fix that fps on 1024 objects.

Link to comment
Share on other sites

@GBear Do you change texture directly (sprite.texture = ...) or change attachment in spine?

The correct way is to use linked meshes ("duplicate" button in spine version 3) and switch them inside one slot. http://ru.esotericsoftware.com/blog/Language-support-linked-meshes

Same with sprites.

If you provide me and example I'll be happy to fix it :) 

Link to comment
Share on other sites

@ivan.popelyshev  hi ivan:)

 

Click 'Spine that moving legs' and then it flipped and changed texture of 'legL_1' to panda

 

 

this example is 'to have exchanging bug' with SkinnedMeshPatch.js

http://jsfiddle.net/gbear/dLo9qxb1/50/

legL_1 is not changed to panda

wrong.png

 

this example is normal (not using SkinnedMeshPatch.js)

http://jsfiddle.net/gbear/dLo9qxb1/49/

legL_1 is changed to panda

good.png

 

 

Link to comment
Share on other sites

Sorry, this is not normal work with spine:

slot.sprites['legL_1'].texture = texture

I mean that's not documented in spine runtimes, you are using specific pixi feature that allows you to change texture.uvs on the fly.

Spine attachments are a bit different, and gpupatch assumes that texture and uvs cant be changed. You have to create separate attachment for it, either in spine editor, either manually after spineData is loaded.

Link to comment
Share on other sites

@ivan.popelyshev T-T.. is there normal if recarete attachment?

pixi's spine is not normal T-T becuase it's not set to uvs directly

T-T...

 

Other thing..

SkinnedMeshPatch.js has problem about interaction. 

is this ok?

 

Actually SkinnedMeshPatch.js give me 10fps more than not using GPUPatch with 30-50 bones and many meshed textures.

this is wonderful!

but i can't use this T-T. Because this is not perfect to service as interaction bug, abnormal rendering, texture loading timing?

if all these clear,, it will be used unconditional

do you have plan to resolve that?

l2

 

Link to comment
Share on other sites

@ivan.popelyshev 

SkinnedMeshAttachment is not anywhere..

this is gone...

    newWeightedMeshAttachment: function (skin, name, path)
    {
        var region = this.atlas.findRegion(path);
        if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")";
        var attachment = new spine.SkinnedMeshAttachment(name);
        attachment.rendererObject = region;
        attachment.regionU = region.u;
        attachment.regionV = region.v;
        attachment.regionU2 = region.u2;
        attachment.regionV2 = region.v2;
        attachment.regionRotate = region.rotate;
        attachment.regionOffsetX = region.offsetX;
        attachment.regionOffsetY = region.offsetY;
        attachment.regionWidth = region.width;
        attachment.regionHeight = region.height;
        attachment.regionOriginalWidth = region.originalWidth;
        attachment.regionOriginalHeight = region.originalHeight;
        return attachment;
    },

example

http://jsfiddle.net/gbear/dLo9qxb1/56/

Link to comment
Share on other sites

@ivan.popelyshev  hi ivan.^^/

looks more good... but something wrong with ik 

see character's hands and dragon's feet

http://jsfiddle.net/dLo9qxb1/99/

 

Quote

Btw, you have to run "npm install" for your version of pixi, because it does not contain "resource.metadata" somehow, and its part of latest "resource-loader"

yes i know that. but i'm not using yet metadata. so i'm deleting now..  if not pixi gave me error.... 

i will be using that soon..^^

 

 

Link to comment
Share on other sites

@ivan.popelyshev hi. this is different question



 

Quote

Sorry, this is not normal work with spine:


slot.sprites['legL_1'].texture = texture


 

I mean that's not documented in spine runtimes, you are using specific pixi feature that allows you to change texture.uvs on the fly.

Spine attachments are a bit different, and gpupatch assumes that texture and uvs cant be changed. You have to create separate attachment for it, either in spine editor, either manually after spineData is loaded.

slot.sprites['legL_1'] is PIXi.Sprite.

And I set texture. but there can't happen anything..
 

does I recreate 'Attachment' if i change parts with pixi with gpu_patch ?

 

Can't I  control PIXI.Spirte's texture on Spine  if using gpu.patch?

 

thx

 

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...