CSKR (File Format) and TXTR (Metroid Prime): Difference between pages

From Retro Modding Wiki
(Difference between pages)
Jump to navigation Jump to search
>Aruki
(Created page with "The '''CSKR format''' contains skin bindings for rigged models. {{todo|Write article.}} Category:File Formats Category:Metroid Prime Category:Metroid Prime 2: Echo...")
 
>Aruki
No edit summary
 
Line 1: Line 1:
The '''CSKR format''' contains skin bindings for rigged models.
'''TXTR''' is, as the name suggests, the Retro Studios texture format. The format remains completely unchanged from Metroid Prime all the way up to Donkey Kong Country Returns.
 
__TOC__
 
== Format ==
 
TXTR files contain a very short 12-byte header, followed by the image data.
 
=== Header ===
 
{| class="wikitable"
! Offset
! Size
! Description
|-
| 0x0
| 4
| '''Image format'''. Possible values range from 0x0 to 0xA; see below for more details.
|-
| 0x4
| 2
| '''Width'''
|-
| 0x6
| 2
| '''Height'''
|-
| 0x8
| 4
| '''Mipmap count'''
|-
| 0xC
| colspan=2 | End of header
|}
 
=== Palettes ===
 
The C4 and C8 image formats contain a palette table after the header, before the image data begins.
 
{| class="wikitable"
! Offset
! Size
! Description
|-
| 0x0
| 4
| '''Palette format'''. Possible values range from 0 to 2.
|-
| 0x4
| 2
| Always 0x1 in C4, 0x100 in C8
|-
| 0x6
| 2
| Always 0x10 in C4, 0x1 in C8
|-
| 0x8
| Varies
| '''Palette colors'''. 16-bit color values; 16 colors in C4, 256 in C8.
|-
| colspan=3 | End of palette table; image data begins immediately after
|}
 
== Image Formats ==
 
There are 11 different image formats; these are built directly into GX, so they remain the same across all GameCube and Wii games. Rather than storing pixels in a linear left-to-right order, GX textures encode pixels in large blocks. The size of the block varies depending on the image format.
 
For example, suppose you have a format that stores 4x4 blocks. Pixels 1-4 of the image will make up the first row of the first block; pixels 5-8 will make up the second row; 9-12 will make up the third row; 13-16 will make up the fourth row, completing the block; and the 17-20 will begin the first row of the second block, appearing directly to the right of the first row of the first block.
 
{| class="wikitable"
! ID
! Name
! Bits per pixel
! Block size
! Description
|-
| 0x0
| I4
| 4
| 8x8
| 4-bit greyscale intensity values. Two pixels per byte.
|-
| 0x1
| I8
| 8
| 8x4
| 8-bit greyscale intensity values.
|-
| 0x2
| IA4
| 8
| 8x4
| 4-bit greyscale intensity values with an additional 4-bit alpha channel.
|-
| 0x3
| IA8
| 16
| 4x4
| 8-bit greyscale intensity values with an additional 8-bit alpha channel.
|-
| 0x4
| C4
| 4
| 8x8
| 4-bit palette indices.
|-
| 0x5
| C8
| 8
| 8x4
| 8-bit palette indices.
|-
| 0x6
| C14x2
| 16
| 4x4
| Another palette format. Not used by any official textures.
|-
| 0x7
| RGB565
| 16
| 4x4
| 16-bit colors without alpha.
|-
| 0x8
| RGB5A3
| 16
| 4x4
| 16-bit colors with alpha.
|-
| 0x9
| RGBA8
| 32
| 4x4
| Uncompressed 32-bit colors with alpha.
|-
| 0xA
| CMPR
| 4
| 8x8
| DXT1-compressed textures.
|}
 
== External links ==
 
* [http://wiki.tockdom.com/wiki/Image_Formats Custom Mario Kart Wiiki]: More detailed information on each format, and how to decode them.


{{todo|Write article.}}


[[Category:File Formats]]
[[Category:File Formats]]

Revision as of 14:44, 23 January 2015

TXTR is, as the name suggests, the Retro Studios texture format. The format remains completely unchanged from Metroid Prime all the way up to Donkey Kong Country Returns.

Format

TXTR files contain a very short 12-byte header, followed by the image data.

Header

Offset Size Description
0x0 4 Image format. Possible values range from 0x0 to 0xA; see below for more details.
0x4 2 Width
0x6 2 Height
0x8 4 Mipmap count
0xC End of header

Palettes

The C4 and C8 image formats contain a palette table after the header, before the image data begins.

Offset Size Description
0x0 4 Palette format. Possible values range from 0 to 2.
0x4 2 Always 0x1 in C4, 0x100 in C8
0x6 2 Always 0x10 in C4, 0x1 in C8
0x8 Varies Palette colors. 16-bit color values; 16 colors in C4, 256 in C8.
End of palette table; image data begins immediately after

Image Formats

There are 11 different image formats; these are built directly into GX, so they remain the same across all GameCube and Wii games. Rather than storing pixels in a linear left-to-right order, GX textures encode pixels in large blocks. The size of the block varies depending on the image format.

For example, suppose you have a format that stores 4x4 blocks. Pixels 1-4 of the image will make up the first row of the first block; pixels 5-8 will make up the second row; 9-12 will make up the third row; 13-16 will make up the fourth row, completing the block; and the 17-20 will begin the first row of the second block, appearing directly to the right of the first row of the first block.

ID Name Bits per pixel Block size Description
0x0 I4 4 8x8 4-bit greyscale intensity values. Two pixels per byte.
0x1 I8 8 8x4 8-bit greyscale intensity values.
0x2 IA4 8 8x4 4-bit greyscale intensity values with an additional 4-bit alpha channel.
0x3 IA8 16 4x4 8-bit greyscale intensity values with an additional 8-bit alpha channel.
0x4 C4 4 8x8 4-bit palette indices.
0x5 C8 8 8x4 8-bit palette indices.
0x6 C14x2 16 4x4 Another palette format. Not used by any official textures.
0x7 RGB565 16 4x4 16-bit colors without alpha.
0x8 RGB5A3 16 4x4 16-bit colors with alpha.
0x9 RGBA8 32 4x4 Uncompressed 32-bit colors with alpha.
0xA CMPR 4 8x8 DXT1-compressed textures.

External links