When working with a renderer like Arnold, it is useful to have a basic understanding of the core principles behind ray-trace rendering. Producing a realistic-looking image of a virtual scene requires simulating the propagation of light in the scene all the way from the light sources to the camera. To determine the color of each image pixel, Arnold collects information from the scene geometry, shaders, lights, etc., and traces a number of random light transport paths that connect the objects seen through the pixel to the light sources - a process called 'sampling'. The quality of the resulting image largely depends on the number of paths, or samples, generated for each pixel.
When rendering an image, Arnold must determine a color value for each pixel by examining the scene. Arnold achieves this by sending out a number of rays from the camera’s position until they hit an object in the scene. Every time a ray hits an object, it will perform some calculations that will eventually return a piece of information about the object (its color, for instance). This process can basically be described as 'sampling' the pixels in the virtual camera's image plane.
Renders computed with too few samples in each pixel can be noisy. Increasing the number of samples per pixel gives a less noisy image which better represents the actual scene. The images below show a comparison when increasing the number of Camera (AA) samples in a scene. Not only does increasing Camera (AA) samples reduce aliasing noise, but it also adds more secondary ray samples which also reduces noise in the lighting.
Camera (AA) Sampling
So, what is camera sampling? Basically, a number of rays are shot from the camera through each required pixel of the rendered screen window into the scene. These are called 'primary rays', but sometimes they are referred to as 'eye' or 'camera rays' (Camera (AA) (anti-aliasing)) as they are cast from the rendering view. Sometimes they are called 'pixel samples'.
The Camera (AA) value controls the pixel supersampling rate or the number of rays per pixel that will be traced from the camera. The higher the number of samples, the better the anti-aliasing quality, but the longer the render times.
These AA samples could be described as primary rays (or pixel samples) and determine the overall quality of the image being rendered. Increasing the AA samples improves the overall quality of the image, but it can often be wasteful because it increases the sampling rate for everything. When the source of noise is identified in the scene, it is more efficient to set the sampling values to increase the number of only those specific rays. If for example, there is a scene with lots of motion blur, a larger Camera (AA) sample is required, and therefore the other sample values can be reduced. Likewise, increasing Camera (AA) can also benefit indirect lighting and therefore not as many Diffuse samples would be required. However, if you were to reduce noise on the skin of a character, it would be more efficient to have higher SSS samples and not such a high value for Camera (AA) samples.
Direct lighting rays can be described as rays which deal with lights. These rays travel from a position in the scene toward the various light sources. These rays determine if a surface is in shadow, and if not, lighting information can be calculated.
Noise from lights can sometimes be difficult to diagnose, particularly if it is a light with a large area or size. In these cases, it can sometimes be mistaken for indirect diffuse noise. This highlights the necessity for testing different noise ray types. If the issue is shadow noise, then we can simply toggle ignore shadows in the Arnold render settings, and the noise will completely resolve. The images below show how a light is traced in Arnold.
The same noise problems described earlier can occur with direct and indirect rays. Noise from direct light sources usually appear in specular highlights or in large, soft shadows from area lights. If this is the case, the number of light samples needs to be increased. The images below show the difference in the shadow noise when increasing the number of light samples from 1 to 3.
It can be useful to separate one source of noise from another, when trying to evaluate noise in a scene. Disabling 'Diffuse' rays (0) can help identify which type of noise is present. When attempting to optimize the number of indirect diffuse rays in a scene, rather than increasing the number of Diffuse rays (render time will double for each Diffuse sample), the source of the noise will need to be isolated first.
Diffuse Ray Sampling
Indirect (diffuse) lighting from emissive green cube. Rollover image to view direct lighting only (Diffuse Samples 0)
Indirect Diffuse rays are rays that interact with objects and their surface shaders. Therefore, rays travel in the scene in directions determined by the shader assigned to the object. Transmission rays travel through objects. When a ray hits a reflective object, such as a mirror, only one reflection ray is traced from that point in a direction determined by the incoming ray. In contrast, diffuse rays are sampled randomly in the hemisphere around the hit point.
Diagram showing how diffuse rays are propagated in an Arnold render
Specular Ray Sampling
When rendering glossy specular surfaces, noise can also be a problem, as with diffuse rays. Bright hotspots can cause noise in indirect specular samples. For example, wide specular reflections of small, bright lights. If the issue is noise in a specular highlight, it needs to be confirmed that the source is the direct light and not a secondary ray type (such as specular). This is easy to achieve by setting the GI_diffuse_depth, GI_specular_depth to zero (this essentially turns off all global illumination). If the noise is still there, we know it is the direct specular component of the illumination model. In most cases, it can be resolved by increasing the number of specular samples.
When sampling volumes, direct (AA) rays sample the volume multiple times as they travel through it. Indirect rays (Volume Indirect) behave similarly, sent multiple times as the ray 'steps' (volume step size) through the volumetric object. Therefore, sampling a volume usually takes longer to calculate than sampling a surface.
Volume sampling. Direct lighting (green). Indirect lighting (blue).
At each step the ray travels, it evaluates the shader and accumulates the density of the volume. When these density values become more erratic throughout the volume, nearby rays can calculate substantially different values, introducing noise into the render. In this case, it may be necessary to render using more light volume samples or to reduce the step size in the volume. Even with low sampling values, it can be expensive to render clean images with volumes.
There are three things to consider when rendering volumes; ray marching, direct light, and indirect light sampling, all of which have different sampling settings.
Generally, the step size needs to be as large as possible before visibly noticeable artifacts occur. Low Step Sizes will increase render times. For example, when the step size is 0.1, and the volume is 10 units big in world space, there are approximately 100 primary samples, and therefore the volume shader is called 100 times.
volume_samples. If the direct lighting noise doesn't significantly decrease as
volume_samplesincreases, then it's probably due to a too-low ,
step_sizeor simply difficult to sample light interactions (highly anisotropic volumes, heavily textured mesh_lights, quadratic falloff, etc. ). In this cas, there's not much to do except to eliminate the samples via clamping or filtering.
GI_volume_depthof a noisy volume needs to be disabled, and if the render is no longer noisy, then the problem is indirect sampling. If the quality needs to be improved, the number of
volume_indirect_samplesneeds to be increased. If increasing this doesn't reduce noise, then the noise could again be from difficult to sample light interactions (multiple scattering, anisotropic volumes, lights embedded in the volume, etc.) and as mentioned before there's not much to do except to eliminate the samples via clamping or filtering.
Volume ray depth
Increasing the volume ray depth can make a dramatic difference to the appearance of a volume. However, be aware that increasing the volume ray depth will increase the number of multiple scattering bounces within the volume (defaults to 0) and therefore render times will increase significantly.
Pepe model by Daniel M. Lara (Pepeland).
Further information about sampling can be found here.
Further information about removing noise can be found here.
Pepe model by Daniel M. Lara (Pepeland)