8476c61 adds a pretty good start at a proper water shader.
Here's a list of things that can be improved:
[ ] remove hardcoded surface light
either replace by rendering water surface to same normal map (will have to see how this looks) or by a second normal map (that'll make rendering lights a lot more expensive, but the same could be used to light smoke and similar effects!)
[ ] consider actual geometry surface normal
this isn't even passed into the shader right now, by considering this, larger-scale waves would look better
[x] consider flow
also not passed into the shader yet. once we do that, we'll have to smoothly transition from a regular surface to a flowing one, and back without strange artifacts
this might require even more texture samples, but hopefully not too many
also, since we project caustics onto the terrain below, we might run into issues having properly flowing caustics at shallower angles, this needs testing
alternatively, if flow adds foam or a generally more turbulent surface, maybe the caustics will hardly be visible and they can remain non-flowing
[ ] sort out tile edges
this is a big problem with deeper drops, if the difference is too high, we gotta make a clear cut in the geometry and use a different effect/shader for the flow (or maybe.. we can just use the same shader, where flowing 'down' is the final interpolated form of regular flow, or some not-too-special case)
using more detailed geometry, or tesselation might be needed
[ ] handle shallow water better
prevent flickering, maybe even update flow to not spread as fast and thin (add min flow?)
[ ] check on performance of generating geometry on the GPU
consider geometry shader, or tesselation, or a static mesh where only the actual fluid data is injected
8476c61 adds a pretty good start at a proper water shader.
Here's a list of things that can be improved: