View Full Version : SSAO edge cases, how to handle them?

Keith Z. Leonard
09-09-2008, 06:39 PM
I have what I think is a pretty decent SSAO system setup, but I get some odd artifacts near the edges where the random samples are off of the pre-rendered depth/normal buffer. In this screen shot I merely reject those samples, but you can see that at times they are all of the samples available given that there are a limited number of samples being taken. Anyway, you can see that the occlusion goes away toward the screen edges.

I was wondering if anyone had a better way of handling this? I also have tried clamping the samples and also if the screen x or y is negative, just negating it. All have had some rather unfortunate artifacts.


09-10-2008, 02:17 AM
Do you have a link to the technique you're using handy?

Sight unseen I'd probably just render a slightly larger view of the scene then crop it to the viewport. Otherwise, looks like good old fashioned variance to me - if you're random sampling, that's to be expected.

09-10-2008, 04:59 PM
Have you tried using repeating or mirroring texture sampling.

09-14-2008, 05:53 AM
What about rendering to a little larger texture and omitting the margins according to your kernel size?