---
title: "Global Illumination"
canonical: "https://documentation.chaos.com/space/DOCSGUIDE/113290525/Global%20Illumination"
format: markdown
---
This page discusses the concept of global illumination and how it pertains to CG rendering.

 

 

Indirect illumination refers to illumination that results from the bounced light in a scene, as opposed to illumination directly from light sources. Global illumination (GI) refers to the computation of this effect through computer graphics.

The effects of indirect illumination can be seen everywhere in life. If you look underneath a table in a well-lit room, for example, you can still make out the details of the flooring even though no light is directly shining in this area. The same is true for areas of shadow on a sunny day. This happens because direct light, as from a lamp or the sun, bounces off surfaces thousands of times to illuminate shadows, cracks, and other areas that aren't reached by direct light. Sunlight also bounces off particles in the atmosphere and clouds to illuminate the entire sky, and the bounced light, in turn, bounces down to the Earth from all parts of the sky.

 

  
> Macro (inline-media-image)

  
*If no direct light falls on the shadow area under the truck, how is the detail of the asphalt visible in the shadow area? *

 

 

Each time a bounce occurs, the light ray loses some of its energy, which is the equivalent of carrying less light along the path. Eventually the ray loses all its energy, or loses so much energy that it no longer makes a visible effect in the areas it strikes.

The computation of GI is vital to photorealism. Early computer graphics renderings did not take GI into account, and only computed the effects of light directly from light sources. The introduction of global illumination into computer graphics made it possible to produce photoreal images.

 

## **How Light Bounces**

---

In life, when light bounces off a perfectly smooth surface, it bounces off at exactly the same angle it struck the surface, on the other side of the perpendicular to the surface.

 

> Macro (inline-media-image)

  
*Light ray bouncing off flat surface*

 

 

On curved surfaces, the same principle applies. Every surface has a *normal* that represents the perpendicular to the surface at that exact point. The light ray bounces off the surface at the same angle, on the other side of the normal.

 

 

> Macro (inline-media-image)

  
*Light rays bouncing off curved surfaces*

 

 

Every time a ray bounces, some of its energy is lost. The amount of energy that the light ray retains after a bounce depends on a variety of factors, including the surface itself. A light ray that hits a smooth, shiny surface carries a larger percentage of its original energy than a light ray that hits a dull or rough surface.

 

## **How GI Works**

---

Global illumination algorithms work by tracing the path that light rays take as they bounce around and traverse the scene. Tracing light rays with an infinite number of bounces, as happens in real life, obviously isn't feasible.

A common method first traces rays from the camera to all surfaces in the scene, and computes the direct light that strikes these surfaces. These same rays can then be bounced off the surfaces to see which other surfaces they hit. For every surface the ray hits, it brings along with it the light information from the previous surface. In this way, the amount of light that indirectly strikes a surface can be computed.

 

> Macro (inline-media-image)

  
*Simplified representation of GI rays*

 

The more rays are traced and the more bounces they make, the more accurate the global illumination calculation, but also the longer it takes to calculate.

 

## **GI Variations**

Because thorough, accurate GI calculations can be heavy (taking up a lot of memory and computing power), methods have been developed to shortcut the process while retaining a high degree of accuracy.

**Caching** - When a surface is hit with a ray, the information is saved in a cache. If another ray hits the same point on the surface, the cached information is used rather than computing it all over again.

**Sampling** - When a ray hits a surface, rather than computing the effect of the light at that one point, samples of the light effect are taken within a specified radius of the hit point. This gives a less detailed solution but reduces rendering time.

**Multiple bounce rays** - When a ray hits a surface, instead of bouncing the single ray, it bounces several rays in various directions. Rays that are bounced at an angle carry lower energy (light) with them commensurate with the angle of the bounce. Using multiple bounces for each strike decreases the overall amount of time for the computation.