Majek Posted April 28, 2017 Share Posted April 28, 2017 Hi! i have a problem with masking in pixi js. What i want to do is a hole in PIXI.Graphics rectangle with PIXI.Sprite .png mask. Here is codepen: I want to make my cloud transparent, so that i can see a red background (pls check commented line in codepen). Any help? Thanks! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 28, 2017 Share Posted April 28, 2017 That's not the mask, but performance is even better, and it uses same principle as internal mask. I use http://pixijs.github.io/examples/#/layers/lighting.js as a base, but i dont use pixi-lights plugin. Red background, grey foreground (with multiply), and on top of that foreground im adding shapes you are using for masking, with ADD blendmode. "VoidFilter" basically means that the container is rendered into separate layer, and then rendered yto main stage. What am I doing: Quote Link to comment Share on other sites More sharing options...
Majek Posted May 2, 2017 Author Share Posted May 2, 2017 On 28.04.2017 at 11:59 PM, ivan.popelyshev said: That's not the mask, but performance is even better, and it uses same principle as internal mask. I use http://pixijs.github.io/examples/#/layers/lighting.js as a base, but i dont use pixi-lights plugin. Red background, grey foreground (with multiply), and on top of that foreground im adding shapes you are using for masking, with ADD blendmode. "VoidFilter" basically means that the container is rendered into separate layer, and then rendered yto main stage. What am I doing: Hi! Thanks for your answer, its almost that! One important difference, i need my page to be visible through the holl. In your example i can see only background object in pixi.js, not my page. Any ideas, is it posiible to do this? Quote Link to comment Share on other sites More sharing options...
Majek Posted May 10, 2017 Author Share Posted May 10, 2017 Im trying to achieve effect like on this site http://robinmastromarino.com/ (pls change project) - i'm talking about this clouds. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.