C# implementation of http://freespace.virgin.net/hugo.elias/graphics/x_water.htm