I am currently building a plugin to explore textures that are used in a project, it is currently working well and I got a list of textures, usage of them and the resolution.
How do I calculate the memory usage of a texture similar to how it is is done in Developer Console → Memory → Place Memory → GraphicsTexture?
I have tried to reverse engineer it by taking the memory usage / (texture_width * texture_height) (all dimensions are power of 2) but always end up with some odd number such as 5.08 (for a 8-bit greyscale texture). But I guess there is some compression algorithm in play here that will make my life hard.
Roblox seems to use different formats depending on the texture and also generates mipmaps for the textures, the formats are also platform specific since they are DX11 formats which means that a calculation that would work for Windows would not be correct for other platforms.
With that said it would be interesting to figure out the logic for when Roblox uses the different formats and how that can be used to reduce the memory impact.