Difference between revisions of "Terragen 4 Global Illumination"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Added Render GI Settings)
m (Render GI Settings)
Line 71: Line 71:
 
** Nearest file in sequence: Beginning with the base filename (given to the right of "Read GI cache files"), this mode looks for files that belong to same sequence as the base filename. The renderer will read only one cache file, choosing the file whose frame number is nearest to the current frame number. You can choose any file in the sequence for the base filename.
 
** Nearest file in sequence: Beginning with the base filename (given to the right of "Read GI cache files"), this mode looks for files that belong to same sequence as the base filename. The renderer will read only one cache file, choosing the file whose frame number is nearest to the current frame number. You can choose any file in the sequence for the base filename.
 
** Equal blend within range: Beginning with the base filename (given to the right of "Read GI cache files"), this mode looks for files that belong to same sequence as the base filename. The renderer will try to read as many files as the "Number of files to blend" parameter below, choosing the files whose frame numbers are nearest to the current frame number. Where the GI solutions overlap in 3D space, the results are averaged together, and wherever there are gaps in one file's solution (e.g. outside the camera's view) the other files can fill in data. You can choose any file in the sequence for the base filename.
 
** Equal blend within range: Beginning with the base filename (given to the right of "Read GI cache files"), this mode looks for files that belong to same sequence as the base filename. The renderer will try to read as many files as the "Number of files to blend" parameter below, choosing the files whose frame numbers are nearest to the current frame number. Where the GI solutions overlap in 3D space, the results are averaged together, and wherever there are gaps in one file's solution (e.g. outside the camera's view) the other files can fill in data. You can choose any file in the sequence for the base filename.
** Interpolate (for animation): This is simillar to "Equal blend within range" except that the files are weighted differently depending on the current frame number, to produce steady blends during animations. This mode becomes useful if your caches are 'sparse' in time. 'Sparse caches' are sequences of GI cache files where not every frame has a cache file. For example you might have a GI cache file on frames 10, 20, 30, and so on. If you do this, and you set the blend mode to "Interpolate (for animation)", a smooth blend will occur between the different sets of GI caches that are selected over the course of an animation. The more frames between cache files, the slower the blend will be. "Number of files to blend" should be set to 2 or more to allow the blending to work.
+
** Interpolate (for animation): This is simillar to "Equal blend within range" except that the files are weighted differently depending on the current frame number, to produce steady blends during animations. This mode becomes useful if your caches are 'sparse' in time. 'Sparse caches' are sequences of GI cache files where not every frame has a cache file. For example you might have a GI cache file on frames 10, 20, 30, and so on. If you do this, and you set the blend mode to "Interpolate (for animation)", a smooth blend will occur between the different sets of GI caches that are selected over the course of an animation. The more frames between cache files, the more gradual the blend will be. "Number of files to blend" should be set to 2 or more to allow the blending to work.
  
 
* '''Number of files to blend:''' TBC
 
* '''Number of files to blend:''' TBC

Revision as of 02:13, 15 April 2012

Work in progress.jpg

Global Illumination in Computer Graphics[edit]

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[edit]

Direct illumination in Terragen is the lighting coming directly from the sun or other specific light sources, but not from luminous objects. Global illumination (GI) in Terragen means the lighting 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.
  • Lighting from the sky.
  • Lighting caused by light bouncing off other objects.
  • Lighting caused by 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[edit]

To render an image with Global Illumination in Terragen you need the following:

  1. An Enviro Light in the scene, enabled, with its mode set to "Global Illumination"
  2. 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 enable 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 enabling multiple Enviro Lights. The only good use for more than one enabled Enviro Light is to have one Enviro Light in Global Illumination mode and another in Ambient Occlusion mode, if you want that effect. Of course you can have as many disabled Enviro Lights in your project as you like.

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[edit]

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 (indirect illumination 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.


Render GI Settings[edit]

Prepass:

  • GI relative detail: TBC
  • GI sample quality: TBC
  • GI blur radius: TBC
  • Supersample prepass: TBC


GI Cache File:

  • No GI cache file: Renders the image normally. A prepass generates the GI and an image pass renders the final image.
  • Write to GI cache file: Renders only the prepass to generate the GI cache, then saves the GI cache to a file.
  • Read GI cache file(s): Renders only the final image. GI is read from a previously generated GI cache file or GI cache files.
  • Blend mode: Applies only when "Read GI cache file(s)" is selected. Blend mode can be set to one of the options below. "One file (exact filename)" reads a single cache file, but the other 3 modes work with sequences of files. If the base filename contains a number and other files in the same folder have similar names which differ only by this number, then they will be assumed to be part of the same sequence and the number will be interpreted as a frame number. The current frame number and the blend mode determine which file(s) in the sequence will be read.
    • One file (exact filename): Reads only one cache file, with the filename given to the right of "Read GI cache file(s)". This can be an exact filename, or if the filename contains '%04d' (without quotes) then that string will be replaced by a 4 digit frame number representing the current frame. Different numbers of digits are supported by replacing the '4' with a different number. If the file is not found then the renderer will report an error; sequences are not detected in this mode.
    • Nearest file in sequence: Beginning with the base filename (given to the right of "Read GI cache files"), this mode looks for files that belong to same sequence as the base filename. The renderer will read only one cache file, choosing the file whose frame number is nearest to the current frame number. You can choose any file in the sequence for the base filename.
    • Equal blend within range: Beginning with the base filename (given to the right of "Read GI cache files"), this mode looks for files that belong to same sequence as the base filename. The renderer will try to read as many files as the "Number of files to blend" parameter below, choosing the files whose frame numbers are nearest to the current frame number. Where the GI solutions overlap in 3D space, the results are averaged together, and wherever there are gaps in one file's solution (e.g. outside the camera's view) the other files can fill in data. You can choose any file in the sequence for the base filename.
    • Interpolate (for animation): This is simillar to "Equal blend within range" except that the files are weighted differently depending on the current frame number, to produce steady blends during animations. This mode becomes useful if your caches are 'sparse' in time. 'Sparse caches' are sequences of GI cache files where not every frame has a cache file. For example you might have a GI cache file on frames 10, 20, 30, and so on. If you do this, and you set the blend mode to "Interpolate (for animation)", a smooth blend will occur between the different sets of GI caches that are selected over the course of an animation. The more frames between cache files, the more gradual the blend will be. "Number of files to blend" should be set to 2 or more to allow the blending to work.
  • Number of files to blend: TBC

Advanced:

  • GI prepass padding: TBC

Image Pass:

GI surface details: TBC

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.

A parameter is an individual setting in a node parameter view which controls some aspect of the node.