Render Properties - Global Illumination

 Click here to expand Table of Contents...


Clicking on the sections with Alt closes sections other than that clicked on and holding Ctrl opens and closes all sections

(Default keyboard shortcut: Alt-P)

Introduction

Without Global Illumination, lighting in LightWave is relatively simple, based on a scene's lights. Their range of intensities and a mapping of the resulting surface brightness translate into image pixel values. Global Illumination (GI) simulates light that bounces between surfaces in your scene. In real life when light hits a surface, some of it bounces away from the surface and can illuminate other surfaces around it. For a diffuse surface this bounced light is spread evenly in all directions. For a reflective surface, the light bounces with different intensity in different directions creating bright rings of light, known as caustics, on the surfaces it illuminates.

Sponza cathedral courtesy Craig Monins

GI is a physical simulation of real world lighting. Scenes rendered with GI enabled have far more realistic shading. Corners appear darker. Interiors of rooms emerge from the shadows. Colored objects can cast colored light on other surfaces around them. However, GI can be slow if done a purely brute force fashion. The interpolated mode trades a small amount of realism for a lot of render speed. It can create noise free global illumination with reasonable render times. When combined with the high dynamic range calculations, renderings can become astoundingly realistic.

How Global Illumination Is Calculated

LightWave approximates Global Illumination using “projection hemispheres.” These basically “sit” on surfaces, each projecting out multiple Global Illumination rays at various angles using the theoretical normals of each polygon in the hemisphere. This is called an “irradiance evaluation.”

An Illustration of a Projection Hemisphere

If a Global Illumination ray strikes a surface that scatters light, some amount of that light illuminates the surface where the ray originated - colors are determined in the usual (non-Global Illumination) way, which can include the effects of luminosity, mirror reflections, caustics, and so on. The light-scattering surfaces are essentially extra little light sources that affect the diffuse shading of the current surface. Evaluated and non-evaluated areas are blended to compute the final effect.

If you activate the Unseen by Rays option on the Rendering Tab of the Object Properties Panel, that object’s luminous surface is not considered a source of light for Global Illumination purposes.

Performing a full irradiance evaluation (tracing hundreds of rays) every time a point must be shaded is too time-consuming. Fortunately, unlike direct lighting, with its concentrated sources that can cause sudden changes across a surface (e.g., shadow boundaries), the indirect lighting that Global Illumination is meant to handle tends to change gradually over a surface. LightWave can use the results of each previous evaluation and smoothly interpolate between them. Only when no previous evaluations are close enough to the point being shaded, is it necessary to fire a new set of rays.

What is close enough? Each time LightWave performs a full evaluation, it estimates the size of the area that can produce valid results. This depends on factors like how far the rays traveled. This depends on the distance from the camera and the field of view per pixel. If all rays went a great distance before hitting anything, then the indirect light must be fairly constant and the calculated irradiance should be good for a large area. But if several rays hit nearby objects, then the indirect light might be varying more rapidly across the surface and the irradiance evaluations should be more closely spaced.

Once you have checked Enable GI, you have the choice of Brute Force Monte Carlo or Interpolated. When other Global Illumination options are available they will be added to the dropdown. Interpolated allows you to control how your Global Illumination is calculated by setting how many Primary Rays are sent out, how many Secondary Rays (if you are using multiple bounces), what Angular Tolerance (AT) is used and a Minimum and Maximum Pixel Spacing.

New Panel Hierarchies

New panels (like the Surface Editor, Render Properties, Scene Editor, Scene/Dope Editor and others) have collapsible hierarchies. Holding down the Ctrl key when clicking the expander arrow will open or close all children, holding down Shift will affect all siblings and holding down the Alt key when clicking a closed hierarchy will open that group and shut others. Holding Alt when there are several hierarchies open will maintain the one clicked on and close the others. All of the modifiers can be combined, they are not mutually exclusive.


Global Illumination

Enable GI - On by default, there is only one choice of type currently: Monte Carlo

There are groups of settings for Monte Carlo Global Illumination.

Brute Force

  • Intensity - A multiplier applied to overall GI brightness. Useful especially for interior scenes. GI is a type of  illumination and like other lights, its intensity can be modified. However only an intensity of 100 % is close to physically accurate.
  • Rays - It is the number of brute force rays to use per pixel sample when not using interpolated or in regions of interpolated GI when interpolated samples could not be generated.
  • Caustics - Generally, a caustic occurs in the real world when light reflects off a curved surface or refracts through a transparent surface so that it is focused on a small area. Light through a wine glass is a good example. With a more complex surface, the caustic can create a random pattern like those seen on the floor and sides of a swimming pool. Switching Caustics on here will generate accurate caustics rather than the approximations seen in previous versions.

    From left: Caustics in a brute force render; Caustics in an interpolated render with Minimum Spacing at 2, Maximum Spacing at 64; more evident Caustics with Min at 1 and Max at 5.

  • Sample Backdrop - Whether or not to sample the backdrop at all.

    If you have backdrop sampling for both the environment light and Global Illumination, the backdrop will be sampled twice (once by each system) and the brightness will be doubled. Remember to disable MIS in radiosity and set surfaces to raytraced only

  • ISBG Sampling - Enables the importance sampled background (ISBG) samples below. This reduces noise when using an HDR backdrop image to illuminate the scene and also makes the illumination far more accurate. Specifically, it will examine very bright hot-spots to help generate more accurate lighting/shading from those hot-spots.
  • ISBG Samples - Sets the number of importance samples for the image.

    ISBG can slow down interactivity in some situations. If you try to change the backdrop image with VPR active it must be recalculated every time you change it, so if you are going to change images, switch back to OpenGL to do it.

  • Affected by Volumetrics - Allows volumetrics to be included in the global illumination calculation. This can slow rendering but is more accurate if there are volumetrics in the scene.

