新浪博客

关于Unity中Texture压缩问题

2020-05-06 14:45阅读:
对于压缩格式分析如下
1、Android系列
ETC格式:仅支持OpenGL ES 2.0 GPUs
ETC2格式:支持OpenGL ES 3.0
DXT1和DXT5格式:仅支持Android (Nvidia Tegra and Intel Bay Trail)
ASTC格式:仅支持Android (PowerVR 6XT, Mali T600 series, Adreno 400 series, Tegra K1)
PVRTC格式:仅支持Android (PowerVR)
ATC格式:Android (Qualcomm - Adreno)


2、高通系列:
可选择专用ATC格式
根据类型选择ETC格式和ETC2格式
同时Adreno 400 series可以选择ASTC格式
3、Mali系列:
Mali T600 series可以选择ASTC格式
一般通用选择ETC2格式或根据需求选择ETC格式
官方文档如下

Texture compression formats for platform-specific overrides


While Unity supports many common image formats as source files for importing your Textures
(such as JPG, PNG, PSD and TGA), these formats are not used during realtime rendering
by 3D graphics hardware such as a graphics card or mobile device. 3D graphics hardware requires Textures to be compressed in specialized formats which are optimised for fast Texture sampling. The various different platforms and devices available each have their own different proprietary formats.
By default, the Unity Editor automatically converts Textures to the most appropriate format to match the build target you have selected. Only the converted Textures are included in your build; your source Asset
files are left in their original format, in your project’s Assets folder. However, on most platforms there are a number of different supported Texture compression formats to choose from. Unity has certain default formats set up for each platform, but in some situations you may want to override the default and pick a different compression format for some of your Textures (for example, if you are using a Texture as a mask, with only one channel, you might choose to use the BC4 format to save space while preserving quality).
To apply custom settings for each platform, use the Texture Importer to set default options, then use the Platform-specific overrides panel to override those defaults for specific platforms.
Default internal Texture representation per platform Default internal Texture representation per platform The following table shows the default formats used for each platform.
Platform Color model None Normal quality (Default) High quality Low quality (higher performance)
Windows, Linux, macOS, PS4
, XBox One
RGB RGB 24 bit RGB Compressed DXT1 RGB(A) Compressed BC7 RGB Compressed DXT1
RGBA RGBA 32 bit RGBA Compressed DXT5 RGB(A) Compressed BC7 RGBA Compressed DXT5
HDR
RGBA Half RGB Compressed BC6H RGB Compressed BC6H RGB Compressed BC6H
WebGL
RGB RGB 24 bit RGB Compressed DXT1 RGB Compressed DXT1 RGB Compressed DXT1
RGBA RGBA 32 bit RGBA Compressed DXT5 RGBA Compressed DXT5 RGBA Compressed DXT5
Android (default subTarget) RGB RGB 24 bit RGB Compressed ETC RGB Compressed ETC RGB Compressed ETC
RGBA RGBA 32 bit RGBA Compressed ETC2 RGBA Compressed ETC2 RGBA Compressed ETC2
iOS
RGB RGB 24 bit RGB Compressed PVRTC 4 bits RGB Compressed PVRTC 4 bits RGB Compressed PVRTC 2 bits
RGBA RGBA 32 bit RGBA Compressed PVRTC 4 bits RGBA Compressed PVRTC 4 bits RGBA Compressed PVRTC 2 bits
tvOS RGB RGB 24 bit RGB Compressed ASTC 6x6 block RGB Compressed ASTC 4x4 block RGB Compressed ASTC 8x8 block
RGBA RGBA 32 bit RGBA Compressed ASTC 6x6 block RGBA Compressed ASTC 4x4 block RGBA Compressed ASTC 8x8 block
RGBA RGBA 32 bit RGBA 16 bit RGBA 16 bit RGBA 16 bit

All supported Texture compression formats

The following table shows the Texture compression format options available on each platform, and the resulting compressed file size (based on a 256px-square image). Choosing a Texture compression format is a balance between file size and quality; the higher the quality, the greater the file size. In the description below, see the final file size of a in-game Texture of 256 by 256 pixels
.
When you use a Texture compression format that is not supported on the target platform, the Textures are decompressed to RGBA 32 and stored in memory alongside the compressed Textures. When this happens, time is lost decompressing Textures, and memory is lost because you are storing them twice. In addition, all platforms have different hardware, and are optimised to work most efficiently with specific compression formats; choosing non-compatible formats can impact your game’s performance. The table below shows supported platforms for each compression format.
Notes on the table below:
  • RGB is a color model in which red, green and blue are added together in various ways to reproduce a broad array of colors.
  • RGBA is a version of RGB with an alpha channel, which supports blending and opacity alteration.
  • Crunch compression is a lossy compression format (meaning that parts of the data are lost during compression) on top of DXT or ETC Texture compression. Textures are decompressed to DXT or ETC on the CPU, and then uploaded to the GPU at run time. Crunch compression helps the Texture use the lowest possible amount of space on disk and for downloads. Crunch Textures can take a long time to compress, but decompression at run time is very fast.
Texture compression format Description Size
for a 256x256 pixel Texture
Platform Support
RGB Compressed DXT1 Compressed unsigned normalised 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 RGB Compressed DXT1, but compressed using Crunch compression. See Notes, above, for more on crunch 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 ar

我的更多文章

下载客户端阅读体验更佳

APP专享