next up previous contents
Next: Lighting Up: KGL API Previous: Drawing functions   Contents

Subsections

Fog

Uses the PVR2 hardware fog table. Care must be taken when changing fog values because there is only one fog table and any changes made while the PVR is rendering a scene may result in display artifacts. Most noteably if the changes made are large. When vertex fog is implemented this will not be an issue, however vertex fog will take more CPU time.

Parameter name parameter default
GL_FOG_MODE GL_EXP, GL_EXP2, GL_LINEAR GL_EXP
GL_FOG_DENSITY density >= 0.0 1.0
GL_FOG_COLOR float [4] color = {R, G, B, A} {0.5, 0.5, 0.5, 1.0}
GL_FOG_INDEX   Palletted modes not supported
GL_FOG_START 0.0 - 259.0 0.0
GL_FOG_END 0.0 - 259.0 1.0

void glFogi(GLenum pname, GLint param)

glFogi(GL_FOG_MODE, GL_EXP2);

void glFogiv(GLenum pname, const GLint *params)

void glFogf(GLenum pname, GLfloat param)

glFogf(GL_FOG_DENSITY, 0.5f);

void glFogfv(GLenum pname, const GLfloat *params)

GLfloat fogcolor[4] = {0.5, 0.5, 0.5, 1.0};

glFogfv(GL_FOG_COLOR, fogcolor);


next up previous contents
Next: Lighting Up: KGL API Previous: Drawing functions   Contents
Dan Potter 2002-07-29