9
Arch & Design Mater ial (mental ray) – Tips & Tricks 1573
the glass and an IOR of 1.5, and a second, closed
surfacefortheliquid,withthenormalspointing
outward and an IOR of 1.33, leaving a small air
gap between the container and the liquid.
This approach works, but can cause a problem:
When light goes from a higher IOR to a lower there
is a chance of an effect known as total internal
reflection (TIR). This is the effect you see when
diving into a swimming pool and then looking
up: You c an s ee the objects above the surface
only in a small circle straight above. Anything
below a certain angle shows only a reflection of the
pool and things b elow the surface. The larger the
difference in the IOR of the two media, the greater
thechanceofTIR.
So in our example, as the ray goes from glass
(IOR=1.5) to air, there is a large chance of TIR.
But in reality the ray would move from a medium
of IOR=1.5 to one of IOR=1.33, which is a much
smaller step with a much smaller chance of TIR.
This looks different:
Left: Correct refraction; R ight: the “air gap” method
Theresultontheleftisthecorrectone,buthow
it is obtained?
The solution is to rethink the modeling, and not to
think in terms of media, but in terms of interfaces.
In our example, we h ave three different interfaces,
wherewecanconsidertheIORastheratio
between the IORs of the outside and inside media:
• air-glass interface (IOR=1.5/1.0=1.5)
• air-liquid interface (IOR=1.33/1.0=1.33)
• glass-liquid interface (IOR=1.33/1.5=0.8)
Inthemostcommoncaseofaninterfacewithair,
theIORtouseistheIORofthemedia(becausethe
IOR of air is 1.0), whereas in an interface between
two different medi a, the situation is different.
To correctly model this scenario, then, we need
three surfaces, each with a different Arch & Design
material applied:
• the air-glass surface (blue), with normals
pointing out of the glass, covering the area
where air directly touches the glass, having an
IOR of 1.5
• the air-liquid surface (green), with nor ma ls
pointing out of the liquid, covering the area
where air directly touches the liquid, h aving an
IOR of 1.33
• the glass-liquid surface (red), with normals
pointing out of the liquid, covering the area
where the glass touches the liquid, having an
IOR of 0.8
The three interfaces for a liquid in a glass
By setting suitable Max Distance and Color At
MaxDistancevaluesforthetwoliquidmaterials
(to get a colored liquid), we obtain the g lass on the
left in the preceding rendered image.
Ocean and Water Surfaces
A water surface is a sligh tly different matter than a
visibly transparent liquid.
The ocean isn’t blue; it is reflective.Notmuchof
thelightthatpenetratesthesurfaceoftheocean
gets anywhere of interest. A small amount of light
is scattered back up again, doing a bit of literal
subsurface scattering.