Sign in to follow this  
AzharulHaque

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]
Uploaded with [URL=http://imageshack.us]ImageShack.us[/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]
Uploaded with [URL=http://imageshack.us]ImageShack.us[/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.

Share this post


Link to post
Share on other sites
Enalis    333
Well right off the bat if you were going to say... multiply this by your light buffer's output then I'd say the first one. Of course there are numerous combination techniques for post processing. However the first one does appear to be more like an edge detection filter. The second one's shadow approximations look more accurate. Just a thought. Cheers! :)

Share this post


Link to post
Share on other sites
AzharulHaque    100
Thanks for the replies.

First one needs more sampling and with little larger radius but doing so it was asking me for good blurring. Right now its just 4x4 blur to both one.

second one looks more closer but its grayish color making scene darker.

If anyone have tried variance SSAO please let me know if it is not so heavy in terms of performance for the mid range graphics card and also gives good visual.

Share this post


Link to post
Share on other sites
Jason Z    6436
They both have undesired artifacts. The first one has some high frequency edges in it - ambient occlusion should exhibit very soft changes over a surface, and there are many places where I see shapes in the slightly occluded areas.

The second one seems to be adding occlusion quite far from where the occluding objects are. One could say that this is due to a large sampling radius, but the left and right hand sides have different bands, so I'm not sure what the issue is. In addition, there is some strange grid-like noise in the image. Is it being upsampled from a smaller image?

In either case, you aren't too far off from a good solution. Keep tweaking and see what you can do :).

Share this post


Link to post
Share on other sites
AzharulHaque    100
Here are further improvements of my SSAO.

Technique 1

[URL=http://img20.imageshack.us/i/ambientocclusionmapping.png/][IMG]http://img20.imageshack.us/img20/8200/ambientocclusionmapping.png[/IMG][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

http://img20.imageshack.us/i/ambientocclusionmapping.png/

[URL=http://img825.imageshack.us/i/ambientocclusionmapping.png/][IMG]http://img825.imageshack.us/img825/8200/ambientocclusionmapping.png[/IMG][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

http://img825.imageshack.us/i/ambientocclusionmapping.png/

Image jagginess has been removed... looks dull but can be corrected by increaing intensity.

Technique 2

[URL=http://img861.imageshack.us/i/ambientocclusionmapping.png/][IMG]http://img861.imageshack.us/img861/8200/ambientocclusionmapping.png[/IMG][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]
http://img861.imageshack.us/i/ambientocclusionmapping.png/

[URL=http://img89.imageshack.us/i/ambientocclusionmapping.png/][IMG]http://img89.imageshack.us/img89/8200/ambientocclusionmapping.png[/IMG][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]
http://img89.imageshack.us/i/ambientocclusionmapping.png/

Noise is the problem here

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this