You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble applying advanced blend modes from the advanced-blend-modes.js extension to filters in PixiJS. Here's my code:
<html><head><metacharset="utf-8"><scriptsrc="/lib/pixi.js"></script><scriptsrc="/lib/advanced-blend-modes.js"></script><scriptsrc="/lib/pixi-filters.js"></script></head><body><scripttype="module">constapp=newPIXI.Application();awaitapp.init({width: 900,height: 500,useBackBuffer: true,})document.body.appendChild(app.canvas);constspriteRef="temp/test.png";awaitPIXI.Assets.load(spriteRef);letsprite=PIXI.Sprite.from(spriteRef);sprite.scale.set(0.5);sprite.x=0;sprite.y=0;letsprite2=PIXI.Sprite.from(spriteRef);sprite2.scale.set(0.5);sprite2.x=100;sprite2.y=0;app.stage.addChild(sprite);app.stage.addChild(sprite2);constblurFilter=newPIXI.BlurFilter();blurFilter.blendMode="overlay";// This doesn't worksprite2.filters=[blurFilter];</script></body></html>
The Issue
When I set blurFilter.blendMode = "add" (a standard blend mode), it works correctly
When I set blurFilter.blendMode = "overlay" (from advanced-blend-modes), nothing happens - the blend mode has no effect
I've imported the advanced-blend-modes.js library properly
My Question
How do I correctly apply advanced blend modes (like "overlay") from the advanced-blend-modes extension to filters in PixiJS? Is there a different syntax or approach required compared to standard blend modes?
Any help or examples would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm having trouble applying advanced blend modes from the
advanced-blend-modes.js
extension to filters in PixiJS. Here's my code:The Issue
blurFilter.blendMode = "add"
(a standard blend mode), it works correctlyblurFilter.blendMode = "overlay"
(from advanced-blend-modes), nothing happens - the blend mode has no effectMy Question
How do I correctly apply advanced blend modes (like "overlay") from the advanced-blend-modes extension to filters in PixiJS? Is there a different syntax or approach required compared to standard blend modes?
Any help or examples would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions