CMDL (Tropical Freeze): Difference between revisions

→‎MTRL: I figured I should just dump what I know here before I put it off too much longer...
>Aruki
mNo edit summary
>Aruki
(→‎MTRL: I figured I should just dump what I know here before I put it off too much longer...)
Line 56: Line 56:
=== MTRL ===
=== MTRL ===


Materials. To do.
The MTRL section has a 32-bit material count, then lays out its materials one after the other. The material structure is somewhat complicated; each material has a name, something that wasn't present in Retro's previous material formats, as well as a shader ID. The rest of the material structure appears to be defining parameters to pass to the shader. This needs a lot more research to determine what the parameters are and what the different data is.
 
{| class="wikitable"
! Type
! Size
! Description
|-
| string
| -
| '''Name''' (zero-terminated)
|-
| [[MTRL (File Format)|MTRL]]
| 16
| '''Shader ID'''
|-
| char[4]
| 4
| '''Shading type fourCC'''; can be PHNG, LAMB, SURF, or FURM
|-
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| u32
| 4
| '''Subsection count'''
|}
 
Material subsections each have a fourCC name and a type identifer, followed by a set of parameters. The type and number of parameters is dependent on the subsection type; there are five known types currently.
 
{| class="wikitable"
! Offset
! Type
! Size
! Description
|-
| 0x0
| char[4]
| 4
| '''Section name fourCC'''
|-
| 0x4
| u32
| 4
| '''Section type'''
|-
| 0x8
| struct
| -
| '''Section data struct'''; type varies based on the section type value
|-
| colspan=4 {{unknown|End of subsection; next one begins}}
|}
 
==== Type 0: Texture Map ====
 
{| class="wikitable"
! Offset
! Type
! Size
! Description
|-
| 0x0
| [[TXTR (Tropical Freeze)|TXTR]]
| 0x10
| '''Texture ID'''
|-
| 0x10
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x14
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x18
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x1C
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x20
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x24
| colspan=3 {{unknown|End of struct}}
|}
 
==== Type 1: Unknown ====
 
{| class="wikitable"
! Offset
! Type
! Size
! Description
|-
| 0x0
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x4
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x8
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0xC
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x10
| colspan=3 {{unknown|End of struct}}
|}
 
==== Type 2: Unknown ====
 
{| class="wikitable"
! Offset
! Type
! Size
! Description
|-
| 0x0
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x4
| colspan=3 {{unknown|End of struct}}
|}
 
==== Type 4: Unknown ====
 
{| class="wikitable"
! Offset
! Type
! Size
! Description
|-
| 0x0
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x4
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x8
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0xC
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x10
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x14
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x18
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x1C
| float
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x20
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x24
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x28
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x2C
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x30
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x34
| u8
| 1
| {{unknown|'''Unknown'''}}
|-
| 0x35
| [[TXTR (Tropical Freeze)|TXTR]]
| 0x10
| {{unknown|'''Unknown Texture ID'''}}
|-
| 0x45
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x49
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x4D
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x51
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x55
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x59
| [[TXTR (Tropical Freeze)|TXTR]]
| 0x10
| {{unknown|'''Unknown Texture ID'''}}
|-
| 0x69
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x6D
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x71
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x75
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x79
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x7D
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x81
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x85
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x89
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x8D
| colspan=3 {{unknown|End of struct}}
|}
 
==== Type 5: Unknown ====
 
{| class="wikitable"
! Offset
! Type
! Size
! Description
|-
| 0x0
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x4
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x8
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0xC
| u32
| 4
| {{unknown|'''Unknown'''}}
|-
| 0x10
| colspan=3 {{unknown|End of struct}}
|}


=== MESH ===
=== MESH ===
Anonymous user