undimon Posted February 11, 2023 Share Posted February 11, 2023 Do anyone can point me to the potential reason why this error can happen? I apply filters to containers and render them to a texture. Everything worked fine until I used DropShadowFilter (https://www.npmjs.com/package/@pixi/filter-drop-shadow). First time see such kind of error... Pixi 5.3.8 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 11, 2023 Share Posted February 11, 2023 That's a new one. Please provide how do you use this filter. 77GAMES 1 Quote Link to comment Share on other sites More sharing options...
undimon Posted February 11, 2023 Author Share Posted February 11, 2023 I add filter to containers protected addStylesToContainer(container: Container): void { container.filters = [ new OutlineFilter(), // Everything work with this filter new DropShadowFilter(), // <-- Breaks here ]; } But the error start to happen even if I call new DropShadowFilter() anywhere (!) in code, even without applying to object's filters property... After some investigation I think it somehow related to masks. In other part of a code I create mask sprite from render texture: const cont = new Container(); const tmpSprite = new Sprite(this.sprite.texture); cont.addChild(tmpSprite); tmpSprite.filters = [new OutlineFilter(outlineSize, 0xffffff, 1, 1)]; const maskTex = RenderTexture.create({ width: tmpSprite.width, height: tmpSprite.height }); Game.renderer.renderer.render(cont, maskTex); cont.destroy({ children: true }); this.maskSprite = new Sprite(maskTex); this.maskSprite.name = 'Mask'; this.addChild(this.maskSprite); this.mask = this.maskSprite; // <--- THIS LINE CRASHES THE APP 77GAMES 1 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.