Contents / Previous / Next


Fog

"Fog" describes how to create the illusion of depth by computing the color values of an object based on distance from the viewpoint. Thus, objects that are far away appear to fade into the background.

Using fog is easy:

 
  glEnable( GL_FOG ) 

  glHint( GL_FOG_HINT, GLenum hint);
you can supply a value for GL_FOG_HINT with glHint(): hint specifies whether fog calculations are done per pixel (GL_NICEST) or per vertex (GL_FASTEST).