I implemented SSAO in my game based on the tutorial at gamerendering.com. But the results I get are disappointing. Instead of a smooth effect as seen in the nvidia demos, my implementation causes either squashy dark noise or results in a huge performance hit for all the blurring.

This is my scene without SSAO applied.

scene simply without SSAO

And this is how the result looks.

scene with ugly SSAO

For now I use the same code as provided in the example I linked above. How can I improve the result of the ambient occlusion shader? A lot of blurring seems to be very slow on the GPU. I would like to get a result similar to this by Nvidia. How do they do that?

  • 2
    \$\begingroup\$ Hard to answer anything more than "follow the tutorial". If you are having trouble following the tutorial, there's not much we can answer here without more details. \$\endgroup\$
    – House
    Mar 22, 2013 at 17:26
  • \$\begingroup\$ I think I followed the tutorial correctly. After that I tweaked the parameters to improve the result. But it's far away from the results I've seen all over the web. My question isn't about the tutorial, it's about a way I can improve the implementation. \$\endgroup\$
    – danijar
    Mar 22, 2013 at 17:31

1 Answer 1


SSAO is frequently implemented with noisy sampling, plus a bilateral filter to smooth things out while preserving sharp edges. The tutorial only mentions this in passing in the second paragraph, so perhaps you missed it:

This SSAO term is saved to the red channel to the texture. This result must be blurred before combined with the original scene render. The blur can for example be a bilateral blur.

From your screenshots, it appears you've implemented the base SSAO effect, but without the bilateral filter. There was a SIGGRAPH course on bilateral filtering in graphics that you might want to check out for additional information.

  • \$\begingroup\$ I use filtering but it might be a naive approach. I just average over all pixels in a given distance. With a distance of ten or more pixels, the results are nice but the framerate drops from 60 to around 15 frame per second. \$\endgroup\$
    – danijar
    Mar 22, 2013 at 17:38
  • \$\begingroup\$ @sharethis There are definitely better ways to do filtering. First off, you can do a 1D horizontal blur followed by a 1D vertical blur. For a box filter or Gaussian filter this is mathematically equivalent to a 2D blur, but much cheaper. For other types of filters it's a useful approach as well, but may introduce artifacts. Second, you can generate SSAO at a lower resolution, like 1/2 or 1/4 of screen resolution, and blur it at that size. That will also make the blur much cheaper. \$\endgroup\$ Mar 22, 2013 at 17:45
  • \$\begingroup\$ Thanks for your explanation. I like the idea of lower resolution sampling. Unfortunately I have no clue how to do that yet. But maybe this is another question. \$\endgroup\$
    – danijar
    Mar 22, 2013 at 19:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .