Jump to content

Need help for performance issue with masks


Recommended Posts

Hi guys,

I have a game in which i create lots of custom animations with gsap and static assets. I want to reuse the animations on different positions, so whenever i finish the animation i destroy it and recreate it later when needed.

Every animation is within it's own container and the logic works great if i dont use any masks, but the design requires that I use 5-6 alpha masks per object, and i can have around 20 objects using the same animation. As you can imaging, this is slowing down the game quite a lot.

I've been trying to find a way to increase the performance, but with no luck so far. Can anyone give me advice on that?

Is there any way to generate some texture frames with the animation states and save it to cache? or prerender animation? Any help would be appreciated.

Link to comment
Share on other sites

We have a plugin that speeds up alpha masking , but that particular feature works only for pixi v4. If you need it yesterday, you should say it and I can port it fast enough.


Here is how it worked with pixi-v4: https://github.com/gameofbombs/pixi-heaven/tree/v4.x#how-to-mask-sprites-with-sprites

As for caching with animation states - yeah, you can do it, but I do not have guarantee of how much memory you will need for renderTextures :)

Offtop link: https://opencollective.com/pixijs

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

OK, you are my tester now.

Please look at https://github.com/gameofbombs/pixi-heaven/tree/master , there's a build in "dist" folder. It works only with 5.2.0 or 5.2.1 .

Test "spriteMask" feature, whether there are any jitters or strange effects. If you find such effect - please make a small demo so i can debug it faster. Its difficult for me to check all the cases.

Edited by ivan.popelyshev
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.

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.


  • Recently Browsing   0 members

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