fog_start examples Features >  Fog_start      [ site map ]

These examples show the result using fog_start in constant fog (type 1) and ground fog (type 2). For constant fog, a similar effect could be in principle obtained using various method, such as a ground fog with an "up" vector lying to the z axis. While the resulting image is similar, it's not possible to setup the starting boundary of the fog, and the density function is not smooth. In the case of ground fog there is to my knowledge no other workaround than using fog_start.

 Constant fog comparison

Normal fog:

fog.pov  fog-scene.inc
 ```#version 3.1; #include "fog-scene.inc" // right-handed coordinates system // camera location is z*50 fog { fog_type 1 // Constant fog, optional distance 20 // Distance at which 36.8% of the background are still visible rgbf 1 } ```

Using fog_start:

fog_start.p4g  fog-scene.inc
 ```#version 3.1; #include "fog-scene.inc" // right-handed coordinates system // camera location is z*50 fog { fog_type 1 // Constant fog, optional fog_start 35 // Starting offset from the camera (new !) distance 20 // Distance at which 36.8% of the background are still visible // but now starting from fog_start, so here it's 35+20 rgbf 1 } ```

 Ground fog comparison

Normal ground fog:

ground_fog.pov  fog-scene.inc
 ```#version 3.1; #include "fog-scene.inc" // right-handed coordinates system // camera location is z*50 fog { fog_type 2 // Ground fog fog_offset -3 // Height below which the fog has a constant density of one fog_alt 2 // At a height of fog_offset+fog_alt the fog density is 25% distance 20 // Distance at which 36.8% of the background are still visible rgbf <.6,.6,.9> } ```

Using fog_start:

ground_fog_start.p4g  fog-scene.inc
 ```#version 3.1; #include "fog-scene.inc" // right-handed coordinates system // camera location is z*50 fog { fog_type 2 // Ground fog fog_offset -3 // Height below which the fog has a constant density of one fog_alt 2 // At a height of fog_offset+fog_alt the fog density is 25% fog_start 35 // Starting offset from the camera (new !) distance 20 // Distance at which 36.8% of the background are still visible rgbf <.6,.6,.9> } ```

Known bugs:
[2000-11-21] A. Dietrich from NOVARTIS kindly reported a bug which seems to affect only transparent objects using the official clipped_by{} modifier. For now there is unfortunately no fix available.

 Page last updated: Jun 20, 2002 Any comment or suggestion ?