forked from davidgfnet/opengx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arrays: allow using positions and normals as texture coordinate inputs
The GX_VA_TEX* formats only allow up to two components in the texture input coordinates (s and t), but OpenGL applications can provide up to four, along with a texture matrix to transform them. While we are not able to support this general case (not easily, at least!), we can handle the case where the array with the texture input coordinates is the same passed for the positional or normal attributes, because in that case we can skip re-uploading these coordinates at all and can setup the TEV to read texture coordinates from GX_TG_POS or GX_TG_NRM and transform them with the given matrix. This works well with Neverball, which passes the same array of positions as texture coordinates when it needs to apply the ball shadow to the object lying under the ball.
- Loading branch information
Showing
3 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters