Alpha masks disable additive blending mode
See original GitHub issueIt appears that applying an alpha mask to a Pixi object will disable the additive blending mode.
var imageEntity = new PIXI.Sprite(this.imageTexture);
imageEntity.blendMode = PIXI.BLEND_MODES.ADD;
var mask = new PIXI.Sprite(this.maskTexture);
imageEntity.addChild(mask);
imageEntity.mask = mask;
stage.addChild(imageEntity);
I seem to remember this having been reported in the past but was unable to find it.
We are using Pixi V.4.0.0.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9
Top Results From Across the Web
Alpha masks disable additive blending mode #3824 - GitHub
It appears that applying an alpha mask to a Pixi object will disable the additive blending mode. var imageEntity = new PIXI.Sprite(this.
Read more >Use blending modes and layer styles in After Effects
Most blending modes modify only color values of the source layer, not the alpha channel. The Alpha Add blending mode affects the alpha...
Read more >Blending Modes Explained - The Complete Guide to ...
Blending Modes are mathematical equations that blend layers based on their hue, saturation, luminosity, or a combination of these components.
Read more >Tag: additive blending - Learn OpenGL ES
We'll look at how to turn blending on and off, how to set different blending modes, and how different blending modes mimic real-life...
Read more >Simple alpha additive blend material. - Unity Forum
Set the albedo color multiplier to black and using the same texture for both the albedo and emission, and set the rendering mode...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You are already at the point where docs are useless, you have to clone the repo.
https://github.com/pixijs/pixi.js/blob/dev/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js
Assume we have
alphaSprite
andmySprite
Maybe, I have the same problem. If I create mask from Graphics and apply it to Graphics it works fine. If I apply blend mode to these Graphics everything is okey too. But if I apply blend mode and then make mask — blend mode doesn’t work.
let overlay = new Graphics(); overlay.lineStyle(5,0xFF3300,1); overlay.beginFill(0x66CCFF); overlay.drawRect(window.innerWidth / 2, 0, window.innerWidth / 2, window.innerHeight); overlay.endFill();
let rectangle = new Graphics(); rectangle.lineStyle(5,0xFF3300,1); rectangle.drawRect(window.innerWidth / 3, window.innerHeight / 3, 500, 500);
overlay.blendMode = PIXI.BLEND_MODES.MULTIPLY;
overlay.mask = rectangle;
app.stage.addChild(overlay);
app.stage.addChild(rectangle);
PixiJS 4.7.3 - ✰ WebGL ✰