Version: 2022.3
Texture formats
Mipmaps

Recommended, default, and supported texture formats, by platform

本页包含以下信息:

This page doesn’t contain information about console platforms. For information about console platforms, see the platform-specific documentation.

For an overview of texture formats, see Texture formats. For information about texture import settings and how to set per-texture platform-specific overrides, see Texture import settings. Some texture import settings can also be overridden globally in Build Settings, mostly to speed up iteration time during development.

术语

本页用到了以下术语:

  • 每像素位数 (bpp) 表示单个纹理像素所需的存储量。Bpp 值越低的纹理在磁盘和内存中也越小。较低的 bpp 值意味着 GPU 可在缓存中存储更多的像素,从而可以更快地访问纹理。
  • LDR(低动态范围)是指最典型的图像,其中颜色在概念上介于 0.0(黑色)和 1.0(白色)值之间。大多数图像文件(例如 PNG 和 JPG)具有低动态范围。
  • HDR(高动态范围)是指特殊的图像和纹理格式,其中颜色的范围可以高于 0 到 1。像 .exr 或 .hdr 这样的图像文件格式通常用于 HDR 图像数据。在运行时和 GPU 上,有多种 HDR 格式,分别对精度、范围和内存使用情况进行取舍。
  • RGB 是一种颜色模型,通过红色、绿色和蓝色的组合生成一系列颜色。
  • RGBA 是具有 Alpha 通道的 RGB 版本,支持混合和不透明度更改。
  • 可变比特率 (VBR) 表示每像素的位数不是固定值,而是取决于实际内容。VBR 仅适用于 Crunch 压缩,仅限于磁盘上的纹理大小。内存中的大小与使用基础纹理格式时的大小相同(例如,RGB Compressed DXT1 对应 RGB Crunched DXT1)。

Recommended texture formats, by platform

桌面端

对于具有 DirectX 11 或更高级别 GPU 的设备,可保证支持 BC7 和 BC6H 格式,推荐的压缩格式选择是: RGB 纹理 - DXT1 4 位/像素。 RGBA 纹理 - BC7(质量更高,压缩速度较慢)或 DXT5(压缩速度较快),均为 8 位/像素。 HDR 纹理 - BC6H 8 位/像素。 如果您需要在 PC 上支持 DirectX 10 类 GPU(2010 年之前的 NVIDIA GPU,2009 年之前的 AMD,2012 年之前的 Intel),则首选 DXT5(而不是 BC7),因为这些 GPU 不支持 BC7 和 BC6H。

See the Supported texture formats reference table for detailed information about all supported formats.

iOS 和 tvOS

For Apple devices that use the A8 chip (2014) or above, ATSC is the recommended texture format for RGB and RGBA textures. This format allows you to choose between texture quality and size on a granular level: all the way from eight bits/pixel (4x4 block size) down to 0.89 bits/pixel (12x12 block size). If support for older devices is needed, or you want additional Crunch compression, then Apple devices support ETC/ETC2 formats starting with A7 chip (2013). For even older devices, PVRTC is the format to use. On iOS you can configure the default texture format in the Player Settings. PVRTC gives you the broadest possible compatibility. ASTC is preferred, but is not supported on A7 devices (the very first Metal-enabled devices) and will be unpacked at runtime.

See the Supported texture formats reference table for detailed information about all supported formats.

Android

Texture format support on Android is complicated. You might need to build several application versions with different sub-targets.

You can select the default format in Player Settings. Your options are ASTC, ETC2 and ETC (ETC1 for RGB, ETC2 for RGBA). See Texture compression settings for more details on how the different settings interact.

For LDR RGB and RGBA textures, most modern Android GPUs that support OpenGL ES 3.1 or Vulkan also support ASTC format, including: Qualcomm GPUs since Adreno 4xx / Snapdragon 415 (2015), ARM GPUs since Mali T624 (2012), NVIDIA GPUs since Tegra K1 (2014), PowerVR GPUs since GX6250 (2014).

