David has over 40 years of industry experience in software development and information technology and a bachelor of computer science
Making It Real
Computers are used to fake everything these days. We use them to simulate the weather so we can generate a forecast, to simulate the progress of disease so we can create cures, and to simulate characters that can't possibly be real for the latest movie. Clearly, it's a useful thing to do.
But how do we make them so real? How do we ensure that we truly believe? There is no simple answer to that, and there are many techniques that come into play. One that plays a significant role, from a visual perspective, is ambient occlusion.
What is Ambient Occlusion?
Ambient occlusion is a computer graphics technique that simulates how light falls on an object. It affects all aspects of the object, but is most noticeable in the shadow areas.
The reason for this is because these areas are not affected by direct light, and less significantly by reflected light. Reflected light is light that bounces off of other surfaces in a scene. It comes from the term 'occlusion', which means blocked, and is part of many graphics packages today.
Consider the side-by-side images below:
The one on the left was rendered without ambient occlusion, the one on the right, with.
Notice any differences?
The first thing you should notice is that the overall image on the right is darker. That is because ambient occlusion is simulating the effects of light more accurately, and darkening areas like the corners and interiors. The second thing you should notice is that the right image looks more realistic. This is because reality contains both dark and light, so the image appears more realistic to us.
We use ambient occlusion for two main reasons:
- Simulate realism - as mentioned, real-life contains both dark and light. So it makes sense that a 3D rendering would strive for this, particularly those that are trying to be as realistic as possible. As an example, think about the special effects in movies. They are trying to convince you that what you are seeing is real, not created in a computer.
- Reduce computation time - calculating shadows for rendering is time consuming, and as such, costs money. So efforts focus on increasing realism, and reducing computational time. As an example, consider the movie special effects mentioned above. Individual frames can take hours to calculate, so every effort is made to reduce that time.
How It Works
Interestingly, ambient occlusion works backwards from every surface in a scene. A line is calculated from every pixel (dot) on the screen that makes up a surface. The line starts out at right angles to the surface, and bounces off every surface it encounters, at an angle equal to the incident angle (like reflection). This continues until the line either reaches the light source, or is blocked.
If it reaches the light source, then the brightness of the pixel is proportional to the distance the line traveled to reach the source. Longer distances are dark, and shorter distances are light. If the line is blocked, then the light from the source can't reach the point of origin, and the pixel is the darkest it can be. The process continues for every pixel in the frame.
Given this, it's easy to see why light calculations are so expensive from a time perspective. There are literally millions of calculations performed for each frame. And the problem increases exponentially for the number of surfaces, and light sources. This is the simulation, just think of what the actual calculations would be like.
To recap, ambient occlusion is a computer graphics technique that simulates how light falls on an object. It affects to main things in an image; overall darkness, and realism. We use ambient occlusion for two reasons. First, it simulates realism, and second, it reduces computation time.
Ambient occlusion works backwards from the surface it affects, which is different than one might expect. A line is calculated from every surface pixel, then bounces off every surface it encounters, at an angle equal to the incident angle (like reflection). This continues until the line either reaches the light source, or is blocked. If it reaches the light source, then the brightness of the pixel is proportional to the distance the line traveled to reach the source.
To unlock this lesson you must be a Study.com Member.
Create your account
Register to view this lesson
Unlock Your Education
See for yourself why 30 million people use Study.com
Become a Study.com member and start learning now.Become a Member
Already a member? Log InBack