MREA (Metroid Prime 3): Difference between revisions

Jump to navigation Jump to search
no edit summary
>Aruki
>Aruki
No edit summary
Line 156: Line 156:
|-
|-
| <code>WOBJ</code>
| <code>WOBJ</code>
| World Geometry Declaration
| [[#Materials|Materials]] + [[#World Model Definition|World Model Definition]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>ROCT</code>
| <code>ROCT</code>
| Area Octree
| [[#Area Octree|Area Octree]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>AABB</code>
| <code>AABB</code>
| Surface Group Bounding Boxes
| [[#Surface Group Bounding Boxes|Surface Group Bounding Boxes]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>GPUD</code>
| <code>GPUD</code>
| World Geometry GPU Data
| [[#GPU Data|World Geometry GPU Data]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
Line 232: Line 232:


=== Materials ===  
=== Materials ===  
[[Materials (Metroid Prime 3)|Materials]] are identical to those found in [[CMDL (Metroid Prime 3)|CMDL]] files.
''See [[Materials (Metroid Prime 3)]]''


=== Mesh Headers ===
Identical to the material format found in [[CMDL (File Format)|CMDL]].
The WOBJ sections correspond to the header for a world mesh. Those sections are unique, in that they don't have a valid section number, which is always 0. However, they are always in the sections immediately following the materials. Each mesh header takes up 4 sections - the main header, the surface offsets, the mesh info table, and the unknown table.


==== Main Header ====
=== World Model Definition ===


{| class="wikitable"
The world geometry definitions always appear immediately following the materials section. Each definition is a sequence of four sections. All four of these sections are identical to their structure in the previous MREA formats in both MP3 and DKCR, so check those pages:
! Type
! Description
! Notes
|-
| long
| '''Unknown'''
| Most likely visor flags in MP3, unknown in DKCR
|-
| CTransform4f
| '''Transformation Matrix'''
| Meshes location in world space
|-
| CAABox
| '''Bounding Box'''
| Likely used for Depth sorting as in previous games.
|}
 
==== Surface Offsets ====
 
{| class="wikitable"
! Type
! Description
! Notes
|-
| long
| '''Surface count''' (SC)
|
|-
| long
| '''Surface Offsets[SC]'''
| Relative to the start first surface (i.e. the first offset points the the end of the first surface)
|}
 
==== Mesh IDs ====
 
The next section contains a table of shorts that associates each surface in the mesh with a mesh ID. It starts with a 16-bit count (which always matches the mesh's surface count). The full extent of what exactly the data is and what it's used for is unknown, but it's accessed by various other components to identify world geometry.
 
{| class="wikitable"
! Type
! Description
! Notes
|-
| long
| {{unknown|'''Unknown'''}}
| Usually a very similar value to the mesh ID, sometimes the same number
|-
| long
| '''Mesh ID'''
|
|}
 
There is one more section after this one before the next mesh header begins that contains unknown data.
 
=== AROT ===
Following the WOBJ sections is usually AROT. AROT is a BSP Tree that appears to be used for shot-collision and possibly depth sorting, nothing is known about how to handle this section.
 
=== AABB ===
The AABB section is exactly what it sounds like, it's an array of Axis-Aligned Bounding Boxes, assembling a BVH tree. AABB starts with the number of bounding boxes with each one consisting of the following struct:
 
{|class="wikitable"
!Type
!Description
!Notes
|-
|CAABox
|'''Axis Aligned Bounding Box'''
|Used to assist depth sorting, and/or collision
|-
|long
|'''Unknown'''
|The first entry in the table always covers the entire, with this value always being -1
|-
|short
|'''Self Index'''
| 1 indexed position of this particular AABB entry, but ONLY if the previous value is -1.
|-
|short
|'''Self Index'''
| 1 indexed position of this particular AABB entry, but ONLY if the previous value is -1.
|}
 
=== GPU Description Section (GPUD) ===
The GPUD section is a bit confusing at first glance, however it's really no different from the previous MREA version in terms of ordering. There is also one GPUD per WOBJ section
 
The section order is as follows:
==== Vertices ====
The vertices are always 32bit floats, even in DKCR


==== Normals ====
* [[MREA (Metroid Prime)#World Geometry|World Model Header]]
The normals are always 32bit floats.
* [[Geometry (Metroid Prime)#Surface Offsets|Surface Definitions]]
* [[Geometry (Metroid Prime)#Surface Group IDs|Surface Group IDs]]
* [[Geometry (Metroid Prime)#Surface Lookup Table|Surface Lookup Table]]


==== Colors ====
=== Area Octree ===
Usually 0 filled and completely unused, it's stored in MREA simply for completeness.
''See [[AROT (MREA Section)]]''


==== Float Texcoords ====
=== Surface Group Bounding Boxes ===
Metroid Prime 3 uses these exclusively, even for lightmaps, which simplifies UV handling quite a bit.
''See [[MREA (Metroid Prime 2)#Surface Group Bounding Boxes]]''


==== Short Texcoords ====
=== GPU Data ===
This is only used in DKCR and can be used for anything, not just for lightmaps
This section contains the GPU buffer data used to render world geometry. This is generally the same as in previous games, with the following sequence of sections repeated once per world model:


==== Submeshes ====
* '''Vertices''': Always floats; world geometry vertices are never packed into shorts.
The submesh format is exactly the same as the Geometry formats found in Metroid Prime 3 and DKCR.
* '''Normals''': Always floats; world geometry normals are never packed into shorts.
* '''Colors''': Contains 32-bit RGBA8 colors. This section is not used in any official assets and is always zeroed out.
* '''Float UV Coordinates''': In Metroid Prime 3, these are used exclusively, even for lightmaps.
* '''Short UV Coordinates''': Only appears in Donkey Kong Country Returns; can be used for anything, not only lightmaps as in previous games.
* '''Surfaces''': One section per surface.


[[Category:File Formats]]
[[Category:File Formats]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Donkey Kong Country Returns]]
[[Category:Donkey Kong Country Returns]]
Anonymous user

Navigation menu