Geometry (Metroid Prime): Difference between revisions

no edit summary
>Aruki
(Created page with "The format for '''geometry''' appears in both the CMDL and MREA formats, and is identical between both. This format is used in all...")
 
>Aruki
No edit summary
Line 5: Line 5:
== Format ==
== Format ==


An important thing to note off the bat is that both CMDL and MREA files are split up into a number of ''sections''; their respective headers both declare a section count, and list the sizes of each section contained in the file. This is required to navigate to different parts of the file, and is required in order to read the geometry data correctly. Sections are generally split based on the type of data contained in them, so one section might contain vertex coordinates, while another contains a submesh definition. For the purposes of this article, each subheader will mark the start of a new section; use that as your cue to advance to the next one. Check the CMDL or MREA pages for more info on how the sections work.
An important thing to note off the bat is that both CMDL and MREA files are split up into a number of 32-byte-aligned ''sections''; their respective headers both declare a section count, and list the sizes of each section contained in the file. This is required to navigate to different parts of the file, and is required in order to read the geometry data correctly. Sections are generally split based on the type of data contained in them, so one section might contain vertex coordinates, while another contains a submesh definition. For the purposes of this article, each subheader will mark the start of a new section; use that as your cue to advance to the next one. Check the CMDL or MREA pages for more info on how the sections work.


For vertex attributes, note that there's no count value present anywhere. If you want a rough count, you can divide the size of that attribute's section by the attribute's size.
For vertex attributes, note that there's no count value present anywhere. If you want a rough count, you can divide the size of that attribute's section by the attribute's size.
Line 131: Line 131:
|}
|}


In addition, the game uses three vertex formats, indicated in the lower 3 bits of the flag value (0x7).
In addition, the game uses three vertex formats, indicated in the lower 3 bits of the flag value (0x7). The only attributes that change between formats are nrm and tex0, so those are the only ones listed in the table below.


{| class="wikitable"
{| class="wikitable"
Line 138: Line 138:
! Format 1 component type/size
! Format 1 component type/size
! Format 2 component type/size
! Format 2 component type/size
|-
| GX_VA_POS
| GX_POS_XYZ / GX_F32
| GX_POS_XYZ / GX_F32
| GX_POS_XYZ / GX_F32
|-
|-
| GX_VA_NRM
| GX_VA_NRM
Line 148: Line 143:
| GX_NRM_XYZ / GX_S16
| GX_NRM_XYZ / GX_S16
| GX_NRM_XYZ / GX_S16
| GX_NRM_XYZ / GX_S16
|-
| GX_VA_CLR0
| GX_CLR_RGBA / GX_RGBA8
| GX_CLR_RGBA / GX_RGBA8
| GX_CLR_RGBA / GX_RGBA8
|-
| GX_VA_CLR1
| GX_CLR_RGBA / GX_RGBA8
| GX_CLR_RGBA / GX_RGBA8
| GX_CLR_RGBA / GX_RGBA8
|-
|-
| GX_VA_TEX0
| GX_VA_TEX0
Line 163: Line 148:
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_S16
| GX_TEX_ST / GX_S16
|-
| GX_VA_TEX1
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
|-
| GX_VA_TEX2
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
|-
| GX_VA_TEX3
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
|-
| GX_VA_TEX4
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
|-
| GX_VA_TEX5
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
|-
| GX_VA_TEX6
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
|-
| GX_VA_TEX7
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
| GX_TEX_ST / GX_F32
|}
|}


Line 204: Line 154:
[[Category:Metroid Prime 2: Echoes]]
[[Category:Metroid Prime 2: Echoes]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Donkey Kong Country Returns]]
Anonymous user