This is the algorithm that I used:
1. Create an Framebuffer Object FBO (you can use TGLFBORenderer from GLScene)
2. Attach the color buffer to a texture (TGLFBORenderer can do it for you; or look at the source files, if you don't want to use GLScene)
3. Attach the depth buffer to a texture (TGLFBORenderer can do it for you)
4. Create your rotateMap texture (4x4 pixels is enough). You can imagine this texture as a sprite which will be imposed on the screen - this is your ambient shadow. (it seems to me that Bokeh Depth of Field uses similar technique)
5. Read about Ambient Occlusion, shader techinques and write your SSAO shader (depthMap+rotateMap); or find a solution on the internet.

screenshot9