Editing Texture Settings

Tutorial

·

intermediate

·

+0XP

·

15 mins

·

(85)

Unity Technologies

Editing Texture Settings

In this tutorial, we review the available settings when importing textures into your 3D mobile application.

Languages available:

1. Overview

Unity makes editing Texture settings very simple. To edit Texture settings, select the Texture you want to edit in the Project view and all available settings will appear in the Inspector window, ready to configure.


Here are some tips for editing Texture settings:


  • Texture Type lets you control the type of Texture, causing the Texture to be used in different ways within the engine.

  • Texture Shape allows you to choose cubemaps instead of 2D for some Texture types.

  • Depending on the Texture Type, there are two additional settings that appear:

  • Texture Settings have specific controls for the Texture to work as needed.

  • Advanced Settings covers: sRGB, Alpha Source, Alpha Is Transparent, Read/Write Enabled, and Generate Mip Maps.

  • Wrap Mode controls how the Texture wraps your UVs. The options are:

  • Repeat tiles the Texture and is used for repeating patterns.

  • Clamp locks the Texture to the last pixel at the edge.

  • Mirror works like Repeat, but mirrors every other repeat of the Texture.

  • Mirror Once mirrors the Texture a single time before locking it to the edge pixels.

  • Filter Mode controls which filter is used on the Texture.

  • The Texture Compression box gives you control over Max Size, Resize Algorithm, Format, Compression, and Use Crunch Compression.

2. ASTC Compression Settings

ASTC Texture compression is an official extension to the OpenGL and OpenGL ES graphics APIs. ASTC can reduce the memory required by your application and reduce the memory bandwidth required by the GPU.


ASTC offers high quality, low bitrate Texture compression and has many control options. It includes the following features:


  • Bit rates range from 8 bits per pixel (bpp) to less than 1 bpp. This allows you to fine-tune the tradeoff of file size against quality.

  • Support for one to four color channels.

  • Support for both low dynamic range (LDR) and high dynamic range (HDR) images.

  • Support for 2D and 3D images.

  • Support for selecting different combinations of features.

The following figure shows the ASTC settings window:



There are a number of block size options available in the ASTC settings window. You can choose from these options and select the block size that best fits the Assets. The larger block sizes provide higher compression. It’s best to select large block sizes for Textures that aren’t shown in great detail, like objects that are far from the camera. Smaller block sizes are best for Textures that show more detail, such as those that are closer to the camera.


The following figure shows the block sizes available for different Texture compression formats:



(Note: If your device supports ASTC, use it to compress the Textures in your 3D content. If your device does not support ASTC, try using ETC2. Also, you must differentiate between Textures used in 3D content and Textures used in the GUI elements. In some cases, it might be best to leave the GUI Textures uncompressed to avoid unwanted artifacts.)


3. Selecting the Correct Format For ASTC Textures

When compressing an ASTC Texture, there are a number of options to choose from.


Texture compression algorithms have different channel formats, typically RGB and RGBA. ASTC supports several other formats, but these formats aren’t exposed within Unity. Each Texture is typically used for different purposes, such as standard texturing, normal mapping, specular, HDR, alpha, and lookup Textures. All of these Texture types require a different compression format to achieve the best possible results.


The following figure shows some Texture types in Import Settings:



It’s best not to compress all of your Textures with one format in Build Settings. A good practice is to keep Texture compression as Don't Override.


Unity typically imports your Texture as the type Texture. This type provides limited options for compression. Set the type to Advanced to show more options.


The following image shows settings for a GUI Texture with some transparency. Since the Texture is for GUI use, sRGB and mipmaps are disabled. To include transparency and gain access to an alpha channel, the Alpha Is Transparency and Override for Android box can be selected.



4. Block Sizes

There is an option to select a format and block size. RGBA includes an alpha channel and 4x4 is the smallest block size you can select.


Selecting specific settings for all of your Textures can improve the visual quality of your project and avoid unnecessary Texture data at compression time.


The following table shows the compression ratio for the available ASTC block sizes in Unity for a 4 MB, 1024x1024 Texture using an RGBA (8-bits per channel) format.



5. Conclusion

There are a multitude of settings for Textures that can be fine-tuned to provide optimal performance on mobile devices. Configuring block sizes, formats, and compression settings can seem overwhelming at first, but with steady practice and patience, these tools will allow you to optimize applications across a wide variety of scenarios and platforms. In the next tutorial, we’ll look at a demo project that examines the impact of Texture atlases on performance.


Complete this tutorial