TXTR (Tropical Freeze)

From Retro Modding Wiki
Revision as of 13:20, 9 May 2016 by >Aruki
Jump to navigation Jump to search

See TXTR (File Format) for the other revisions of this format.

The TXTR format is Tropical Freeze's texture format. The image data in the GPU buffer is compressed using LZSS compression.


This file format needs a lot of research
Most everything in the header + image compression formats needs to be cracked + documented.


Format

The format starts with the typical form descriptor found in every Tropical Freeze format. Following that, there's a HEAD header section that contains most of the texture parameters, then the GPU section containing the actual compressed image data. This is the structure of the HEAD section:

Offset Type Size Description Notes
0x0 Chunk Descriptor 0x18 HEAD Chunk Descriptor
0x18 u32 4 Unknown
0x1C u32 4 Image Format
0x20 u32 4 Width
0x24 u32 4 Height
0x28 u32 4 Depth
0x2C u32 4 Unknown
0x30 u32 4 Swizzle
0x34 u32 4 Unknown Mipmap count? (MC)
0x38 u32[MC] 4 × MC Unknown array Appears to be mipmap sizes, but it doesn't match the size of the image data (unless there's 1)...
- u32 4 Unknown
- u8 1 Unknown
- u8 1 Unknown
- u8 1 Unknown
- u8 1 Unknown

Image Formats

ID Name
0xC RGBA8888
0x14 DXT1
0x18 DXT5
0x1C ATI2

PAK Metadata

The pak metadata for the TXTR format primarily contains compression-related information and provides the values required to decompress it.

Offset Type Size Description Notes
0x0 u32 4 Unknown
0x4 u32 4 Unknown
0x8 u32 4 GPU section offset Relative to the start of the file
0xC u32 4 Unknown
0x10 u32 4 GPU data start This is the offset to the start of the GPU data, immediately after the GPU section header.
0x14 u32 4 GPU section size Matches the size from the GPU section header.
0x18 u32 4 Compressed buffer count (BC)
0x1C Compressed Buffer[BC] 0xC × BC Compressed buffer metadata

Compressed Buffer

This is a small struct that defines a compressed data buffer within the GPU section.

Offset Type Description Notes
0x0 u32 Decompressed Size
0x4 u32 Compressed Size
0x8 u32 Offset Relative to after the GPU section header