blue
blue

Reputation: 7375

Best way to compress textures in Unity for iOS (game is way too big)?

I have looked everywhere and at Unity iOS Build size is way big, and after building my game for iOS it is way too big at 170 MB. I checked my player size statistics in the editor log and 96% of the size is textures - this is because as I was going into this box and maxing out everything (I did not know what I was doing):

enter image description here

Now I need to go back and reduce my asset sizes. I don't know a lot about texture compression so I need to know - for iOS (and Android later), what are the optimal settings in this override box for compressing textures to minimum size?

Is there a way to do this to multiple images at once? What should the compressor quality be?

Upvotes: 0

Views: 12081

Answers (1)

Foggzie
Foggzie

Reputation: 9821

This is a great time to learn about the AssetPostProcessor! Specifically, AssetPostProcessor.OnPreprocessTexture will allow you to automatically handle the import settings of textures in your Unity project. It will modify their meta files as they're imported and Right-click > Reimport will force them to run (you can use this on a whole directory; even the whole Assets directory).

As far as which settings you should use, that's entirely dependent on your project. A few thoughts:

  1. Make sure your Max Size is appropriate for the textures. Icons don't need to be 4k and background images shouldn't be scaled down to 256.

  2. Compressor Quality "Normal" is fine in most cases. Any compression is far better than no compression.

  3. We use "Compressed ETC2 8 bits" on Android and "Compressed PVRTC 4 bits" on iOS.

  4. Whether or not you use "RGB" vs "RGBA" is important to consider; textures that don't need an alpha chanel would be wasting memory if you choose "RGBA" and textures that do need one wont function properly if you choose "RGB".

Upvotes: 1

Related Questions