Jump to content

Canvas Blend Mode Bug


breadfan
 Share

Recommended Posts

There seems to be a bug in the latest version of pixi in the canvas renderer.

 

If the last item rendered is not the normal blend mode, then its possible for the next few items rendered to use the same blend mode as that previous item (thus creating random graphic flashes across the screen when items with the normal blend mode are being processed with the wrong blend mode). We couldn't find the exact pattern of when the normal blend mode kicks back in, but it is possible that this happens when theres an additional blend mode being applied somewhere in the draw stack.

 

We were able to fix it with a hack by adding in these two lines of code in the PIXI.CanvasRenderer.prototype.render function:

this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL;this.context.globalCompositeOperation = PIXI.blendModesCanvas[this.renderSession.currentBlendMode];
 
Let me know if that needs more clarification as it's kind of a weird bug. Has anyone else ran into this issue?
 
Edit: Looks like this issue was also posted on github today: https://github.com/GoodBoyDigital/pixi.js/issues/837
Edited by breadfan
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...