Friday, July 11, 2008

Screen Space Ambient Occlusion (SSAO)

hi, since the game crysis (by crytek) every talks about it, so i thought to give it a try :)
ambient occlusion is a global shading method that computes how much a certain point need to be illuminated based on the surrounding objects.
in computer graphics we can calculated this by taking specific point in space and cast x rays in random directions from that point and for every ray hit we check add or subtract "illumination value" from that point based on the closeness of the object the ray hit.
the closest the surface we hit, the point will be less illuminated, so if we have a point in space surrounded by alot of objects the point will be darken while other point that does not have a lot of objects around will be lighten.
ssao approximate this by using the depth buffer, for every pixel we check/sample few pixels around and try to compute the amount of occlusion from those points based on the difference in the depth of the current pixel and the pixels around, this technique has a lot of tiny things to set up before you could make it looks good, because of that i'v chosen to use ati render monkey application to create and test my shaders.
i'm glade to say the after one day and a half i got it, and it looks very good.
here is a screenshot from my results:

No comments: