Jump to content

Pixi-Layers with Filters


Jammy
 Share

Recommended Posts

Hey,

I'm using pixi-layers and I have 1 layer which is for bloom, I add an object to that layer whenever I want bloom (I believe it was also better practice to add all objects for a specific filter to one layer and apply the filter to the layer, for performance).

When I apply parentGroup to a bloom object, I believe pixi-layers swaps its layer/container and therefore it loses its filter. Is this right?

Is it possible at all, to have a layer full of objects, that still sort on groups, without changing container? I guess it may be impossible.

Do we have any idea the difference it may cause if I add the bloom filter to sprites individually (may be up to 100-200 sprites)

Thanks, Jammy.

Edited by Jammy
Link to comment
Share on other sites

You want to sort stuff from different containers, right? If layer itself is under the filter - it will work, otherwise - I just dont know the order of operations that you want :)

Just imagine how do you want pixi to push/pop filter and when to draw elements, in which buffers - and then you'll be able to make a scheme that'll work. Also if your sorted elements are all in same container - you can just use pixi-v5 zIndex + "container.sortChildren=true" (https://github.com/pixijs/pixi.js/blob/dev/packages/display/src/Container.ts#L421) instead of pixi-layers

Edited by ivan.popelyshev
Link to comment
Share on other sites

On 7/30/2020 at 1:07 PM, ivan.popelyshev said:

You want to sort stuff from different containers, right? If layer itself is under the filter - it will work, otherwise - I just dont know the order of operations that you want :)

Just imagine how do you want pixi to push/pop filter and when to draw elements, in which buffers - and then you'll be able to make a scheme that'll work. Also if your sorted elements are all in same container - you can just use pixi-v5 zIndex + "container.sortChildren=true" (https://github.com/pixijs/pixi.js/blob/dev/packages/display/src/Container.ts#L421) instead of pixi-layers

pixi-v5 zIndex + helps a lot thanks, So i have two types of sorting going on now, one on the layer level and one on the objects contents (collection of sprites inside a container).

I've got bloom on a mixture of layers coz of this so I assume im probably going to see some perf hit at some point, but I think I can control that.

Thanks!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...