1GLACCUM(3G) GLACCUM(3G)
2
3
4
6 glAccum - operate on the accumulation buffer
7
8
10 void glAccum( GLenum op,
11 GLfloat value )
12
13
15 op Specifies the accumulation buffer operation. Symbolic constants
16 GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN are accepted.
17
18 value Specifies a floating-point value used in the accumulation buffer
19 operation. op determines how value is used.
20
22 The accumulation buffer is an extended-range color buffer. Images are
23 not rendered into it. Rather, images rendered into one of the color
24 buffers are added to the contents of the accumulation buffer after ren‐
25 dering. Effects such as antialiasing (of points, lines, and polygons),
26 motion blur, and depth of field can be created by accumulating images
27 generated with different transformation matrices.
28
29 Each pixel in the accumulation buffer consists of red, green, blue, and
30 alpha values. The number of bits per component in the accumulation
31 buffer depends on the implementation. You can examine this number by
32 calling glGetIntegerv four times, with arguments GL_ACCUM_RED_BITS,
33 GL_ACCUM_GREEN_BITS, GL_ACCUM_BLUE_BITS, and GL_ACCUM_ALPHA_BITS.
34 Regardless of the number of bits per component, the range of values
35 stored by each component is [-1, 1]. The accumulation buffer pixels
36 are mapped one-to-one with frame buffer pixels.
37
38 glAccum operates on the accumulation buffer. The first argument, op,
39 is a symbolic constant that selects an accumulation buffer operation.
40 The second argument, value, is a floating-point value to be used in
41 that operation. Five operations are specified: GL_ACCUM, GL_LOAD,
42 GL_ADD, GL_MULT, and GL_RETURN.
43
44 All accumulation buffer operations are limited to the area of the cur‐
45 rent scissor box and applied identically to the red, green, blue, and
46 alpha components of each pixel. If a glAccum operation results in a
47 value outside the range [-1, 1], the contents of an accumulation buffer
48 pixel component are undefined.
49
50 The operations are as follows:
51
52 GL_ACCUM Obtains R, G, B, and A values from the buffer currently
53 selected for reading (see glReadBuffer). Each component
54 value is divided by 2n−1, where n is the number of bits
55 allocated to each color component in the currently
56 selected buffer. The result is a floating-point value in
57 the range [0, 1], which is multiplied by value and added
58 to the corresponding pixel component in the accumulation
59 buffer, thereby updating the accumulation buffer.
60
61 GL_LOAD Similar to GL_ACCUM, except that the current value in the
62 accumulation buffer is not used in the calculation of the
63 new value. That is, the R, G, B, and A values from the
64 currently selected buffer are divided by 2n−1, multiplied
65 by value, and then stored in the corresponding accumula‐
66 tion buffer cell, overwriting the current value.
67
68 GL_ADD Adds value to each R, G, B, and A in the accumulation
69 buffer.
70
71 GL_MULT Multiplies each R, G, B, and A in the accumulation buffer
72 by value and returns the scaled component to its corre‐
73 sponding accumulation buffer location.
74
75 GL_RETURN Transfers accumulation buffer values to the color buffer
76 or buffers currently selected for writing. Each R, G, B,
77 and A component is multiplied by value, then multiplied
78 by 2n−1, clamped to the range [0,2n−1], and stored in the
79 corresponding display buffer cell. The only fragment
80 operations that are applied to this transfer are pixel
81 ownership, scissor, dithering, and color writemasks.
82
83 To clear the accumulation buffer, call glClearAccum with R, G, B, and A
84 values to set it to, then call glClear with the accumulation buffer
85 enabled.
86
88 Only pixels within the current scissor box are updated by a glAccum
89 operation.
90
92 GL_INVALID_ENUM is generated if op is not an accepted value.
93
94 GL_INVALID_OPERATION is generated if there is no accumulation buffer.
95
96 GL_INVALID_OPERATION is generated if glAccum is executed between the
97 execution of glBegin and the corresponding execution of glEnd.
98
100 glGet with argument GL_ACCUM_RED_BITS
101 glGet with argument GL_ACCUM_GREEN_BITS
102 glGet with argument GL_ACCUM_BLUE_BITS
103 glGet with argument GL_ACCUM_ALPHA_BITS
104
106 glClear(3G), glClearAccum(3G), glCopyPixels(3G), glDrawBuffer(3G),
107 glGet(3G), glReadBuffer(3G), glReadPixels(3G), glScissor(3G),
108 glStencilOp(3G)
109
110
111
112 GLACCUM(3G)