All scene files, images, derivative images and movies are presented for instructional purposes only and are the sole property and copyright of Michael Vance.

R11 GI Tutorial Part 1
R11 GI Tutorial Part 2

R11 GI Tutorial Part 3

R11 GI Tutorial by Michael Vance, August 8, 2008. Part 2

Irradiance Cache: The magic of averaging & saving.

Image_15

So far we have discussed the GI Mode QMC, a brute force method of GI rendering. It needs high stochastic ray counts to produce grain free results but can produce impressive photorealistic results given enough time. Besides being relatively slow and processor intensive, a principle disadvantage of this method compared to the Irradiance Cache method is that it writes no cache to disk. Its solution, therefore, unlike with Irradiance Cache, cannot be saved or reused.

Cache is King:

One of the greatest advantages to using an IR (Irradiance Cache) method is its ability to save the GI records to a file or cache (pronounced the same as cash). After that one can then rerender a scene using the saved cache and skip the time that the records would take to rerender. Many general render settings, and even some GI settings, can be changed and still use the same GI cache, so experimentation and tweaking can be quickly achieved.

Image_16

Image16 above shows the Irradiance Cache File tab of the GI render settings. When an IR file is rendered, a cache is saved by default to an "Illum" (Illumination) folder created in the source file directory. The total number of records and the cache file size is displayed as shown. If you wish to save the file in another location or by another name, use the Custom Location option. Setting a custom location is also the only way to use a cache having a different name from the file name. Once a GI cache has been rendered and saved, it can be reused. One must activate the Auto Load setting to reuse a cache. Once you're happy with a rendered cache, don't forget to lock it to insure that it isn't overwritten. If you forget to do this and accidentally initiate a rerender without having first activated the auto load option shown above, your last cache will be lost without warning.

A saved cache is a wonderful thing. Once saved, provided you haven't changed the scene, and once the Auto Load setting is activated, you can rerender with different AA settings, different multipass settings, different resolutions, zoomed in, and in some cases even different materials, all without having to wait again for the cache to rerender. If you leave the cache lock setting unchecked, even different camera angles can be rendered and only records for areas not seen in previous cache renders will be added to the existing cache, saving a great deal of time, much the same way Camera and Full Animation modes work. Moreover, if you run out of time and the prepass has not finished rendering, you can simply stop the render wherever you're at, set the cache to auto load, lock it, and use the records that were pre-rendered up to the point where you stopped. This is one possible way to make full use of allotted rendering time. If you latter unlock the cache, you can rerender and it will pick up where it left off. Likewise, many GI render options themselves can be changed without having to rerender the cache, such as primary illumination intensity strength, different interpolation and or smoothing methods, etc. Below (Image_17) is the complete list of GI render options that can be changed without having to renderer the cache.

Image_17

For the Record:

The Irradiance Cache method was first described in a paper by Greg Ward, Frances Rubinstein, and Robert Clear in a SIGGRAPH paper printed in the August 1988 edition of Computer Graphics.

With an Irradiance Cache, instead of each pixel in a scene being sampled, fewer samples called records are taken with each record covering an area of the scene whose size is determined by user specified radius settings, the curvature of the surface, and the proximity to other surfaces.

Fewer record samples means faster performance, but not without some costs. Each border of each record must be blended with adjacent borders to get a smooth result. This is achieved though interpolation and smoothing. Because the renderer must interpolate and smooth the results, the image render itself can take longer, thus offsetting some of the time saved by calculating fewer records. Moreover, and more importantly, definition of shadow is lost in proportion to the fewer samples taken. The larger the radius area which is sampled, the less definition shadows will have. In order to diminish that effect, smaller radius records are placed where the geometry is more complex and in the proximity of geometry surfaces that could be expected to need more shadow definition such as corners and areas where geometries intersect.

If the downside to interpolating and smoothing between records is the potential loss of shadow definition, the upside is the lessoned likelihood of grain in still images or noise in animation. The smaller the radius of records, the greater the likelihood of grain noise or splotchyness, especially at lower stochastic sample counts. This is why pure QMC GI, where each shading point is sampled, is more subject to noise. (One can think of QMC GI as having a record for each pixel, with no interpolation.) Likewise, the more records computed in an irradiance cache, the closer it comes to pure QMC GI. Thus, as the IR record count increases, so too the potential for noise. If a record sample is imperfect because too few stochastic rays fail to find an illumination source that adjacent record samples do find, the difference between them will be harder to smoothen the more tightly spaced they become. Typically then, stochastic sample count must increase as records become smaller, or noise can result.

Since Wards paper in 1988, many advances in Irradiance Cache rendering have come in the form of more efficient record sample placement, better surface handling and better storage methods. Accordingly, R11 GI introduces better distribution of records than in the previous version of AR GI, better control over their placement, better pinning to geometry for noise free animations, and better cache handling. Thanks in large part to the easy to use presets; record placement now requires less user trial and error than previously, adopting itself better to the geometry at hand more automatically. The number of records to be used is still an important user decision, as it will affect the overall definition of shadows, but the best general purpose settings in terms of render time to quality have been preset in the various presets. 

