UV Animations: Difference between revisions

Minor Mode6 translation scale fix
>Aruki
imported>Jackoalan
(Minor Mode6 translation scale fix)
 
(9 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 11 animation types across those four games.
'''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/9/10 are unknown}}
{{research|moderate|Modes 8/10/11/12/13 are unknown}}


__TOC__
__TOC__
Line 126: Line 126:
| {{check}}
| {{check}}
| {{check}}
| {{check}}
| {{check}}
| {{nocheck}}
|-
|-
| 7
| 7
| [[#Mode_7:_Convoluted reflection mode|Convoluted reflection mode]]
| [[#Mode_7:_Cylinder Environment|Cylinder Environment]]
| 2
| 2
| {{check}}
| {{check}}
Line 144: Line 144:
| {{check}}
| {{check}}
|-
|-
| 9
| 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 152: Line 168:
| {{check}}
| {{check}}
|-
|-
| 10
| 13
| {{unknown|Unknown mode}}
| {{unknown|Unknown mode}}
| 0
| 2
| {{nocheck}}
| {{nocheck}}
| {{nocheck}}
| {{nocheck}}
| {{nocheck}}
| {{nocheck}}
| {{check}}
| {{check}}
|-
|}
|}


Line 220: 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.50000001,
<pre>0.5, 0.0, 0.0, ModelMatrix[0][3] * 0.050000001,
0.0, 0.0, 0.5, ModelMatrix[1][3] * 0.5</pre>
0.0, 0.0, 0.5, ModelMatrix[1][3] * 0.050000001</pre>


==== Mode 7: Convoluted reflection mode ====
==== Mode 7: Cylinder Environment ====


Mode 7 takes two parameters and generates both a texture matrix and a post-transform matrix. Feel free to come up with a name for it.
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 247: 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]]
Anonymous user