<p>Ambient light does not really exist, if we do not talk about cosmology. What we call ambient is just light form many secondary reflections.</p>

<p><a href="https://i.sstatic.net/b1FF5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/b1FF5.png" alt="enter image description here"></a></p>

<p><strong>Image 1</strong>: No ambient light (left) and ambient light (right). Both look artificial.</p>

<p>We can approximate ambient light by a constant factor. But this looks slightly washed out as ambient light is not constant over the scene. To make the ambient look better we can use a trick. If we make a hemispherical probe for object coverage (occlusion), we get an estimate of how much the pixel lies inside a cavity. The less you live in cavity the more likely the ambient light is going to hit here.</p>

<p><a href="https://i.sstatic.net/g57I5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/g57I5.png" alt="enter image description here"></a></p>

<p><strong>Image 2</strong>: By modulating the ambient light with local geometric occlusion we get a much nicer and realistic contribution of ambient light. Final color and contribution also tweaked slightly (right). Just plain ambient (left).</p>

<p>NOTE: Ambient occlusion component is also used by other phenomena so it can also simulate dirt packing etc. In any case your NOT supposed to multiply ambient occlusion by everything. Quite many tutorials make this mistake. You should add the ambient occlusion to existing image, that is if you only estimate ambient light with it.</p>

CC BY-SA 3.0
2015-09-01T11:40:49.123Z
Oops. the shared models of the red, metal and green balls don't react to ambient light but they do react to my ambient occlusion light. Hope you get the point nonetheless.
joojaa
CC BY-SA 3.0
2015-09-01T11:26:19.687Z
2015-09-01T11:26:19.687Z
joojaa
<p>Your point is correct when applied to <a href="https://en.wikipedia.org/wiki/Shading#Ambient_lighting">ambient lighting</a> as an approximation technique. This crude approach does indeed give the same lighting level to all surfaces regardless of their surroundings.</p>

<p>However, <a href="https://en.wikipedia.org/wiki/Ambient_occlusion">ambient occlusion</a> is a different (less crude) approach, that models how the light levels in a real scene vary depending on how much reflected light can reach a surface. The confusion is due to two very different approaches having similar names.</p>

<p>Ambient occlusion is a much better approximation of what in real life is described as ambient light - light that arrives from the background rather than directly from a light source.</p>

<blockquote>
  <p>If ambient lighting has no fixed position, how can points then be more or less exposed to it?</p>
</blockquote>

<p>When used in the context of ambient occlusion, the term "ambient lighting" still means background light approximated as being the same in all directions, but the surface is lit based on how many of those directions are not occluded by objects in the scene.</p>

<p>This gives subtly varying light levels that give much more realistic images than with a single level of ambient lighting. This gives the effects seen in real life such as the corners of a room being slightly darker than elsewhere.</p>

CC BY-SA 3.0
2015-09-01T00:28:55.947Z
"the surface is lit based on how many of those directions are not occluded by objects in the scene. " I unterstand this. But the question is from where comes the light? Where is the origin?

Because if I have two balls, and the ambient lighting has it's origin between those balls, then there won't be nothing occluded, because there is nothing between objects and light source. But if the origin is behind one of the balls, then one ball is occluded by the other. -> http://i.imgur.com/IRDvCzF.png
So the position of the source is important to determine what will be occluded. But Amb.L. has no pos.
Joey
CC BY-SA 3.0
2015-09-01T09:05:56.367Z
@Joey With one point light source every point on a surface will be either lit or not. With two point light sources a point on a surface may be lit by zero, one or two lights, giving three different light levels. With many point lights, there is gradual variation in the lighting. Ambient occlusion pretends that there are an infinite number of point light sources in the distance in all directions. This is not physically realistic, but it gives an approximation to the lighting in  a real scene, where light is reflected from the objects in the scene so that they are all lit by second hand light.
trichoplax is on Codidact now
CC BY-SA 3.0
2015-09-01T13:23:28.933Z
It might help a bit for understanding to specify that ambient occlusion is usually simulating light coming from the "sky," which would clear up questions about what the source of the light is.
porglezomp
CC BY-SA 3.0
2015-09-01T13:44:08.270Z
@porglezomp that's a useful way of thinking about it to gain understanding, but it can also be used in a closed room with no sky, where the ambient occlusion is the occlusion of the light reflected multiple times from the walls.
trichoplax is on Codidact now
CC BY-SA 3.0
2015-09-01T13:48:59.960Z
@trichoplax Yeah, that's why I put it in quotes.
porglezomp
CC BY-SA 3.0
2015-08-31T23:55:57.460Z
2015-08-31T23:55:57.460Z
trichoplax is on Codidact now
<p><a href="https://en.wikipedia.org/wiki/Ambient_occlusion" rel="nofollow noreferrer">Ambient occlusion</a> "is a shading and rendering technique used to calculate <strong>how exposed</strong> each point in a scene is <strong>to ambient lighting</strong>.</p>

<p>Ambient lighting is regarding to <a href="https://computergraphics.stackexchange.com/questions/375/what-is-ambient-lighting/">What is ambient lighting?</a>:</p>

<blockquote>
  <p>... lighting to be constant and independent from position: that's ambient
  lighting.</p>
</blockquote>

