Underwater Caustics

I subscribe to several guys building game engines that use youtube to showcase their work – the ‘Wicked Engine’ being one of my favourites, there are prolific updates that often show cutting edge game engine rendering.

Recently a video popped up showing underwater caustic simulation and it is actually a pretty good case of ‘fakery’ (isn’t all game build fakery of sorts though). So using that as inspiration I delved in to the open source to see if I could replicate/duplicate in the ‘Cogwheel Engine’.

[note this is a ‘time travel’ post – with a retro fitted blog posting date matching the approximate time the work was completed]

HBAO – Ambient Occlusion

Last year I looked at SSAO techniques (Screen Space Ambient Occlusion) and a fellow game developer mentioned HBAO to me (Horizon Based Ambient Occlusion). As post processing screen based effects are often the most rewarding to work on I thought I would investigate HBAO compared to SSAO. I found that there was a significant improvement – almost to the point that the HBAO first pass rendering is good enough – it may not actually need the blurring shader pass that typically follows SSAO.

I tested on static geometry with a stable camera:

hbao – no blur
hbao – with blur

I had problems with SSAO in that when characters or the player camera is in motion across geometry the SSAO rendering would be very noisy and ‘swim’, HBAO however is very stable. A test on a character confirmed this.

Isolated HBAO on a character without and with blur
character on left has no HBAO, on the right has blurred HBAO applied

[note this is a ‘time travel’ post – with a retro fitted blog posting date matching the approximate time the work was completed]