Guide / Materials
Nested Dielectrics
A drink is three objects that occupy the same space: the glass, the liquid and the ice. Cycles alone bends light at every surface it meets, including the surfaces buried inside other objects, so overlapping objects render wrong and modellers cut the meshes apart by hand. Reblend fixes this with a priority per object. Works with every method.
- Model each object as a closed mesh and let them overlap a little: the liquid slightly into the glass wall, the ice fully inside the liquid. Never let two surfaces sit exactly on top of each other.
- Give each object its own Glass, Refraction or Principled material with the right IOR. The colour of a liquid goes in a Volume Absorption node, not on the Glass BSDF, where it would not show.
- That is all. With Render Properties → Light Paths → Nested Dielectrics → Automatic Priorities on, the default, the objects are ordered by size, the smaller one higher: the glass wall, the ice and any bubbles win over the liquid.
Where objects overlap, the higher priority wins, and at every boundary the light bends as it should between the two materials, glass to liquid rather than glass to air.
An object gets an automatic priority when it is a closed mesh, its material is a Glass or Refraction BSDF or a Principled BSDF with Transmission above 0 (not Thin Walled), and it overlaps another such object. Everything else takes no part, so scenes without overlapping glass render exactly as before.
To decide yourself, set Object Properties → Shading → Nested Dielectrics → Priority. Any number above 0 ranks above every automatic priority, and higher wins. Do this when an ice cube cuts into the glass wall (give the glass 1, so the wall stays solid) or when an object is bigger than the liquid around it. With Automatic Priorities off, only objects with a priority above 0 take part.
Limits in this version: Shadow Caustics does not know about priorities (Photon Caustics does); shadow rays through refractive surfaces without transparent shadows are blocked as they are in Blender; subsurface, coat and thin-wall materials ignore priorities.