Debo Posted June 14, 2018 Share Posted June 14, 2018 I have two sections on screen. when ever I am focusing on one section I am setting other sections cacheAsBitmap true. My problem is when ever I am toggling focus every time it is creating new texture and memory is going up. Is there a mechanism to delete texture created by cache as bitmap whenever I am setting cacheAsBitmap false? Quote Link to comment Share on other sites More sharing options...
samme Posted June 15, 2018 Share Posted June 15, 2018 The old cached texture should be "destroyed" each time a new one is created. Quote Link to comment Share on other sites More sharing options...
Debo Posted June 15, 2018 Author Share Posted June 15, 2018 Hi Samme, Thanks for replay. I was also expecting the same. But every time I set cacheAsBitmap False and then True the memory on my box increases by 20 mb. Am I missing any flag? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 15, 2018 Share Posted June 15, 2018 here's where the texture is destroyed: https://github.com/pixijs/pixi.js/blob/dev/src/extras/cacheAsBitmap.js#L389 If you are sure, go investigate it. I, even as pixi core team member, have no guarantees about cacheAsBitmap behaviour. Also, no guarantees about "generateTexture". People should just use "renderer.render(myContainer, myTemporaryRenderTexture)" after determining container bounds and transforms, all manually, making their own tests of whats working and whats not, because those functions are basically minefield, and so far, everyone who tried to disarm it failed. That's one of reasons that no one repeated Flash platform - they cant make persistant cacheAsBitmap. If it works for you - fine, if not - go investigate your case with a debugger. I' think Ive spent 100 hours on those kind of issues, and so far my PR's related to that were too monstrous to be added in pixi. 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.