|
These chunks contain all the texture maps that will be used by the game. For now,
texture maps must have dimensions that are powers of two in the range 64 to 256.
Texels are stored in 32bit form, with 8 bits for all of R, G, B and A.
Texture chunks have one of two forms, depending on which turns out to be smaller, allowing for
the zlib compression. Either they are interleaved :
[standard chunk header - chunk type is 0x0000]
|
Offset
|
Length
|
Description
| |
0
|
4
|
Texture id. Every texture must have a unique id. It is this id that is used
by object files to refer to textures. If two textures have the same id, only
one will be loaded.
| |
4
|
4
|
Width of texture.
| |
8
|
4
|
Height of texture
| |
12
|
(width)*(height)*4
|
The image itself, pixel by pixel. Pixels are stored left to right, top to bottom,
with one pixel described by four bytes. The bytes are ordered (in file space) :
red, green, blue, alpha.
|
Or planar :
[standard chunk header - chunk type is 0x0001]
|
Offset
|
Length
|
Description
| |
0
|
4
|
Texture id. Every texture must have a unique id. It is this id that is used
by object files to refer to textures. If two textures have the same id, only
one will be loaded.
| |
4
|
4
|
Width of texture.
| |
8
|
4
|
Height of texture
| |
12
|
(width)*(height)
|
The image itself, red channel only.
| |
12+(width)*(height)
|
(width)*(height)
|
The image itself, green channel only.
| |
12+2*(width)*(height)
|
(width)*(height)
|
The image itself, blue channel only.
| |
12+3*(width)*(height)
|
(width)*(height)
|
The image itself, alpha channel only.
|
|