<p>If ambient lighting has no fixed position, how can points then be more or less <strong>exposed</strong> to it? Ambient lighting is "<a href="https://computergraphics.stackexchange.com/a/380/480">shining by a constant amount in all directions.</a>" So if the light is coming from <strong>all directions</strong>, every point should be exposed by <strong>the same factor</strong> to the ambient lighting.</p>

CC BY-SA 3.0
2015-09-02T09:10:06.683Z
I answered a similar question http://gamedev.stackexchange.com/questions/23/what-is-ambient-occlusion/66638#66638
concept3d
<shading><ambient-occlusion>
What is ambient occlusion?
Joey
# What is ambient occlusion?

(Asked by: username_0 on 2015-08-31)

[Ambient occlusion](https://en.wikipedia.org/wiki/Ambient_occlusion) "is a shading and rendering technique used to calculate **how exposed** each point in a scene is **to ambient lighting**.

Ambient lighting is regarding to [What is ambient lighting?](https://computergraphics.stackexchange.com/questions/375/what-is-ambient-lighting/):

> ... lighting to be constant and independent from position: that's ambient
> lighting.

If ambient lighting has no fixed position, how can points then be more or less **exposed** to it? Ambient lighting is "[shining by a constant amount in all directions.](https://computergraphics.stackexchange.com/a/380/480)" So if the light is coming from **all directions**, every point should be exposed by **the same factor** to the ambient lighting.

**Tags:** shading, ambient-occlusion

> **Comments:**
> **username_1**: I answered a similar question http://gamedev.stackexchange.com/questions/23/what-is-ambient-occlusion/66638#66638  

---

## 2 answers

### Answer by username_3 on 2015-08-31. Score: 6 | Accepted answer

Your point is correct when applied to [ambient lighting](https://en.wikipedia.org/wiki/Shading#Ambient_lighting) as an approximation technique. This crude approach does indeed give the same lighting level to all surfaces regardless of their surroundings.

However, [ambient occlusion](https://en.wikipedia.org/wiki/Ambient_occlusion) is a different (less crude) approach, that models how the light levels in a real scene vary depending on how much reflected light can reach a surface. The confusion is due to two very different approaches having similar names.

Ambient occlusion is a much better approximation of what in real life is described as ambient light - light that arrives from the background rather than directly from a light source.

> If ambient lighting has no fixed position, how can points then be more or less exposed to it?

When used in the context of ambient occlusion, the term "ambient lighting" still means background light approximated as being the same in all directions, but the surface is lit based on how many of those directions are not occluded by objects in the scene.

This gives subtly varying light levels that give much more realistic images than with a single level of ambient lighting. This gives the effects seen in real life such as the corners of a room being slightly darker than elsewhere.

> **Comments:**
> **username_0**: "the surface is lit based on how many of those directions are not occluded by objects in the scene. " I unterstand this. But the question is from where comes the light? Where is the origin?  Because if I have two balls, and the ambient lighting has it's origin between those balls, then there won't be nothing occluded, because there is nothing between objects and light source. But if the origin is behind one of the balls, then one ball is occluded by the other. -> http://i.imgur.com/IRDvCzF.png So the position of the source is important to determine what will be occluded. But Amb.L. has no pos.  
> **username_3**: @username_0 With one point light source every point on a surface will be either lit or not. With two point light sources a point on a surface may be lit by zero, one or two lights, giving three different light levels. With many point lights, there is gradual variation in the lighting. Ambient occlusion pretends that there are an infinite number of point light sources in the distance in all directions. This is not physically realistic, but it gives an approximation to the lighting in  a real scene, where light is reflected from the objects in the scene so that they are all lit by second hand light.  
> **username_4**: It might help a bit for understanding to specify that ambient occlusion is usually simulating light coming from the "sky," which would clear up questions about what the source of the light is.  
> **username_3**: @username_4 that's a useful way of thinking about it to gain understanding, but it can also be used in a closed room with no sky, where the ambient occlusion is the occlusion of the light reflected multiple times from the walls.  
> **username_4**: @username_3 Yeah, that's why I put it in quotes.  

---

### Answer by username_2 on 2015-09-01. Score: 5

Ambient light does not really exist, if we do not talk about cosmology. What we call ambient is just light form many secondary reflections.

[![enter image description here](https://i.sstatic.net/b1FF5.png)](https://i.sstatic.net/b1FF5.png)

**Image 1**: No ambient light (left) and ambient light (right). Both look artificial.

We can approximate ambient light by a constant factor. But this looks slightly washed out as ambient light is not constant over the scene. To make the ambient look better we can use a trick. If we make a hemispherical probe for object coverage (occlusion), we get an estimate of how much the pixel lies inside a cavity. The less you live in cavity the more likely the ambient light is going to hit here.

[![enter image description here](https://i.sstatic.net/g57I5.png)](https://i.sstatic.net/g57I5.png)

**Image 2**: By modulating the ambient light with local geometric occlusion we get a much nicer and realistic contribution of ambient light. Final color and contribution also tweaked slightly (right). Just plain ambient (left).

NOTE: Ambient occlusion component is also used by other phenomena so it can also simulate dirt packing etc. In any case your NOT supposed to multiply ambient occlusion by everything. Quite many tutorials make this mistake. You should add the ambient occlusion to existing image, that is if you only estimate ambient light with it.

> **Comments:**
> **username_2**: Oops. the shared models of the red, metal and green balls don't react to ambient light but they do react to my ambient occlusion light. Hope you get the point nonetheless.  

---

