【Texture Format全解析】
What internal representation is used for the texture. This is a tradeoff between size and quality.
紋理的壓縮方式取決於大小和質量的平衡。
由上圖可以看到:
1)RGB Compressed DXT1 > RGB 16 bit
2)RGBA Compressed DXT5 > RGBA 16 bit
3)非 Normal 情況下,RGBA Compressed DXT5 > RGBA 32 bit
【iOS平台】
上圖可以看到,前一節中的DXT壓縮無法應用於iOS設備上,取而代之的理PVRTC技術。從上圖可以看出:
RGB Compressed PVRTC 4 bits > RGB 16 bit
RGB Compressed PVRTC 4 bits > RGB Compressed PVRTC 2 bits
RGBA Compressed PVRTC 4 bits > RGBA 16 bit
RGBA Compressed PVRTC 4 bits > RGBA Compressed PVRTC 2 bits
RGBA Compressed PVRTC 4 bits > RGBA 32 bit
【Android】
Unless you’re targeting a specific hardware, like Tegra, we’d recommend using ETC1 compression. If needed you could store an external alpha channel and still benefit from lower texture footprint.
If you absolutely want to store an alpha channel in a texture, RGBA16 bit is the compression supported by all hardware vendors.
RGB Compressed ETC 4 bits 適合於diffuse-map,如果圖像有alpha通道,為了全平台使用,必須使用RGBA16。
If your app utilizes an unsupported texture compression, the textures will be uncompressed to RGBA 32 and stored in memory along with the compressed ones. So in this case you lose time decompressing textures and lose memory storing them twice. It may also have a very negative impact on rendering performance.
如果使用了不支持的壓縮技術,那么帶帶來浪費解壓時間,以及花費雙倍內存的情況,有極大的負面影響。
【Texture Size】
If the platform or GPU does not support NPOT texture sizes, then Unity will scale and pad the texture up to next power of two size, which will use even more memory and make loading slower.
如果紋理不是2的次冪,Unity會scale、pad紋理,以使得達到2的次冪,這樣會花費更多內存,讓加載更慢。所以良好的建議是,所有的紋理都必須是2的次冪。
【Mip Maps】
Using mip maps uses 33% more memory, but not using them can be a huge performance loss. You should always use mipmaps for in-game textures.
Mip Map會多花費33%的內存。
【Anisotropic filtering】
Anisotropic filtering increases texture quality when viewed from a grazing angle, at some expense of rendering cost (the cost is entirely on the graphics card). Increasing anisotropy level is usually a good idea for ground and floor textures.
anisotropic filtering只花費gpu時間。