Terragen 4 Global Illumination
Global Illumination in Computer Graphics
Global illumination is a general name for a group of algorithms used in 3D computer graphics that are meant to add more realistic lighting to 3D scenes. Such algorithms take into account not only the light which comes directly from a light source (direct illumination), but also subsequent cases in which light rays from the same source are reflected by other surfaces in the scene, whether reflective or not (indirect illumination).
Global Illumination in Terragen
Direct illumination in Terragen is the light coming directly from the sun or other specific light sources, but not from luminous objects. Global illumination (GI) in Terragen means the light from everywhere else, including indirect illumination as well as illumination caused by bright, luminous objects that aren't specifically light sources. In a Terragen scene, the intensity of GI is controlled using a single "Enviro Light" node.
In Terragen, GI is:
- The reason shadows are not black.
- Light from the sky.
- Light bouncing off other objects.
- Light emitted from glowing, luminous objects, e.g. lava, fire, bioluminescence.
- "Multiple scattering" in clouds and atmospheres. "Multiple scattering" in volumes is often thought of as a separate phenomenon from global illumination, but in fact it can be treated as a form of global illumination if the scattering is rendered as a lighting effect upon the volume. In Terragen, multiple scattering is approximated using the global illumination cache. Clouds and atmospheres will illuminate themselves in a way that simulates multiple scattering. Being part of the global illumination system, GI in volumes completely integrates with GI from surfaces. Light bouncing off or emitted from surfaces will light up clouds and atmospheres, and light scattering through clouds and atmospheres will light up surfaces.
Rendering with GI
To render an image with Global Illumination in Terragen you need the following:
- An Enviro Light in the scene, enabled, with its mode set to "Global Illumination"
- In Render GI Settings, 'GI relative detail' set to 1 or higher.
You can turn off global illumination by disabling the Enviro Light, but Terragen might still waste time on the pre-pass. To completely turn off GI, edit the Render GI settings and set 'GI relative detail' to 0. All other GI settings can be left how they are.
Performance note: Do not create more than one Enviro Light in the scene unless you really need to. If you wish to brighten the effect of the Enviro Light, increase the 'strength' settings in a single Enviro Light. Multiple Enviro Lights can increase GI quality, but they are not the best way to do that and they increase render time unnecessarily. You can achieve a more efficient increase in quality by increasing 'GI sample quality' in Render GI Settings. This will give a higher quality in a shorter render time than would creating multiple Enviro Lights. The only good use for more than one Enviro Light is to have one Enviro Light in Global Illumination mode and another in Ambient Occlusion mode, if you want that effect.
Normally when you render an image with Global Illumination, Terragen renders the image in two passes. A pre-pass is rendered which calculates the Global Illumination for the image and stores it in a spatial data structure called a GI cache. When you see lots of tiny dots filling the image before the real rendering begins, you're seeing the pre-pass generating the GI cache. Once the pre-pass is done, rendering of the final pass begins. Global Illumination in the final image depends on the GI cache that was generated in the pre-pass.
GI cache files
A new feature in Terragen 2.4 (not in the Free Non-Commercial Edition) is the ability to read and write GI cache files. These allow you to write the results of the pre-pass to disk or file network and to read them back in when rendering an image. Using GI caches files is a two step process. First you render a pre-pass which calculates the Global Illumination for the image (or sequence of images), and writes the resulting GI cache to your disk or network in the form of a GI cache file (or sequence of GI cache files). After you have created those GI cache files, you can render final images using the GI in the cache files instead of recalculating the GI every time you render an image.
You don't need to use GI cache files to enjoy Global Illumination. However, GI caches have many uses, such as:
- Eliminating GI flicker in animations. To do this, read a single cache file or interpolate between cache files in a sequence.
- Matching the GI in separately rendered tiles that you want to combine into a larger image, panorama, skybox or skydome. This is achieved by reading a single cache file or blending multiple cache files rendered with different cameras.
- Rendering a GI pass, by disabling all lights and reading the GI from a GI cache file.
- Rendering special effects using GI that was generated with different lighting or other changes to the scene, e.g. some objects added or removed. You could write to a GI cache file using the scene that generates the GI you want, then render your final image with that GI cache file.
- More control over the level of detail in your GI pre-pass than is possible with the GI relative detail setting, which only allows whole number values. When writing to the GI cache, you can choose a different image size to render or a different value for 'detail'. Normally, 'detail' affects many things in your rendered image, but if you render the GI cache separately then you can choose a different detail for your GI. Image size and detail both have the same effect on the detail of your GI solution as 'GI relative detail' - they are all linear multipliers - but you can change the detail more precisely with image size or the detail slider than you can with GI relative detail.
A single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene.
A sample refers to a value or set of values at a point in time and/or space. The defining point of a sample is that it is a chosen value out of a continuous signal. In Terragen 2 it is usually a mathematical (procedural) function that is being sampled.