Materials (Metroid Prime): Difference between revisions
→Vertex Attribute Flags
>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. | ||
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 | |||
|} | |} | ||