If you need support for older devices, or you want additional Crunch compression, then all GPUs that run Vulkan or OpenGL ES 3.0 support the ETC2 format. The resulting image quality is quite high, and it supports one- to four-component texture data. OpenGL ES 2 devices do not support the ETC2 format, so Unity decompresses the texture at runtime to the format ETC2 fallback specifies. For even older devices, usually only ETC format is available. The drawback is that there is no direct alpha channel support. For Sprites, Unity offers an option to use ETC1 compression by splitting a texture into two ETC1 textures: one for RGB, one for alpha. To enable this, enable the Android-specific Split Alpha Channel option for the Texture when importing a Sprite Atlas. The sprite shader samples both textures and combines them into the final result.

For HDR textures, ASTC HDR is the only compressed format available on Android devices. ASTC HDR requires Vulkan or GL_KHR_texture_compression_astc_hdr support. ASTC is the most flexible format. If a device doesn’t support ASTC HDR the texture is decompressed at runtime to RGB9e5 or RGBA Half, depending on alpha channel usage.

对于不支持 ASTC HDR 的设备,所有运行 Vulkan、Metal 或 OpenGL ES 3.0 的设备都支持 RGB9e5,适用于没有 Alpha 通道的纹理。如果需要 Alpha 通道或更广泛的支持,请使用 RGBA Half。这种格式占用的内存是 RGB9e5 的两倍。

See the Supported texture formats reference table for detailed information about all supported formats.

Default texture formats, by platform

下表显示了每个平台使用的默认格式。

平台 颜色模型 正常质量(默认设置) 高质量 低质量(更高性能)
Windows、Linux、macOS RGB RGB 24 位 RGB Compressed DXT1 RGB(A) Compressed BC7 RGB Compressed DXT1
RGBA RGBA 32 位 RGBA Compressed DXT5 RGB(A) Compressed BC7 RGBA Compressed DXT5
HDR RGBA Half RGB Compressed BC6H RGB Compressed BC6H RGB Compressed BC6H
WebGL (configurable) RGB RGB 24 位 RGB Compressed DXT1 RGB Compressed DXT1 RGB Compressed DXT1
RGBA RGBA 32 位 RGBA Compressed DXT5 RGBA Compressed DXT5 RGBA Compressed DXT5
Android (configurable) RGB RGB 24 位 RGBA Compressed ASTC 6x6 block
RGB Compressed ETC2
RGB Compressed ETC
RGBA Compressed ASTC 4x4 block
RGB Compressed ETC2
RGB Compressed ETC
RGBA Compressed ASTC 8x8 block
RGB Compressed ETC2
RGB Compressed ETC
RGBA RGBA 32 位 RGBA Compressed ASTC 6x6 block
RGBA Compressed ETC2
RGBA Compressed ASTC 4x4 block
RGBA Compressed ETC2
RGBA Compressed ASTC 8x8 block
RGBA Compressed ETC2
iOS (configurable) RGB RGB 24 位 RGBA Compressed ASTC 6x6 block
RGB Compressed PVRTC 4 bits
RGBA Compressed ASTC 4x4 block
RGB Compressed PVRTC 4 bits
RGBA Compressed ASTC 8x8 block
RGB Compressed PVRTC 2 bits
RGBA RGBA 32 位 RGBA Compressed ASTC 6x6 block
RGBA Compressed PVRTC 4 bits
RGBA Compressed ASTC 4x4 block
RGBA Compressed PVRTC 4 bits
RGBA Compressed ASTC 8x8 block
RGBA Compressed PVRTC 2 bits
tvOS RGB RGB 24 位 RGBA Compressed ASTC 6x6 块 RGBA Compressed ASTC 4x4 块 RGBA Compressed ASTC 8x8 块
RGBA RGBA 32 位 RGBA Compressed ASTC 6x6 块 RGBA Compressed ASTC 4x4 块 RGBA Compressed ASTC 8x8 块
Default RGBA RGBA 32 位 RGBA 16 位 RGBA 16 位 RGBA 16 位

Texture formats, by quality

The table below shows each format available in Unity, and their quality details.

Texture format 描述 通道 Quality 每像素位数 1024x1024 纹理的大小,以 MB 为单位
RGB(A) Compressed BC7 压缩 RGB 或 RGBA RGB 或 RGBA。 8 1
RGBA Crunched DXT5 Compressed RGBA,采用额外的磁盘上 Crunch 压缩。 RGBA 低到中 可变 可变
RGBA 64 bit 未压缩 RGBA,精度非常高 RGBA 非常高 64 8
RGBA 32 bit 未压缩 RGBA RGBA 32 4
RGBA 16 bit 量化 RGBA RGBA 16 2
RGB Compressed DXT1 压缩 RGB(也称为 BC1) RGB 4 0.5
RGB Crunched DXT1 压缩 RGB,采用额外的磁盘上 Crunch 压缩。 RGB 低到中 可变 可变
RGB 48 bit 未压缩 RGB,精度非常高。为 GPU 转换为 RGBA 64 位 RGB 非常高 48(磁盘),64(GPU) 6(磁盘),8(GPU)
RGB 24 bit 未压缩 RGB。为 GPU 转换为 RGBA 32 位 RGB 24(磁盘),32(GPU) 3(磁盘),4(GPU)
RGB 16 bit 量化 RGB RGB 16 2
RG Compressed BC5 压缩双通道 (RG) RG 8 1
RG 32 bit 未压缩双通道 (RG),精度非常高 RG 非常高 32 4
R Compressed BC4 压缩单通道 (R) R 4 0.5
R 8 未压缩单通道 (R) R 8 1
R 16 bit 未压缩单通道 (R),精度非常高 R 非常高 16 2
Alpha 8 未压缩单通道 (A) A 8 1
RGBA Half HDR, half-precision (FP16) RGBA, –64k to +64k range RGBA 64 8
RGB Compressed BC6H HDR,压缩 RGB,0 到 +64k 范围 RGB 8 1
RGB9e5 32 Bit Shared Exponent Float HDR,量化 RGB,0 到 +64k 范围 RGB 32 4
RGB(A) Compressed ASTC 压缩 RGB 或 RGBA,大小和质量取决于块大小 RGB 或 RGBA。 低到高 12x12: 0.89, 10x10: 1.28, 8x8: 2, 6x6: 3.56, 5x5: 5.12, 4x4: 8 12x12: 0.11, 10x10: 0.16, 8x8: 0.25, 6x6: 0.45, 5x5: 0.64, 4x4: 1.0
RGBA Compressed ETC2 压缩 RGBA RGBA 8 1
RGBA Crunched ETC2 Compressed RGBA,采用额外的磁盘上 Crunch 压缩。 RGBA 低到中 可变 可变
RGB + 1-bit Alpha Compressed ETC2 4 bits 压缩 RGBA,Alpha 值完全不透明或完全透明 RGBA 4 0.5
RGBA Compressed PVRTC 4 bits 压缩 RGBA,纹理要求为方形 RGBA 4 0.5
RGBA Compressed PVRTC 2 bits 压缩 RGBA,纹理要求为方形 RGBA 2 0.25
RGB Compressed ETC2 压缩 RGB RGB 4 0.5
RGB Compressed ETC 压缩 RGB RGB 4 0.5
RGB Crunched ETC 压缩 RGB,采用额外的磁盘上 Crunch 压缩。 RGB 可变 可变
RGB Compressed PVRTC 4 bits 压缩 RGB,纹理要求为方形 RGB 4 0.5
RGB Compressed PVRTC 2 bits 压缩 RGB,纹理要求为方形 RGB 2 0.25
RG Compressed EAC 8 bit 压缩双通道 (RG) RG 8 1
R Compressed EAC 4 bit 压缩单通道 (R) R 4 0.5
RGB(A) Compressed ASTC HDR HDR,压缩 RGB 或 RGBA,大小和质量取决于块大小 RGB 或 RGBA。 低到高 12x12: 0.89, 10x10: 1.28, 8x8: 2, 6x6: 3.56, 5x5: 5.12, 4x4: 8 12x12: 0.11, 10x10: 0.16, 8x8: 0.25, 6x6: 0.45, 5x5: 0.64, 4x4: 1.0

Supported texture formats, by platform

The table below shows each texture format available in Unity, and the platforms that support them.

Texture format Windows macOS Linux Android iOS 和 tvOS WebGL (Desktop Browsers) WebGL (iOS and Android browser)
RGB(A) Compressed BC7 是 (1) 是 (1) no no yes (1) no
RGBA Compressed DXT5 否 (3) no 部分 (2) no
RGBA Crunched DXT5 否 (3) no 部分 (2) no
RGBA 64 bit 部分 (6) no no
RGBA 32 bit
RGBA 16 bit
RGB Compressed DXT1 否 (3) no 部分 (2) no
RGB Crunched DXT1 否 (3) no 部分 (2) no
RGB 48 bit 部分 (6) no no
RGB 24 bit
RGB 16 bit
RG Compressed BC5 no no yes no
RG 32 bit 部分 (6) no no
R Compressed BC4 no no yes no
R 8 部分 (5) 部分 (5) 部分 (5)
R 16 bit 部分 (6) 部分 (6) yes (14) yes (14)
Alpha 8
RGBA Half 部分 (7) 部分 (7) 部分 (7)
RGB Compressed BC6H 是 (1) 是 (1) no no yes (1) no
RGB9e5 32 Bit Shared Exponent Float 部分 (4) 部分 (4) 部分 (4)
RGB(A) Compressed ASTC no no no 部分 (8) 是 (10) no yes (13 & 10)
RGBA Compressed ETC2 no no no 部分 (9) no
RGBA Crunched ETC2 no no no 部分 (9) no
RGB + 1-bit Alpha Compressed ETC2 4 bits no no no 部分 (9) no
RGBA Compressed PVRTC 4 bits no no no 否 (12) no no
RGBA Compressed PVRTC 2 bits no no no 否 (12) no no
RGB Compressed ETC2 no no no 部分 (9) no
RGB Compressed ETC no no no no
RGB Crunched ETC no no no no
RGB Compressed PVRTC 4 bits no no no 否 (12) no no
RGB Compressed PVRTC 2 bits no no no 否 (12) no no
RG Compressed EAC 8 bit no no no 部分 (9) no
R Compressed EAC 4 bit no no no 部分 (9) no
RGB(A) Compressed ASTC HDR no no no 部分 (11) 部分 (11) no 部分 (11)

注意:

  1. Except on pre-DX11 level GPUs, or macOS when using WebGL or OpenGL. When not supported, BC6H textures get decompressed to RGBA Half, and BC7 get decompressed to RGBA32 at load time.
  2. With linear rendering on web browsers that don’t support sRGB DXT, textures are decompressed to RGBA32 at load time.
  3. 采用 NVIDIA Tegra GPU 的 Android 设备除外;这些确实支持 DXT/ BC 格式。
  4. OpenGL ES 2.0 / WebGL 1 上除外。
  5. 对于 OpenGL ES 2.0/ WebGL 1:需要 GL_EXT_texture_rg 扩展支持。
  6. 在 Android 上需要 GL_EXT_texture_norm16 或相应 Vulkan 功能。
  7. 对于 OpenGL ES 2.0/ WebGL 1:需要 OES_texture_half_float 扩展支持。
  8. 需要 Vulkan 或 GL_KHR_texture_compression_astc_ldr OpenGL ES 扩展。
  9. Except on OpenGL ES 2.0; there ETC2 textures are decompressed into the format ETC2 fallback specifies in the Android Build Settings or on the Android tab for the Platform-specific overrides.
  10. Apple A7 芯片设备 (2013) 上除外。
  11. Android: requires GL_KHR_texture_compression_astc_hdr extension. iOS: requires A13 or later chip (2019).WebGL: requires WEBGL_compressed_texture_astc extension and HDR profile. When not supported, the texture is decompressed to RGB9E5 format, losing the alpha channel.
  12. 采用 Imagination PowerVR GPU 的 Android 设备除外;这些确实支持 PVRTC 格式。
  13. Requires WEBGL_compressed_texture_astc extension.
  14. Requires EXT_texture_norm16 extension and WebGL 2.

Supported texture formats in WebGL

The following table provides the supported texture formats for WebGL.

格式 Descritpion
ASTC Adaptive Scalable Texture Compression (ASTC) is an advanced lossy texture compression format. Widely used for mobile browsers / devices.
DXT Also known as S3 Texture Compression (S3TC), DXT is mainly used for desktop browsers and devices.
ETC2 Ericsson Texture Compression (ETC) is an older lossy texture compression format, lower quality than ASTC, used for mobile browsers / devices.

Additional resources:

TextureImporterOverride

Texture formats
Mipmaps