Sampling And Final Gather

Maya, Mental Ray: Lighting

Please Note that this page is depreciated and is not supported in the C3dC Subscription
Sampling and Final Gather are the two elements we must learn when understanding how Mental Ray renders images for animation. These two quite different systems are at the core of the physically correct rendering system.

Sampling is the quality of the pixel information and is usually scene as grain. Sharp images are relatively easy to render in CG, but as soon as anything is blurred we need to up sampling levels for better image quality. Blurring of shadows, specular reflections, subsurface scatter and many other elements may introduce grain.

Final Gather is Mental Rays method for calculating bounce light. It must be thought of as a separate lighting system and comes under the category of Indirect Lighting. Mental Rays Global Illumination method can also be used but because of slower render times it’s usually not used in rendering for animation where we have multiple frames.

Think of Indirect Lighting as a seperate system to direct light which is the lights and shadows cast directly from the light source. indirect Lighting is the bounce lighting and is also cast from IBL’s or Image Based Lighting spheres with HDR Images.

We are using Linear lighting for these tutorials, so refer to linear lighting pages for more info there. Setup tutorial here is video 2 and I use scripts from the Fast Linear Workflow Setup page as well.

HDR images can be downloaded from HDRlabs.com

1. Introduction and Setup (5:16 mins)

Here we go over the basics of this tutorial and setup the scene ready with linear workflow.

VIDEO 1.1 : INTRODUCTION (1:16 mins)

Information
The introduction for this tutorial.
VIDEO 1.2 : SETTING UP THE SCENE (4:00 mins)

Information
Setting Up the scene quickly
2. Sampling (16 mins)

Sampling is usually the cause of noise in our scenes. It happens on any pixels needing soft or blurred areas. Anti-aliasing, soft shadows, blurry specular reflections, subsurface scattering are all common offenders.

There’s a MR overall setting in the Render Settings > Quality > unified sampling slider. This is our overall sampling setting but we also must tweak other settings too for shadows and materials individually.

VIDEO 2.1 : SAMPLING OVERVIEW (8:13 mins)

Information
The Unified Sampling Slider is a Global sampling level in MR.

Render Settings > Quality > Unified Sampling Slider

This is our overall image quality setting.

It most obviously improves antialiasing but it also globally improves the sampling of all elements including textures, shadows, SSS and reflections.

Defaults are .25 which is low. For final renders it’s recomended to set at .75 or 1. You can go higher but usually we’ll remove the grain in post since render times can get very heavy. Still images are commonly set high where you can leave renders over night to render for 12hrs plus. This is usually not recomended for animation where hundreds of frames need to be rendered.

VIDEO 2.2 : SAMPLING ON SHADOWS REFLECTIONS AND SSS (8:13 mins)

Information
The Unified Sampling Slider is a Global sampling level in MR.

Render Settings > Quality > Unified Sampling Slider

This is our overall image quality setting.

It most obviously improves antialiasing but it also globally improves the sampling of all elements including textures, shadows, SSS and reflections.

Defaults are .25 which is low. For final renders it’s recomended to set at .75 or 1. You can go higher but usually we’ll remove the grain in post since render times can get very heavy. Still images are commonly set high where you can leave renders over night to render for 12hrs plus. This is usually not recomended for animation where hundreds of frames need to be rendered.

3. Indirect Lighting Overview (6:50 mins)

Now we’ll explore Indirect Lighting, a new topic which isn’t related at all to sampling. Indirect Lighting is the bounce light in our scene and must be thought of a separate to direct lighting from the actual lights in our scene. This becomes more important later when we noticed “blotches” in our renders, “blotches” are usually cause by final gather and are not related to sampling. Sampling is usually diagnosed as grain.

VIDEO 3.1 : INDIRECT LIGHTING OVERVIEW (5:09 mins)

Information
An Overview of Indirect Lighting and what bounce light systems are available to us in Maya’s Mental Ray. We’ll be focusing on the subsection “Final Gather” exclusively for render speed in animation with a minimal loss of quality.
VIDEO 3.2 : A NOTE ABOUT REAL WORLD BOUNCE LIGHTING (1:41 mins)

Information
Quick note about Final Gather compared to how light behaves in the real world.
4. Final Gather: Understanding the Common Settings (15 mins)

Final Gather is composed mainly of three values, “accuracy” which is related to rays, “density” is the amount of points and “point interpolation” which can be thought of as blur. With a good understanding of how these values relate to each other we can start to optimise render times and remove Final Gather artefacts. This is crucial for good lighting in Mental Ray.

VIDEO 4.1 : FINAL GATHER – ACCURACY AND RAYS (5:33 mins)

Information
Accuracy is the foundational value that governs how Final Gather calculates bounce light. It’s important to really understand how the light rays randomly ping the scene to produce the bounce lighting effect.
VIDEO 4.2 : FINAL GATHER – POINT AMOUNT (DENSITY) (1:14 mins)

Information
Point density is the value that adds more or less points. But it’s important to know that just adding more points doesn’t necessarily mean better looking renders.
VIDEO 4.3 : FINAL GATHER – BLURRING (POINT INTERPOLATION) (4:05 mins)

Information
Blurring is the key to getting rid of the point blotches in our renders, but it comes at a cost, both in render times and in loosing crack shadow details.
VIDEO 4.4 : FINAL GATHER – COMBINE THE THREE VALUES FOR QUALITY (4:24 mins)

Information
Now that we understand all the values here we explore how they can be used in conjunction, keeping in mind that the more we blur with “point interpolation” the more we’ll loose our lovely crack shadow detail. In the past we’d use ambient occlusion passes to add our detail back, ambient occlusion is a little bit like cavity maps where darkness is caught in the crack detail, but if we get out FG settings right we should minimise the need to add ambient occlusion later in post.
5. Blurring Image Based Lighting (IBL) Domes (8:15 mins)

Interestingly blurring our IBL image domes will help our Final Gather in outdoor scenes. This is an interesting effect which is quite intuitive now we understand how the Final Gather is working.

VIDEO 5.1 : BLURRING IMAGE BASED LIGHT DOMES FOR BETTER AND FASTER RESULTS (8:15 mins)

Information
Here we see how different images can be used to further optimise our lighting. A blurred lores version of the IBl can be used for the diffuse lighting and counter intuitively produces better lighting results. However we usually still use the hires .hdr image for reflections and the super hires jpg for our background clarity. HDR Labs have a free Maya plugin that automatically divides the rays correctly. It’s recommended for further study in this area.

Leave a reply