Previous:Creating a Filtering Fog Main Index Next:Using Ground Fog

#### Adding Some Turbulence to the Fog

In order to make our somewhat boring fog a little bit more interesting we can add some turbulence, making it look like it had a non-constant density (`fog4.pov`).

      fog {

        distance 150

        color rgbf<0.3, 0.5, 0.2, 1.0>

        turbulence 0.2

        turb_depth 0.3

      }

Adding some turbulence makes the fog more interesting.

The `turbulence` keyword is used to specify the amount of turbulence used while the `turb_depth` value is used to move the point at which the turbulence value is calculated along the viewing ray. Values near zero move the point to the viewer while values near one move it to the intersection point (the default value is 0.5). This parameter can be used to avoid noise that may appear in the fog due to the turbulence (this normally happens at very far away intersection points, especially if no intersection occurs, i. e. the background is hit). If this happens just lower the `turb_depth` value until the noise vanishes.

You should keep in mind that the actual density of the fog does not change. Only the distance-based attenuation value of the fog is modified by the turbulence value at a point along the viewing ray.

Previous:Creating a Filtering Fog Main Index Next:Using Ground Fog