Skip navigation.

A Blag About Graphics and Programming

...and Stuff

SSAO The Wrong Way


Apparently everybody and their uncle is doing screen-space ambient occlusion, so I've decided to hack-up my own version. As you can tell from the screenshot, I failed.

The basic idea is that you take the depth of a pixel and compare it to depths of pixels that are around it. If they are closer to the camera- the pixel is occluded and therefore receives less ambient light.
I can see two main problems:
  1. If a surface is almost parallel to the viewing direction (like the "floor" in the screenshot), It "occludes" itself: take the depth of a pixel, and compare it to the depth of a pixel just below it. It is closer to the camera, and ends up "occluding" the pixel above it. This is obviously wrong.
  2. Occlusion factor grows as you get further away from the camera, because the difference in depth of two neighbouring pixels becomes bigger (this can also be seen on the "floor"- it becomes darker as it's getting further away).
    I think this could be solved, by scaling something somewhere according to depth, just have to guess what and where...
The first problem is a bit more complicated, I have a feeling that you need to have information about surface normals.

Better Late Than NeverSSAO: Double Fail

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

January 2010
M T W T F S S
December 2009February 2010
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31