Ambient Occlusion 3.13

Ambient Occlusion, abbreviated as AO, is a technique that can add visual realism to the image without being physically correct. It typically generates a gray-scale image where each pixel represents how much that position is covered by surrounding objects - the closer the neighboring pieces the darker the pixel. This result can be used to darken concave areas, which human eye perceives as indirect illumination shadows, therefore often referred to as contact shadows. The advantage of ambient occlusion is its computational speed. As it does not require any shading and may be computed with very short rays, the performance may be significantly higher than for final gathering.

mental ray supports two major ways of computing AO: either using the built-in AO render pass, or providing internal machinery like a AO point cache to help custom shaders speeding up their own AO calculations.

The ambient occlusion shader support is enabled by default in mental ray, but no actual computations will happen until requested by custom shaders. The related ambient occlusion cache is off by default. In this mode, only shaders which call for ambient occlusion values will initiate computation on demand. If no such shaders exist in the scene, there is no overhead compared to the rendering of scenes with ambient occlusion support turned off. In case the ambient occlusion caching is enabled then mental ray will perform computations before rendering starts, to fill the cache, and re-generate its content in every frame of an animation.

The global defaults for ambient occlusion shader support can be specified as scene options or on the command line of standalone mental ray. Most of these values can be overwritten and customized by a shader.

The ambient occlusion caching may be enabled for custom AO shaders to gain overall speed. It stores computed AO values in a point cloud for re-use in nearby locations or subsequent frames of an animation. In this case, several phases will be computed. In the first phase, some ambient occlusion points are created on a coarse grid. Subsequent passes refine the grid adaptively. The grid layout is derived from the current view so that grid points projected into screen space align with the pixels in the final image. The density of the grid is determined by the cache density setting, which specifies the upper bound for the number of ambient occlusion points per pixel. Increasing the image resolution without adjusting the density will indirectly increase the size of the cache to retain quality. During tile rendering, ambient occlusion values are interpolated from several ambient occlusion points closest to the lookup location. The number of points to be used for interpolation determines the smoothness of the result, and can be adjusted with the cache points setting.

Ambient Occlusion Pass, GPU Accelerated 3.13

mental ray offers a built-in ambient occlusion pass that works without further scene manipulations or material and shader adjustments. Once enabled, the AO calculation is executed in parallel to the beauty pass rendering and its result is kept in a separate frame buffer for post-compositing operations. The quality is derived from the global unified sampling quality by default, but can also be overridden to achieve special effects. The algorithm is based on brute-force calculation without any caching capabilities, which guarantees best quality and least artifacts both in stills and in animations. It also opens the door to acceleration by massively parallel compute architectures like on modern GPUs. The AO render pass implementation can take advantage of this.

If the machine is equipped with a CUDA-enabled NVIDIA GPU then the computation can run solely on the graphics hardware in a fraction of the time it would take on the CPU. If the GPU is not sufficient, or there is none, the AO pass will be rendered on the CPU using the exact same algorithm for pixel identical results. The quality is derived from the global unified sampling quality automatically, but can also be controlled towards special preferences using scene options or on the command line of the standalone mental ray.


Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.