Sign in to follow this  
pr_mk

How to destroy texture created by cacheasbitmap

Recommended Posts

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? 

Share this post


Link to post
Share on other sites

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? 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.