openglshadow-mappingssao

Opengl : SSAO vs Shadow mapping


Literary every tutorial that has written an article on SSAO ends with 'dosent exactly produce realistic results'. We can get much more accurate shadows with shadow mapping without the extra memory required to store a texture[or an uniform array] full of random vectors for sampling or an extra blur pass to reduce banding so why still use SSAO?

I have also seen some tutorials combining SSAO and shadow mapping which seems like overkill to me. Both techniques are to produce shadows right?


Solution

  • They solve different problems and complement each other.

    SSAO solves ambient occlusion. Even if your point is in shadow, SSAO modifies the intensity so that more occluded areas are more dark. Shadow maps aren't that accurate.

    Here's a comparison image. The whole area is in the shadow, but with SSAO you can better see the curtain's shape (click it to open it larger so it's more apparent):

    enter image description here Shadow maps solve the visibility from light source, not taking into account light bouncing (SSAO fakes this by using the depth buffer).

    A scene rendered only using shadow maps looks more flat than a scene with SSAO and shadow maps.