Jump to content

Inverse masking?


ramshreyas
 Share

Recommended Posts

Instead of specifying a region I want drawn, I want to specify a "hole" in my sprite. The hole is dynamic (can change every frame).

 

Performance-wise, it's not feasible to use a regular mask (too expensive to specify a mask that is everything but the hole every frame), I need to use an inverse mask. This (old) thread describes a hack on how to make it work:

 

https://github.com/GoodBoyDigital/pixi.js/issues/252

 

It involves changing gl.EQUAL to gl.NOTEQUAL in a certain file, but this hack is obsolete as there's a new WebGLStencilManager.js file in its place.

 

Any ideas how to get inverse masks working using Pixi (WebGL)? Or another solution? Again, it's a dynamic mask that defines regions *not* to draw.

Link to comment
Share on other sites

  • 11 months later...

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