forked from davidgfnet/opengx
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEV: store raster color output in a TEV register
The GX_CC_RASC and GX_CA_RASA constants do not refer to the untextured vertex color, but only to the color being generated by the color channel associated with the current stage: while in some situation these two entities coincide, in the case of a lit object we do have two active color channels, and these constants can only be used to refer to one of them at a time. Furthermore, when we enter the texturing stage on a lit geometry, we pass GX_COLORNULL, meaning that no rasterizer color channel is associated, and here GX_CC_RASC and GX_CA_RASA only render black. Yet, the texture environment operations in OpenGL sometimes need to operate on the color emitted on the vertex by the rasterizer. The solution is to emit the result of the lighting operations not on GX_TEVPREV (which gets changed at each stage), but on a well-named register (one of GX_TEVREG0 - GX_TEVREG2), which later stages can then refer to.
- Loading branch information
1 parent
342d989
commit d89ccf9
Showing
3 changed files
with
53 additions
and
38 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