Jonny Shaw

Wireframe showing on flipped Spine meshes (canvas only)

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!

Share this post


Link to post
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.

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.