Closed NathanHawks closed 5 years ago
Currently its possible to sort&light using sortPriority
field. Sort the containers, each container has two sprites inside - one for diffuse, one for normals.
https://pixijs.io/examples/#/layers/normals-drag.js
Next version of pixi-layers will allow muti-render-target, only one sprites will be needed.
Yep, I would have commented a couple of hours ago when I got it right, but internet was down... thankfully I already had your example code up ;)
Thank you!
Apologies if I'm just missing something obvious due to being new at PIXI. Also apologies because I edit a lot :-/
As I understand it...
Currently I can have one of these lines uncommented and get layer sorting; or I can uncomment the other line and get lighting. Is there another pattern I'm missing?
I tried this in order to get both features:
PIXI.lights.diffuseGroup.on('sort', (sprite) => { sprite.zOrder = -sprite.y; })
But no sorting occurs; I then also added a sort to the normal, also no change. I've tried adding the container holding the diffuse/normal pair, to the entity group, but still no sorting.
Thank you very much for these libraries and for any help past either my blindness or whatever's going on here :)
EDIT: Probably found the answer already: https://pixijs.io/examples/#/layers/normals-drag.js
will close asap after confirming.