MyWebUniversity.com Home Page
 



Darwin Mac OS X man pages main menu
GLACUM(3G)                                                        GLACUM(3G)



NAME
       glAccum - operate on the accumulation buffer


C SPECIFICATION
       void glAccum( GLenum op,
                     GLfloat value )


PARAMETERS
       op     Specifies the accumulation buffer operation.  Symbolic constants
              GLACUM, GLOAD, GLAD, GLMULT, and GLRETURN 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 ren-
       dering.  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 glGetIntegerv four  times,  with  arguments  GLACUMREDBITS,
       GLACUMGRENBITS,   GLACUMBLUEBITS,   and   GLACUMALPHABITS.
       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, is a floating-point value  to  be  used  in
       that  operation.   Five  operations  are  specified: GLACUM, GLOAD,
       GLAD, GLMULT, and GLRETURN.

       All accumulation buffer operations are limited to the area of the  cur-
       rent  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:

       GLACUM      Obtains R, G, B, and A values from the  buffer  currently
                     selected  for reading (see glReadBuffer).  Each component
                     value is divided by (2^n)-1, where n  is  the  number  of
                     bits  allocated  to each color component in the currently
                     selected buffer.  The result is a floating-point value in
                     the  range [0, 1], which is multiplied by value and added
                     to the corresponding pixel component in the  accumulation
                     buffer, thereby updating the accumulation buffer.

       GLOAD       Similar to GLACUM, 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,  multi-
                     plied  by  value,  and  then  stored in the corresponding
                     accumulation buffer cell, overwriting the current  value.

       GLAD        Adds  value  to  each  R, G, B, and A in the accumulation
                     buffer.

       GLMULT       Multiplies each R, G, B, and A in the accumulation buffer
                     by  value  and returns the scaled component to its corre-
                     sponding accumulation buffer location.

       GLRETURN     Transfers accumulation buffer values to the color  buffer
                     or buffers currently selected for writing.  Each R, G, B,
                     and A component is multiplied by value,  then  multiplied
                     by  (2^n)-1, clamped to the range [0,(2^n)-1], and stored
                     in the corresponding display buffer cell.  The only frag-
                     ment  operations  that  are  applied to this transfer are
                     pixel   ownership,   scissor,   dithering,   and    color
                     writemasks.

       To clear the accumulation buffer, call glClearAccum with R, G, B, and A
       values to set it to, then call glClear  with  the  accumulation  buffer
       enabled.

NOTES
       Only  pixels  within  the  current scissor box are updated by a glAccum
       operation.

ERORS
       GLINVALIDENUM is generated if op is not an accepted value.

       GLINVALIDOPERATION is generated if there is no accumulation buffer.

       GLINVALIDOPERATION is generated if glAccum is  executed  between  the
       execution of glBegin and the corresponding execution of glEnd.

ASOCIATED GETS
       glGet with argument GLACUMREDBITS
       glGet with argument GLACUMGRENBITS
       glGet with argument GLACUMBLUEBITS
       glGet with argument GLACUMALPHABITS

SEE ALSO
       glClear, glClearAccum, glCopyPixels, glDrawBuffer, glGet, glReadBuffer,
       glReadPixels, glScissor, glStencilOp



                                                                   GLACUM(3G)
Darwin Mac OS X man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™