The Quest for Great SSAO

April 10, 2012 General News 2 Comments

No, in fact, I haven't fallen out of love with graphics and stopped working on all of my ideas. On the contrary, I've been spending the past month or so working hard on writing an OpenGL engine from the ground up. I have several reasons for doing so, among the them, a purely-curiosity-driven desire to learn the world of GL, as well as the fact that school uses GL in all coding assignments. It's been a good experience and I'm progressing rapidly, but I must say, I've confirmed for myself once-and-for-all that DirectX is the better API, a least from an API standpoint (that is, considering only the interface, not necessarily the performance or functionality). Surely anyone out there who's written a deferred pipeline in both APIs would have to agree...

At any rate, I'm revisiting SSAO, since my HLSL implementation was rather lacking (although good enough to produce some cool screenshots). I've come up with a fairly nice algorithm that uses only a linear depth buffer and screen-space (no unprojecting/reprojecting), but does a little bit of work to approximate the tangent plane at a given point, making it more accurate than a naive screen-space algorithm. I'm sure there are still lots of artifacts and places for improvement, but I'm please with the look of it so far.

Of course, the occlusion there is dramatically exaggerated; I wouldn't dare turn it up that high in a serious game.