Recently I made an attempt to code some examples of this technique based on existing on-line code.
My results were mixed, but interesting.
Two of the demos don’t really use “SSAO” but rather more of an edge detection algorithm that looks similar.
Performance is pretty bad…my intent was to get things working and learn the techniques rather than optimize. An obvious optimization would be to use smaller off screen FBO’s for the SSAO and then scale up after.
I cobbled together my own Render to Texture class also from examples I found because I needed a Depth attachment which current OF examples didn’t have.
There’s also an updated and slightly modified ofxShader addon that you’ll probably need to use.
The examples were based on these links:
http://www.idevgames.com/forum/showthre-…-149&page=4
http://mattisb0rgen.wordpress.com/2009/-…-ao-part-1/
http://iquilezles.org/www/articles/ssao/ssao.htm
http://www.gamerendering.com/category/l-…–lighting/
http://www.opengl.org/discussion-boards-…-98&fpart=2
If you make any improvements or optimizations please send them to me, or if you have better examples please share as well
One last thing - I found that for most of the examples using a small dithering radius caused really bad banding. I think this is normal - a result of the low freq. sampling (moiré effect). However I’d love to improve this somehow if anyone has any ideas…
You can find the code here, with Linux Codeblocks projects, but very easy to convert to win32 and osx. Make sure you have the following addons: ofxVectorMath, ofx3DUtils, ofx3DModelLoader and my version of ofxShader:
http://digitalstarcode.googlecode.com/f-…-ls-0.1.zip