To properly resolve transitions through different transparent media (glass, water and ice, for example) Octane uses "Nested Dielectrics" — a combination of a material priorities and intersecting geometry to help correctly resolve the different boundary interfaces when rendering. The different IOR volumes must overlap and be watertight. (Dielectric materials are anything non-metallic [non-conducting], and quite often, transparent.) 

Material Priority

Material Priority is used to differentiate the different IOR volumes from each other — materials of differing priorities are assigned to the different transparent objects. Priorities are numerically assigned lowest (-100) to highest (100). The Priority value is located in the Common tab of Octane materials, as shown in the following illustration. 



nested dielectrics priority




The diagram below shows how the liquid volume is intersecting/penetrating into the glass volume. The ice cubes are placed within the liquid volume (and breaking into the air above the liquid), as well as some condensation lining the surface of the glass wherever there is air touching the glass. Nested Dielectrics basically pushes the water inside the glass by delaying the shading of the liquid until it is no longer within the volume of the glass, rendering it correctly. The red sections will not be shaded at all.



The following image shows the correct result on the left, and with nested dielectrics disabled on the right. The difference can be subtle, but noticeable. Here, the glass material has a priority of 1 and an IOR of 1.5; the ice material has a priority of 2 and an IOR of 1.309 (feel free to cheat this value if need be); and the liquid material (bourbon, if you must know) has a priority of 0 and an IOR of 1.335. Lastly, the condensation has a priority of -1 and an IOR of 1.33. 



nested dielectrics




The lower priority surface will be ignored if it gets hit while the ray is inside a higher priority surface — in other words, the water is ignored until the ray exits the glass. Thus, the double reflection/total internal reflection between the water and the glass is avoided. That is basically how Nested Dielectrics work in Octane — as long as the ice has higher priority than water it will be correctly seen in the render. The condensation has a priority of -1 in this example, as it is water and the liquid in the glass is bourbon, a different IOR value — should condensation geometry occur within the liquid volume, the condensation would not be visible, since the condensation is a lower priority. Additionally, as the condensation priority is less than that of the glass, any interpenetration of the condensation inside of the glass will also be invisible (which is great for animation). 


How it works

In raytracing, when two volumes (objects, etc.) share a face, there is some ambiguity about how to present a realistic result. If the glass and the water are both sharing a surface, what material should a particular pixel in that boundary area be shaded with? Water or glass? Adding priority values to the materials representing the water and the glass, along with properly modeled intersecting surfaces, there is enough information to correctly shade a given pixel. 


By reducing the priority of the water to a value below that of the glass, and the condensation priority value above that of the glass, there is sufficient information to render out the results like the image above. As the water has lower priority than the ice and the water has lower priority than the glass, and since the ice does not actually intersect with the cup, there is no need to set a different priority. As condensation is likely to intersect with the glass, give it a higher priority. Change the priority of a surface only if two surfaces are intersecting with each other and need to be visually distinct.


Multiple Glasses of Water

In the case where there is a table full of glasses with water, ice and condensation, each sharing materials, everything still works. Each glass is localized to the contents it holds as well as the contents attached to it. It does not matter how many glasses there are; the process is only concerned with the local environment of the glass (in this example.)