Previous:Finishes Main Index Next:Using Surface Highlights

#### Using Ambient

Since objects in POV-Ray are illuminated by light sources, the portions of those objects that are in shadow would be completely black were it not for the first two finish properties, `ambient` and `diffuse`. Ambient is used to simulate the light that is scattered around the scene that does not come directly from a light source. Diffuse determines how much of the light that is seen comes directly from a light source. These two keywords work together to control the simulation of ambient light. Let's use our gray sphere to demonstrate this. Let's also change our plane back to its original green and white checkered pattern.

      plane {y,-1.5

        pigment {checker Green, White}

      }

      sphere { <0,0,0>, 1

        pigment {Gray75}

        finish {

          ambient .2

          diffuse .6

      }

In the above example, the default values for ambient and diffuse are used. We render this to see what the effect is and then make the following change to the finish.

      ambient 0

      diffuse 0

The sphere is black because we have specified that none of the light coming from any light source will be reflected by the sphere. Let's change `diffuse` back to the default of 0.6.

Now we see the gray surface color where the light from the light source falls directly on the sphere but the shaded side is still absolutely black. Now let's change `diffuse` to 0.3 and `ambient` to 0.3.

The sphere now looks almost flat. This is because we have specified a fairly high degree of ambient light and only a low amount of the light coming from the light source is diffusely reflected towards the camera. The default values of `ambient` and `diffuse` are pretty good averages and a good starting point. In most cases, an ambient value of 0.1 ... 0.2 is sufficient and a diffuse value of 0.5 ... 0.7 will usually do the job. There are a couple of exceptions. If we have a completely transparent surface with high refractive and/or reflective values, low values of both ambient and diffuse may be best. Here is an example:

    sphere { <0,0,0>, 1

       pigment { White filter 1 }

       finish {

          ambient 0

          diffuse 0

          reflection .25

          specular 1

          roughness .001

       }

       interior{ior 1.33}

    }

This is glass, obviously. Glass is a material that takes nearly all of its appearance from its surroundings. Very little of the surface is seen because it transmits or reflects practically all of the light that shines on it. See `glass.inc` for some other examples.

If we ever need an object to be completely illuminated independently of the lighting situation in a given scene we can do this artificially by specifying an `ambient` value of 1 and a `diffuse` value of 0. This will eliminate all shading and simply give the object its fullest and brightest color value at all points. This is good for simulating objects that emit light like light bulbs and for skies in scenes where the sky may not be adequately lit by any other means.

Let's try this with our sphere now.

      sphere { <0,0,0>, 1

         pigment { White }

         finish {

            ambient 1

            diffuse 0

         }

      }

Rendering this we get a blinding white sphere with no visible highlights or shaded parts. It would make a pretty good streetlight.

Previous:Finishes Main Index Next:Using Surface Highlights