# SSAO issues

## Recommended Posts

AzharulHaque    100
I am trying to implement screen space ambient occlusion using depth buffer only. And in order to achieve it i am using crytek approach.
The method is very simple and as follows:-

Depth Buffer calculation:-
1.Move position to viewspace in vertex shader and store it in pixelshader as ViewPos.z/farClip
AO calculation:-
1.Take current pixel say P and get its depth stored in the Depth Buffer.
2. Then sample points around current pixel i.e. P, and check whether the depth of the samples taken around P and depth at P are close or not. if close then its occluded otherwise not.

Now i have taken two ways to sample points around P. In both cases i am sampling the points circularally around the P with different angle offset but with different mathmatical function and settings(best possible).

From one i am getting this result

[URL=http://imageshack.us/photo/my-images/268/ambientocclusionmapping.png/][IMG]http://img268.imageshack.us/img268/8200/ambientocclusionmapping.png[/IMG][/URL]
http://imageshack.us/photo/my-images/268/ambientocclusionmapping.png/

From second i am getting this

[URL=http://imageshack.us/photo/my-images/821/ambientocclusionmapping.png/][IMG]http://img821.imageshack.us/img821/8200/ambientocclusionmapping.png[/IMG][/URL]
http://imageshack.us/photo/my-images/821/ambientocclusionmapping.png/

Now i need to know that atleast whether am i getting results closer enough or not?

Which one looks better to you?

what are the possible artifacts you are observing and how i can get rid off it.

Is there any better solution using depth buffer only as i have limitation of not using normal buffer

Current scene has 8096 face running on resolution 1025*526 with fps 60-64.
My app in running in my laptop with inbuilt ATI Mobility radeon HD 5470.
So here the app should run in the low end systems like general laptops or onboard graphics chips that has atleast shader 3.0 support with good fps.

I wont be able to provide any source code here.

thank you for your time and i hope you guys help me out here.