本页包含以下信息:
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.
本页用到了以下术语:
对于具有 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.
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.
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.
下表显示了每个平台使用的默认格式。
平台 | 颜色模型 | 无 | 正常质量(默认设置) | 高质量 | 低质量(更高性能) |
---|---|---|---|---|---|
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 位 |
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 |
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) |
注意:
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. |