Optimize quality and speed with samples and Ray Depth
- [Instructor] Understanding the Arnold renderer settings is essential to an efficient workflow. The Arnold render settings give us a great deal of control over how the render is processed. Proper application of these settings can optimize render times by directing computing resources toward render components that contribute most significantly to the final image. In other words, we devote computing resources to render components that have the most visual impact or importance in the final render.
Let's go ahead and open up the Render Settings window and additionally, open up the Arnold Renderer tab, and let's also open up the Arnold render view, so we can see our changes in real time. Arnold, Render. We don't need the Display Settings panel, we can hide that from the gear icon. In the Render Settings the two most important sections are Sampling and Ray Depth. Let's go down here and open up Ray Depth also.
In the Ray Depth section we control the number of times rays are allowed to bounce in the scene. For the individual components, such as Diffuse, Specular, Transmission, and so on, there is an appropriate Ray Depth parameter. The label Diffuse here refers to indirect illumination on diffused surfaces. In other words, bounce light or color bleeds. The rendering with default values looks a bit dark and that's because Diffuse Ray Depth is only 1 bounce by default.
Light will hit a surface, such as this table cloth, and then bounce off that surface to illuminate nearby surfaces, such as the wall. Once it hits that second surface the ray stops and there's no further bounces. If we increase the number of Diffuse rays, for example, then we'll get more bounce light in the scene. Go over here and set this to a value of 5. And now our shot is much brighter, because we have more bounce light. Likewise, with the Specular rays.
We need more of those, because we've got some metallic and glass surfaces in the scene. Increase the number of Specular rays to 4. And that should help to lighten up any dark areas on reflective surfaces, such as glass here. Transmission rays is the trace depth for refractions. It is set to 8 by default and as we'll see later in the chapter on materials we will need at least seven rays for the vase and the water here, so 8 is sufficient in this case.
The shot is brighter, because we have more bounce light. We can make it brighter yet. Increase the number of Diffuse rays to 10 and now the shot is brighter still. As a result of increasing all of those rays now our rendering has slowed down. At the top is the Total number of rays allowed. We've got a default Total of 10, but the numbers we have down here add up to greater than 10.
Our components give us 10 plus 4 plus 8 or 22 rays. Let's set the maximum allowable number of rays up higher in order to allow all of these rays. Let's set it to 30. And now we can actually render all of those component rays. And again, the rendering is going to slow down and it's going to be better quality, because we'll have more information about the transference of light through the scene.
Sampling controls the over all visual fidelity. And in this case it will help us to illuminate the grain that we see, especially in the shadows. The first attribute here is Camera Anti-Aliasing, it's labeled Camera AA. That's the global fidelity of the image. We can increase this value or we could dial in the individual values for the separate components. Camera Samples is set to 3 by default.
That can actually be a reasonable value for production provided that we increase the Sampling of these components below. For a draft render we can bring Anti-Aliasing down to a very low, or even a negative number. And as we do that we see the rendering becomes a kind of mosaic, meaning it's not actually sampling every pixel. I might bring that up to 0 for a draft render and then maybe back up to its default of 3 for a final production render.
Now once this completes we'll see that we still have quite a lot of grain and that's because we haven't dealt with the component samples yet. Increasing the Diffuse samples will help us eliminate that grain in the shadow. The scale of these attributes is deceptive, because the actual number of samples is calculated using the squares of these values. Increasing one of these by just one or two integers will greatly increase the number of samples and slow down the rendering.
For the Diffuse samples I'll bring that up from its default of 2 to a value of 5. And as I do that notice that these numbers increase. So with Diffuse samples set up to 5 we'll pretty much get rid of most of the grain in the shadows here. After increasing the Diffuse samples from 2 to 5 the render will take quite a lot longer. Instead of a few seconds it might take a couple of minutes.
Once that render is complete we can see that it has helped to remove the grain, especially in the shadow areas. There is still some grain here though. We can zoom in with the mouse wheel in the shadow area here and move around with alt and middle mouse. There is still some grain there. And we could increase the Diffuse even more, but of course, that would slow down the render. But I will increase the Specular and Transmission sampling. Set those both to values of 3.
And that will trigger a new render. We can zoom back out once again by clicking 1:1. Those new sample values will help to resolve the glass and metal better. As we increase the Sampling and Ray Depth attributes the number of samples per pixel goes up. Statistics are displayed at the top of the Sampling section. On the left is the minimum number of samples and on the right in parentheses is the maximum.
The Camera AA Samples value, displayed at the top, is 9. The value I entered in the attribute here is 3. 3 times 3 is 9. The number of actual camera samples per pixel is the square of this attribute value. Notice that the Camera AA Samples does not have a maximum, and that is because the camera samples don't have anything to do with global illumination.
Camera samples only with anti-aliasing or grain removal and not tracing any secondary rays through the scene, such as diffused bounce light. Notice that there's no Ray Depth for the camera down here. For the camera samples there are no bounce rays, only the one primary camera ray. The separate components however do have minimum and maximum values. Because the number of rays is adaptive Arnold is highly optimized and never traces rays unless they are needed.
We set the maximum allowable rays in the Ray Depth section, but the actual number of rays is variable depending upon scene conditions. The minimum value of samples per component displayed up here is for a trace depth of one. So at one ray we have the minimum number of samples. The maximum number of samples is the number of samples at the full trace depth for that component, down here.
For the Diffuse component the minimum samples displayed up here is 225. The Diffuse sampling value I entered is 5. The minimum number of samples per component is determined by an equation, which is the camera sample value squared multiplied by the component sample value squared. 3 squared is 9, 5 squared is 25, 9 times 25 is 225.
To calculate the maximum number of component samples per pixel take the minimum number and add to that. The value you're adding is the camera squared multiplied by the component Ray Depth minus 1. In this example, Diffuse Ray Depth is 10, subtract 1 from that and the remainder is 9. Multiply that by the camera samples attribute value squared, which is also 9.
9 times 9 is 81. Add 81 to the minimum value of 225 and we get the maximum potential number of samples for the Diffuse component, which is currently 306. The Sampling attributes have a much more dramatic effect on the sample totals than the Ray Depth attributes do. Bring the Sampling values up slowly and never take them higher than they need to be for your image. And that's how the min and max number of samples are calculated.
Here's a before and after comparison of the rendering. First with default Sampling and Ray Depth values and then with the optimized render settings. And that's how to use the Arnold renderer settings to tune Sampling and Ray Depth. It concludes the chapter on Arnold concepts.
- Arnold rendering concepts
- Lighting with Maya and Arnold lights
- Controlling exposure
- Filtering light with Gobo
- Light attenuation with Decay
- Image-based lighting with Skydome
- Exterior daylight with Physical Sky
- Arnold Standard Surface material attributes
- Mapping material attributes
- Rendering refractions
- Mesh subdivision and displacement at render time
- Shading effects such as ambient occlusion and vertex color
- Camera effects such as fisheye and depth of field
- Animation image sequence rendering