Скачиваний:
47
Добавлен:
17.03.2015
Размер:
2.46 Mб
Скачать

4.2. WHOLE FRAMEBUFFER OPERATIONS

217

operations described in the last section (4.2.2) are also effective. If a buffer is not present, then a Clear directed at that buffer has no effect.

The state required for clearing is a clear value for each of the color buffer, the depth buffer, the stencil buffer, and the accumulation buffer. Initially, the RGBA color clear value is (0,0,0,0), the clear color index is 0, and the stencil buffer and accumulation buffer clear values are all 0. The depth buffer clear value is initially 1.0.

Clearing the Multisample Buffer

The color samples of the multisample buffer are cleared when one or more color buffers are cleared, as specified by the Clear mask bit COLOR BUFFER BIT and the DrawBuffer mode. If the DrawBuffer mode is NONE, the color samples of the multisample buffer cannot be cleared.

If the Clear mask bits DEPTH BUFFER BIT or STENCIL BUFFER BIT are set, then the corresponding depth or stencil samples, respectively, are cleared.

4.2.4 The Accumulation Buffer

Each portion of a pixel in the accumulation buffer consists of four values: one for each of R, G, B, and A. The accumulation buffer is controlled exclusively through the use of

void Accum( enum op, float value );

(except for clearing it). op is a symbolic constant indicating an accumulation buffer operation, and value is a floating-point value to be used in that operation. The possible operations are ACCUM, LOAD, RETURN, MULT, and ADD.

When the scissor test is enabled (section 4.1.2), then only those pixels within the current scissor box are updated by any Accum operation; otherwise, all pixels in the window are updated. The accumulation buffer operations apply identically to every affected pixel, so we describe the effect of each operation on an individual pixel. Accumulation buffer values are taken to be signed values in the range [−1, 1]. Using ACCUM obtains R, G, B, and A components from the buffer currently selected for reading (section 4.3.2). Each component, considered as a fixed-point value in [0, 1]. (see section 2.14.9), is converted to floating-point. Each result is then multiplied by value. The results of this multiplication are then added to the corresponding color component currently in the accumulation buffer, and the resulting color value replaces the current accumulation buffer color value.

Version 2.0 - October 22, 2004

Соседние файлы в папке OpenGL