I’m trying to create a water shader with some shoreline behavior. The overall effect I’m trying to pull off can be seen in this video:
at 26 seconds in, as the water comes up on the shore, you can see a thin line (not the foam hitting the shore, I already have that accomplished) coming towards the shore. I’m working on a stylized game, using cel shading and I rely on emission more than specularity for certain dynamic lighting pieces.
I already have the foam hitting the shore, by masking in a foam texture to the diffuse and emissive color channels, using the depth-fade function as the alpha. But I to get the smaller, thinner waves, I think I’ll need to use some form of subtractive depth fade to add in the thin lines, so that they align with the shore. What I think I need to do is set the fade depth further out than the reach of the foam, but somehow mask the area between the shore and the edge of the depth fade, so that only a thin line of it is rendered. Is this possible? And if so, how would I do this?
Here’s what I have so far, and what I’m shooting for: