CMDL (Tropical Freeze)

From Retro Modding Wiki
Revision as of 22:49, 23 January 2015 by >Aruki (Unfinished. Saving as a WIP.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The CMDL, SMDL, and WMDL format are Tropical Freeze's three model formats. All three are the same basic format, with SMDL and WMDL each containing an extra data section at the start of the file. With the Wii U's graphics system being updated from GX to GX2, the Retro model format has been dramatically overhauled, bearing little to no resemblance to the previous CMDL format found in DKCR and the Prime series.

Format

After the RFRM Header, the first section of the file is SKHD in SMDL, and WDHD in WMDL. Following those extra sections, all three formats start with a header.

HEAD

Offset Size Description
0x0 24 "HEAD" section header
0x18 4 Unknown
0x1C 4 Unknown
0x20 4 Unknown
0x24 4 Unknown
0x28 4 Unknown
0x2C 24 Axis-aligned bounding box
0x30 4 Extra data flag

If the ending flag is 1, then a large chunk of extra data follows before the next section begins; otherwise, the HEAD section ends.

MTRL

Materials. To do.

MESH

The MESH section does what the name suggests: it defines submeshes. The MESH section header is as follows:

Offset Size Description
0x0 24 "HEAD" section header
0x18 4 Submesh count
0x1C End of MESH header

Each submesh definition is structured as follows:

Offset Size Description
0x0 4 Unknown; always 3?
0x4 2 Material ID
0x6 1 Vertex buffer ID
0x7 1 Index buffer ID
0x8 4 Start index
0xC 4 Index count
0x10 4 Unknown
0x14 1 Unknown; usually seems to be either 0 or 1, possibly a bool value
0x15 End of submesh definition

VBUF

The VBUF section defines vertex buffers; each buffer can have different vertex types, with different strides and attributes.

Offset Size Description
0x0 24 "VBUF" section header
0x18 4 Vertex buffer count
0x1C End of MESH header
Offset Size Description