ArticleslgStudy

computer science

Screen space ambient occlusion

Screen space ambient occlusion is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Screen space ambient occlusion rather than just read about it. In short: Screen space ambient occlusion (SSAO) is a computer graphics technique for efficiently approximating the ambient occlusion effect in real time. It was developed by Vladimir Kajalin while working at Crytek and was used for the first time in 2007 by the video game Crysis, also developed by Crytek.

Screen space ambient occlusion — main illustration
Screen space ambient occlusion — illustration

Key takeaways

  • Screen space ambient occlusion belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Screen space ambient occlusion to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Screen space ambient occlusion from memory before moving on to harder problems.

Reference excerpt

Screen space ambient occlusion (SSAO) is a computer graphics technique for efficiently approximating the ambient occlusion effect in real time. It was developed by Vladimir Kajalin while working at Crytek and was used for the first time in 2007 by the video game Crysis, also developed by Crytek.

Implementation

The algorithm is implemented as a pixel shader, analyzing the scene depth buffer which is stored in a texture. For every pixel on the screen, the pixel shader samples the depth values around the current pixel and tries to compute the amount of occlusion from each of the sampled points. In its simplest implementation, the occlusion factor depends only on the depth difference between sampled point and current point. Without additional smart solutions, such a brute force method would require about 200 texture reads per pixel for good visual quality. This is not acceptable for real-time rendering on current graphics hardware. In order to get high quality results with far fewer reads, sampling is performed using a randomly rotated kernel. The kernel orientation is repeated every N screen pixels in order to have only high-frequency noise in the final picture. In the end this high frequency noise is greatly removed by a NxN post-process blurring step taking into account depth discontinuities (using methods such as comparing adjacent normals and depths). Such a solution allows a reduction in the number of depth samples per pixel to about 16 or fewer while maintaining a high quality result, and allows the use of SSAO in soft real-time applications like computer games. Compared to other ambient occlusion solutions, SSAO has the following advantages:

Independent from scene complexity. No data pre-processing needed, no loading time and no memory allocations in system memory. Works with dynamic scenes. Works in the same consistent way for every pixel on the screen. No CPU usage –it can be executed completely on the GPU. May be easily integrated into any modern graphics pipeline. SSAO also has the following disadvantages:

Rather local and in many cases view-dependent, as it is dependent on adjacent texel depths which may be generated by any geometry whatsoever. Hard to correctly smooth/blur out the noise without interfering with depth discontinuities, such as object edges (the occlusion should not "bleed" onto objects). Because SSAO operates only on the current depth buffer, it can miss occluding geometry that is not rasterized into the z-buffer and may produce undersampling-related artifacts.

See also Screen space directional occlusion (SSDO)

References

External links Finding Next Gen – CryEngine 2 Video showing SSAO in action Image Enhancement by Unsharp Masking the Depth Buffer Hardware Accelerated Ambient Occlusion Techniques on GPUs Overview on Screen Space Ambient Occlusion Techniques Real-Time Depth Buffer Based Ambient Occlusion Source code of SSAO shader used in Crysis Archived 2014-10-26 at the Wayback Machine Approximating Dynamic Global Illumination in Image Space Accumulative Screen Space Ambient Occlusion NVIDIA has integrated SSAO into drivers Several methods of SSAO are described in ShaderX7 book SSAO Shader ( Russian ) SSAO Tutorial, extension of the technique used in Crysis

Worked examples

Example 1 — a first encounter with Screen space ambient occlusion

Start with the simplest possible case. Write down what Screen space ambient occlusion claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Screen space ambient occlusion before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Screen space ambient occlusion ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Screen space ambient occlusion

In research
Screen space ambient occlusion appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Screen space ambient occlusion in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Screen space ambient occlusion is common in secondary-school and first-year university syllabi. It links to neighbouring topics 3D computer graphics, Computer graphics, Global illumination algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Screen space ambient occlusion outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Screen space ambient occlusion” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Screen space ambient occlusion in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Screen space ambient occlusion means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Screen space ambient occlusion out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Screen space ambient occlusion in simple terms?

Screen space ambient occlusion (SSAO) is a computer graphics technique for efficiently approximating the ambient occlusion effect in real time. It was developed by Vladimir Kajalin while working at Crytek and was used for the first time in 2007 by the video game Crysis, also developed by Crytek.

Why does Screen space ambient occlusion matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Screen space ambient occlusion?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Screen space ambient occlusion.

Tags

  • 3D computer graphics
  • Computer graphics
  • Global illumination algorithms
  • Shading

Keep exploring