Bubble Shader

by NM-8 in Materials, Shaders, Textures

This is a procedural surface shader for bubbles, soap, spray and foam adding realism to your productshots, bathrooms and kitchen renderings.

It works in CYCLES and EEVEE

The bubble structure is generated with parallax mapping resulting in spherical bubbles on the meshsurface, rather than flat discs.

It uses several reflective shaders to project an outer, an inner spehere, as well as inner segments which reflect sideway specular highlights, adding up to the complex glossy sparkling material we all know.

The shader is grouped into a handy shadernodegroup, which gives the most relevant parameters, like scale, transparency, translucency, and alpha to ensure a smooth and immersive integration into your scene. 

Transparency uses the bubbleshape while alpha just sets the transparency of the meshsurface, in order to easily blend it into your liquids or quickly set an overall transparency.

the size of the bubbles can change along the surface, so that you wont end up with squeezed textures! The shader input into segments of a particular scale, rather than smoothly changing the scale value according to your input (which would stretch and squeeze the texture).