Fog

Vertex Fog This node blends the color of objects with a chosen fog color based on the depth of objects in a scene. This is done per vertex.
Pixel Fog This node blends the color of objects with a chosen fog color based on the depth of objects in a scene. This is done per pixel.

Adding fog to a 3D scene can enhance realism, provide ambiance or set a mood, and obscure artifacts sometimes caused when distant geometry comes into view. Essentially, fog is implemented by blending the color of objects in a scene with a chosen fog color based on the depth of an object in a scene or its distance from the viewpoint.

Vertex Fog

Vertex Fog is calculated on a per-vertex basis by the rendering pipeline during transformation and lighting calculations, whereas Pixel Fog is calculated in the device driver.
The fog effect is controlled by the following input properties:
The property Start determines the distance at which the fog effect begins.
The property End determines the distance at which the fog effect no longer increases.
Which color is used for fog blending is defined by the property Color.
The property Mode defines the formula used to calculate the fog effect. Mode can have the following values:

None No fog is added to the scene.
Linear Fog effect is linearly interpolated between the Start and End values.
Exponential Fog effect increases exponentially between Start and End.
ExponentialSquared Fog effect increases exponentially as well, but the argument of the exponential function is squared. This results in higher increase of the fog effect.

The property Density only affects the fog if Mode is set to one of the Exponential modes. In this case, an increase of Density results in full fog intensity being reached sooner.

By default, the fog density is calculated based on the Z-value in the depth buffer. This is very efficient as the Z-value is calculated for depth testing anyway and can be reused. However, vertices with the same Z-distance but different Euclidean distance will produce the same fog density. By activating the RangeFog property, the Euclidean distance between a vertex and the camera is used. This improves fog quality but comes with a small performance penalty.

Pixel Fog

Pixel Fog gets its name from the fact that it is calculated on a per-pixel basis in the device driver. This is different from Vertex Fog, which is computed by the rendering pipeline during transformation and lighting calculations.
The fog effect is controlled by the following input properties:
The property Start determines the distance at which the fog effect begins.
The property End determines the distance at which the fog effect no longer increases.
Which color is used for fog blending is defined by the property Color.
The property Mode defines the formula used to calculate the fog effect. Mode can have the following values:

None No fog is added to the scene.
Linear Fog effect is linearly interpolated between the Start and End values.
Exponential Fog effect increases exponentially between Start and End.
ExponentialSquared Fog effect increases exponentially as well, but the argument of the exponential function is squared. This results in higher increase of the fog effect.

The property Density only affects the fog if Mode is set to one of the Exponential modes. In this case, an increase of Density results in a faster reach of the full fog effect.