acbuf(3G) acbuf(3G)
acbuf - operate on the accumulation buffer
void acbuf(op, value)
long op;
float value;
op expects one of six symbolic constants:
AC_CLEAR: The red, green, blue, and alpha accumulation buffer
contents are all set to value (rounded to the nearest integer).
value is clamped to the range of the accumulation buffer.
AC_ACCUMULATE: Pixels are taken from the current readsource bank
(front, back, or zbuffer). If this buffer has color component
resolutions of other than 8 bits, the components are rescaled to
the range [0,255]. Then the red, green, blue, and alpha
components are each scaled by value. The resulting pixels are
added to the pixels already present in the accumulation buffer.
The range of value is -256 through 256. Arguments outside this
range are clamped to it. Accumulated values are NOT clamped to
the range of the accumulation buffer. Thus overflow is avoided
only by limiting the range of accumulation operations.
AC_CLEAR_ACCUMULATE: An efficient combination command whose
effect is to first clear the accumulation buffer contents to
zero, then add as per AC_ACCUMULATE. Ranges and clamping are as
per AC_ACCUMULATE.
AC_RETURN: Pixels are taken from the accumulation buffer. Their
red, green, blue, and alpha components are each scaled by value,
then clamped to the range [0,255]. The resulting 8 bit per
component pixels are then scaled to the range of the currently
enabled drawing buffers (front, back, or zbuffer) and written to
these buffers. All special pixel operations (zbuffer,
blendfunction, logicop, stencil, texture mapping, etc.) are
ignored during this transfer. Destination values are simply
replaced. The operation is limited by the current viewport and
screenmask, however. The range of value is 0.0 through 1.0.
Arguments outside this range are clamped to it.
AC_MULT: The red, green, blue, and alpha components of each
accumulation buffer pixel are scaled by value.
AC_ADD: value is added to each red, green, blue, and alpha
component of each pixel in the accumulation buffer.
value expects a float point value. op determines how value is used.
Page 1
acbuf(3G) acbuf(3G)
The accumulation buffer is a bank of high resolution pixels, typically 12
or more bits for each of red, green, blue, and alpha, that is mapped 1-
to-1 with screen pixels. (See acsize.) Pixel images stored in the
normal framebuffer can be added to the accumulation buffer. These pixels
are scaled during the transfer by a floating-point value (of limited
range and resolution). Later, the accumulated image can be returned to
the normal frame buffer, again while being scaled.
Effects such as antialiasing (of points, lines, and polygons), motionblur,
and depth-of-field can be created by accumulating images generated
with different transformation matrixes. Predictable effects are possible
only when subpixel mode is TRUE (see subpixel).
readsource mode is shared with other pixel read operations, including
lrectread and rectcopy. rectzoom, however, has no effect on accumulation
operation.
All accumulation buffer operations are limited to the area of the current
screenmask, which itself is limited to the current viewport.
The accumulation buffer is a part of the normal framebuffer. acbuf
should be called only while draw mode is NORMALDRAW, and while the normal
framebuffer is in RGB mode.
acsize, drawmode, subpixel, scrmask
An error is reported, and no action is taken, if accumulate is called
while acsize is zero.
PPPPaaaaggggeeee 2222 [ Back ]
|