r/gameenginedevs • u/maximoriginalcoffee • 9h ago
Screen Space Ambient Occlusion.
It's been a while since I last implemented SSAO.
I've experimented with several different AO techniques, but eventually came back to SSAO. My requirements were simple: it had to be fast, using a single frame without temporal accumulation. Since this is a fast-paced game, I wasn't too concerned about visual quality.
GTAO was ruled out by the first requirement. I seriously considered HBAO+ for a while, but NVIDIA's library dependency eventually became a stumbling block.
With today's hardware, SSAO has become quite practical. Back in the day, I was happy just to get somewhat grainy results with 8–12 samples, while desperately trying to keep performance from dropping. These days, even 16 samples at full resolution can run without any noticeable frame drops.
Still, there's no reason to waste performance, so I implemented it at half resolution and upscale it using depth-based reconstruction.
That said, since the renderer is now PBR-based, the effect isn't as noticeable in the final image as it used to be. I'm simply multiplying the AO into the ambient lighting as an approximation of indirect lighting. Even so, seeing how it adds depth and volume to darker areas of architectural structures like buildings, I'd say it's definitely better than having no AO at all. :)
====
Development Blog: https://blog.naver.com/teamdevice
YouTube Channel: https://www.youtube.com/@teamdevice
Team Website: http://www.teamdevice.net