idzhurov Posted February 11, 2020 Share Posted February 11, 2020 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 11, 2020 Share Posted February 11, 2020 (edited) 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. https://github.com/gameofbombs/pixi-heaven 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 February 11, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
idzhurov Posted February 12, 2020 Author Share Posted February 12, 2020 Thanks, Ivan, No pressure. I am exploring options. Do you think this approach will be better performant than png sequence? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 15, 2020 Share Posted February 15, 2020 (edited) 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 February 15, 2020 by ivan.popelyshev 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.