OpenGL fog mixes the color of a fragment with the color of the fog. The degree of mixing is a function of the distance from the camera to the fragment.
finalColor = (1-f) * polyColor + f * fogColor
Example:
glEnable(GL_FOG)
glFogi(GL_FOG_MODE, GL_LINEAR)
glFogfv(GL_FOG_COLOR, [1, 1, 1, 1])
glFogf(GL_FOG_START, 5.0)
glFogf(GL_FOG_END, 40.0)