gl.Accum(op, value)
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 gl.Get() 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 through 1 . The accumulation buffer
pixels are mapped one-to-one with frame buffer pixels.
gl.Accum()
operates on the accumulation buffer. The first argument, op
, is a symbolic constant that selects an accumulation
buffer operation. The second argument, value
, is a 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 gl.Accum()
operation results in a value outside the range -1 through 1,
the contents of an accumulation buffer pixel component are undefined.
The operations are as follows:
#GL_ACCUM
#GL_LOAD
#GL_ACCUM
, except that the current value in the accumulation buffer is not used in the calculation of the new
value. That is, the R, G, B, and A values from the currently selected buffer are divided by 2^n - 1 , multiplied by value,
and then stored in the corresponding accumulation buffer cell, overwriting the current value.
#GL_ADD
#GL_MULT
#GL_RETURN
To clear the accumulation buffer, call gl.ClearAccum() with R, G, B, and A values to set it to, then call gl.Clear() with the accumulation buffer enabled.
Only pixels within the current scissor box are updated by a gl.Accum()
operation.
Please consult an OpenGL reference manual for more information.
#GL_ACCUM
, #GL_LOAD
, #GL_ADD
, #GL_MULT
, and #GL_RETURN
are acceptedop
determines how value
is used#GL_INVALID_ENUM
is generated if op is not an accepted value.
#GL_INVALID_OPERATION
is generated if there is no accumulation buffer.
#GL_INVALID_OPERATION
is generated if gl.Accum()
is executed between the execution of gl.Begin() and the corresponding execution of gl.End().
#GL_ACCUM_RED_BITS
gl.Get() with argument #GL_ACCUM_GREEN_BITS
gl.Get() with argument #GL_ACCUM_BLUE_BITS
gl.Get() with argument #GL_ACCUM_ALPHA_BITS