Jump to content

Is memory usage double a texture image?


Recommended Posts

When an image loads in Pixi, I assume it loads into memory as an HTML object and is copied into a WebGL (or other) texture buffer, meaning it uses 2x the memory of the image itself?

A 2k image texture for example is 2048 x 2048 x 32-bit = 16MB. In a WebGL app, would this be 32MB of memory plus overhead?

If so, is there a way to get Pixi to flush the source images from memory and just keep the WebGL buffers or does it need to retain the source images, for example, to generate buffers in different WebGL contexts?

Link to comment
Share on other sites

Yes, that's correct. However, when image is not used for some time, browser removes RGBA from regular memory and only original jpg/png remains. That's purely browser feature, pixi has no control over it. I also recommend to use compressed textures when its possible , its x4 times less in videomem, but quality is subpar

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