GRaAL Posted December 28, 2017 Share Posted December 28, 2017 Hi, I noticed that sprite masking does not work when the sprite is rendered into RenderTexture - here is jsfiddle which demonstrates it: https://jsfiddle.net/GRaAL/tt4bgppf/ (I'm using WebGL renderer). I've tried to dive into Phaser code, but didn't found a reason. I see that the same DisplayObject._renderWebGL used in both cases - when rendered to screen or into framebuffer (RenderTexture) - and in both cases stencilManager is called with valid mask. Unfortunately I'm not so good in WebGL to understand what is wrong here. I found an old issue in pixi itself about that (https://github.com/pixijs/pixi.js/issues/694), but I'm not sure which pixi's version is used in Phaser. Could you please advice how can I make it work (and is it possible)? Thanks. Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 28, 2017 Share Posted December 28, 2017 In pixi (at least v3 v4) sprite masking works through a Filter, without Stencil. UPD. its not alpha sprite mask, you actually use graphics for a mask, that's ok Link to comment Share on other sites More sharing options...
GRaAL Posted January 19, 2018 Author Share Posted January 19, 2018 Yeah, I saw it works in pixi. But Phaser uses its own modified version of pixi. Is there a way to make it work in Phaser? Link to comment Share on other sites More sharing options...
Recommended Posts