Unity and ASTC

Unity lets you enable ASTC on Android, iOS, tvOS, and WebGL if the hardware supports it. On Android, both HDR and LDR profiles are available.

Build settings

Each platform has default texture compression formats. For example, on Android the defaults are ETC2 for RGBA textures and ETC for RGB textures. You can change the compression setting in File > Build Settings, as you can see here:

The Texture Compression setting is global for all textures. The Don't override option means the default texture compression format is used.

Texture-specific settings

Use the Override for platform section in Texture settings to override the global compression format for each texture, as you can see in this screenshot:

If you select Best for Compression Quality, the compressor thoroughly chooses the optimum ASTC blocks, but at the cost of increased compression time.

You can specify the size of ASTC blocks by choosing the corresponding Format, as shown in the following screenshot:

If Override for platform is disabled, the settings in this section are still useful. You can consult these settings to see which format and settings are in use for this specific texture, based on the global setting and texture type.

Import Settings let you specify texture type and alpha channel information. These settings let Unity choose appropriate compression settings for the texture, as you can see in the following screenshot:

Make sure you select Normal map if needed.

After you apply the texture settings, Texture Preview lets you see the result and the selected compression format and memory usage:

Building for different hardware

Not every device supports ASTC. If you have chosen a texture format your platform does not support, texture data is decompressed at runtime. This does not have a huge impact on loading time because Unity uses robust decoders. However, you lose all the other benefits of texture compression like lower memory footprint and cache efficiency.

To avoid this situation, you can build separate APKs for different hardware. For example, ASTC is available on devices with OpenGL ES 3. For OpenGL ES 2, you can use ETC.

For example, the following steps show one of the possible workflows that you can follow to build different APKs for different platforms:

  1. Build for OpenGL ES 3 and Vulkan:

    1. Select ASTC in File > Build Settings for Android.
    2. Go to Edit > Project Settings > Player Settings and disable OpenGL ES 2.
    3. Build the APK.
  2. Build for OpenGL ES 2:

    1. Select Don't override in File > Build Settings for Android.
    2. Ensure that all the texture-specific overrides for the platform are either disabled or use ETC format.
    3. Go to Edit > Project Settings > Player Settings and leave only OpenGL ES 2 enabled.
    4. Build the APK.
Previous Next