Materials (Metroid Prime): Difference between revisions

m
>Aruki
>Aruki
Line 339: Line 339:
* COLOR0 is disabled if the count value is 0. Otherwise, it's set up the same way as with shadowmaps.
* COLOR0 is disabled if the count value is 0. Otherwise, it's set up the same way as with shadowmaps.


Finally, an important note is that the formatting of the color channel info is bugged. There is always a count value and a single set of flags; 8 bytes total. However, for some reason the game is expecting one set of flags per color channel. To reach the TEV stages, you need to advance (4 * count) bytes past the count value, rather than 4. A likely explanation is that there was one set of flags per channel earlier in development, and the material loading code wasn't fully updated when this was changed; it's not normally an issue because the count is always 1 in every file the game uses, but beware for experimentation/custom materials.
Finally, an important note is that the formatting of the color channel info is bugged. There is always a color channel count and a single set of flags; 8 bytes total. However, for some reason the game is expecting one set of flags per color channel. To reach the TEV stages, you need to advance (4 * count) bytes past the count value, rather than 4. A likely explanation is that there was one set of flags per channel earlier in development, and the material loading code wasn't fully updated when this was changed. It's not normally an issue because the count is always 1 in every file the game uses, but beware for experimentation/custom materials.


=== TEV Stages ===
=== TEV Stages ===
Anonymous user