Hi All
As the title says, my project has 6 high res (4096*4096) compressed PNGs that are wreaking havoc with my build size.
The total size of the assets folder is 155mb, and yet my build blows out to 443mb. I suspect this is because the textures are decompressing in the build.
Is there anything I can do to help this somehow? Can I save the image files in another format that handles compression better (like some sort of DXT format?
They need to retain as much quality as possible, but i’d like to know if there’s some sort of special tricks I could use to help reduce final build size.
Thanks!
The source format is always irrelevant; the only thing that matters is the settings you select in Unity. Unity does not use PNG, JPG, etc., it only uses uncompressed or hardware compression (DXT or PVRTC depending on platform). If you want to use PNG files you need to save them as external files and load them at runtime with a function such as LoadImageIntoTexture.
–Eric
Hi Eric.
I guess what I really wanted to know was if it’s possible to save my textures directly to a DXT format to reduce the final build size? My textures are always a fixed distance from the camera with no alpha so I should be able to use DXT1 with no mip-maps.
Upon further inspection it seems that this is the case - the textures look identical, even though dds doesn’t have any of the Unity image options - I assume this is because they are fully uncompressed?
Thanks!
EDIT: Yep, I re-saved my 6 PNGs as DXT1 format dds files. The final build size dropped from 443mb to 107mb :shock: with only a VERY minimal loss of quality (barely noticeable). I’m guessing that Unity by default converts to DXT5 or similar?
If you’re using DXT, then you might as well just set DXT/no mipmaps format in Unity. Leave the textures in Photoshop (or whatever you’re using) format in your project for ease of editing.
You don’t have to guess, you can just look at the texture in Unity and it will tell you.
It’s DXT1 for no alpha, or DXT5 with alpha.
–Eric
That is awesome, I didn’t actually realise you could make so many adjustments by using the Advanced texture type.
And you’re absolutely right - when I select DXT1 with no mip maps it is the same size as the manually saved dds texture… So I’ll definitely be sticking to your suggestion of saving everything as a photoshop file.
Thanks a lot Eric, you’ve been a big help.