Interpolated

When you engage the Interpolated button, new settings become available.

  • Primary Rays (PR) - the number of evenly-distributed Global Illumination rays sent out for evaluation. As you might expect, the higher the density, the more accurate, but the longer rendering will take.
  • Secondary Rays (SR) - This is the number of rays cast per primary ray when Diffuse Bounces is set to more than 1. Exterior scenes don’t always even need secondary bounces, but where used keep this value low, single digits will often suffice. Interiors will want more but probably still less than 100.

    In 2015 and earlier versions of LightWave, the Indirect Bounces setting on the Global Illumination tab controlled how many bounces were rendered. That setting is now on the Render tab and named Diffuse Bounces. It performs the same function.

  • Minimum Pixel Spacing (MinPS) -  Controls how tightly GI samples are packed near corners and measured in pixels. You typically should not need a value of less than 1. Larger values reduce the number of GI samples near corners which makes the GI less accurate but also can decrease render times.
  • Maximum Pixel Spacing (MaxPS) - Controls the maximum distance in pixels between interpolated Global Illumination samples. Larger values (100 is typical) reduce noise in large flat areas. Lower values make shadows more accurate but need more primary/secondary samples to reduce noise.
  • Angular Tolerance (AT) - is set in degrees and controls the density of samples on curved surfaces such as a sphere or a cylinder. It is the maximum variation allowed in the sample direction in order to blend. Smaller tolerances will cause more samples to be used on curved surfaces.
  • Interpolation Softness - Makes interpolated samples "softer" in order to give more control over the appearance of the rendered result.

    In these deliberately low-quality examples, Interpolation Softness is set at 0 %, 50 % and 100 %. The blotchiness is progressively softened

    With more Primary Rays and the same percentages, you can see that the contact shadow reduces as the Interpolation Softness increases
  • Use Bumps - Will use bump maps to generate ray samples. This can create vastly longer render times so only use it if absolutely necessary
  • Behind Test - checks the ray samples determining whether or not the rays should be blended. Important for things like pieces of paper on a desk, but this feature will rapidly slow down scenes that have a lot of thin overlapping geometry, such as plant leaves.

Ray Recursion is the upper limit on the number of Diffuse Bounces you are allowed. For example, if you have a Ray Recursion Limit set to 1 and Diffuse Bounces set to 8, only one Global Illumination bounce will be calculated. However, if you have Ray Recursion Limit set to 8 and Diffuse Bounces set to 4, you will still get four bounces of Global Illumination.

Minimum Pixel Spacing (1) and Maximum Pixel Spacing (100) shown with the size of the cells changing

Interpolated Cache

Caching saves Global Illumination data for subsequent render passes and frames, which can significantly reduce rendering time. The results can be inaccurate if objects or lights are animated, but this option works particularly well with scenes like a walk-through in which only the camera moves.

The Global Illumination cache gets loaded before baking begins if it exists. This will allow you to continue baking an existing Global Illumination cache. You could, for example, extend an animation by setting your start and stop frames beyond those you have already baked and clicking Bake Global Illumination Scene. You could add just a single frame to the cache by selecting a frame and clicking Bake Global Illumination Frame. The down side to this change is that if you want LightWave to bake the Global Illumination from scratch, you must first click the Clear Global Illumination Cache button before baking.

If your chosen Global Illumination mode set has Interpolated checked, the Cache Global Illumination option is available.

  • Enable Caching - Turns on the ability to cache Global Illumination.
  • PreProcess - This dropdown menu has four choices:
    • Automatic - The default. LightWave checks the disk cache to see if frames are contained and if their settings need refreshing. If a frame is not contained in the cache and should be, this mode will add it.
    • Always - Use this mode to force LightWave to add a frame to the cache, useful if you have multiple cameras or want to add a particularly troublesome frame.
    • Never - This will never preprocess your render. If however, samples are needed that are not in the cache already because of moved geometry or the camera taking a different path, Never will still save new samples.
    • Locked - Like Never only new samples will not be added to the cache. This is the mode used by LWSN when rendering on a network.
  • Animation - Animated GI is designed to reduce temporal aliasing (flicker) in animations. If you set the Frame Step to more than 1 when Animation is enabled it will base the cache on changes between the animation step frames during pre-processing. During rendering it will interpolate each in-between frame using the neighboring step frames. With a frame step of 5, frame 3 would be 50% of frame 1 and 50% of frame 5 for example.
  • Frame Step - The value used when baking a scene to determine how frequently the frames should be baked. If your scene has slow moves it’s quite likely that the frame step number can be set quite high.
  • Cache File - Saves the cache to disk in the specified directory.
  • Save After Every Frame - Particularly of use for people without a good, permanent connection to where caches are saved. This option will add to the cache file at more regular intervals.
  • Reset Cache File Path - Set the cached directory back to the default, if the user changed it to something else.
  • Clear Cache - Deletes all files in cache directory.
  • Bake Frame - Bakes a single frame.
  • Bake Scene - Bakes a scene file.

