I can’t take credit for this. The original node setup is from https://www.youtube.com/watch?v=4EZezYWyelM. I cleaned it up a bit, and made it more usable for the end user. Figured I should try it on beer.
EDIT: The following is modified, renders in less memory, and the actual shader is tweaked. I also noticed that the original had failed to upload, so now fixed.
You can get the blend for the beer scene from
beer.blend (2.5 MB) Warning - I had to do some stuff to get this from a 14Gb render to something my gfx cards will handle. I had to eventually render in CPU.
And if you just want the foam shader, See next post
Append into your scene.

