Amplify Water Shader Foam

It’s the same principle as shown in this tutorial by AnasEinea:

Even though it is made with shader graph I’m sure you can translate it to amplify. You use the scene depth to get the intersection with other objects