Jump to content

How to destroy texture created by cacheasbitmap


Debo
 Share

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? 

Link to comment
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.

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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