Thanks guys. Otakar (Jake) asked me about the problem of using terrain elevation for foam distribution, which was partly handled at the fuze, but here's a quick setup of the basics. You can use the blue nodes to convert the displacement of the perlin terrain (you can add a Y height to shift the foam to and from the coast), and/or use the distribution shader as a blender for the surface shader to get the foam restricted to the highest waves.