Sign in to follow this  
Waaayoff

Is SSAO view dependent?

Recommended Posts

I'm pretty sure it isn't but just want to make sure. I'm trying to implement a simple and practical approach to SSAO and i'm getting wrong results that also happen to be view dependent. In the image below, when i rotate the camera to look at the wall to the left, it becomes dark while the other wall lightens. I reconstruct position from depth and both positions and normals are in view space. What do these results mean?

 

rgzu.png

 

 

Share this post


Link to post
Share on other sites

Ok so i took another look at the code that uses position directly instead of reconstruction and found a bug. Fixed it and got the following result:

 

vwuy.png

 

Which looks correct, right? If so, it's the damn reconstruction code again. It just won't work!!

Edited by Waaayoff

Share this post


Link to post
Share on other sites

[url=http://www.iquilezles.org/blog/?p=1911]The last few paragraphs of this post[/url] explain the reconstruction from Z buffer quite nicely, but go ahead and show a bit of your code if you're still having troubles. Your second picture looks just like a typical SSAO, so your problem is indeed most likely in the reconstruction.

 

The real problem here is that corners [url=http://nothings.org/gamedev/ssao/]don't look like that[/url]. SSAO is a fakey trick and doesn't really resemble real world lighting too much. If you tone it down enough so it's not black noisy bars but a slight darkening at some places, it can be a nice artistic touch.

Edited by powly k

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