497 500














Open GL Super Bible:Buffers: Not Just for Animation















To access the contents, click the chapter and section titles.


Open GL Super Bible


(Publisher: Macmillan Computer Publishing)

Author(s): Waite group Press

ISBN: 1571690735

Publication Date: 08/01/96

 




Previous
Table of Contents
Next




Using the Accumulation Buffer for Anti-Aliasing
Another application of the accumulation buffer is full-scene anti-aliasing. The basic strategy is to jitter the image one-half a pixel in several directions, to blur the edges of an image but not the solid areas. Accumulating as little as four of these “jittered" scenes will produce remarkably smoother images. The Microsoft Visual C++ compiler includes many OpenGL examples that use jitter for anti-aliasing. See the file OPENGL\BOOK\JITTER.H from the Visual C++ CD-ROM for many different sets of jitter values.
Anti-aliasing with the accumulation buffer does carry a price in speed, however. If you want to do any real-time anti-aliased animation, youłll have to look at graphics hardware that supports multisampling to do your anti-aliasing for you. The accumulation buffer is just too slow for interactive work.
If you are generating stills or stop-motion animations, the accumulation buffer will give you anti-aliasing and simulated depth-of-field that simply are not possible with multisampling.
Reference Section
glAccum

Purpose
Operates on the accumulation buffer to establish pixel values.
Include File
<GL/gl.h>
Syntax
void glAccum(GLenum func, GLfloat value);
Description
This function operates on the accumulation buffer. Except for GL_RETURN, color values are scaled by the value parameter and added or stored into the accumulation buffer. For GL_RETURN, the accumulation bufferłs color values are scaled by the value parameter and
stored in the current color buffer.


Parameters

func

GLenum: The accumulation function to apply.
Valid functions are as follows:





GL_ACCUM
Add scaled color-buffer values to the accumulation buffer.

GL_LOAD
Load scaled color-buffer values into the accumulation buffer, replacing whatever was there before.

GL_ADD
Add a constant color to the accumulation buffer values.

GL_MULT
Multiply color values in the accumulation buffer by a constant color (filtering effects).

GL_RETURN
Copy the accumulation buffer into the main
color buffer.



Returns
None.
Example
See the CH15\MOTION.C example on the source code CD-ROM.
See Also
ChoosePixelFormat, SetPixelFormat


glClearColor

Purpose
Specifies a color value for the color buffer.
Include File
<GL/gl.h>
Syntax
void glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
Description
This function sets the color value that will be
used when clearing the color buffer with glClear(GL_COLOR_BUFFER_BIT).


Parameters

red

GLfloat: The red color value for the color buffer.
green

GLfloat: The green color value for the color buffer.
blue

GLfloat: The blue color value for the color buffer.
alpha

GLfloat: The alpha color value for the color buffer.
Returns
None.
See Also
ChoosePixelFormat, SetPixelFormat


glClearDepth

Purpose
Specifies a depth value for the depth buffer.
Include File
<GL/gl.h>
Syntax
void glClearDepth(GLclampd depth);
Description
This function sets the depth value that will be
used when clearing the depth buffer with glClear(GL_DEPTH_BUFFER_BIT).


Parameters

depth

GLclampd: The clear value for the depth buffer.
Returns
None.
See Also
ChoosePixelFormat, SetPixelFormat


glClearIndex

Purpose
Specifies a color index value for the color buffer.
Include File
<GL/gl.h>
Syntax
void glClearIndex(GLfloat index);
Description
This function sets the color index value that
will be used when clearing the color buffer with
glClear(GL_COLOR_BUFFER_BIT).


Parameters

index

GLfloat: The color index value for the color buffer.
Returns
None.
See Also
ChoosePixelFormat, SetPixelFormat






Previous
Table of Contents
Next














 


Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.












Wyszukiwarka

Podobne podstrony:
Kultowa 500 EskaRock 2012
US NSA Pays Israel $500,000 in 2004
Ethofol 500 SC
OSCAR 500 SC
Dakota 500 SC
GOLDEN FENIKAN 500 SC
Terex RCI 500 Troubleshooting Manual
ZALACZNIK 4 RODZINA 500
słowniczek 500
SL2008 497
remote master 500 bw5080e

więcej podobnych podstron