Previous:The Fog Main Index Next:Setting a Minimum Translucency

#### A Constant Fog

The simplest fog type is the constant fog that has a constant density in all locations. It is specified by a `distance` keyword which actually describes the fog's density and a fog `color`.

The distance value determines the distance at which 36.8% of the background are still visible (for a more detailed explanation of how the fog is calculated read the reference section "Fog").

The fog color can be used to create anything from a pure white to a red, blood-colored fog. You can also use a black fog to simulate the effect of a limited range of vision.

The following example will show you how to add fog to a simple scene (`fog1.pov`).

      #include "colors.inc"

      camera {

        location  <0, 20, -100>

      }

      background { color SkyBlue }

      plane { y, -10

        pigment {

          checker color Yellow color Green

          scale 20

        }

      }

      sphere { <0, 25, 0>, 40

        pigment { Red }

        finish { phong 1.0 phong_size 20 }

      }

      sphere { <-100, 150, 200>,  20

        pigment { Green }

        finish { phong 1.0 phong_size 20 }

      }

      sphere { <100, 25, 100>, 30

        pigment { Blue }

        finish { phong 1.0 phong_size 20 }

      }

      light_source { <100, 120, 40> color White}

      fog {

        distance 150

        color rgb<0.3, 0.5, 0.2>

      }

A foggy scene.

According to their distance the spheres in this scene more or less vanish in the greenish fog we used, as does the checkerboard plane.

Previous:The Fog Main Index Next:Setting a Minimum Translucency