Occlusion ambiante

L’occlusion ambiante est un calcul de lancer de rayon sophistiqué qui simule des ombres d’illumination globale en atténuant l’obscurité perçue dans les coins et aux intersections de maillage, dans les plis, et dans les fissures, où la lumière ambiante est, ou bloquée.

There is no such thing as AO in the real world; AO is a specific not-physically-accurate (but generally nice-looking) rendering trick. It basically samples a hemisphere around each point on the face, sees what proportion of that hemisphere is occluded by other geometry, and shades the pixel accordingly.

It is got nothing to do with light at all; it is purely a rendering trick that tends to look nice because generally in real-world surfaces that are close together (like small cracks) will be darker than surfaces that do not have anything in front of them, because of shadows, dirt, etc.

The AO process, though, approximates this result; it is not simulating light bouncing around or going through things. That is why AO still works when you do not have any lights in the scene, and it is why just switching on AO alone is a very bad way of « lighting » a scene.

You must have ray tracing enabled as a Render panel option in the Shading section for this to work.

You must have an ambient light color set as you desire. By default, the ambient light color (world) is black, simulating midnight in the basement during a power outage. Applying that color as ambient will actually darken all colors. A good outdoor mid-day color is RGB(0.9, 0.9, 0.8) which is a whitish yellow sunny kind of color on a bright-but-not-harshly-bright day.

Options

../../../_images/render_blender-render_world_ambient-occlusion_panel.png

Le panneau World avec les curseurs de couleur ambiante surlignés.

Factor
La force de l’effet AO, un multiplicateur pour l’addition.

Ambient Occlusion is composited during the render. Two blending modes are available:

Add
Le pixel reçoit de la lumière selon le nombre des rayons non obstrués. La scène est plus claire, Ceci simule l’illumination globale.
Multiply
Ambient occlusion is multiplied over the shading, making things darker.

Note

Si Multiply est choisi, il doit y avoir d’autres sources de lumière ; autrement la scène sera. Dans les deux autres cas la scène est éclairée même si aucune lumière explicite est présent, juste effet AO. Bien que beaucoup de personnes aiment utiliser Ao seul comme un raccourci rapide pour éclairer une scène, les résultats qu’il sera et plat, comme un jour. Dans la plupart des cas, c’est mieux d’éclairer une scène proprement avec des lampes standards de Blender, puis utiliser AO au dessus de cela, fixé à Multiply, pour des détails supplémentaires et des ombres de contact.

Le panneau Gather contient des réglages pour la qualité de l’occlusion ambiante. Notez que ces réglages s’appliquent aussi à Environment Lighting et Indirect Lighting.

L’occlusion ambiante a deux méthodes principales de calcul : Raytrace et Approximate.

Gather

Raytrace

../../../_images/render_blender-render_world_ambient-occlusion_gather.png

Le panneau Ambient Occlusion panel, méthode Raytrace.

La méthode Raytrace donne des résultats les plus précis, mais aussi les plus bruyants. Vous pouvez obtenir une image presque sans bruit, mais du temps de rendu… C’est le seule option si vous voulez utiliser les couleurs de texture de votre ciel.

Attenuation
Length of rays defines how far away other faces may be and still have an occlusion effect. The longer this distance, the greater impact that far away geometry will have on the occlusion effect. A high Distance value also means that the renderer has to search a greater area for geometry that occludes, so render time can be optimized by making this distance as short as possible for the visual effect that you want.

Sampling

Sampling Method
Constant QMC
Le Quasi-Monte Carlo de base, donne des rayons distribués uniformément et aléatoirement.
Adaptive QMC

Une méthode de QMC améliorée, qui essaie de déterminer quand la fréquence d’échantillonnage peut être abaissée ou quand l’échantillon est sauté, en fonction de ses deux réglages :

