Water foam

I’ve asked this question at least three time and I haven’t even gotten a reply, I’m assuming the effect is either hard or just no body knows. I’m looking for a sea foam effect or beach line foam; however, I’m not trying to go all out. A simple flat effect will be perfect, how would I make this or does anyone have this?

Something almost exactly what I’m looking for

Bump

The most efficient way would be to manually bake it into the texture mapping. Just use a texture with foam on the edge, and do some vertex/UV animation.

A more automatic way is to check the depth buffer, and see do a comparison with the depth buffer and the geometry you’re rendering. If you do a Google search for “fun with shaders and the depth buffers” you should find an example of an intersection shader, and the same general principle could be applied to water foam.

The Unity environment effects include water that has foam. The shaders are included. Assets > Import > Environment.

Water4 in Unity has this functionality. Also you cn check out this shader which basically has the same foam only low poly… GitHub - danielzeller/Lowpoly-Water-Unity: Low poly water with edge/shore blend. Similar to the awesome water in Monument Valley.

Thanks that asset was great help and I was able to modify it to fit my needs!