DKRDS Texture Group (File Format): Difference between revisions

From Wexos's Wiki
Jump to navigationJump to search
(Created page with "'''DKRDS Texture Group''' is the nameless file format used in ''[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]'' that stores texture and palette data. This format is also implemented inside other files, such as DKRDS Model and DKRDS Track. Its type identifier in assets.bin is '''0x0C'''. == Header == The file starts with a header that is 4 bytes long. {|class=wikitable ! Offset !! Type !! Description |- | 0x00 || UInt16 || '''Num...")
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 26: Line 26:
|-
|-
| 0x08 || UInt16 || '''Texture format''':
| 0x08 || UInt16 || '''Texture format''':
* 0 = '''Unknown'''. 8 bits per texel and no palette data
* 1 = A3I5
* 1 = A3I5
* 2 = 4-Color Palette
* 2 = 4-Color Palette
* 3 = 16-Color Palette
* 3 = 16-Color Palette
* 4 = 256-Color Palette
* 4 = 256-Color Palette
* 5 = 4x4-Texel Compressed
* 5 = 4x4-Texel Compressed (unused?)
* 6 = A5I3
* 6 = A5I3
* 7 = Direct Color (RGB5551)
* 7 = Direct Color (RGB5551)
|-
|-
| 0x0A || UInt16 || '''Wrap mode'''. Only 1 bit per S and T components is used:
| 0x0A || UInt16 || '''Flags''':
* 0 = Clamp
* 0 = If 1, the texture S component repeats, if 0, it clamps
* 1 = Repeat
* 1 = If 1, the texture T component repeats, if 0, it clamps
* 2 = '''Unknown'''. Has something to do with texture animations?
* 3 = '''Unknown'''. Has something to do with textures than can be replaced by in-game decals?
* 4 = '''Unknown'''. Seen as 1 when there's an external texture reference
* 14 = '''Unknown'''. Seen as 1 when there's an external texture reference
|-
|-
| 0x0C || UInt16 || {{unknown-left|'''Unknown'''. Maybe TexGen, always 0?}}
| 0x0C || UInt16 || {{unknown-left|'''Unknown'''. Maybe TexGen, always 0?}}
Line 56: Line 61:
| 0x00 || Byte[4] || '''Palette UID'''. Presumably the checksum of its original file name.
| 0x00 || Byte[4] || '''Palette UID'''. Presumably the checksum of its original file name.
|-
|-
| 0x04 || Int32 || '''Palette size''' in bytes.
| 0x04 || UInt16 || '''Palette size''' in bytes.
|-
| 0x06 || UInt16 || {{unknown-left|'''Unknown'''.}}
|-
|-
| 0x08 || colspan=2 {{unknown|End of Palette Entry header, start of palette data}}
| 0x08 || colspan=2 {{unknown|End of Palette Entry header, start of palette data}}

Latest revision as of 18:47, 26 June 2024

DKRDS Texture Group is the nameless file format used in Diddy Kong Racing DS that stores texture and palette data. This format is also implemented inside other files, such as DKRDS Model and DKRDS Track. Its type identifier in assets.bin is 0x0C.

Header

The file starts with a header that is 4 bytes long.

Offset Type Description
0x00 UInt16 Number of textures.
0x02 UInt16 Number of palettes.
0x04 End of header, start of Texture Entries

Texture Entry

After the header there's an entry for each texture. This entry consists of a 20-byte header followed by the texture data. In DKRDS Model files, the textures are referenced in the Texture Reference Table using 4-byte UIDs.

Texture Entry Header
Offset Type Description
0x00 Byte[4] Texture UID. Presumably the checksum of its original file name.
0x04 Byte[4] Palette UID.
0x08 UInt16 Texture format:
  • 0 = Unknown. 8 bits per texel and no palette data
  • 1 = A3I5
  • 2 = 4-Color Palette
  • 3 = 16-Color Palette
  • 4 = 256-Color Palette
  • 5 = 4x4-Texel Compressed (unused?)
  • 6 = A5I3
  • 7 = Direct Color (RGB5551)
0x0A UInt16 Flags:
  • 0 = If 1, the texture S component repeats, if 0, it clamps
  • 1 = If 1, the texture T component repeats, if 0, it clamps
  • 2 = Unknown. Has something to do with texture animations?
  • 3 = Unknown. Has something to do with textures than can be replaced by in-game decals?
  • 4 = Unknown. Seen as 1 when there's an external texture reference
  • 14 = Unknown. Seen as 1 when there's an external texture reference
0x0C UInt16 Unknown. Maybe TexGen, always 0?
0x0E UInt16 Number of texture blocks, which is the texture data size divided by 0x10.
0x10 UInt16[2] Texture dimensions (width and height).
0x14 End of Texture Entry header, start of texture data

Palette Entry

After all the texture entries there's an entry for each palette. This entry consists of an 8-byte header followed by the RGBA5551 palette data.

Palette Entry Header
Offset Type Description
0x00 Byte[4] Palette UID. Presumably the checksum of its original file name.
0x04 UInt16 Palette size in bytes.
0x06 UInt16 Unknown.
0x08 End of Palette Entry header, start of palette data

Tools

The following tools can handle DKRDS Texture Group:

  • (none)