Manual/Ambient Occlusion

From BlenderWiki

User Manual: Contents | Guidelines | Blender Version 2.4x

Contents

[hide]

Ambient Occlusion

Mode: All Modes

Panel: Shading/World Context → Amb Occ

Hotkey: F8

Description

Ambient Occlusion is a sophisticated calculation which simulates soft global illumination by taking into account the amount of sky (which is assumed to be the lightsource) seen by a given point. This has the effect of darkening cracks, corners and points of contact, which is why Ambient Occlusion is often referred to as a 'dirt shader'.

Options

Ambient Occlusion Panel.
Ambient Occlusion Panel.

Sampling

Samples
The number of rays used to detect if an object is occluded. Higher numbers of samples give smoother and more accurate results, at the expense of slower render times. The default value of 5 is usually good for previews. The actual amount of shot rays is the square of this number. (i.e. Samples=5 means 25 rays). Rays are shot at the hemisphere according to a random pattern, this causes differences in the occlusion pattern of neighbouring pixels unless the number of shot rays is big enough to produce good statistical data.


Ambient Occlusion with 3 Samples
Ambient Occlusion with 3 Samples
Ambient Occlusion with 6 Samples
Ambient Occlusion with 6 Samples
Ambient Occlusion with 12 Samples
Ambient Occlusion with 12 Samples
Dist
The length of the occlusion rays. The longer this distance, the greater impact that far away geometry will have on the occlusion effect. A high Dist value also means that the renderer has to search a greater area for geometry that occludes, so render time can be optimised by making this distance as short as possible, for the visual effect that you want.
Use Distances, DistF
Controls the attenuation of the shadows. Higher values give a shorter shadow, as it falls off more quickly.

Blending

The ambient occlusion pass is composited during the render pipeline. Three blending modes are available:

Add
The pixel receives light according to the number of non-obstructed rays. The scene is lighter.
Sub
The pixel receives shadow (negative light) according to the number of obstructed rays. The scene is darker.
Both
Both effects take place, the scene has more or less the same brightness, but more contrast.


Energy
The strength of the AO effect, a multiplier for addition or subtraction


Note:

If Sub is chosen, there must be other light sources, otherwise the scene will be pitch black. In the other two cases the scene is lit even if no explicit light is present, just from the AO effect. Although many people like to use AO alone as a quick shortcut to light a scene, the results it gives will be muted and flat, like an overcast day. In most cases, it is best to light a scene properly with Blender's standard lamps, then use AO on top of that, set to 'Sub', for the additional details and contact shadows.

Ambient Color

Ambient Occlusion can take the color of its lighting from various sources

Plain
The pixel receives shading based on the World's ambient color
Sky Color
The pixel receives shading based on the World's sky color. The color is computed on the basis of the portion of the sky hit by the non-obstructed rays (Ambient Occlusion with Sky Color. Zenith is blue, Horizon is orange, and type is Blend so that sky goes full orange at Nadir.).
Sky Texture
A Sky Image texture must be present, possibly an AngMap or a SphereMap. It behaves as Sky Color but the ray color depends on the color of the Sky texture pixel hit.
Ambient Occlusion with Sky Color. Zenith is blue, Horizon is orange, and type is Blend so that sky goes full orange at Nadir.
Enlarge
Ambient Occlusion with Sky Color. Zenith is blue, Horizon is orange, and type is Blend so that sky goes full orange at Nadir.
Ambient Occlusion with Sky Texture, using a scaled down St. Peters Basilica HDR AngMap [1]
Enlarge
Ambient Occlusion with Sky Texture, using a scaled down St. Peters Basilica HDR AngMap [1]

Bias

Bias
The angle (in radians) the hemisphere will be made narrower.
The bias setting allows you to control how smooth 'smooth' faces will appear in AO rendering. Since AO occurs on the original faceted mesh, it is possible that the AO light makes faces visible even on objects with 'smooth' on. This is due to the way AO rays are shot, and can be controlled with the Bias Slider.
24x24 UV Sphere with Bias: 0.05 (default). Note the facets on the sphere's surface even though it is set smooth
24x24 UV Sphere with Bias: 0.05 (default). Note the facets on the sphere's surface even though it is set smooth
Raising the Bias to 0.15 removes the faceted artifacts
Raising the Bias to 0.15 removes the faceted artifacts

Technical Details

Ambient Occlusion is calculated by casting rays from each visible point, and by counting how many of them actually reach the sky, and how many, on the other hand, are obstructed by objects.

The amount of light on the point is then proportional to the number of rays which have 'escaped' and have reached the sky. This is done by firing a hemisphere of shadow-rays around. If a ray hits another face (it is occluded) then that ray is considered 'shadow', otherwise it is considered 'light'. The ratio between 'shadow' and 'light' rays defines how bright a given pixel is.

Hints

Ambient Occlusion is a raytracing technique, so it tends to be slow. Furthermore, performance severely depends on Octree size, see the Rendering Chapter for more information.


Previous: Manual/World Background Contents Next: Manual/Exposure
Personal tools