If you set the Frame Step to 1, a new experimental system of caching will engage. It works by including more samples in areas where samples are widely separated. Try reducing Maximum Pixel Spacing and increasing Primary and Secondary Rays until flicker is no longer noticeable in tests. Use a large Angular Tolerance so that the Maximum Pixel Spacing is used for curved surfaces. There is no need to bake or even turn on Enable Caching for this to work, just Animation and a Frame Step of 1.

The goal of the new trick is to make the GI naturally less variable by including more samples in the solution. If you still get flicker try increasing the interpolated GI samples.

If a Global Illumination ray strikes a surface that scatters light, some amount of that light illuminates the surface where the ray originated - colors are determined in the usual (non-Global Illumination) way, which can include the effects of luminosity, mirror reflections, caustics, and so on. The light-scattering surfaces are essentially extra little light sources that affect the diffuse shading of the current surface. Evaluated and non-evaluated areas are blended to compute the final effect.

If you activate the Unseen by Rays option on the Rendering Tab of the Object Properties Panel, that object’s luminous surface is not considered a source of light for Global Illumination purposes.

Debug Display Options

When troubleshooting an interpolated radiosity scene it is often useful to find out exactly where samples are being taken from.

 Click here to expand Debug Display Options...

When troubleshooting an interpolated radiosity scene it is often useful to find out exactly where samples are being taken from.

Best to look at the following pictures full scale by clicking on them


  • Show Samples - Green dots mark the center of each sample taken.
  • Show Cells - Shows Sample Cells
  • Show Color Cells - As above but randomly colored
  • Show Octree - Octree shows the nodes in the sample octree. They appear as colored boxes that intersect the surfaces in the scene. The more samples there are, the smaller the nodes in the octree.
  • Show Second Bounce - Shows cells for the second, and further, bounces.
  • Show Behind Test - Shows the Behind Test operation with a red overlay demonstrating where the Behind test was needed.
  • Show Missing Preprocess - Shows cyan dots representing cells not sampled during preprocessing.
  • Show Missing Render - Shows purple dots representing samples not taken during rendering.

Lighting Considerations

Global Illumination must consider global illumination, which means accounting for all lighting, whether direct or indirect. This includes indirect light provided by the backdrop or Environment light, sometimes referred to as "sky lighting."

When the Global Illumination rays are fired, the color and brightness of the closest element hit by each ray (other than direct light sources, which are accounted for separately) are added into the global illumination for that point. It doesn’t matter if a ray hits another diffuse shaded polygon, a luminous polygon, or the backdrop - whatever is hit will be taken into account.

Of course, if the backdrop is blocked by objects, it won’t affect shading. For example, in a scene with an infinite ground plane object, the lower half of the backdrop gradient won’t matter since no rays will ever reach it. Similarly, when shading the floor of an enclosed room, only the areas of the backdrop seen through open doors, windows or skylights will contribute.

Moreover, with gradient backdrops, orientation matters. If the sky is dark blue at the zenith, but bright at the horizon, then the sides of an outdoor object may get more sky lighting than the top. This is because Global Illumination rays are fired more densely near the direction of the surface normal than around the base of the sampling hemisphere for each shaded point. Thus, light coming in perpendicularly is more important than light coming in at a glancing angle.

Troubleshooting

“Blotchiness” in areas lit by Global Illumination occurs when different evaluations come up with different results. If the lighting environment is complex and there are not enough rays to properly sample it, then two or more nearby evaluations can be different enough to cause blotchiness. This can occur, for example, when Angular Tolerance is set too high.

Consider a scene lit only by a single luminous polygon. The smaller that polygon is (as seen from the surface being shaded), the larger the number of rays necessary to ensure that at least one of them hits it. If only one of two adjacent Global Illumination evaluations contains a ray that hits that polygon, then the other evaluation will result in a dark patch on the surface. You can minimize this effect by increasing the evenness of the environment - that is, making the luminous polygon bigger or dimmer or using more rays to increase the density of the sampling pattern.

The same principle applies to indirect lighting. A brightly lit area is very much like a luminous polygon as far as Global Illumination is concerned. For example, when shading a ceiling, more rays are required if the adjacent wall has a few tight spotlights shining on it than if the wall is lit by a broad floodlight. Specular highlights or caustics can also act as tiny indirect light sources that can require a higher sampling density.