Shore detection for water surfaces

Technically if it can work in a distance field it can also work in a texture, since you can encode distance fields as textures. It may just be there is an additional step needed to transform height date or whatever texture data you have into something more like a distance field. In general, blurring the values a ton will make it work better with something like gerstner waves.

It is very difficult to have a gerstner wave that reacts to the shoreline without making sure that the field has mostly continuous low curvature. Any sharp changes of any kind will cause a huge discontinuity in the wave. You need more of a very averaged direction towards the shore rather than an exact height field (though heightfield and local DF still useful for FX like wave crests hitting rocks in open water, the rock DF doesnt need to alter the wave direction just spawn foam + FX).

I have implemented a jump flooding method that can convert seeds into voronoi diagrams (look it up in the pixeljunk shooter paper), and next I want to make it work with landscape edges. All I should have to do is render the heightmap into an RT and detect pixels that straddle the waterZ (like sobel method) and encode those pixels as seeds and every other pixel as black and then run the jump flood. Fingers crossed. If I get something good I will share it with you guys.