Jump to content
  • Advertisement
Sign in to follow this  
AzharulHaque

SSAO issues

This topic is 2577 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

ambientocclusionmapping.png
Uploaded with ImageShack.us
http://imageshack.us/photo/my-images/268/ambientocclusionmapping.png/

From second i am getting this

ambientocclusionmapping.png
Uploaded with ImageShack.us
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
Advertisement
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
The first image looks "correct" to me... Because only the parts of the spheres close to each other are occluded...

Share this post


Link to post
Share on other sites
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
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
Yeah you are right the jagged edges in the second one is due to the larger sampling area. When i was applying smaller radius it was not looking so cool.

Share this post


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

Technique 1

ambientocclusionmapping.png

Uploaded with ImageShack.us

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

ambientocclusionmapping.png

Uploaded with ImageShack.us

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

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

Technique 2

ambientocclusionmapping.png

Uploaded with ImageShack.us
http://img861.imageshack.us/i/ambientocclusionmapping.png/

ambientocclusionmapping.png

Uploaded with ImageShack.us
http://img89.imageshack.us/i/ambientocclusionmapping.png/

Noise is the problem here

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!