•Depth Cueing: Draw objects farther from the viewer darker
•Fog: Draw objects farther from the viewer whiter
•Let the color to be added with depth be Cf , the color of the pixel be Cs and the factor
for blending be f, then:
• Cs = f Cs + (1 - f) Cf
•Depth cueing: f varies linearly with depth, eg: f = 1 - 0.5z
•Fog: f varies exponentially with depth, eg: f = e -0.5z2
• glEnable (GL_FOG);
•
glFogf (GL_FOG_MODE, GL_EXP);
•
glFogf (GL_FOG_DENSITY, 0.5);
•
glFogfv
(GL_FOG_COLOR, fcolor); // Glfloat fcolor[4] =
{…};