CMDL (Donkey Kong Country Returns) and CSKR (File Format): Difference between pages

From Retro Modding Wiki
(Difference between pages)
Jump to navigation Jump to search
>Aruki
 
>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...")
 
Line 1: Line 1:
''See [[CMDL (File Format)]] for the other revisions of this format.''
The '''CSKR format''' contains skin bindings for rigged models.


The '''CMDL format''' is DKCR's model format. It's similar to the CMDL format found in the Metroid Prime trilogy, but with a lot of additions and changes, and some layout changes.
{{todo|Write article.}}
 
{{research|moderate|The visibility group data in the header has a lot of unknown values.}}
 
__TOC__
 
== Format ==
 
Like the previous CMDL formats, DKCR CMDL files are split up into a number of 32-byte aligned ''sections''. Every section both starts and ends on a 32-byte boundary. These are used to separate different parts of the file; different types of sections typically indicate different sets of data. The header declares the section count and the size of each one; using these is the only way to navigate the file.
 
=== Header ===
 
{| class="wikitable"
! Offset
! Type
! Count
! Name
! Notes
|-
| 0x0
| u16
| 1
| '''Magic'''
| Always <code>0x9381</code>
|-
| 0x2
| u16
| 1
| '''Version'''
| Always 0xA. See [[CMDL (File Format)|hub article]] for a list of possible version numbers.
|-
| 0x4
| u32
| 1
| '''Flags'''
| [[#Flags|See below]]
|-
| 0x8
| float
| 6
| '''Model Bounding Box'''
|
|-
| 0x20
| u32
| 1
| '''Section Count'''
| Count of data sections in the file.
|-
| 0x24
| u32
| 1
| '''Material Set Count'''
| Count of material sets in the model.
|-
| 0x28
| [[#Visibility Groups|Visibility Groups]]
| 1
| '''Visibility Group Data'''
| Only present if flag 0x10 is set.
|-
| {{none}}
| u32
| ''Section Count''
| '''Section Sizes'''
|
|-
| colspan=5 {{unknown|End of header; pad to multiple of 32 before first section starts}}
|}
 
==== Flags ====
 
The following flags are possible:
 
{| class="wikitable"
! Bit
! Hex
! Description
|-
| 0
| 0x1
| Indicates the model is skinned
|-
| 1
| 0x2
| {{unknown|Unknown}}
|-
| 2
| 0x4
| {{unknown|Unknown}}
|-
| 3
| 0x8
| {{unknown|Unknown}}
|-
| 4
| 0x10
| Enable visibility groups
|-
| 5
| 0x20
| Store vertex positions as shorts
|}
 
==== Visibility Groups ====
 
Visibility group data is present in the header if bit 0x10 is set, after the material set count and before the section sizes. Visibility groups are used to toggle the visibility of certain surfaces on or off during animations; for instance, Diddy's jetpack is part of his model but doesn't render in most of his animations.
 
{| class="wikitable"
! Offset
! Type
! Count
! Name
! Notes
|-
| 0x0
| u32
| 1
| {{unknown|'''Unknown'''}}
|
|-
| 0x4
| u32
| 1
| '''Visibility Group Count'''
|
|-
| 0x8
| [[#Visibility Group Name|Visibility Group Name]]
| ''Visibility Group Count''
| '''Visibility Group Name Array'''
|
|-
| {{none}}
| u32
| 1
| {{unknown|'''Unknown'''}}
|
|-
| {{none}}
| u32
| 1
| {{unknown|'''Unknown'''}}
|
|-
| {{none}}
| u32
| 1
| {{unknown|'''Unknown'''}}
|
|-
| {{none}}
| u32
| 1
| {{unknown|'''Unknown'''}}
|
|-
| {{none}}
| u32
| 1
| {{unknown|'''Unknown'''}}
|
|}
 
===== Visibility Group Name =====
 
{| class="wikitable"
! Offset
! Type
! Count
! Name
! Notes
|-
| 0x0
| u32
| 1
| '''Name Length'''
|
|-
| 0x4
| char
| ''Name Length''
| '''Visibility Group Name'''
| Zero-terminated.
|}
 
=== Materials ===
 
''See [[Materials (Metroid Prime 3)]]''
 
DKCR uses the same material format as Metroid Prime 3, with the main differences being what pass types and UV animation modes are supported (a few have been added/removed). The only other significant difference in DKCR compared to Prime 3 is that in Prime 3, each material set would get its own section. In DKCR, every material set is in the same section. Each material set begins with a material count, and each material begins with its own size.
 
=== Geometry ===
 
''See [[Geometry (Donkey Kong Country Returns)]]''


[[Category:File Formats]]
[[Category:File Formats]]
[[Category:Metroid Prime]]
[[Category:Metroid Prime 2: Echoes]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Donkey Kong Country Returns]]
[[Category:Donkey Kong Country Returns]]

Revision as of 04:59, 26 January 2015

The CSKR format contains skin bindings for rigged models.


To do:
Write article.