UV Animations: Difference between revisions
Minor Mode6 translation scale fix
>Aruki (Created page with "'''UV animations''' are used to animate texture coordinates. They're present in the material data of the Metroid Prime trilogy and Donkey Kong Country Returns. There are 11 an...") |
imported>Jackoalan (Minor Mode6 translation scale fix) |
||
(13 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
'''UV animations''' are used to animate texture coordinates. They're present in the material data of the Metroid Prime trilogy and Donkey Kong Country Returns. There are | '''UV animations''' are used to animate texture coordinates. They're present in the material data of the Metroid Prime trilogy and Donkey Kong Country Returns. There are 13 animation types across those four games. | ||
{{research|moderate|Modes 8/10/11/12/13 are unknown}} | |||
__TOC__ | __TOC__ | ||
Line 71: | Line 73: | ||
|- | |- | ||
| 0 | | 0 | ||
| [[# | | [[#Mode_0:_Inverse ModelView Matrix (No Translation)|Inverse ModelView Matrix (No Translation)]] | ||
| 0 | | 0 | ||
| {{check}} | | {{check}} | ||
Line 79: | Line 81: | ||
|- | |- | ||
| 1 | | 1 | ||
| [[# | | [[#Mode_1:_Inverse ModelView Matrix|Inverse ModelView Matrix]] | ||
| 0 | | 0 | ||
| {{check}} | | {{check}} | ||
Line 87: | Line 89: | ||
|- | |- | ||
| 2 | | 2 | ||
| [[# | | [[#Mode_2:_UV Scroll|UV Scroll]] | ||
| 4 | | 4 | ||
| {{check}} | | {{check}} | ||
Line 95: | Line 97: | ||
|- | |- | ||
| 3 | | 3 | ||
| [[# | | [[#Mode_3:_Rotation|Rotation]] | ||
| 2 | | 2 | ||
| {{check}} | | {{check}} | ||
Line 103: | Line 105: | ||
|- | |- | ||
| 4 | | 4 | ||
| [[# | | [[#Mode_4/5:_Horizontal/Vertical_Filmstrip|Horizontal Filmstrip]] | ||
| 4 | | 4 | ||
| {{check}} | | {{check}} | ||
Line 111: | Line 113: | ||
|- | |- | ||
| 5 | | 5 | ||
| [[# | | [[#Mode_4/5:_Horizontal/Vertical_Filmstrip|Vertical Filmstrip]] | ||
| 4 | | 4 | ||
| {{check}} | | {{check}} | ||
Line 119: | Line 121: | ||
|- | |- | ||
| 6 | | 6 | ||
| [[# | | [[#Mode_6:_Model Matrix|Model Matrix]] | ||
| 0 | | 0 | ||
| {{check}} | | {{check}} | ||
| {{check}} | | {{check}} | ||
| {{check}} | | {{check}} | ||
| {{ | | {{nocheck}} | ||
|- | |- | ||
| 7 | | 7 | ||
| [[# | | [[#Mode_7:_Cylinder Environment|Cylinder Environment]] | ||
| 2 | | 2 | ||
| {{check}} | | {{check}} | ||
Line 142: | Line 144: | ||
| {{check}} | | {{check}} | ||
|- | |- | ||
| | | 10 | ||
| {{unknown|[[#Mode_10:_Another_reflection_mode|Another reflection mode]]}} | |||
| 0 | |||
| {{nocheck}} | |||
| {{nocheck}} | |||
| {{nocheck}} | |||
| {{check}} | |||
|- | |||
| 11 | |||
| {{unknown|Unknown mode}} | |||
| 2 | |||
| {{nocheck}} | |||
| {{nocheck}} | |||
| {{nocheck}} | |||
| {{check}} | |||
|- | |||
| 12 | |||
| {{unknown|Unknown mode}} | | {{unknown|Unknown mode}} | ||
| | | 2 | ||
| {{nocheck}} | | {{nocheck}} | ||
| {{nocheck}} | | {{nocheck}} | ||
Line 150: | Line 168: | ||
| {{check}} | | {{check}} | ||
|- | |- | ||
| | | 13 | ||
| {{unknown|Unknown mode}} | | {{unknown|Unknown mode}} | ||
| | | 2 | ||
| {{nocheck}} | | {{nocheck}} | ||
| {{nocheck}} | | {{nocheck}} | ||
| {{nocheck}} | | {{nocheck}} | ||
| {{check}} | | {{check}} | ||
|- | |||
|} | |} | ||
Line 170: | Line 189: | ||
texmtx[0][3] = texmtx[1][3] = texmtx[2][3] = 0;</pre> | texmtx[0][3] = texmtx[1][3] = texmtx[2][3] = 0;</pre> | ||
The post-transform matrix is a constant value. | The post-transform matrix is a constant value. The purpose of it is to adjust the normalized texture coordinates so that they range from 0 to 1. | ||
<pre>0.5, 0.0, 0.0, 0.5, | <pre>0.5, 0.0, 0.0, 0.5, | ||
Line 218: | Line 237: | ||
The texture matrix is simply the model matrix, with the translation values set to 0. The post-transform matrix is set to the following: | The texture matrix is simply the model matrix, with the translation values set to 0. The post-transform matrix is set to the following: | ||
<pre>0.5, 0.0, 0.0, ModelMatrix[0][3] * 0. | <pre>0.5, 0.0, 0.0, ModelMatrix[0][3] * 0.050000001, | ||
0.0, 0.0, 0.5, ModelMatrix[1][3] * 0. | 0.0, 0.0, 0.5, ModelMatrix[1][3] * 0.050000001</pre> | ||
==== Mode 7: | ==== Mode 7: Cylinder Environment ==== | ||
Mode 7 takes two parameters and generates both a texture matrix and a post-transform matrix | Mode 7 takes two parameters and generates both a texture matrix and a post-transform matrix, projecting the UVs onto the surface of a cylinder, used almost exclusively on pipes. | ||
The texture matrix is generated the same way as in mode 0; translation is ignored. | The texture matrix is generated the same way as in mode 0; translation is ignored. | ||
Line 245: | Line 264: | ||
0.0f, 0.0f, halfA, z, | 0.0f, 0.0f, halfA, z, | ||
0.0f, 0.0f, 0.0f, 1.0f</pre> | 0.0f, 0.0f, 0.0f, 1.0f</pre> | ||
==== Mode 10: Another reflection mode ==== | |||
This one needs more research done, but the only thing the game does with this mode is load this post-transform matrix: | |||
<pre>0.5, 0.0, 0.0, 0.5, | |||
0.0, 0.0, 0.5, 0.5, | |||
0.0, 0.0, 0.0, 1.0</pre> | |||
The function of this matrix is to transform normalized texture coords so that they range from 0 to 1, instead of from -1 to 1. This mode seems to work well with mode 0's settings, though, so it's possible that the game is creating a texture matrix somewhere else. This needs some looking into. | |||
[[Category:File Formats]] | [[Category:File Formats]] |