Keywords: main

Next: 1.32 Final Gathering Up: 1. Functionality Previous: 1.30 Caustics
Subsections

- 1.31.1 Light Sources
- 1.31.2 Objects
- 1.31.3 Fine-tuning Global Illumination

# 1.31 Global Illumination

Global illumination is the simulation of all light interreflection effects in a scene (except caustics). This includes effects such as color bleeding: if a red table is next to a white wall, the white wall gets a slightly pink tint. This effect is not possible with ordinary ray tracing algorithms. But if the pink tint is lacking in an image, the image looks fake, even though it might be hard to point out precisely why. Global illumination effects are subtle but add realism to a scene.

Simulation of global illumination has at least two distinct uses:

- Physically accurate simulation of the illumination in an environment. For example the light distribution inside an office building.

- Visually pleasing lighting effects for applications in the entertainment industry. Here physical accuracy is not the most important aspect, the images just have to look believable.

The computation of global illumination requires photon tracing, just like computation of caustics. In fact, the same photon material shaders can be used. Since caustics are treated separately in mental ray, the global illumination simulation does not include caustics. So if all light interreflections should be simulated, both global illumination and caustics must be enabled.

The photons stored during global illumination simulation are stored in a separate photon map, the global illumination photon map. When the material shader calls mi_compute_irradiance, the irradiance from both the caustics photon map and the global illumination photon map are computed.

To turn global illumination on, specify `globillum on` in the `options` or give command-line option `-globillum on`.

## 1.31.1 Light Sources

Each light source that should emit global illumination should have an `energy` statement (just as for caustics). Each light source can also optionally have a `globillum photons` statement to specify how many photons should be emitted, or specify emitted photons only by setting the first number to zero (similar to `caustic photons` for caustics). The default value is 100000 globillum photons. For example:

         light "globillum-light" "physical_light" (
               "color"       700.0 700.0 700.0
            )
            origin             20.0 30.0 -40.0
            energy             700 700 700
            globillum photons  100000
         end light

## 1.31.2 Objects

By default, all objects can participate in global illumination computations. This is necessary for simulation of real global illumination. However, sometimes one might just be interested in color bleeding from one object to another, and the rest of the scene does not need to participate in the global illumination simulation.

To simulate global illumination more efficiently in such cases, objects can be flagged such that the photons are only emitted towards certain objects and stored only on selected objects. Objects are then divided into globillum-casting (`globillum 1` flag) and globillum-receiving (`globillum 2` flag), or both (`globillum 3` flag), or neither (`globillum 0` flag). For example, color bleeding from a red diffuse table onto a diffuse white wall requires a globillum-casting table and a globillum-receiving wall. Objects can also be flagged `globillum off`, which means that globillum photons will not hit them at all (the objects will be ``invisible'' to globillum photons), or flagged `globillum on` which is the same as `globillum 3`. The globillum mode is an object attribute. Photons are emitted only in the direction of globillum-casting objects, and only stored on globillum-receiving objects.

To use this optimization requires that the default object globillum flag (specified in the options) is set to something different than 3 (which is the default value, enabling all objects to cast and receive global illumination).

## 1.31.3 Fine-tuning Global Illumination

To change the number of photons used to compute the local intensity of global illumination, specify a `globillum accuracy` (and optionally a maximum radius) in the `options`. For example,

         globillum accuracy 300 2.0

The default number is 500; larger numbers make the global illumination smoother but increases render time. The default radius depends on the scene extent.

Next: 1.32 Final Gathering Up: 1. Functionality Previous: 1.30 Caustics