Jammy Posted July 29, 2020 Share Posted July 29, 2020 (edited) 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 July 29, 2020 by Jammy Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 30, 2020 Share Posted July 30, 2020 (edited) 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 July 30, 2020 by ivan.popelyshev Jammy 1 Quote Link to comment Share on other sites More sharing options...
Jammy Posted August 2, 2020 Author Share Posted August 2, 2020 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! ivan.popelyshev 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.