Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Filters on containers in pixi-layers

$
0
0

I have an application with:

* multiple groups of sprites currently organized into containers
* one or more filters applied to each sprite group
* groups and individual sprites that overlay each other in default z-index order
* but some sprites need to be sent to a bottom or top layer (but still use the filters of their sprite group)

Core Pixi takes care of points 1-3 nicely and I was hoping to use pixi-layers for point 4. Here's a small example:
https://www.pixiplayground.com/#/edit/ocKhrG_qVPo6JvNlyneu-

On the left you see sprites A-F in default order. On the right I use pixi-layers to send B to the bottom and C to the top. This works fine so far. But there are also filters active which are not working.

To see the filters, activate line 9 and comment out line 8. This puts everything inside a standard container instead of a pixi-layers Stage, so pixi-layers is bypassed completely. Now you see the filters, but the layers no longer work.

There is a directly relevant issue in the repo:
https://github.com/pixijs/layers/issues/45

But since no Pixi devs have commented there, I'm not sure if this is a bug or if this is fundamentally impossible due to how pixi-layers works. I suspect the latter.

Which is it? Is there a (relatively) simple way to get the filters and layers working at the same time? In my real application I have multiple sprites in different filter groups that need to be rendered in the bottom layer (like B), or in the top layer (like C).


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>