Materials (Metroid Prime): Difference between revisions

>Aruki
No edit summary
>Aruki
Line 191: Line 191:
==== Vertex Attribute Flags ====
==== Vertex Attribute Flags ====


These flags are generally toggled in pairs, with each pair corresponding to a vertex attribute; if a pair is set, then vertices using this material will have the corresponding attribute. This is vital for reading geometry.
These flags are generally toggled in pairs, with each pair corresponding to a vertex attribute; if a pair is set, then vertices using this material will have the corresponding attribute. This is vital for reading geometry. Starting in Echoes, each pair is used to indicate the size of the attribute indices in the geometry data, with 3 meaning a 16-bit index and 2 meaning an 8-bit index.


An important note is that while the leftmost byte is not used in Prime 1, in Echoes there's occasionally a value there that toggles an extra vertex attribute preceding position. This needs research to determine what the new attribute actually is. Also, GX supports up to 8 texture coords per vertex, but the game doesn't seem to allow you to assign more than 7 (though this could do with some double-checking).
GX supports up to 8 texture coords per vertex, but the game doesn't seem to allow you to assign more than 7 (though this could do with some double-checking).


These are the possible attributes:
These are the possible attributes:
Line 233: Line 233:
| 0x300000
| 0x300000
| Tex 6
| Tex 6
|}
Echoes introduces some new attributes using the top byte of the flags value; unlike the other flags, these are not set in pairs. Each individual bit indicates the presence of a different attribute. The indices in the geometry data are always 8 bits.
{| class="wikitable"
! Bit
! Attribute
|-
| 0x1
| Position Matrix Index
|-
| 0x2
| Tex0 Matrix Index
|-
| 0x4
| Tex1 Matrix Index
|-
| 0x8
| Tex2 Matrix Index
|-
| 0x10
| Tex3 Matrix Index
|-
| 0x20
| Tex4 Matrix Index
|-
| 0x40
| Tex5 Matrix Index
|-
| 0x80
| Tex6 Matrix Index
|}
|}


Anonymous user