Tutorial: Ambient Occlusion
By olivS, dimanche 16 janvier 2005 à 11:21 :: Blender tutorials :: #10 :: rss :: PDF

Global illumination is a very popular method for lighting three dimensional scenes. Unfortunately, most of the methods are very slow and requires lots of ressources. Ambient Occlusion is a method for simulating global illumination, while keeping a respectable ratio between results and computing times.
File(s) Attached :
- No file available for download
For Blender: 2.33 - Version française disponible(
)
::Preliminaries::
As well as anything related to raytracing with Blender, because of the supplementary computing time required by your computer, raytracing is only an option that you should feel free to activate and deactivate. This is done by the mean of the Scene menu (F10 key). The Render tab shows a button labeled Ray you will have to activate in order to use raytracing in your pictures.

::Activating Ambient Occlusion::
Let's start by downloading our working scene. After unpacking and opening the file, go to the Shading (F5) menu, and then in the World buttons.
In the World buttons menu, activate the Ambient Occlusion button in the Amb Occ tab. From now, when rendering and for each pixel of the picture, the renderer will cast (accordingly to an hemispheric distribution) a number of rays equal to square of Samples. If the ray encounters an object before reaching the World, then it will be referenced as "shaded"; if it encounters nothing, then it will be referenced as "lit". The pixel is given a value of lighting accordingly to the number of rays respectively "shaded" or "lit".
If the number of Samples is too low (the default value equal to 5 is near perfect for previews of your scene) you will encounter much grainyness. On the other hand, if it's too high, the rendering will look cleaner but will take more time (remind that for each pixel a number of rays equal to square of Samples is cast!).
As you see, it's very easy to obtain your first results using this method.
::Controling the luminosity::
We just saw that the renderer takes into account the number of "lit" and "shaded" rays, but we didn't said anything about the algorithm it uses to give to a pixel its proper brightness. In fact, there are three distinct behavior.
- Add:
The renderer adds lights and shadows computed to the actual lighting of the scene. Because we just add information, you can work with no additional light in your scene. Generally speaking, the result is somewhat bright.

- Sub:
The renderer subtracts lights and shadows computed to the actual lighting of the scene. Generally speaking, the result is somewhat dark, and without other lighting sources in your scene, all the objects of the scene could be rendered pitch black.

- Both:
The renderer does both at the same time, achieving a more contrasted result.

- -
These three operating modes could still be improved using two other options.
The Energy slider lets you gain control over the ambient luminosity achieved with this lighting method. Feel free do decrease its values if you have many other lighting sources in your scene, in the case your main goal in using Ambient Occlusion is achieving lighter shadows. In the following picture, we kept the both option and increased the Energy value up to 2.00. Please note that the graniness increased.

Finally, when activating the Use Distances button, the renderer will deal differently with the "lit" and "shaded" rays according to the distance between the pixel to be lit/shaded and the object from which the shadow originated. As with Area lamps, the closer is the shadow from the occluding object, the deeper it will be. The following picture has the very same setings as the previous one, except that Use Distances is activated and that the DistF parameter has been increased up to 5.00.

::Banding effects::
Because of its very nature, shading using the Ambient Occlusion method tends toward unveiling faces of your objects, even if these faces are theoretically smoothed using the Set Smooth button (Editing (F9) menu, Link and Materials tab). If you witness this phenomenon, you'd probably want to decrease the value of the Bias slider.
::World's influence on the lighting::
Here's the setting of our World: a red-orange gradient, overwritten during the rendering by a blueish texture.

By default, the Plain button (when activated) makes sure that the ambient luminosity gained through this method is purely white.

However, you can make sure that the ambiant luminosity is effected by the color of the World (particularly the Horizon and Zenith colors) if you activate the Sky color button. In fact, when a ray is referenced as "lit", this is because it reached the World instead of an object. It can retrieve the color information where it hit the World, and then color accordingly the pixel (taking into account all the color information retrieved by the other rays as well, of course). Here, the World's color is predominantly red, even if a blue texture is applied to the sky. The result is quite strange but shows perfectly how this option works.

Of course, what is true for the Sky color is also true for the Sky texture, if you activate this button. The way it differs is that instead of taking into account the color of the World, the ray will retrieve its color information from the Angular Map (AngMap button in the Texture and Input tab) or from the texture used as spherical mapping (Sphere button in the Texture and Input tab). By using any of these two options, you can achieve an ambient color not uniform and more realistic in your scene.









Comments
1. On mercredi 19 janvier 2005 à 20:46, by Girardi
2. On vendredi 28 janvier 2005 à 12:02, by olivS
3. On samedi 5 mars 2005 à 06:02, by Jean Montambeault
4. On samedi 5 mars 2005 à 18:40, by olivS
5. On samedi 26 mars 2005 à 23:41, by criss
6. On vendredi 21 avril 2006 à 03:47, by Locutus
7. On mardi 25 décembre 2007 à 18:02, by aleletum
8. On mardi 29 janvier 2008 à 22:40, by kylecaldbeck
9. On jeudi 2 octobre 2008 à 22:50, by jean
10. On mercredi 13 mai 2009 à 02:57, by FloridaJo
Add a comment