Image texture compression scheme

Unity supports a variety of image formats as source file import texture (JPG, PNG, PSD, TGA), Unity will convert them to the supported format Texture2D, at the option of setting Texture2D for different platforms and the actual needs, select the appropriate the compression format to minimize image textures take up memory.

Official document gives all supported texture compression formats: official document link , select the texture compression format is a trade-off between image memory size and picture quality. At the same time, to select texture compression format supported by the platform, when the platform does not support the target texture compression format, decompresses textures RGBA 32, and stored in memory together with the compressed textures. When this happens, the texture will be a waste of time to decompress, and a waste of memory. In addition, different platforms have different hardware, specific compression format optimized, select incompatible format will affect the performance of the game.

Without the Android platform transparent channel preferentially used ETC1, with transparent channel preferentially used ETC2, higher quality requirements may be used RGBA16, RGBA32. Under IOS platform precedence PVRTC, followed by ASTC. It requires higher quality can be used RGBA16, RGBA32.

Picture memory occupied by smaller, load faster, better gaming performance. But some compression format size of the picture there are some limitations. ETC1, ETC2 and ASTC4x4 required width and height of the image size may not be equal, but must be divisible by 4; PVRTC of the IOS image compression format requested width and height must be the same and is an integer power of 2, or can not be compressed. In addition ETC2 and ASTC hardware also has some limitations, ETC2 only supports OpenGL ES 3.0 Android phone more, ASTC supports only Apple A8 future devices. These are all matters in the choice of compression format to note.

The following table shows the platform support for each compression format.

Texture compression format Description Size
for a 256x256 pixel Texture
Platform Support
RGB Compressed DXT1 Compression unsigned integer integer RGB texture. 32KB (4 bits per pixel) Windows, Linux, macOS, PS4, XBox One, Android (Nvidia Tegra and Intel Bay Trail), WebGL

Note: With linear rendering on web browser that doesn’t support sRGB DXT, textures are uncompressed at run time to RGBA32.
RGB Crunched DXT1 Similar to the RGB compression DXT1, but using compression compression. See note above to learn more about the compression. Variable, depending on the complexity of the content in the texture. Windows, Linux, macOS, PS4, XBox One, Android (Nvidia Tegra and Intel Bay Trail), WebGL

Note: With linear rendering on a web browser that doesn’t support sRGB DXT, textures are uncompressed at run time to RGBA32.
RGBA Compressed DXT5 Compression unsigned integer integer RGBA texture. 8 bits per pixel. 64KB (8 bits per pixel) Windows, Linux, macOS, PS4, XBox One, Android (Nvidia Tegra and Intel Bay Trail), WebGL

Note: With linear rendering on a web browser that doesn’t support sRGB DXT, textures are uncompressed at run time to RGBA32.
RGBA Crunched DXT5 And RGBA compression DXT5 similar, but using compression compression. See note above to learn more about the compression. Variable, depending on the complexity of the content in the texture. Windows, Linux, macOS, PS4, XBox One, Android (Nvidia Tegra and Intel Bay Trail), WebGL

Note: With linear rendering on a web browser that doesn’t support sRGB DXT, textures are uncompressed at run time to RGBA32.
RGB Compressed BC6H Unsigned floating compression / high dynamic range (HDR) RGB texture. 64KB (8 bits per pixel) Windows Direct3D 11: OpenGL 4, Linux.

Note: BC6H Textures are uncompressed at run time to RGBA half on the following platform configurations:
- macOS with OpenGL
- Platforms with Direct3D 10 Shader Model 4 or OpenGL 3 GPUs.
RGB(A) Compressed BC7 High-quality compressed unsigned integer integer RGB or RGBA texture. 64KB (8 bits per pixel) Windows Direct3D 11: OpenGL 4, Linux

Note: BC7 Textures are uncompressed at run time to RGBA 32bits on the following platform configurations:
- macOS with OpenGL
- Platforms with Direct3D 10 Shader Model 4
Platforms with OpenGL 3 GPUs.
RGB Compressed ETC RGB texture compression. This is a default texture compression format, no alpha channel Android project. 32KB (4 bits per pixel) Android, iOS, tvOS.
Note: ETC1 is supported by all OpenGL ES 2.0 GPUs. It does not support alpha.
RGB Crunched ETC 类似于RGB压缩等,但使用压缩压缩压缩。请参阅上面的注释,了解更多关于压缩压缩的内容。 Variable, depending on the complexity of the content in the texture. Android, iOS, tvOS.
RGB Compressed ETC2

压缩RGB纹理。

