Water history in a deferred shader: wet sand on the beach

Water in games is often implemented with simple flat geometry augmented with an animation cycle to simulate small waves. In addition, sophisticated pixel shading operations are also integrated to simulate surface disturbance, refraction, color extinction etc, this improving the water's realism and quality. In this paper, we take advantage of the simplicity of the geometry to render water in a post processing fragment shader. Our approach shades pixels as water, based on the pixel's position in world space; a technique demonstrated by Toman [2009]. In Toman's work, world space coordinates are compared with an animated water level function to determine if a pixel is 'under water'. We extend this concept with additional tests to follow the history of interaction between the water and its container. Our system is therefore able to render surfaces that have been recently under water in varying degrees of 'dampness'. An ad-hoc drainage model is integrated to produce visually credible results.