hmm, having some trouble with water - I'm trying to get the world coordinates of each point from just the x,y screen coord and z-depth. I think it should be possible but it isn't quite working
I've updated the download to include my attempts so far (as well as a couple of improvements to the rest that I've forgotten). If you use the EXAMPLE_SANDBOX you can see that the height of the water varies with the camera (I did take the camera position into account, not sure what's causing the bug). No waves, sun or surf yet, but has water depth colouring and faded edges.
edit: forgot to mention; this is very limited in size, because I can only fake an 8-bit zbuffer. If I could get a 16 or 32-bit buffer this wouldn't be limited in size.
I'm done with this for now, going back to my other project (which was the reason I started this). anybody else is welcome to make improvements.