Sign in to follow this  
GuyWithBeard

SSAO and edge artifacts

Recommended Posts

Hey,

 

I have been looking over my slightly broken SSAO and I have one last problem. I render the normal/depth map at half res, and after that the ambient map at half res. After that I do a bilateral blur on the ambient map, comparing the main pixel normal and depth with the surrounding pixels' normal and depth, to make sure I preserve the edge discontinuities. This results in this nice looking ambient map:

 

ssao_ambient.png

 

However, when it comes to using the ambient map I get problems around the edges as the ambient map is half res, resulting in the nasty looking halo-effects seen here:

 

ssao_final.png

 

It seems that most people are rendering their SSAO at half res though, for performance reasons, so I would like to know how they deal with the problem of different resolutions in the ambient map and final buffer, and how to combine them nicely.

 

Thanks!

Edited by GuyWithBeard

Share this post


Link to post
Share on other sites

Thanks for the link but I am not prepared to rewrite the whole thing right now. I was more looking for tips on how to tackle and/or improve the current system. Regarding your second tip, I think the problem with rendering full res SSAO is that the blur pass gets very expensive.

 

Anyway, I was able to improve my system quite a bit by changing the blur pass shader to not discard pixels across edges completely, but rather include them with a much lower weigth (I am currently using 0.25 of the original). This results in the following:

 

ssao_final2.png

 

There are still some halo pixels visible on the right, but overall the result is much nicer, so I think I am going to go with this for now.

Edited by GuyWithBeard

Share this post


Link to post
Share on other sites

I don't? I render a combined view space normal and depth buffer at half resolution as the first thing in the SSAO.

Usually second geometry pass is way more expensive than doing full res SSAO.

Share this post


Link to post
Share on other sites

 

I don't? I render a combined view space normal and depth buffer at half resolution as the first thing in the SSAO.

Usually second geometry pass is way more expensive than doing full res SSAO.

 

That may be the case, however since I am working with forward rendering I need to do a geometry pass to get the view space normals. If you are doing deferred then I guess you have a point.

Share this post


Link to post
Share on other sites

Can't you do a single geometry pass that writes normals too? ie, two outputs, normal forward lighting pass + an additional output for normals. Then you grab that target and use it for SSAO.

This would basically turns out full deferred. SSAO should be only applied for indirect illumination which will need more information per pixel than depth and normal.

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