RGB565: 16-bit texture without alpha channel, good image quality but no alpha (transparency)
PVR文件格式内容:
参见:http://imgtec.eetrend.com/download/1595
Header(52Byte) + Meta Data(0 + Bytes) + Texture Data(0 + Bytes)
包含了表面和层级mipmap,cubemap,volumemap信息,nFlag加表面特性信息,这都是提交给显卡直接需要的特性,类似PC下的dds贴图格式。
1.Name Size(bytes) Data Format
// The exact value of ‘Version’ will be one of the following depending upon the endianess of the file
1)Version 4 Unsigned 32bit Integer
/*
0x03525650, if endianess does not match
· 0x50565203, if endianess does match
*/
2)Flags 4 Unsigned 32bit Integer
/*
No Flag 0 No flag has been set.
Pre-multiplied 0x02 When this flag is set, colour values within the texture have been pre-multiplied by the alpha
values.
*/
3)Pixel Format 8 Unsigned 64bit Integer
/*
PVRTC 2bpp RGB 0
PVRTC 2bpp RGBA 1
PVRTC 4bpp RGB 2
PVRTC 4bpp RGBA 3
PVRTC-II 2bpp 4
PVRTC-II 4bpp 5
ETC1 6
DXT1 7
DXT2 8
DXT3 9
DXT4 10
DXT5 11
BC1 7
BC2 9
BC3 11
BC4 12
BC5 13
BC6 14
BC7 15
UYVY 16
YUY2 17
BW1bpp 18
R9G9B9E5 Shared Exponent 19
RGBG8888 20
GRGB8888 21
ETC2 RGB 22
ETC2 RGBA 23
ETC2 RGB A1 24
EAC R11 Unsigned 25
EAC R11 Signed 26
EAC RG11 Unsigned 27
EAC RG11 Signed 28
*/
4)Colour Space 4 Unsigned 32bit Integer
/*Linear RGB 0 Texture data is in the Linear RGB colour space
sRGB 1 Texture data is in the Standard RGB colour space
*/
5)Channel Type 4 Unsigned 32bit Integer
/*Unsigned Byte Normalised 0
Signed Byte Normalised 1
Unsigned Byte 2
Signed Byte 3
Unsigned Short Normalised 4
Signed Short Normalised 5
Unsigned Short 6
Signed Short 7
Unsigned Integer Normalised 8
Signed Integer Normalised 9
Unsigned Integer 10
Signed Integer 11
Float 12
*/
6)Height 4 Unsigned 32bit Integer // 高度的像素个数
7)Width 4 Unsigned 32bit Integer // 宽度的像素个数
8)Depth 4 Unsigned 32bit Integer // 深度的像素个数(也就是所有的深度数)
9)Num. Surfaces 4 Unsigned 32bit Integer // 纹理数组的表面面数
10)Num. Faces 4 Unsigned 32bit Integer // CubeMap纹理的面数
11)MIP-Map Count 4 Unsigned 32bit Integer // mipmap的 levels渐进层级数,如果是1只有一个纹理
12)Meta Data Size 4 Unsigned 32bit Integer // meta data大小
2.Meta Data Format
Meta data allows for the creator of a PVR to store custom information within the PVR file relating to
the storage
2.1)FourCC 4 Four Byte Array
2.2)Key 4 Unsigned 32bit Integer
2.3)Data Size 4 Unsigned 32bit Integer
2.4)Data Variable Variable
3.Texture Data
The remainder of the file, after the header and meta data, is texture data. The format and size of this
texture data can be found in the header (see Section 2.1 Header Format).
The texture data is laid out as follows:
for each MIP-Map Level in MIP-Map Count // 纹理层级数
for each Surface in Num. Surfaces // 表面数(一个表面可以有6个面数)
for each Face in Num. Faces // 面数
for each Slice in Depth // 片(一个面可能有多个片三角形)
for each Row in Height // 行
for each Pixel in Width // 像素
Byte data[Size_Based_On_PixelFormat]
end
end
end
end
end
end