Jump to content

Wireframe showing on flipped Spine meshes (canvas only)


Jonny Shaw
 Share

Recommended Posts

Hi all, just polishing off another pixi based game.

Another one for mobile, so looking now to see if we can scale back some of the effects when using canvas for the lower end devices.

I'll be dropping out particle effects, and a lot of the animations as it's rendering a bit slow atm, but one issue I've come across is with spine meshes.  To save load time I've designed some assets to be flipped, but have noticed the mesh wireframes are visible on all those that are flipped.

eg. grave.scale.set(-1,1);

This is only visible on canvas (webGL is perfectly fine).
Anyone know if there is a quick fix for this, or reckon I will have to duplicate the spine elements and flip the assets? (Last resort really)

4HAmBG1.jpg

Thanks in advance!

Link to comment
Share on other sites

Yes, That's known issue.

https://github.com/pixijs/pixi.js/blob/dev/src/mesh/canvas/CanvasMeshRenderer.js#L121

You can override it:

PIXI.mesh.CanvasMeshRenderer.prototype._renderDrawTriangle = function() { 
 ...
}

 

You can try to reverse the order of points if orientation is wrong. If you fail, I will fix it myself, because that's the fourth time this month people want flipped meshes on canvas2d.

Link to comment
Share on other sites

On 9/25/2017 at 2:37 PM, ivan.popelyshev said:

Yes, That's known issue.

https://github.com/pixijs/pixi.js/blob/dev/src/mesh/canvas/CanvasMeshRenderer.js#L121

You can override it:


PIXI.mesh.CanvasMeshRenderer.prototype._renderDrawTriangle = function() { 
 ...
}

 

You can try to reverse the order of points if orientation is wrong. If you fail, I will fix it myself, because that's the fourth time this month people want flipped meshes on canvas2d.

That's brilliant thanks @ivan.popelyshev will take a look at this later today :)

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