Threshold
La limite au dessous de laquelle l’échantillon est considéré complètement obstrué (« noir ») ou non obstrué (« blanc »), et sauté.
Adapt to Speed
A factor to reduce AO sampling on fast-moving pixels. As it uses the Vector render pass, that must also be enabled (see render passes page).

Note

About QMC

Vois aussi la page des ombres en lancer de rayon pour plus d’informations sur la méthode d’échantillon Quasi-Monte Carlo.

Constant Jittered

La méthode d’échantillon historique, plus susceptible d’artefacts « bias »…

Bias

L’angle (en radians) que l’hémisphère va rendre plus étroit (càd. que l’hémisphère ne sera plus un hémisphère réel : sa section ne sera plus un demi-cercle, mais un arc de cercle de : pi - bias radians).

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. Note that while it might even happen with QMC sampling methods, it is much more visible with the Constant Jittered one and anyway, you have no Bias option for QMC.

../../../_images/render_blender-render_world_ambient-occlusion_bias0-05.jpg

24×24 UV Sphere with Bias: 0.05 (default). Note the facets on the sphere’s surface even though it is set to smooth.

../../../_images/render_blender-render_world_ambient-occlusion_bias0-15.jpg

L’augmentation de Bias à 0.15 supprime les artefacts facettés.

Échantillons

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 number of rays shot out is the square of this number (i.e.*Samples* at 5 means 25 rays). Rays are shot at the hemisphere according to a random pattern (determined by the sample methods described above); this causes differences in the occlusion pattern of neighboring pixels unless the number of shot rays is big enough to produce good statistical data.

../../../_images/render_blender-render_world_ambient-occlusion_3samples.jpg

Occlusion ambiante avec 3 échantillons.

../../../_images/render_blender-render_world_ambient-occlusion_6samples.jpg

Occlusion ambiante avec 6 échantillons.

../../../_images/render_blender-render_world_ambient-occlusion_12samples.jpg

Occlusion ambiante avec 12 échantillons.

Approximate

../../../_images/render_blender-render_world_ambient-occlusion_gather2.png

Le panneau Ambient Occlusion, méthode Approximate.

La méthode Approximate donne un résultat beaucoup plus doux pour le de temps de rendu, mais comme son nom l’indique, c’est seulement une approximation de la méthode Raytrace, qui implique qu’il pourrait produire quelques artefacts et ne peut pas utiliser le texture de ciel comme la couleur de base.

Cette méthode semble les résultats. Vous avez deux options complémentaires pour réduire ce problème :

Passes
Fixe le nombre des passes de pré-processing, entre (0 à 10) passes. En gardant les passes de pré-processing vont augmenter le temps de rendu mais effacent aussi quelques artefacts et sur-occlusions.
Error
This is the tolerance factor for approximation error (i.e. the max allowed difference between approximated result and fully computed result). The lower, the slower the render, but the more accurate the results… Ranges between (0.0 to 10.0), defaults to 0.250.
Pixel Cache
When enabled, it will keep values of computed pixels to interpolate it with its neighbors. This further speeds up the render, generally without visible loss in quality…
Correction
Un facteur de correction pour réduire la sur-occlusion. Intervalles de correction entre (0.0 à 1.0)

Réglages communs

Falloff

When activated, the distance to the occluding objects will influence the « depth » of the shadow. This means that the further away the occluding geometry is, the lighter its « shadow » will be. This effect only occurs when the Strength factor is higher than 0.0. It mimics light dispersion in the atmosphere…

Strength
Controls the attenuation of the shadows enabled with Use Falloff. Higher values give a shorter shadow, as it falls off more quickly (corresponding to a more foggy/dusty atmosphere). Ranges from (0.0 to 10.0), default is 0.0, which means no falloff.

Détails techniques

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.

Astuces

L’occlusion ambiante est u ne technique de lancer de rayon (au moins avec la méthode Raytrace), aussi il tend à être lent. De plus, la performance dépend grandement de la taille de l’octree, voir le chapitre de rendu pour plus d’information.