NAME

glAlphaFunc - specify the alpha test function

C SPECIFICATION

void ggllAAllpphhaaFFuunncc( GLenum _f_u_n_c,
                  GLclampf _r_e_f )

PARAMETERS

_f_u_n_c
Specifies the alpha comparison function. Symbolic constants GGLL__NNEEVVEERR, GGLL__LLEESSSS, GGLL__EEQQUUAALL, GGLL__LLEEQQUUAALL, GGLL__GGRREEAATTEERR, GGLL__NNOOTTEEQQUUAALL, GGLL__GGEEQQUUAALL, and GGLL__AALLWWAAYYSS are accepted. The initial value is GGLL__AALLWWAAYYSS.
_r_e_f
Specifies the reference value that incoming alpha values are compared to. This value is clamped to the range [0, 1], where 0 represents the lowest possible alpha value and 1 the highest possible value. The initial reference value is 0.

DESCRIPTION

The alpha test discards fragments depending on the outcome of a comparison between an incoming fragment's alpha value and a constant reference value. ggllAAllpphhaaFFuunncc specifies the reference value and the comparison function. The comparison is performed only if alpha testing is enabled. By default, it is not enabled. (See ggllEEnnaabbllee and ggllDDiissaabbllee of GGLL__AALLPPHHAA__TTEESSTT.)

_f_u_n_c and _r_e_f specify the conditions under which the pixel is drawn. The incoming alpha value is compared to _r_e_f using the function specified by _f_u_n_c. If the value passes the comparison, the incoming fragment is drawn if it also passes subsequent stencil and depth buffer tests. If the value fails the comparison, no change is made to the frame buffer at that pixel location. The comparison functions are as follows:

GGLL__NNEEVVEERR
Never passes.
GGLL__LLEESSSS
Passes if the incoming alpha value is less than the reference value.
GGLL__EEQQUUAALL
Passes if the incoming alpha value is equal to the reference value.
GGLL__LLEEQQUUAALL
Passes if the incoming alpha value is less than or equal to the reference value.
GGLL__GGRREEAATTEERR
Passes if the incoming alpha value is greater than the reference value.
GGLL__NNOOTTEEQQUUAALL
Passes if the incoming alpha value is not equal to the reference value.
GGLL__GGEEQQUUAALL
Passes if the incoming alpha value is greater than or equal to the reference value.
GGLL__AALLWWAAYYSS
Always passes (initial value).

ggllAAllpphhaaFFuunncc operates on all pixel write operations, including those resulting from the scan conversion of points, lines, polygons, and bitmaps, and from pixel draw and copy operations. ggllAAllpphhaaFFuunncc does not affect screen clear operations.

NOTES

Alpha testing is performed only in RGBA mode.

ERRORS

GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _f_u_n_c is not an accepted value.

GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllAAllpphhaaFFuunncc is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.

ASSOCIATED GETS

ggllGGeett with argument GGLL__AALLPPHHAA__TTEESSTT__FFUUNNCC
ggllGGeett with argument GGLL__AALLPPHHAA__TTEESSTT__RREEFF
ggllIIssEEnnaabblleedd with argument GGLL__AALLPPHHAA__TTEESSTT

SEE ALSO

ggllBBlleennddFFuunncc((33GG)), ggllCClleeaarr((33GG)), ggllDDeepptthhFFuunncc((33GG)), ggllEEnnaabbllee((33GG)), ggllSStteenncciillFFuunncc((33GG))