#include <revolution/gx.h>
void GXSetAlphaCompare(
GXCompare comp0,
u8 ref0,
GXAlphaOp op,
GXCompare comp1,
u8 ref1 );
comp0 |
comparison subfunction 0 Applicable values are as follows:
|
||||||||||||||||||
ref0 |
reference value for subfunction 0 An 8-bit value. |
||||||||||||||||||
op |
an operator for combining subfunction 0 and subfunction 1 Applicable values are as follows:
|
||||||||||||||||||
comp1 |
comparison subfunction 1 Applicable values are as follows:
|
||||||||||||||||||
ref1 |
reference value for subfunction 1 An 8-bit value. |
None.
This function sets the arguments for the alpha comparison function which uses alpha output from the last active texture environment (TEV) stage. The number of active TEV stages are specified using GXSetNumTevStages.
The output alpha can be used in blending equations (see GXSetBlendMode) to control how source and target (frame buffer) pixels are combined.
The alpha comparison is:
alpha_pass = (alpha_src (comp0) ref0) (op) (alpha_src (comp1) ref1)
where alpha_src is the alpha from the last active TEV stage. As an example, you can implement these equations:
alpha_pass = (alpha_src > ref0) AND (alpha_src < ref1)
or
alpha_pass = (alpha_src > ref0) OR (alpha_src < ref1)
Z comparisons can occur either before or after texturing. Please refer to GXSetZCompLoc. In the case where Z comparison occurs before texturing, the Z is written based only on the Z test. The color is written if both the Z and alpha tests pass.
When Z comparisons occur after texturing, the color and Z are written if both the Z and alpha tests pass. When using texture to make cutout shapes (like billboard trees) that need to be correctly Z buffered, you should configure the pipeline for Z buffering after texturing.
GXSetNumTevStages
GXSetTevAlphaIn
GXSetTevAlphaOp
GXSetBlendMode
GXSetZCompLoc
03/01/2006 Initial version.