devkitPro / opengx

OpenGL-like wrapper for Nintendo Wii/GameCube
19 stars 2 forks source link

Allow using position and normals as tex coordinates #82

Closed mardy closed 2 days ago

mardy commented 1 week ago

Some application (like the Neverball game) specify the same array of positional coordinates to glTexCoordPointer(), and setup an appropriate texture matrix to transform them as needed. But GX only allows submitting up to two components of texture coordinates (s and t), and simply discarding the third component leads to incorrect rendering results.

The solution (which only works in the case the same array pointer is specified both as positional and texture coordinates -- a fully generic solution does not seem to be possible) is to setup the TEV so that texture coordinates are read from the positional array. This requires some refactoring of the array processing code.

Unlike the previous MR, these commits are all related (but can still be reviewed independently).