### 2.6.2 Photons, Dispersion and Improved Radiosity

Photons

The basic goal of the photon map is to render true reflective and refractive caustics. The photon map was first introduced by Henrik Wann Jensen (see Suggested Reading).

Photon mapping is a technique which uses a backwards ray-tracing pre-processing step to render refractive and reflective caustics realistically. This means that mirrors can reflect light rays and lenses can focus light. Photons can also interact with media, to show the path the light travels.

A code example:

     global_settings {
       photons {
         count 20000
         autostop 0
         jitter .4
       }
     }

     light_source {
       MyLight
       photons {
         refraction on
         reflection on
       }
     }

     object {
       MyObject
       photons {
         target
         refraction on
         reflection on
         collect off
       }
     }

Dispersion

Since the refractive index of a material changes as a function of the lights wavelength, light passing through a material will be separated according to wavelength. This is known as chromatic dispersion. It creates a prismatic color effect inside the object.

As POV-Ray does not use wavelengths for rendering, the effect is simulated. Dispersion can also be used in combination with photons (to recreate that famous record sleeve)

Improved Radiosity

Many things have changed in radiosity, compared to POV-Ray 3.1. A short overview:

- The brightness of radiosity in POV-Ray 3.5 is based on: The amount of light "gathered" and the `diffuse` property of the surface finish.
- Use `nearest_count` to specify the minimum number of old values blended together. The total number blended will vary depending on `error_bound`.
- Distance_maximum is automatically computed
- Radiosity works with any sized rooms, also "outdoors".
- Radiosity `recursion_limit` is not limited to 2. You can specify any `recursion_limit` up to 20.
- You can specify an `adc_bailout` for radiosity rays.
- Radiosity estimation can be affected by surface normal, add `normal on` to the `radiosity` block within `global_settings`.
- Radiosity estimation can be affected by media, add `media on` to the `radiosity` block within `global_settings`.
- You can save the radiosity data using `save_file` "file_name" and load the same data later using `load_file` "file_name".
- Instead of using the INI options "Preview_Start_Size" and "Preview_End_Size" to control the radiosity pre-trace gathering step, use the keywords `pretrace_start` and `pretrace_end` within the `radiosity` block inside `global_settings`.
- Radiosity is enabled only when the `radiosity` block exists in POV file.
- Added `max_sample`. It takes a float parameter which specifies the brightest that any gathered sample is allowed to be.

Radiosity is still an experimental feature. We cannot guarantee that scenes using these features in this version will render identically in future releases or that full backwards compatibility of language syntax can be maintained.