1GLALPHAFUNC(3G) GLALPHAFUNC(3G)
2
3
4
6 glAlphaFunc - specify the alpha test function
7
8
10 void glAlphaFunc( GLenum func,
11 GLclampf ref )
12
13
15 func Specifies the alpha comparison function. Symbolic constants
16 GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL,
17 GL_GEQUAL, and GL_ALWAYS are accepted. The initial value is
18 GL_ALWAYS.
19
20 ref Specifies the reference value that incoming alpha values are com‐
21 pared to. This value is clamped to the range [0, 1], where 0
22 represents the lowest possible alpha value and 1 the highest pos‐
23 sible value. The initial reference value is 0.
24
26 The alpha test discards fragments depending on the outcome of a compar‐
27 ison between an incoming fragment's alpha value and a constant refer‐
28 ence value. glAlphaFunc specifies the reference value and the compari‐
29 son function. The comparison is performed only if alpha testing is
30 enabled. By default, it is not enabled. (See glEnable and glDisable of
31 GL_ALPHA_TEST.)
32
33 func and ref specify the conditions under which the pixel is drawn.
34 The incoming alpha value is compared to ref using the function speci‐
35 fied by func. If the value passes the comparison, the incoming frag‐
36 ment is drawn if it also passes subsequent stencil and depth buffer
37 tests. If the value fails the comparison, no change is made to the
38 frame buffer at that pixel location. The comparison functions are as
39 follows:
40
41 GL_NEVER Never passes.
42
43 GL_LESS Passes if the incoming alpha value is less than the
44 reference value.
45
46 GL_EQUAL Passes if the incoming alpha value is equal to the
47 reference value.
48
49 GL_LEQUAL Passes if the incoming alpha value is less than or
50 equal to the reference value.
51
52 GL_GREATER Passes if the incoming alpha value is greater than
53 the reference value.
54
55 GL_NOTEQUAL Passes if the incoming alpha value is not equal to
56 the reference value.
57
58 GL_GEQUAL Passes if the incoming alpha value is greater than or
59 equal to the reference value.
60
61 GL_ALWAYS Always passes (initial value).
62
63 glAlphaFunc operates on all pixel write operations, including those
64 resulting from the scan conversion of points, lines, polygons, and bit‐
65 maps, and from pixel draw and copy operations. glAlphaFunc does not
66 affect screen clear operations.
67
69 Alpha testing is performed only in RGBA mode.
70
72 GL_INVALID_ENUM is generated if func is not an accepted value.
73
74 GL_INVALID_OPERATION is generated if glAlphaFunc is executed between
75 the execution of glBegin and the corresponding execution of glEnd.
76
78 glGet with argument GL_ALPHA_TEST_FUNC
79 glGet with argument GL_ALPHA_TEST_REF
80 glIsEnabled with argument GL_ALPHA_TEST
81
83 glBlendFunc(3G), glClear(3G), glDepthFunc(3G), glEnable(3G),
84 glStencilFunc(3G)
85
86
87
88 GLALPHAFUNC(3G)