- Home /
Compressed texture using same memory as uncompressed in run time? Please clear up.
OK, I get it that compressed texture take up less file storage space and helps make a mobile game build smaller...
But when I'm looking at the Player Stats in the Editor, it shows the exact same texture count and amount of memory used when I used a compress texture atlas vs a non-compressed texture atlas.
Could this be right?
Thanks, Manny
Answer by Owen-Reynolds · Nov 12, 2014 at 08:00 PM
Yes. Think about how zipped folders work. Compressed images are pretty much the same. Have to uncompress the entire thing in order to use them. Compression is only for "dead" file size.
So, it would seem to me, that if my goal is image quality over file size, that I should stick with uncompressed texture given that in my case, compression only saved me 2 $$anonymous$$B but the textures were not as crisp. That during run time the amount or RA$$anonymous$$ used was exactly the same.
Have I got it?
Hmm...normal compression doesn't affect image quality (it isn't "lossy.") But, then the final build is always compressed anyway, so there's no reason to use compressed images in that sense.
I'm thinking the specific compression, if you read up on it, is really decreasing the resolution a bit, using a "smaller" format. So it is saving some run-time space, maybe.
$$anonymous$$aybe someone knows about the stats window -- I'm thinking it doesn't always give you the sizes you think.
The entire compressed texture will not be decompressed in memory, unless you use a compression format that isn't supported by the hardware. http://forum.unity3d.com/threads/will-compressed-texture-be-uncompressed-into-memory.274634/ http://docs.unity3d.com/$$anonymous$$anual/OptimizingGraphicsPerformance.html
(I did submit an answer, they don't show up immediately)
It's often better to just write you own Answer. Like, in this case, it's difficult to know what your initial "this" refers to; and UA isn't all that good for discussions; and, even if you were to be specific that still leaves the initial question, "so why is a compressed texture showing the same memory use as an uncompressed one." and the follow-up "why does compressed textures appear to reduce image quality."
It's likely the OP is long gone (and there are obvious Q's about version number and specific compression method.) But you found this Q. Other people may search and find it. So it's fine to leave an Answer for them (and not bother addressing any others. If yours contradicts $$anonymous$$e, it's implicit that you disagree.)
Answer by chrismarch · Oct 28, 2015 at 12:49 PM
If you use a texture compression format supported by your mobile hardware, and your texture dimensions are powers of two on each side, the size reported by Unity in the texture importer inspector preview window should be about how much memory it will use on your hardware, since it will not need to decompress the whole image at the same time to use it.
http://forum.unity3d.com/threads/will-compressed-texture-be-uncompressed-into-memory.274634/