Unity-Technologies / AssetBundles-Browser

Editor tool for viewing and debugging asset bundle contents before and after builds
Other
2.2k stars 528 forks source link

Compressed / resized / downloaded asset size would more useful than raw disk size #39

Open joecodespark opened 7 years ago

joecodespark commented 7 years ago

Currently the browser is displaying the size of the asset on disk which is not representative of the final size the user will get.

For example, on a texture this is the non-resized PSD which can be 10-20MB instead of the actual 100kB compressed and resized texture after import settings are applied.

It would be more helpful to show the resized and compressed file sizes that will actually be downloaded in the asset bundle. Showing the final asset bundle size (or a close approximation) would make optimization much easier.

alffanclub commented 7 years ago

yes, it would be more helpful to get something closer. The only way to get really close is to trigger a build and spy on the result, but that is expensive and can still be flawed. I have it on my to-do list to try to find an in between technique that is more accurate than what we have without being too expensive to determine. I'll leave this ticket open and comment here once there's something "better" to try out.

MorganMoon commented 5 years ago

Well, for texture's unity has UnityEditor.TextureUtil.GetStorageMemorySizeLong(Texture t) It is currently an internal class though - maybe that could be changed or we could use reflection 😬. Is there something similar for all other asset types? @alffanclub

alffanclub commented 5 years ago

I don't know of anything like that for other types, and reflecting into a Unity internal isn't ideal. Also, to do that you have to load the texture (you don't send it a path, but a loaded Texture), which can potentially be expensive too.