32KB (4 bits per pixel) Android (OpenGL ES 3.0)
Note: On Android platforms that don’t support ETC2, the texture is uncompressed at run time to the format specified by ETC2 fallback in the Build Settings.
RGBA Compressed ETC2 压缩RGBA纹理。这是用于Android项目的alpha通道纹理的默认纹理压缩格式。 64KB (8 bits per pixel) Android (OpenGL ES 3.0), iOS (OpenGL ES 3.0), tvOS (OpenGL ES 3.0)

Note: On iOS and tvOS devices that don’t support ETC2, the texture is uncompressed at run time to RGBA32. On Android platforms that don’t support ETC2, the texture is uncompressed at run time to the format specified by ETC2 fallback in the Build Settings.
RGBA Crunched ETC2 类似于RGBA压缩ETC2,但是使用压缩压缩压缩。请参阅上面的注释,了解更多关于压缩压缩的内容。 Variable, depending on the complexity of the content in the texture. Android (OpenGL ES 3.0), iOS (OpenGL ES 3.0), tvOS (OpenGL ES 3.0)

Note: On iOS and tvOS devices that don’t support ETC2, the texture is uncompressed at run time to RGBA32. On Android platforms that don’t support ETC2, the texture is uncompressed at run time to the format specified by ETC2 fallback in the Build Settings.
RGB Compressed ASTC 可变块大小压缩RGB纹理。 12x12: 0.89 bits per pixel (7.56KB for a 256x256 Texture)
10x10: 1.28 bits per pixel (10.56KB for a 256x256 Textures)
8x8: 2 bits per pixel (16KB for a 256x256 Texture);
6x6: 3.56 bits per pixel (28.89KB for a 256x256 Texture)
5x5: 5.12 bits per pixel (42.25KB for a 256x256 Texture)
4x4: 8 bits per pixel (64KB for a 256x256 Texture)
tvOS (all), iOS (A8), Android (PowerVR 6XT, Mali T600 series, Adreno 400 series, Tegra K1).
RGBA Compressed ASTC 可变块大小压缩RGBA纹理。 12x12: 0.89 bits per pixel (7744 bytes for a 256x256 Texture)
10x10: 1.28 bits per pixel (10816 bytes for a 256x256 Textures)
8x8: 2 bits per pixel (16KB for a 256x256 Texture);
6x6: 3.56 bits per pixel (29584 bytes for a 256x256 Texture)
5x5: 5.12 bits per pixel (43264 bytes for a 256x256 Texture)
4x4: 8 bits per pixel (64KB for a 256x256 Texture)
tvOS (all), iOS (A8), Android (PowerVR 6XT, Mali T600 series, Adreno 400 series, Tegra K1).
RGB Compressed PVRTC 2 bits 高压缩RGB纹理。质量低,但尺寸小,性能更佳。 16KB (2 bits per pixel) Android (PowerVR), iOS, tvOS.
RGBA Compressed PVRTC 2 bits 高压缩RGBA纹理。质量低,但尺寸小,性能更佳。 16KB (2 bits per pixel) Android (PowerVR), iOS, tvOS.
RGB Compressed PVRTC 4 bits 压缩RGB纹理。高质量的纹理,特别是在颜色数据上,但是需要很长时间来压缩。 32KB (4 bits per pixel) Android (PowerVR), iOS, tvOS.
RGBA Compressed PVRTC 4 bits 压缩RGB纹理。高质量的纹理,特别是在颜色数据上,但是需要很长时间来压缩。 32KB (4 bits per pixel) Android (PowerVR), iOS, tvOS.
RGB Compressed ATC

压缩RGB纹理。

32KB (4 bits per pixel) Android (Qualcomm - Adreno), iOS, tvOS.
RGBA Compressed ATC

压缩RGBA纹理。

64KB (8 bits per pixel) Android (Qualcomm - Adreno), iOS, tvOS.
RGB 16 bit

65万种没有阿尔法的颜色。使用比压缩格式更多的内存,但是更适合于UI

或者没有渐变的脆纹理。

128KB (16 bits per pixel) All platforms.
RGB 24 bit 真正的颜色,但没有alpha。 192KB (24 bits per pixel) All platforms
Alpha 8 高质量的alpha通道,但没有任何颜色。 64KB (8 bits per pixel) All platforms.
RGBA 16 bit 低质量的真实颜色。这是具有alpha通道的纹理的默认压缩。 128KB (16 bits per pixel) All platforms.
RGBA 32 bit 真正的颜色和alpha。这是具有alpha通道的纹理的最高质量压缩。 256KB (32 bits per pixel) All platforms.

Guess you like

Origin www.cnblogs.com/dingzhaoliang/p/12149598.html