Distance To Nearest Surface node still needs input. Can you try this?
Just opacity variation is a bit of a simple solution though. If we’re talking about something realistic with waves and foam that’s a whole different story depending on how far you want to go with that.