How to make liquid top surface

Hello community,
I 'm trying how to make liquid material, and there is current progress.

liquidtop.png

I use position to decide liquid’s opacity, it looks fine on liquid side surface.
But I have no idea how to add liquid’s top surface(like water foam).

Does anyone has good ideas?

Hey man I am trying something similar to you but trying to use sphere masks. But it doesnt work when the object is rotated and starts to clip through the container. Did you manage to figure this out?

Bump
Bump
Bump