MOD file
Jump to navigation
Jump to search
Contents
- 1 MOD Format
- 1.1 Alignment
- 1.2 Chunk Structure
- 1.3 Chunk Types
- 1.4 Chunk Details
- 1.4.1 Header (0x00)
- 1.4.2 Vertex (0x10)
- 1.4.3 VertexNormal (0x11)
- 1.4.4 VertexNBT (0x12)
- 1.4.5 VertexColour (0x13)
- 1.4.6 TexCoord0-7 (0x18 to 0x1F)
- 1.4.7 Texture (0x20)
- 1.4.8 TextureAttribute (0x22)
- 1.4.9 Material (0x30)
- 1.4.10 VertexMatrix (0x40)
- 1.4.11 MatrixEnvelope (0x41)
- 1.4.12 Mesh (0x50)
- 1.4.13 Joint (0x60)
- 1.4.14 JointName (0x61)
- 1.4.15 CollisionPrism (0x100)
- 1.4.16 CollisionGrid (0x110)
- 1.4.17 EndOfFile (0xFFFF)
- 1.5 Additional Notes
MOD Format[edit]
The MOD format is a proprietary binary data structure used to represent and serialize 3D model data, including geometry, textures, materials, and metadata. It employs a chunk-based architecture where each chunk represents a specific data category or type, enabling modular and efficient parsing and serialization.
Alignment[edit]
Chunks are written at addresses that are a multiple of `0x20` (32), using `00` bytes to pad as necessary. This is done for efficiency during reading and writing operations.
Chunk Structure[edit]
Although every individual chunk is unique, they all follow a similar structure:
Header[edit]
Each chunk begins with a header consisting of:
- Opcode (4 bytes): Identifies the chunk type.
- Length (4 bytes): Specifies the size of the chunk payload, excluding the header.
Chunk Types[edit]
Below is a list of chunk types with links to detailed descriptions:
- Header (0x00)
- Vertex (0x10)
- VertexNormal (0x11)
- VertexNBT (0x12)
- VertexColour (0x13)
- TexCoord0 to TexCoord7 (0x18 to 0x1F)
- Texture (0x20)
- TextureAttribute (0x22)
- Material (0x30)
- VertexMatrix (0x40)
- MatrixEnvelope (0x41)
- Mesh (0x50)
- Joint (0x60)
- JointName (0x61)
- CollisionPrism (0x100)
- CollisionGrid (0x110)
- EndOfFile (0xFFFF)
Chunk Details[edit]
Header (0x00)[edit]
- Description: Contains minimal metadata about the MOD file, including creation date and flags.
- Contents: (To be filled)
Vertex (0x10)[edit]
- Description: Contains vertex position data for the 3D model.
- Contents: (To be filled)
VertexNormal (0x11)[edit]
- Description: Contains normal vector data for vertices, used for lighting calculations.
- Contents: (To be filled)
VertexNBT (0x12)[edit]
- Description: Stores additional data such as binormal and tangent vectors for vertices.
- Contents: (To be filled)
VertexColour (0x13)[edit]
- Description: Contains color information for vertices, often used for vertex shading.
- Contents: (To be filled)
TexCoord0-7 (0x18 to 0x1F)[edit]
- Description: Stores texture coordinate set 0 to 7 for mapping textures onto geometry.
- Contents: (To be filled)
Texture (0x20)[edit]
- Description: Contains texture data used for rendering the model.
- Contents: (To be filled)
TextureAttribute (0x22)[edit]
- Description: Stores attributes and metadata related to textures.
- Contents: (To be filled)
Material (0x30)[edit]
- Description: Defines materials, including shaders and associated textures.
- Contents: (To be filled)
VertexMatrix (0x40)[edit]
- Description: Stores transformation matrices for vertices.
- Contents: (To be filled)
MatrixEnvelope (0x41)[edit]
- Description: Defines envelopes for vertex weighting and deformation.
- Contents: (To be filled)
Mesh (0x50)[edit]
- Description: Contains data for geometric objects, including faces and connectivity.
- Contents: (To be filled)
Joint (0x60)[edit]
- Description: Stores joint data for skeletal animation.
- Contents: (To be filled)
JointName (0x61)[edit]
- Description: Contains names of joints for animation and rigging purposes.
- Contents: (To be filled)
CollisionPrism (0x100)[edit]
- Description: Defines collision prisms used in physics calculations.
- Contents: (To be filled)
CollisionGrid (0x110)[edit]
- Description: Contains data for collision grids, used for spatial partitioning.
- Contents: (To be filled)
EndOfFile (0xFFFF)[edit]
- Description: Marks the end of the MOD file.
- Contents: (To be filled)
Additional Notes[edit]
- Alignment ensures optimal performance with the GameCube and Wii, where aligned data loads quicker as they directly fall onto cache lines.