Modifying the color of a pixel/fragment based on how far or near it is in the view

glFog

Search for: glFog