Hello, does anyone here have any suggestions on how to do Ambient Occlusion from a depth map? I have been trying for a very long time to figure out an equation, but have not been able to. Currently I am using:
Occlusion = 255 + ((LeftSample + RightSample + UpSample + DownSample) / 4) - CurrentPixel
It does this for every pixel on the screen being displayed. I am not currently looking for a language specific answer more of just some sort of equation I could use on every pixel of a depth map to get the ambient occlusion. Perhaps someone could just get me headed in the right direction?