I created the ocean water & shore foam shaders fairly early on during my time working on Spirit Crossing. I took inspiration from the look of the water in The Legend Of Zelda: The Wind Waker, as well as taking cues from anime (in particular, I thought about the way 90s anime tended to have a sparkling “shimmer” effect on the water that I wanted to capture).
A handpainted tiling texture was used to provide the foamy “crest” pattern, with a procedural sine/cosine warp effect applied in shader.Various layers of the above image at different speeds were masked against each other to provide both the appearance of things underneath the surface as well as an extra layer of specular highlights (in addition to the actual specular highlights around the sun)The shore foam texture packs multiple channels together – one channel contains a UV offset, and another channel contains the foam texture which is sampled with that UV offset. A Curve Table is used to drive the animation of the texture layers.