A
glAccum
Chapter 1
10
glAccum
glAccum: operate on the accumulation buffer.
C Specification
void glAccum(
GLenum op,
GLfloat value)
Parameters
op Specifies the accumulation buffer operation. Symbolic constants
GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN are
accepted.
value Specifies a floating-point value used in the accumulation buffer
operation. op determines how value is used.
Description
The accumulation buffer is an extended-range color buffer. Images are not rendered into
it. Rather, images rendered into one of the color buffers are added to the contents of the
accumulation buffer after rendering. Effects such as anti-aliasing (of points, lines, and
polygons), motion blur, and depth of field can be created by accumulating images
generated with different transformation matrices.
Each pixel in the accumulation buffer consists of red, green, blue, and alpha values. The
number of bits per component in the accumulation buffer depends on the
implementation. You can examine this number by calling glGetIntegerv four times, with
arguments:
GL_ACCUM_RED_BITS,
GL_ACCUM_GREEN_BITS,
GL_ACCUM_BLUE_BITS, and
GL_ACCUM_ALPHA_BITS.
Regardless of the number of bits per component, the range of values stored by each
component is [- 1, 1]. The accumulation buffer pixels are mapped one-to-one with frame
buffer pixels.
glAccum operates on the accumulation buffer. The first argument, op, is a symbolic
constant that selects an accumulation buffer operation. The second argument, value,isa
floating-point value to be used in that operation. Five operations are specified:
GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN.
All accumulation buffer operations are limited to the area of the current scissor box and
applied identically to the red, green, blue, and alpha components of each pixel. If a
glAccum operation results in a value outside the range [- 1, 1], the contents of an
accumulation buffer pixel component are undefined.
The operations are as follows:
GL_ACCUM Obtains R, G, B, and A values from the buffer currently selected for
reading (see glReadBuffer).