Trying four different approaches to rendering a glass container filled with liquid.
- Liquid and glass shapes have been unioned into a single shape. This is obviously only a solution for when the container and the contents have the same material. In the case of water and glass at least the index of refraction is different, so even though this looks rather good, it is not technically correct and does not scale to more complicated scenes.
- The glass and the liquid are both separate, closed polysurfaces that fit into each other exactly. This is the naive approach which yields problems because the surface meshes are coincident.
- Same as (2), except the liquid shape is scaled up by 1%. As a result the shape of the water intersects the shape of the glass, fixing the coincidence problem but resulting in other weird side effects.
- Three separate surfaces all with their own material. IOR values picked to represent Air→Glass, Air→Water, and Glass→Water.
Long story short; use (1) if you can get away with it, (3) if you’re gunning for ‘good enough’ or (4) if you aim to impress.
IOR tests (no environment).3dm (8.2 MB)