pixijs/pixi-heaven

Is there any way to apply masking as a batch operation to multiple sprites?

rkdrnf opened this issue · 1 comments

I have multiple sprites to apply mask to each. each mask is same in its shape and only its positions is different from each other.

I'm currently using heaven.Sprite.maskSprite and "spriteMasked" plugin to apply mask to sprites and it seems masking for each sprite is done as single operation.

I hope I can apply mask to all those sprites in a single batch operation.
Is there any way that I can achieve this using pixi-heaven?

To help your understanding, these are things that I want to apply mask
image
so there would be a mask applied to each heart.
and currently mask is applied total 5 times, 1 for each heart

I assumed this by inspecting webgl drawing procedure
image
You can see that masking shader is applied 5 times in a single frame.

I thought I fixed that bug. Give me a fiddle please, I'll debug it.