Hey Roel!
Thanks for this nice work.
Unfortunately I couldn’t get this to work properly. This is all I’m getting:
I had to remove the last vector normalize from DirectionToNearstSurface function, otherwise it wouldn’t work. There seems to be some problems with DistanceFieldGradient. Water doesn’t react to obstacles and it’s not producing any foam either. DistanceFieldGradient just produces blue (RG masking just outputs zero), so it’s not surprising that it’s not working as it should.