Still Image: For that singular sensation.

Image_18 GI Mode: IR (Still Image) / Custom settings. / 2.5 hours pre-render. / 2.5 minutes render.
Render times are on a Mac Dual G5 and are for comparison only. New computers will be faster.

This is the option to select when rendering only one image frame. There are two still image modes: IR (Still Image) and IR+QMC (Still Image). IR renders a separate cache for each diffuse depth, with each new pass creating a new stochastic ray flower at the point of the last passes' termination. This method is much slower at higher diffuse depths than the IR+QMC mode. IR+QMC creates just a single ray bounce at the collision point of the last ray, so instead of creating a new ray flower for each ray collision, only a single ray is traced through the next pass, so it's much faster with higher pass settings than is IR. Because IR+QMC uses more initial rays than IR, it gives a slower but slightly better result than IR when only one ray depth is selected. With higher ray depths, the IR mode uses more stochastic rays at higher depths, so it will be much slower than IR+QMC but give truer results. IR is most suitable for interiors, the extra rays being useful for getting into those nooks and crannies, while IR+QMC is more suited to outdoor renders but can do well indoors too. If speed is a consideration, IR+QMC is your friend with higher diffuse depths.

Camera Animation: The architect's best friend.

Image_19 GI Mode: IR+QMC (Camera Animation) / Diffuse Depth: 1 / Medium Settings
TRT: 9 hours
Render times are on a Mac Dual G5 and are for comparison only. New computers will be faster.

Movie File: http://mvpny.com/R11GITutorial/CausticRingNV13mjpeg.mov

Camera animation is the right choice for architectural flythroughs and animations where only the camera moves. This method reuses records stored from previous frames when rendering subsequent frames, so it renders an animation in much less time than if you render out all frames using the still image mode, and with superior quality. With this option the cache for the entire animation is rendered before any frame render begins, so while it renders faster than rendering out individual frames, it still can take quite some time before you see your first fully rendered frame. Thus for longer animations, it may be best to test a few individual frame renders first using one of the still image settings.

The GI Animation Prepass HUD is displayed at the top left of the frame for the duration of the prepass, in which all frames will be checked for new records (Image_20 below). The first frame takes the same amount of time as a still image would with the same settings, but subsequent frames render much faster as only the records for areas not seen in any previous frame need be rendered. Happily, Camera Animation need render only one Update Pass, which means the GI cache render will be done after all frames are checked once. In Full Animation mode, there are many more update passes needed, but more about that in a minute. 

Image_20

As with Still Image, there are two Camera Animation modes: IR (Camera Animation) and IR+QMC (Camera Animation). The difference between them is the same as described above for the Still Image modes.

With Camera Animation, continuity of shading between frames is perfectly preserved for an overall very smooth animation result without motion flicker. It is however important to remember that while this is the fastest method for rendering camera animations, it will not successfully render an object animation. If you try to do so, you will find that object shadows don't update with moving scene objects.

Full Animation: Camera, lights, action!

Image_21 GI Mode: IR+QMC (Full Animation) / Diffuse Depth: 2 / Medium Settings
TRT: 40 hours
Render times are on a Mac Dual G5 and are for comparison only. New computers will be faster.
Movie File:
http://mvpny.com/R11GITutorial/EggboxMV13MG27mjpeg.mov
Scene File: http://mvpny.com/R11GITutorial/EggboxMV13MG27Public.zip

For non camera moving objects and or changing lighting, one must use Full Animation. This setting produces the best object animation result possible without flicker. Because of the extra overhead of having to keep the record samples pined to moving geometry, each frame can take up to twice as long or more than if rendering out a sequence using one of the Still Image modes, but short of using very high values, it is the only way to render a full animation without noise and flicker. As with the Camera Animation mode, the entire cache is rendered out before any final images, so again it is advisable to do some individual frame testing with one of the Still Image settings first.

The GI Animation Prepass HUD shows the cache render progress (Image_22). Unlike Camera Animation, many update passes are required for Full Animation. Some go faster than others, and many of them don't need to render every frame. The multiple passes are used to pin the records to the moving geometry and update shadows and illumination. For the sake of your sanity, try not to watch them.

Image_22

NET Render:

The IR+QMC (Net Render) setting renders the separate Full Animation passes on separate clients. Using net render speeds up the calculation of full animation GI caching, but not camera animation or still images. It should only be used with full animations that have changing lighting or object animation. If you only have a camera animation with no changing lights or object animation then don't use this setting. Use a camera animation setting instead.

A camera animation is rendered simultaneously on all clients with the first finisher used. Even with Net, use the Camera Animation setting when rendering camera animation. A camera animation cache, while not divided between clients, will still finish faster than a full NET animation.

R11 GI Tutorial Part 1
R11 GI Tutorial Part 2

R11 GI Tutorial Part 3

Proceed to Part 3