F
glFog
Chapter 6
155
glFog
glFogf, glFogi, glFogfv, glFogiv: specify fog parameters.
C Specification
void glFogf(
GLenum pname,
GLfloat param)
void glFogi(
GLenum pname,
GLint param)
void glFogfv(
GLenum pname,
const GLfloat *params)
void glFogiv(
GLenum pname,
const GLint *params)
Parameters
pname Specifies a single-valued fog parameter. GL_FOG_MODE,
GL_FOG_DENSITY, GL_FOG_START, GL_FOG_END, and
GL_FOG_INDEX are accepted.
param Specifies the value that pname will be set to.
pname Specifies a fog parameter. GL_FOG_MODE, GL_FOG_DENSITY,
GL_FOG_START, GL_FOG_END, GL_FOG_INDEX, and
GL_FOG_COLOR are accepted.
params Specifies the value or values to be assigned to pname.
GL_FOG_COLOR requires an array of four values. All other
parameters accept an array containing only a single value.
Description
Fog is initially disabled. While enabled, fog affects rasterized geometry, bitmaps, and
pixel blocks, but not buffer clear operations. To enable and disable fog, call glEnable and
glDisable with argument GL_FOG.
glFog assigns the value or values in params to the fog parameter specified by pname.
The following values are accepted for pname:
GL_FOG_MODE
params is a single integer or floating-point value that specifies the equation to be used to
compute the fog blend factor, f. Three symbolic constants are accepted: GL_LINEAR,
GL_EXP, and GL_EXP2. The equations corresponding to these symbolic constants are
defined below. The initial fog mode is GL_EXP.
GL_FOG_DENSITY