Image bm763.GIF Fog Type
Scene
 
The fog type element enables to choose the following fog type:
 
0 linear fog
1 exponential fog
2 quadratic fog
+4 fog correction (range vertex fog will be used, otherwise depth table fog is used)
 
The linear fog is determined by the start of linear fog and the end of linear fog parameters. The fog density is linear dependent on the distance from the viewer according to the term fog = (end - distance)/(end - start). By interchanging the start and end of linear fog the fog can be inverted, the fog will be getting thin with increasing distance. This feature is suppressed in some drivers. In such case the fog is switched off.
 
The exponential fog is defined by the density of fog parameter. The exponential fog density is dependent on the distance from the viewer according to the following relationship: fog = 1 / (e ^ (distance * density)).
 
The quadratic fog is defined by the density of fog parameter. The quadratic fog density is dependent on the distance from the viewer according to the following relationship: fog = 1 / (e ^ ((distance * density)^2)).
 
The exponential fog type is set as the default setting. If the fog is in the switched off state, it is switched on by setting the fog type. The default setting of its color will take place according to the actual scene background color setting.
 
By adding 4 to a fog type the corrected fog will be used. In calculating a fog, the so called table fog is normally utilized. The table fog is applied to the entire object surface. To calculate the object distance the object depth information is used, which is the distance from the projection plane. This will cause the objects lying on the projection plane periphery to be, as a matter of fact, more distant from the viewer than objects having the same depth and lying in the projection plane center (The depth is given by the plane). If the viewer rotates, the objects located on the picture periphery will be coming out of the fog (They will get into an area having a smaller distance from the projection plane). This problem can be eliminated by the corrected fog type, called "range-based fog". This fog type does not use the depth information. Here, each object's real distance from the viewer is calculated (which is a very time consuming operation). This fog type is mostly not hardware supported, it is therefore connected with a software type fog, called "vertex fog". By the vertex fog, a certain fog is determined for the vertices of the faces being displayed. For the face surface the fog is linearly interpolated. With large surfaces the vertex fog is not displayed properly. For example, if the viewer is standing in the center of a square surface, so the surface vertices are lying in the fog. Due to the interpolation, the surface center in which the viewer is standing is also fogged in an improper manner.

Full Html Context Help of The Peter - Gemtree Software & Children Programming