unity 纹理压缩格式‘_XDRender_Texture2D 基础2D纹理总结-1

本文总结了Unity中2D纹理的原始压缩格式,包括PNG、JPG和GIF,以及针对渲染的编码如ETC1、DXT、PVRTC和ASTC。此外,探讨了渲染过程中获取纹理数据的方法,如重心坐标、采样点插值、最近点采样、线性过滤、三线性过滤、MIPMap和异性过滤,以及反锯齿技术。
摘要由CSDN通过智能技术生成

(不知为何知乎的目录用MD的TOC不能自动)

[TOC]

d2ec6e972f763dc74676eb26cac6c9ac.png

前言


这里也会持续总结2D纹理渲染相关、存储相关.

正文


纹理作为表述像素级的信息载体, 总的来说需要关注三个

1、原始压缩格式、用于渲染前编码的格式

2、获取信息的方式,和出现的问题

3、信息部分

一、纹理原始压缩格式


这里主要说的是原始的压缩格式,如PNG, JPG/JPEG等

PNG格式

PNG图像格式文件由文件署名和数据块(chunk)组成

其中我们关系的数据块主要包含主要和辅助(就是AD说这个会不会被骂 哈哈)

每个数据块都包含

| Length(长度) | 4字节 | 指定数据块中数据域的长度,其长度不超过(231−1)(231−1)字节 | | ----------------------------- | -------- | -------------------------------------------------------- | | Chunk Type Code(数据块类型码) | 4字节 | 数据块类型码由ASCII字母(A-Z和a-z)组成 | | Chunk Data(数据块实际内容 | 可变长度 | 存储按照Chunk Type Code指定的数据 | | CRC(循环冗余检测 | 4字节 | 存储用来检测是否有错误的循环冗余码 |

关键数据块包含了

1、文件头数据

这个我们记录就好, 方便自己做那啥(一般直接用库,不过可以做Editor时候的检查等)

| 域的名称 | 字节数 | 说明 | | ------------------ | ------- | ------------------------------------------------------------ | | Width | 4 bytes | 图像宽度,以像素为单位 | | Height | 4 bytes | 图像高度,以像素为单位 | | Bit depth | 1 byte | 图像深度:索引彩色图像:1,2,4或8 ;灰度图像:1,2,4,8或16 ;真彩色图像:8或16 | | ColorType | 1 byte | 颜色类型:0:灰度图像, 1,2,4,8或16;2:真彩色图像,8或16;3:索引彩色图像,1,2,4或84:带α通道数据的灰度图像,8或16;6:带α通道数据的真彩色图像,8或16 | | Compression method | 1 byte | 压缩方法(LZ77派生算法) | | Filter method | 1 byte | 滤波器方法 | | Interlace method | 1 byte | 隔行扫描方法:0:非隔行扫描;1: Adam7(由Adam M. Costello开发的7遍隔行扫描方法) |

2、调色板数据

3、图像数据块IDAT(它存储实际的数据,在数据流中可包含多个连续顺序的图像数据块...这个我们最最关心哈哈)、

4、图像结束数据

辅助数据块

这里有一些可以做魔法的地方,比如

图像透明数据块tRNS,图像γ数据块gAMA.

由于过多, 就不一一说明了. 可以查看官方或着Google

JPG格式

未完待续

GIF格式

GIF应该不能算是压缩, 而是编码.

未完待续......

二、纹理针对渲染的编码


这里说的编码,是针对方便GPU访问的能够有合适压缩比.

(正常方式导入后 解编码就得到按需可以用不同的编码R16, R8G8B8,A8R8G8B8等等, 但这些比较大. 所以就有针对GPU的编码.)

1、什么叫方便

GPU需要能够高效的随机访问一个像素, 或者说不需要太过大范围的解码辅助信息. (可以参考小道对完美硬件的YY, ),另外GPU这些采样点是几乎并行.这样就很确定顺序.

这也就是原始的压缩格式不能直接用的原因.

2、什么叫合适压缩

这个主要针对解码方便, 由于编码可以离线做到.(一些情况要实时那另说)

另外还需的是*压缩比.

所以出现一些压缩算法和格式

2.1 ETC1编码

(给个链接:https://www.khronos.org/registry/OpenGL/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt)

其中文件头:特征符——编码宽——编码高——实际宽——实际高

ETC还区分出1和2. etc1只存储RGB色,不存储alpha通道值,平均4Bit/像素-4BPP,块上也是划分为4*4的块,每块的颜色组成

2.2 Windows的DXT

是由一对低精度的“基色”来描述一个4x4的RGB像素块,并允许每个像素在这些基色之间指定一个插值

2.3 MACMobile(基于PowerVR显卡)的PVRTC

2.4 A卡的ASTC

编码后格式可以按备注

三、渲染获取纹理中数据


为何不总是直接获取到存放的数据用于展示.

首先来开展示的问题, 这也是会对需要展示的或者说在片元着手阶段(注意这里是发生在屏幕, 也就是其实和我们的分辨率相关)

1、重心坐标

我们的采样点的产生是有重兴坐标计算而来,或者说插值.

519d9d0f7ee642c3d0773e81bcc28090.png

2、采样点(UV)再去采样

这里我们就要注意Sample2D后面还会发生什么

让我来看这个图

100958212c051ca025ac203c22995e9a.png
利用XDRenderUtil-ShaderGen生成-所以精度有点过了不够错乱

但将视野想象到像素级上, 不难发现像素距离都是格子(这块区域颜色值)

d1774f5fb6ccf7dce31485117a2b8880.png

在没有纳米级(或者说普朗克常数)标记,也就会出现采样点(Float2)和INT问题. 且角度不完全和纹理UV相同锯齿阶梯会更严重.这也就是最近点采样.

所以还没还需要找到映射函数

最近点采样

线性过滤

对四个点做插值混合

294a8df8937cf669b031461e969c2d1d.png

三线性过滤

二次过滤

以上是大多处来处理小到大映射问题(如果我们一些情况就是不需要这种近视方式也是可以的), 但我们还需要一个东西, 但这个不一定都要用.

MIPMap

当我们视野空间很接近UV(World下)方向可能出现一种问题, 一个采样点可能覆盖了几个像素.(这就很尴尬)

所以降低下(也就是远处的纹理精度小)

备注: 其实Mipmap还有其他用, 比如用来用图像模拟辐射度时候根据Rough(粗糙度)来获取MipLevel, 然后用模糊的去采样等等.

下面是由近到远的MipMap

727638af6d8018f2ccc908eaf2275571.png

b4046edbe063a3a265d2fed5e86a1e14.png

609cfc336a8adb890cca99d9b42a7687.png

b523ee65c66a285047957f97c5518489.png

没有开启MipMap

密码纹出现(相邻pixel采样的texel都是空间不连续)

ccbbfaf997cf3ed9416b5bade3937b21.png

a9aaa2245089dd62df2d5561290e3b49.png

开启MipMap后

1550ba72d675a37992bba21a4e4701b1.png

这里使用Box(没有用Kai)

异性过滤

(可以联想下各项异性的物理含义)

a77d143190379db30cbcdeeec5cb352c.png

d6fb7d88ac5907cefd3ed863f7715886.png

这个主要是用来处理方向上矢量值变化不一致的纹理, 也是一种信号处理手段(各项异性是处理同一空间中相异坐标的质量)

3、反锯齿

超采样

多重采样

四、纹理的信息


这里是UV的计算相关, 和采样后获取的值如何使用总结

常用解码

常用UV计算

备注


备注2:一些格式

Unity设定的:

//
        // Summary:
        //     The format is not specified.
        None = 0,
        //
        // Summary:
        //     A one-component, 8-bit unsigned normalized format that has a single 8-bit R component
        //     stored with sRGB nonlinear encoding.
        R8_SRGB = 1,
        //
        // Summary:
        //     A two-component, 16-bit unsigned normalized format that has an 8-bit R component
        //     stored with sRGB nonlinear encoding in byte 0, and an 8-bit G component stored
        //     with sRGB nonlinear encoding in byte 1.
        R8G8_SRGB = 2,
        //
        // Summary:
        //     A three-component, 24-bit unsigned normalized format that has an 8-bit R component
        //     stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with
        //     sRGB nonlinear encoding in byte 1, and an 8-bit B component stored with sRGB
        //     nonlinear encoding in byte 2.
        R8G8B8_SRGB = 3,
        //
        // Summary:
        //     A four-component, 32-bit unsigned normalized format that has an 8-bit R component
        //     stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with
        //     sRGB nonlinear encoding in byte 1, an 8-bit B component stored with sRGB nonlinear
        //     encoding in byte 2, and an 8-bit A component in byte 3.
        R8G8B8A8_SRGB = 4,
        //
        // Summary:
        //     A one-component, 8-bit unsigned normalized format that has a single 8-bit R component.
        R8_UNorm = 5,
        //
        // Summary:
        //     A two-component, 16-bit unsigned normalized format that has an 8-bit R component
        //     stored with sRGB nonlinear encoding in byte 0, and an 8-bit G component stored
        //     with sRGB nonlinear encoding in byte 1.
        R8G8_UNorm = 6,
        //
        // Summary:
        //     A three-component, 24-bit unsigned normalized format that has an 8-bit R component
        //     in byte 0, an 8-bit G component in byte 1, and an 8-bit B component in byte 2.
        R8G8B8_UNorm = 7,
        //
        // Summary:
        //     A four-component, 32-bit unsigned normalized format that has an 8-bit R component
        //     in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and
        //     an 8-bit A component in byte 3.
        R8G8B8A8_UNorm = 8,
        //
        // Summary:
        //     A one-component, 8-bit signed normalized format that has a single 8-bit R component.
        R8_SNorm = 9,
        //
        // Summary:
        //     A two-component, 16-bit signed normalized format that has an 8-bit R component
        //     stored with sRGB nonlinear encoding in byte 0, and an 8-bit G component stored
        //     with sRGB nonlinear encoding in byte 1.
        R8G8_SNorm = 10,
        //
        // Summary:
        //     A three-component, 24-bit signed normalized format that has an 8-bit R component
        //     in byte 0, an 8-bit G component in byte 1, and an 8-bit B component in byte 2.
        R8G8B8_SNorm = 11,
        //
        // Summary:
        //     A four-component, 32-bit signed normalized format that has an 8-bit R component
        //     in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and
        //     an 8-bit A component in byte 3.
        R8G8B8A8_SNorm = 12,
        //
        // Summary:
        //     A one-component, 8-bit unsigned integer format that has a single 8-bit R component.
        R8_UInt = 13,
        //
        // Summary:
        //     A two-component, 16-bit unsigned integer format that has an 8-bit R component
        //     in byte 0, and an 8-bit G component in byte 1.
        R8G8_UInt = 14,
        //
        // Summary:
        //     A three-component, 24-bit unsigned integer format that has an 8-bit R component
        //     in byte 0, an 8-bit G component in byte 1, and an 8-bit B component in byte 2.
        R8G8B8_UInt = 15,
        //
        // Summary:
        //     A four-component, 32-bit unsigned integer format that has an 8-bit R component
        //     in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and
        //     an 8-bit A component in byte 3.
        R8G8B8A8_UInt = 16,
        //
        // Summary:
        //     A one-component, 8-bit signed integer format that has a single 8-bit R component.
        R8_SInt = 17,
        //
        // Summary:
        //     A two-component, 16-bit signed integer format that has an 8-bit R component in
        //     byte 0, and an 8-bit G component in byte 1.
        R8G8_SInt = 18,
        //
        // Summary:
        //     A three-component, 24-bit signed integer format that has an 8-bit R component
        //     in byte 0, an 8-bit G component in byte 1, and an 8-bit B component in byte 2.
        R8G8B8_SInt = 19,
        //
        // Summary:
        //     A four-component, 32-bit signed integer format that has an 8-bit R component
        //     in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and
        //     an 8-bit A component in byte 3.
        R8G8B8A8_SInt = 20,
        //
        // Summary:
        //     A one-component, 16-bit unsigned normalized format that has a single 16-bit R
        //     component.
        R16_UNorm = 21,
        //
        // Summary:
        //     A two-component, 32-bit unsigned normalized format that has a 16-bit R component
        //     in bytes 0..1, and a 16-bit G component in bytes 2..3.
        R16G16_UNorm = 22,
        //
        // Summary:
        //     A three-component, 48-bit unsigned normalized format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in
        //     bytes 4..5.
        R16G16B16_UNorm = 23,
        //
        // Summary:
        //     A four-component, 64-bit unsigned normalized format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes
        //     4..5, and a 16-bit A component in bytes 6..7.
        R16G16B16A16_UNorm = 24,
        //
        // Summary:
        //     A one-component, 16-bit signed normalized format that has a single 16-bit R component.
        R16_SNorm = 25,
        //
        // Summary:
        //     A two-component, 32-bit signed normalized format that has a 16-bit R component
        //     in bytes 0..1, and a 16-bit G component in bytes 2..3.
        R16G16_SNorm = 26,
        //
        // Summary:
        //     A three-component, 48-bit signed normalized format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in
        //     bytes 4..5.
        R16G16B16_SNorm = 27,
        //
        // Summary:
        //     A four-component, 64-bit signed normalized format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes
        //     4..5, and a 16-bit A component in bytes 6..7.
        R16G16B16A16_SNorm = 28,
        //
        // Summary:
        //     A one-component, 16-bit unsigned integer format that has a single 16-bit R component.
        R16_UInt = 29,
        //
        // Summary:
        //     A two-component, 32-bit unsigned integer format that has a 16-bit R component
        //     in bytes 0..1, and a 16-bit G component in bytes 2..3.
        R16G16_UInt = 30,
        //
        // Summary:
        //     A three-component, 48-bit unsigned integer format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in
        //     bytes 4..5.
        R16G16B16_UInt = 31,
        //
        // Summary:
        //     A four-component, 64-bit unsigned integer format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes
        //     4..5, and a 16-bit A component in bytes 6..7.
        R16G16B16A16_UInt = 32,
        //
        // Summary:
        //     A one-component, 16-bit signed integer format that has a single 16-bit R component.
        R16_SInt = 33,
        //
        // Summary:
        //     A two-component, 32-bit signed integer format that has a 16-bit R component in
        //     bytes 0..1, and a 16-bit G component in bytes 2..3.
        R16G16_SInt = 34,
        //
        // Summary:
        //     A three-component, 48-bit signed integer format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in
        //     bytes 4..5.
        R16G16B16_SInt = 35,
        //
        // Summary:
        //     A four-component, 64-bit signed integer format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes
        //     4..5, and a 16-bit A component in bytes 6..7.
        R16G16B16A16_SInt = 36,
        //
        // Summary:
        //     A one-component, 32-bit unsigned integer format that has a single 32-bit R component.
        R32_UInt = 37,
        //
        // Summary:
        //     A two-component, 64-bit unsigned integer format that has a 32-bit R component
        //     in bytes 0..3, and a 32-bit G component in bytes 4..7.
        R32G32_UInt = 38,
        //
        // Summary:
        //     A three-component, 96-bit unsigned integer format that has a 32-bit R component
        //     in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit B component in
        //     bytes 8..11.
        R32G32B32_UInt = 39,
        //
        // Summary:
        //     A four-component, 128-bit unsigned integer format that has a 32-bit R component
        //     in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B component in bytes
        //     8..11, and a 32-bit A component in bytes 12..15.
        R32G32B32A32_UInt = 40,
        //
        // Summary:
        //     A one-component, 32-bit signed integer format that has a single 32-bit R component.
        R32_SInt = 41,
        //
        // Summary:
        //     A two-component, 64-bit signed integer format that has a 32-bit R component in
        //     bytes 0..3, and a 32-bit G component in bytes 4..7.
        R32G32_SInt = 42,
        //
        // Summary:
        //     A three-component, 96-bit signed integer format that has a 32-bit R component
        //     in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit B component in
        //     bytes 8..11.
        R32G32B32_SInt = 43,
        //
        // Summary:
        //     A four-component, 128-bit signed integer format that has a 32-bit R component
        //     in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B component in bytes
        //     8..11, and a 32-bit A component in bytes 12..15.
        R32G32B32A32_SInt = 44,
        //
        // Summary:
        //     A one-component, 16-bit signed floating-point format that has a single 16-bit
        //     R component.
        R16_SFloat = 45,
        //
        // Summary:
        //     A two-component, 32-bit signed floating-point format that has a 16-bit R component
        //     in bytes 0..1, and a 16-bit G component in bytes 2..3.
        R16G16_SFloat = 46,
        //
        // Summary:
        //     A three-component, 48-bit signed floating-point format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in
        //     bytes 4..5.
        R16G16B16_SFloat = 47,
        //
        // Summary:
        //     A four-component, 64-bit signed floating-point format that has a 16-bit R component
        //     in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes
        //     4..5, and a 16-bit A component in bytes 6..7.
        R16G16B16A16_SFloat = 48,
        //
        // Summary:
        //     A one-component, 32-bit signed floating-point format that has a single 32-bit
        //     R component.
        R32_SFloat = 49,
        //
        // Summary:
        //     A two-component, 64-bit signed floating-point format that has a 32-bit R component
        //     in bytes 0..3, and a 32-bit G component in bytes 4..7.
        R32G32_SFloat = 50,
        //
        // Summary:
        //     A three-component, 96-bit signed floating-point format that has a 32-bit R component
        //     in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit B component in
        //     bytes 8..11.
        R32G32B32_SFloat = 51,
        //
        // Summary:
        //     A four-component, 128-bit signed floating-point format that has a 32-bit R component
        //     in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B component in bytes
        //     8..11, and a 32-bit A component in bytes 12..15.
        R32G32B32A32_SFloat = 52,
        //
        // Summary:
        //     A three-component, 24-bit unsigned normalized format that has an 8-bit R component
        //     stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with
        //     sRGB nonlinear encoding in byte 1, and an 8-bit B component stored with sRGB
        //     nonlinear encoding in byte 2.
        B8G8R8_SRGB = 56,
        //
        // Summary:
        //     A four-component, 32-bit unsigned normalized format that has an 8-bit B component
        //     stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with
        //     sRGB nonlinear encoding in byte 1, an 8-bit R component stored with sRGB nonlinear
        //     encoding in byte 2, and an 8-bit A component in byte 3.
        B8G8R8A8_SRGB = 57,
        //
        // Summary:
        //     A three-component, 24-bit unsigned normalized format that has an 8-bit B component
        //     in byte 0, an 8-bit G component in byte 1, and an 8-bit R component in byte 2.
        B8G8R8_UNorm = 58,
        //
        // Summary:
        //     A four-component, 32-bit unsigned normalized format that has an 8-bit B component
        //     in byte 0, an 8-bit G component in byte 1, an 8-bit R component in byte 2, and
        //     an 8-bit A component in byte 3.
        B8G8R8A8_UNorm = 59,
        //
        // Summary:
        //     A three-component, 24-bit signed normalized format that has an 8-bit B component
        //     in byte 0, an 8-bit G component in byte 1, and an 8-bit R component in byte 2.
        B8G8R8_SNorm = 60,
        //
        // Summary:
        //     A four-component, 32-bit signed normalized format that has an 8-bit B component
        //     in byte 0, an 8-bit G component in byte 1, an 8-bit R component in byte 2, and
        //     an 8-bit A component in byte 3.
        B8G8R8A8_SNorm = 61,
        //
        // Summary:
        //     A three-component, 24-bit unsigned integer format that has an 8-bit B component
        //     in byte 0, an 8-bit G component in byte 1, and an 8-bit R component in byte 2
        B8G8R8_UInt = 62,
        //
        // Summary:
        //     A four-component, 32-bit unsigned integer format that has an 8-bit B component
        //     in byte 0, an 8-bit G component in byte 1, an 8-bit R component in byte 2, and
        //     an 8-bit A component in byte 3.
        B8G8R8A8_UInt = 63,
        //
        // Summary:
        //     A three-component, 24-bit signed integer format that has an 8-bit B component
        //     in byte 0, an 8-bit G component in byte 1, and an 8-bit R component in byte 2.
        B8G8R8_SInt = 64,
        //
        // Summary:
        //     A four-component, 32-bit signed integer format that has an 8-bit B component
        //     in byte 0, an 8-bit G component in byte 1, an 8-bit R component in byte 2, and
        //     an 8-bit A component in byte 3.
        B8G8R8A8_SInt = 65,
        //
        // Summary:
        //     A four-component, 16-bit packed unsigned normalized format that has a 4-bit R
        //     component in bits 12..15, a 4-bit G component in bits 8..11, a 4-bit B component
        //     in bits 4..7, and a 4-bit A component in bits 0..3.
        R4G4B4A4_UNormPack16 = 66,
        //
        // Summary:
        //     A four-component, 16-bit packed unsigned normalized format that has a 4-bit B
        //     component in bits 12..15, a 4-bit G component in bits 8..11, a 4-bit R component
        //     in bits 4..7, and a 4-bit A component in bits 0..3.
        B4G4R4A4_UNormPack16 = 67,
        //
        // Summary:
        //     A three-component, 16-bit packed unsigned normalized format that has a 5-bit
        //     R component in bits 11..15, a 6-bit G component in bits 5..10, and a 5-bit B
        //     component in bits 0..4.
        R5G6B5_UNormPack16 = 68,
        //
        // Summary:
        //     A three-component, 16-bit packed unsigned normalized format that has a 5-bit
        //     B component in bits 11..15, a 6-bit G component in bits 5..10, and a 5-bit R
        //     component in bits 0..4.
        B5G6R5_UNormPack16 = 69,
        //
        // Summary:
        //     A four-component, 16-bit packed unsigned normalized format that has a 5-bit R
        //     component in bits 11..15, a 5-bit G component in bits 6..10, a 5-bit B component
        //     in bits 1..5, and a 1-bit A component in bit 0.
        R5G5B5A1_UNormPack16 = 70,
        //
        // Summary:
        //     A four-component, 16-bit packed unsigned normalized format that has a 5-bit B
        //     component in bits 11..15, a 5-bit G component in bits 6..10, a 5-bit R component
        //     in bits 1..5, and a 1-bit A component in bit 0.
        B5G5R5A1_UNormPack16 = 71,
        //
        // Summary:
        //     A four-component, 16-bit packed unsigned normalized format that has a 1-bit A
        //     component in bit 15, a 5-bit R component in bits 10..14, a 5-bit G component
        //     in bits 5..9, and a 5-bit B component in bits 0..4.
        A1R5G5B5_UNormPack16 = 72,
        //
        // Summary:
        //     A three-component, 32-bit packed unsigned floating-point format that has a 5-bit
        //     shared exponent in bits 27..31, a 9-bit B component mantissa in bits 18..26,
        //     a 9-bit G component mantissa in bits 9..17, and a 9-bit R component mantissa
        //     in bits 0..8.
        E5B9G9R9_UFloatPack32 = 73,
        //
        // Summary:
        //     A three-component, 32-bit packed unsigned floating-point format that has a 10-bit
        //     B component in bits 22..31, an 11-bit G component in bits 11..21, an 11-bit R
        //     component in bits 0..10.
        B10G11R11_UFloatPack32 = 74,
        //
        // Summary:
        //     A four-component, 32-bit packed unsigned normalized format that has a 2-bit A
        //     component in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G component
        //     in bits 10..19, and a 10-bit R component in bits 0..9.
        A2B10G10R10_UNormPack32 = 75,
        //
        // Summary:
        //     A four-component, 32-bit packed unsigned integer format that has a 2-bit A component
        //     in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G component in
        //     bits 10..19, and a 10-bit R component in bits 0..9.
        A2B10G10R10_UIntPack32 = 76,
        //
        // Summary:
        //     A four-component, 32-bit packed signed integer format that has a 2-bit A component
        //     in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G component in
        //     bits 10..19, and a 10-bit R component in bits 0..9.
        A2B10G10R10_SIntPack32 = 77,
        //
        // Summary:
        //     A four-component, 32-bit packed unsigned normalized format that has a 2-bit A
        //     component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component
        //     in bits 10..19, and a 10-bit B component in bits 0..9.
        A2R10G10B10_UNormPack32 = 78,
        //
        // Summary:
        //     A four-component, 32-bit packed unsigned integer format that has a 2-bit A component
        //     in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component in
        //     bits 10..19, and a 10-bit B component in bits 0..9.
        A2R10G10B10_UIntPack32 = 79,
        //
        // Summary:
        //     A four-component, 32-bit packed signed integer format that has a 2-bit A component
        //     in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component in
        //     bits 10..19, and a 10-bit B component in bits 0..9.
        A2R10G10B10_SIntPack32 = 80,
        //
        // Summary:
        //     A four-component, 32-bit packed unsigned normalized format that has a 2-bit A
        //     component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component
        //     in bits 10..19, and a 10-bit B component in bits 0..9. The components are gamma
        //     encoded and their values range from -0.5271 to 1.66894. The alpha component is
        //     clamped to either 0.0 or 1.0 on sampling, rendering, and writing operations.
        A2R10G10B10_XRSRGBPack32 = 81,
        //
        // Summary:
        //     A four-component, 32-bit packed unsigned normalized format that has a 2-bit A
        //     component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component
        //     in bits 10..19, and a 10-bit B component in bits 0..9. The components are linearly
        //     encoded and their values range from -0.752941 to 1.25098 (pre-expansion). The
        //     alpha component is clamped to either 0.0 or 1.0 on sampling, rendering, and writing
        //     operations.
        A2R10G10B10_XRUNormPack32 = 82,
        //
        // Summary:
        //     A four-component, 32-bit packed unsigned normalized format that has a 10-bit
        //     R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit
        //     B component in bits 0..9. The components are gamma encoded and their values range
        //     from -0.5271 to 1.66894. The alpha component is clamped to either 0.0 or 1.0
        //     on sampling, rendering, and writing operations.
        R10G10B10_XRSRGBPack32 = 83,
        //
        // Summary:
        //     A four-component, 32-bit packed unsigned normalized format that has a 10-bit
        //     R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit
        //     B component in bits 0..9. The components are linearly encoded and their values
        //     range from -0.752941 to 1.25098 (pre-expansion).
        R10G10B10_XRUNormPack32 = 84,
        //
        // Summary:
        //     A four-component, 64-bit packed unsigned normalized format that has a 10-bit
        //     A component in bits 30..39, a 10-bit R component in bits 20..29, a 10-bit G component
        //     in bits 10..19, and a 10-bit B component in bits 0..9. The components are gamma
        //     encoded and their values range from -0.5271 to 1.66894. The alpha component is
        //     clamped to either 0.0 or 1.0 on sampling, rendering, and writing operations.
        A10R10G10B10_XRSRGBPack32 = 85,
        //
        // Summary:
        //     A four-component, 64-bit packed unsigned normalized format that has a 10-bit
        //     A component in bits 30..39, a 10-bit R component in bits 20..29, a 10-bit G component
        //     in bits 10..19, and a 10-bit B component in bits 0..9. The components are linearly
        //     encoded and their values range from -0.752941 to 1.25098 (pre-expansion). The
        //     alpha component is clamped to either 0.0 or 1.0 on sampling, rendering, and writing
        //     operations.
        A10R10G10B10_XRUNormPack32 = 86,
        RGB_DXT1_SRGB = 96,
        //
        // Summary:
        //     A three-component, block-compressed format. Each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of unsigned normalized RGB texel data with sRGB nonlinear
        //     encoding. This format has a 1 bit alpha channel.
        RGBA_DXT1_SRGB = 96,
        RGB_DXT1_UNorm = 97,
        //
        // Summary:
        //     A three-component, block-compressed format. Each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format has
        //     a 1 bit alpha channel.
        RGBA_DXT1_UNorm = 97,
        //
        // Summary:
        //     A four-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 64 bits encoding alpha values followed by 64 bits encoding RGB values with
        //     sRGB nonlinear encoding.
        RGBA_DXT3_SRGB = 98,
        //
        // Summary:
        //     A four-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 64 bits encoding alpha values followed by 64 bits encoding RGB values.
        RGBA_DXT3_UNorm = 99,
        //
        // Summary:
        //     A four-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 64 bits encoding alpha values followed by 64 bits encoding RGB values with
        //     sRGB nonlinear encoding.
        RGBA_DXT5_SRGB = 100,
        //
        // Summary:
        //     A four-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 64 bits encoding alpha values followed by 64 bits encoding RGB values.
        RGBA_DXT5_UNorm = 101,
        //
        // Summary:
        //     A one-component, block-compressed format where each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of unsigned normalized red texel data.
        R_BC4_UNorm = 102,
        //
        // Summary:
        //     A one-component, block-compressed format where each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of signed normalized red texel data.
        R_BC4_SNorm = 103,
        //
        // Summary:
        //     A two-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RG texel data with the first
        //     64 bits encoding red values followed by 64 bits encoding green values.
        RG_BC5_UNorm = 104,
        //
        // Summary:
        //     A two-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of signed normalized RG texel data with the first
        //     64 bits encoding red values followed by 64 bits encoding green values.
        RG_BC5_SNorm = 105,
        //
        // Summary:
        //     A three-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned floating-point RGB texel data.
        RGB_BC6H_UFloat = 106,
        //
        // Summary:
        //     A three-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of signed floating-point RGB texel data.
        RGB_BC6H_SFloat = 107,
        //
        // Summary:
        //     A four-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with sRGB
        //     nonlinear encoding applied to the RGB components.
        RGBA_BC7_SRGB = 108,
        //
        // Summary:
        //     A four-component, block-compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data.
        RGBA_BC7_UNorm = 109,
        //
        // Summary:
        //     A three-component, PVRTC compressed format where each 64-bit compressed texel
        //     block encodes a 8×4 rectangle of unsigned normalized RGB texel data with sRGB
        //     nonlinear encoding. This format has no alpha and is considered opaque.
        RGB_PVRTC_2Bpp_SRGB = 110,
        //
        // Summary:
        //     A three-component, PVRTC compressed format where each 64-bit compressed texel
        //     block encodes a 8×4 rectangle of unsigned normalized RGB texel data. This format
        //     has no alpha and is considered opaque.
        RGB_PVRTC_2Bpp_UNorm = 111,
        //
        // Summary:
        //     A three-component, PVRTC compressed format where each 64-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGB texel data with sRGB
        //     nonlinear encoding. This format has no alpha and is considered opaque.
        RGB_PVRTC_4Bpp_SRGB = 112,
        //
        // Summary:
        //     A three-component, PVRTC compressed format where each 64-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format
        //     has no alpha and is considered opaque.
        RGB_PVRTC_4Bpp_UNorm = 113,
        //
        // Summary:
        //     A four-component, PVRTC compressed format where each 64-bit compressed texel
        //     block encodes a 8×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 32 bits encoding alpha values followed by 32 bits encoding RGB values with
        //     sRGB nonlinear encoding applied.
        RGBA_PVRTC_2Bpp_SRGB = 114,
        //
        // Summary:
        //     A four-component, PVRTC compressed format where each 64-bit compressed texel
        //     block encodes a 8×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 32 bits encoding alpha values followed by 32 bits encoding RGB values.
        RGBA_PVRTC_2Bpp_UNorm = 115,
        //
        // Summary:
        //     A four-component, PVRTC compressed format where each 64-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 32 bits encoding alpha values followed by 32 bits encoding RGB values with
        //     sRGB nonlinear encoding applied.
        RGBA_PVRTC_4Bpp_SRGB = 116,
        //
        // Summary:
        //     A four-component, PVRTC compressed format where each 64-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 32 bits encoding alpha values followed by 32 bits encoding RGB values.
        RGBA_PVRTC_4Bpp_UNorm = 117,
        //
        // Summary:
        //     A three-component, ETC compressed format where each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format has
        //     no alpha and is considered opaque.
        RGB_ETC_UNorm = 118,
        //
        // Summary:
        //     A three-component, ETC2 compressed format where each 64-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGB texel data with sRGB
        //     nonlinear encoding. This format has no alpha and is considered opaque.
        RGB_ETC2_SRGB = 119,
        //
        // Summary:
        //     A three-component, ETC2 compressed format where each 64-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format
        //     has no alpha and is considered opaque.
        RGB_ETC2_UNorm = 120,
        //
        // Summary:
        //     A four-component, ETC2 compressed format where each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of unsigned normalized RGB texel data with sRGB nonlinear
        //     encoding, and provides 1 bit of alpha.
        RGB_A1_ETC2_SRGB = 121,
        //
        // Summary:
        //     A four-component, ETC2 compressed format where each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of unsigned normalized RGB texel data, and provides 1
        //     bit of alpha.
        RGB_A1_ETC2_UNorm = 122,
        //
        // Summary:
        //     A four-component, ETC2 compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 64 bits encoding alpha values followed by 64 bits encoding RGB values with
        //     sRGB nonlinear encoding applied.
        RGBA_ETC2_SRGB = 123,
        //
        // Summary:
        //     A four-component, ETC2 compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the
        //     first 64 bits encoding alpha values followed by 64 bits encoding RGB values.
        RGBA_ETC2_UNorm = 124,
        //
        // Summary:
        //     A one-component, ETC2 compressed format where each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of unsigned normalized red texel data.
        R_EAC_UNorm = 125,
        //
        // Summary:
        //     A one-component, ETC2 compressed format where each 64-bit compressed texel block
        //     encodes a 4×4 rectangle of signed normalized red texel data.
        R_EAC_SNorm = 126,
        //
        // Summary:
        //     A two-component, ETC2 compressed format where each 128-bit compressed texel block
        //     encodes a 4×4 rectangle of unsigned normalized RG texel data with the first 64
        //     bits encoding red values followed by 64 bits encoding green values.
        RG_EAC_UNorm = 127,
        //
        // Summary:
        //     A two-component, ETC2 compressed format where each 128-bit compressed texel block
        //     encodes a 4×4 rectangle of signed normalized RG texel data with the first 64
        //     bits encoding red values followed by 64 bits encoding green values.
        RG_EAC_SNorm = 128,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with sRGB
        //     nonlinear encoding applied to the RGB components.
        RGBA_ASTC4X4_SRGB = 129,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 4×4 rectangle of unsigned normalized RGBA texel data.
        RGBA_ASTC4X4_UNorm = 130,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 5×5 rectangle of unsigned normalized RGBA texel data with sRGB
        //     nonlinear encoding applied to the RGB components.
        RGBA_ASTC5X5_SRGB = 131,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 5×5 rectangle of unsigned normalized RGBA texel data.
        RGBA_ASTC5X5_UNorm = 132,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 6×6 rectangle of unsigned normalized RGBA texel data with sRGB
        //     nonlinear encoding applied to the RGB components.
        RGBA_ASTC6X6_SRGB = 133,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 6×6 rectangle of unsigned normalized RGBA texel data.
        RGBA_ASTC6X6_UNorm = 134,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes an 8×8 rectangle of unsigned normalized RGBA texel data with sRGB
        //     nonlinear encoding applied to the RGB components.
        RGBA_ASTC8X8_SRGB = 135,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes an 8×8 rectangle of unsigned normalized RGBA texel data.
        RGBA_ASTC8X8_UNorm = 136,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 10×10 rectangle of unsigned normalized RGBA texel data with sRGB
        //     nonlinear encoding applied to the RGB components.
        RGBA_ASTC10X10_SRGB = 137,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 10×10 rectangle of unsigned normalized RGBA texel data.
        RGBA_ASTC10X10_UNorm = 138,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 12×12 rectangle of unsigned normalized RGBA texel data with sRGB
        //     nonlinear encoding applied to the RGB components.
        RGBA_ASTC12X12_SRGB = 139,
        //
        // Summary:
        //     A four-component, ASTC compressed format where each 128-bit compressed texel
        //     block encodes a 12×12 rectangle of unsigned normalized RGBA texel data.
        RGBA_ASTC12X12_UNorm = 140

参考引用


https://zhuanlan.zhihu.com/p/237940807

https://blog.csdn.net/e295166319/article/details/52622811

https://blogs.unity3d.com/cn/2017/12/15/crunch-compression-of-etc-textures/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值