#include <revolution/gx.h>
void GXSetTevAlphaIn(
GXTevStageID stage,
GXTevAlphaArg a,
GXTevAlphaArg b,
GXTevAlphaArg c,
GXTevAlphaArg d );
| stage | Name of the stage. Accepted values are: GX_TEVSTAGE0, GX_TEVSTAGE1, GX_TEVSTAGE2, ... , GX_TEVSTAGE15. |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| a | Input operand. An unsigned 8-bit value for the component. Accepted values are:
|
||||||||||||||||||
| b | Input operand. An unsigned 8-bit value for the element. Applicable values are the same as for a. | ||||||||||||||||||
| c | Input operand. An unsigned 8-bit value for the element. Applicable values are the same as for a. | ||||||||||||||||||
| d | Input operand. A signed 1-bit + 10-bit value per element. Applicable values are the same as for a. |
None.
This function sets the input operands for one stage of the texture environment (TEV) alpha combiner unit. The input operands a, b, and c are unsigned 8-bit inputs (0 <= a, b, c <= 255). The d input operand is a signed 10-bit input (-1024 <= d <= 1023).
Each TEV stage implements the following function:
reg = ( d ( op ) (( 1.0 - c ) * a + c * b ) + bias) * scale;The operations described by op, bias, and scale are programmable using the GXSetTevAlphaOp function.
The output of this stage is directed by default to the GX_TEVPREV register (see GXInit), but can be set explicitly by the GXSetTevAlphaOp function. When the input a, b or c is from a signed 10-bit number (either the results of a previous TEV stage or an input constant), only the 8 least-significant bits are used. The number is not converted; upper bits are simply discarded.
The registers used to store the output of TEV stages can also be used as inputs: GX_CA_A0, GX_CA_A1, GX_CA_A2, and GX_CA_APREV. These registers can be set with constant alpha values using the GXSetTevColor or GXSetTevColorS10 functions.
The input operand GX_CA_RASA is the solution for the per-vertex lighting equation. The input operand GX_CA_TEXA is the texture alpha input for this stage. You can select the colors and textures to which these inputs correspond using the GXSetTevOrder function.
GXSetTevOp, GXSetTevColorIn, GXSetTevAlphaOp, GXSetTevKAlphaSel
2008/05/26 Corrected errors.
2006/03/01 Initial version.
CONFIDENTIAL