Shore detection for water surfaces

Even though distance to nearest works on landscape, my method for generating waves had waves appearing over sand bars, and not nice sine waves: the entire sandbar just faded between white and blue. My wave-generation method using a gradient around the shoreline did not work with depth-based methods because it had waves crashing and distorting where no waves should be crashing at all. Once again, the only thing you can get with distance based functions is a very simple foam around the object itself. The distance-field method does not render fast enough for games, and the depth-based method does not produce waves around objects. So the best method, the only method that is sure to work when determining the shoreline, is a texture mask. And don’t knock it! This is how Assassin’s Creed III made their water: with a 512x512 texture mask for the shoreline. And their water was lovely.
[/QUOTE]

The texture method is not working with 3D generated waves like the ocean community project or the physical water surface from the marketplace. It only works for flat water that does not crawl up and down on landscapes and other shore objects. Distance field based can do this.
A completely different technique, day dreaming really, might be to use wave particles that react naturally to objects and assign them foam. But this is a rather high-hanging fruit.