Global Illumination

Global illumination (GI) is a key asset in rendering photo-realistic images. It simulates how light interacts with the data in a natural way. HOOPS Luminate features a full GI support and this section will cover it in details.

GI includes direct lighting (light coming in straight line from known luminaries) as well as indirect lighting (light coming after at least one bounce on a diffuse surface). In HOOPS Luminate, GI refers to the indirect lighting component, the direct lighting component being always computed, even if GI is turned off.

../../../../_images/bk_re_sw3d_gi.jpg

See the differences between a scene without GI (on the left) and the same scene rendered with GI (on the right).

Enabling and Setting GI Up

As usual in HOOPS Luminate, enabling GI is only a matter of setting engine options:

Enabling GI

To enable the usage of GI for a given RED window:

// win is a pointer to a RED window.
bool gi_enabled = true;

RED::IOptions* iopt = win->As< RED::IOptions >();
RC_TEST( iopt->SetOptionValue( RED::OPTIONS_RAY_GI, gi_enabled, iresmgr->GetState() ) );

There are some other options in HOOPS Luminate to control how the GI is processed, but default values have been tuned to give a good result in a reasonable amount of time for common scenes.

Method Description

In HOOPS Luminate, GI is a two-step process. The first step computes a so-called GI estimator. It stores an approximation of the complete lighting in sparse positions in the scene. It’s therefore a 3D structure. The number of entries in that structure (called GI samples) is quite high, but each entry only describes a very rough approximation of the light reaching it.

The GI estimator is computed by tracing rays from the camera into the scene and accumulating lighting information at ray intersections with the geometries. The visible result is a kind of path-traced image.

../../../../_images/bk_re_sw3d_gi_estimator.jpg

User feedback of RED computing the GI estimator.

During the second step, the engine computes a far better approximation to the GI, but in very few key positions in the scene. It uses information stored in the estimator to do so and produces another 3d structure to store the results: this is the GI cache.

The GI cache is computed across several passes. The first pass subdivides the screen into a number of sampling positions which depends on the GI Error as seen in Engine GI Options. For each sampling position, a full GI calculation is performed by re-using the GI estimator computed previously. This is achieved by firing rays around the sampling position and, for each ray, using the GI estimator to approximate the light transported by that ray. Then, in each following pass, new sampling positions are added to refine the GI cache. The location of the new sampling positions is determined automatically from the GI samples of the previous passes by estimating the quality of the cache information.

../../../../_images/bk_re_sw3d_gi_cache.jpg

User feedback of RED computing the GI cache. Small grey points are selected sampling positions white blocks in the background show the content of the GI estimator previously computed.

Finally, during the rendering step, information is collected from the GI cache and interpolated to reconstruct an estimate of the GI at the point being shaded. The interpolation introduced here helps in getting smooth, good-looking results from only a quite small amount of data. The drawback of interpolation methods is that they can miss details or over-smooth the lighting and cause light leaks.