Materials (Metroid Prime): Difference between revisions
Jump to navigation
Jump to search
m
grammar correction and minor improvements in readability
>Aruki m (trying embyr's new Research template. seems to work well) |
>Sdmr m (grammar correction and minor improvements in readability) |
||
Line 1: | Line 1: | ||
The format for '''materials''' is seen in both the [[CMDL (Metroid Prime)|CMDL]] and [[MREA (File Format)|MREA]] formats | The format for '''materials''' is seen in both the [[CMDL (Metroid Prime)|CMDL]] and [[MREA (File Format)|MREA]] formats and is identical in both. This particular material format appears in both Metroid Prime and Metroid Prime 2 with minor differences. | ||
{{research|moderate|There are a few unknown values, and some unknown settings in known values; there are also a few unknown material animation modes. Also, basically everything that was introduced in Echoes (two general settings and a vertex attribute) is unknown.}} | {{research|moderate|There are a few unknown values, and some unknown settings in known values; there are also a few unknown material animation modes. Also, basically everything that was introduced in Echoes (two general settings and a vertex attribute) is unknown.}} | ||
Line 9: | Line 9: | ||
The materials system in Metroid Prime is heavily dependent on the GameCube and Wii's graphics system, GX. GX is a fixed-function graphics pipeline, similar to old versions of OpenGL. In GX, rendering is done through a series of steps called '''T'''exture '''E'''n'''V'''ironment Stages, or or TEV stages for short. | The materials system in Metroid Prime is heavily dependent on the GameCube and Wii's graphics system, GX. GX is a fixed-function graphics pipeline, similar to old versions of OpenGL. In GX, rendering is done through a series of steps called '''T'''exture '''E'''n'''V'''ironment Stages, or or TEV stages for short. | ||
Prior to TEV stages, per-vertex calculations are performed. Lighting calculations are performed | Prior to TEV stages, per-vertex calculations are performed. Lighting calculations are performed and passed to GX as a rasterized vertex color; texture coordinate generation (texgen) is also performed and made available to TEV. | ||
How TEV stages actually work: Each TEV stage takes in four color (RGB) inputs | How TEV stages actually work: Each TEV stage takes in four color (RGB) inputs and four alpha inputs, from one of eight sources. Then these four input colors are combined into one output color, and the output is saved into one of four registers, which can subsequently be used as input in the next TEV stages. The final stage must always save its output into the "previous TEV stage" register; that register is used as the final pixel color that gets displayed onscreen. | ||
== Material Set Format == | == Material Set Format == | ||
Line 292: | Line 292: | ||
==== Color Channels ==== | ==== Color Channels ==== | ||
There's an odd quirk with how these values work; although there's a count value listed, the game will only actually read the first value listed | There's an odd quirk with how these values work; although there's a count value listed, the game will only actually read the first value listed and then skip the rest. There's no reason to ever have more than one flag value. Aside from that, how this works is unknown and needs research. | ||
=== TEV Stages === | === TEV Stages === | ||
Line 440: | Line 440: | ||
==== Alpha Input Flags ==== | ==== Alpha Input Flags ==== | ||
Similar to the color input flags, these set the four alpha inputs used by the TEV stage. Each value is allocated 5 bits, although only 3 are used. The main difference with alpha is there | Similar to the color input flags, these set the four alpha inputs used by the TEV stage. Each value is allocated 5 bits, although only 3 are used. The main difference with alpha is that there are only 8 possible sources instead of 16: | ||
{| class="wikitable" | {| class="wikitable" |