AndrewJS Posted September 30, 2020 Share Posted September 30, 2020 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? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 30, 2020 Share Posted September 30, 2020 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 AndrewJS 1 Quote Link to comment Share on other sites More sharing options...
AndrewJS Posted September 30, 2020 Author Share Posted September 30, 2020 Great, thanks for the reply. I'll have a look at the compressed texture module. https://github.com/pixijs/pixi-compressed-textures 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.