Home / comp / gb.opengl / gl / accum 
Gl.Accum (gb.opengl)
Syntax
STATIC SUB Accum ( Operation AS Integer, Value AS Float )

Operate on the accumulation buffer

Parameters

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 antialiasing (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 Gl.GetAccumRedBits, Gl.GetAccumGreenBits, Gl.GetAccumBlueBits and Gl.GetAccumAlphaBits, respectively. Regardless of the number of bits per component, however, the range of values stored by each component is [-1, 1]. The accumulation buffer pixels are mapped one-to-one with frame buffer pixels.

  Gl.Accum operates on the accumulation buffer. The first argument, Operation, is a 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.GL_ACCUM, Gl.GL_LOAD, Gl.GL_ADD, Gl.GL_MULT, and Gl.GL_RETURN.

  All accumulation buffer operations are limited to the area of the current scissor box and are applied identically to the red, green, blue, and alpha components of each pixel. The contents of an accumulation buffer pixel component are undefined if the Gl.Accum operation results in a value outside the range [-1, 1].

The accumulation buffer is cleared by specifying Red, Green, Blue, and Alpha values to set it to with the Gl.ClearAccum directive, and issuing a Gl.Clear command with the accumulation buffer enabled.

Only those pixels within the current scissor box are updated by any Gl.Accum operation.

Errors

Gl.GL_INVALID_ENUM is generated if Operation is not an accepted value.
Gl.GL_INVALID_OPERATION is generated if there is no accumulation buffer.
Gl.GL_INVALID_OPERATION is generated if Gl.Accum is called between a call to Gl.Begin and the corresponding call to Gl.End.

Associated Gets

Gl.GetAccumRedBits
Gl.GetAccumGreenBits
Gl.GetAccumBlueBits
Gl.GetAccumAlphaBits


See also
Gl.BlendFunc , Gl.Clear , Gl.ClearAccum , Gl.CopyPixels, Gl.LogicOp, Gl.PixelStore, Gl.PixelTransfer, Gl.ReadPixels, Gl.ReadBuffer, Gl.Scissor, Gl.StencilOp.