ArticlePDF Available

Simple Nested Dielectrics in Ray Traced Images


Abstract and Figures

This paper presents a simple method for modeling and rendering refractive objects that are nested within each other. The technique allows the use of simpler scene geometry and can even improve rendering time in some images. The algorithm can be easily added into an existing ray tracer and makes no assumptions about the drawing primitives that have been implemented.
Content may be subject to copyright.
Simple Nested Dielectrics in Ray Traced
Charles M. Schmidt and Brian Budge
University of Utah
This paper presents a simple method for modeling and rendering refractive
objects that are nested within each other. The technique allows the use of
simpler scene geometry and can even improve rendering time in some im-
ages. The algorithm can be easily added into an existing ray tracer and
makes no assumptions about the drawing primitives that have been imple-
1 Introduction
One of the chief advantages of ray tracing is that it provides a mathematically
simple method for rendering accurate refractions through dielectrics [3]. How-
ever, most dielectric objects are part of a more complex scene and may be nested
in other objects. For example, consideran ice cubepartially submergedin a glass
of water. The ice, water, and glass each have different indices of refractionwhich
would change the ray direction differently. Moreover, the change in ray direction
depends on both the refractive index of its current medium and of the medium it
is passing into. If a ray was entering ice from water, it would change direction
differently than if it was entering ice from air.
A common method for rendering nested dielectrics is to model the scene
ensuring that no two objects overlap. This can either be done using constructive
solid geometry (CSG) or by manual manipulations of the geometry. A small gap
is placed between objects to ensure that rays are never confused about which
object they are hitting. This method presents a challenge in that the gap must be
large enough so that floating point errors do not transpose the object borders, but
if the gap is too large it becomes a visible artifact in the rendered image. Our
method allows nested dielectrics without requiring the renderer to support CSG
primitives and without needing any gap between the nested objects. It can also
allow certain pieces of geometry to be modeled at a lower resolution than would
otherwise be necessary. Finally, the algorithm allows some surfaces to be ignored
by the renderer reducing the rendering time needed for some models.
Figure 1: The same scene rendered with different priorities. In the first image,
priorities decrease from left to right. In the second, the middle sphere has the
lowest priority. To make the difference more visible, the spheres have been given
the same refractive indices as the surrounding air.
2 Algorithm
Our method works by enforcing a strict hierarchy of closed geometry. All poten-
tially overlapping materials are represented as closed solids and given a priority
when they are defined. Our algorithm works by ensuring that if a ray is traveling
through multiple objects, only the object with the highest priority will have any
effect on the behavior of the ray. Essentially, the algorithm is a simplified form
of CSG applied to the refraction problem in that object interfaces are defined
by a geometric difference operation. This operation is controlled by the object
priorities. Figure 1 demonstrates a scene using two different sets of priorities.
For our algorithm nested objects should be modeled in such a way that en-
sures they overlap. For example,if rendering a glass filled with water, the bound-
ary of the water would be set between the inner and outer walls of the glass. The
modeler would assign a higher priority to the glass to ensure that, when a ray
passed through the overlapping region, this regionwould be treated as part of the
To determine which object a ray is effectivelytraveling through,the algorithm
uses a simple structure called an interior list. Interior lists are small arrays stored
with each ray that indicate which objects that ray is traveling through. Due to the
fact that objects overlap, a ray’s interior list may contain multiple objects. The
highest priority object of a ray’s interior list is the object which will influence the
ray’s behavior.
In order to handle the fact that objects overlap, all object intersections are
evaluated using the interior list and priority numbers. Since only the highest
priority object is considered to exist when multiple objects overlap, we have two
cases: the ray intersects an object with a priority greater than or equal to the
highest element in the ray’s interior list (called a true intersection), or the ray
intersects an object with a lower priority than this greatest interior list element
(called a false intersection). Rays with empty interior lists will always produce
true intersections. Examples of true and false intersections are shown in figure 2.
This algorithm can be utilized in virtually any ray casting scheme including
path tracing [2] and photon mapping [1] and should require only modest modi-
fications to most existing renderers. These modifications are added to keep the
interior list updated and to differentiate between true and false intersections.
2.1 False Ray Intersections
When a false intersection is encountered no color calculations are performed and
we simply continue searching for the next closest intersection. (“Color calcula-
tions” refer to the spawningof reflection and refraction rays, lighting,shadowing,
and other similar calculations that would contributeto the color discoveredby the
given ray.) This search is repeated until a true intersection is found or all possible
intersections have been shown to be false, the latter indicating the ray missed all
The only computationmade as a result of a false intersection is in the interior
list. The intersected object is added to or removed from the ray’s interior list
based on whether the ray entered or exited this object respectively.
2.2 True Ray Intersections
True intersections result in normal color calculations, just as they would in a nor-
mal ray tracer. Unlike a standardray tracer, however, the reflection and refraction
rays have interior lists which must be initialized. The reflection ray is simply
given a copy of the original ray’s interior list since the reflection ray crosses no
additional boundaries. The refraction ray, however, is created by crossing from
one object to another, and therefore would have a different interior list from the
original. The refraction ray starts by copying the interior list of its parent, but
then adds or removes the intersected object (dependingon whether the refraction
ray is entering or exiting this object respectively).
Interior list:
The ray intersects the glass from the outside. Since
the ray did not begin in any object (the interior list
is empty) this is guaranteed to be a true intersection.
We would compute the color values for this point.
The reflection ray would continue to use an empty
interior list. The refraction ray is shown in
Interior list: Glass
The refraction ray from continues into the glass.
It next strikes the border of the water (entering the
area where both water and glass are specified). Be-
cause the glass has a higher priority than water, the
intersection with the water is a false intersection.
The interior list is updated and the ray continues to
search for an intersection.
Interior list: Glass, Water
The ray next strikes the other side of the glass. Be-
cause the glass is equal to the highest priority ob-
ject in the interior list (itself) this is a true intersec-
tion. Color values for this point are calculated. The
reflection ray’s interior list would contain both the
glass and the water objects. The refraction ray is
shown in .
Interior list: Water
The refraction ray from continues into the water.
Figure 2: True and false ray intersections. Glass (red) has a higher priority than
water (blue). The dark red area indicates where both materials overlap. Note that
in a real image the ray direction between and and between and would
likely change due to refraction. (This was not done here to simplify the figure.)
There would be no change in direction between and since the intersection in
is false.
At the same time, to compute the direction of the refracted ray it is necessary
to know the refraction index of the current medium (the “from-index”)and of the
medium the ray will be transitioning into (the “to-index”). If the refraction ray is
entering the intersected object, the from-index would be the index of the highest
priority object in the original ray’s interior list and the to-index would be that of
the intersected object. If the refraction ray is exiting the intersected object, the
from-index would the the index of the intersected object and the to-index would
be the index of the highest priority object in the refraction ray’s interior list. If a
ray’s interior list is empty, this indicates that rayis traveling outside all geometry.
Usually this space is given the refractive index of air, although any index could
be assigned.
3 Discussion
The key contributionof this algorithm is that it allows objects to overlapin model
space while still producing correct borders in the rendered image. The method is
relatively simple, but still manages to produce strong performance.
3.1 Advantages
This algorithm can significantlysimplify the modelingof nested dielectrics. Con-
sider a glass filled with water. Previously, the water would have been modeled as
slightly smaller than the inside of the glass. In order to keep the gap between the
objects as small as possible the border of the water would need to be rendered
at high resolution to closely follow the glass’s surface. Using the method pro-
posed in this paper the sides of the water could be anywhere between the sides
of the glass. Since the sides of the water would only be used to mark the water’s
boundary and would never be rendered, they could be modeled at a lower reso-
lution. Only the glass boundaries would be modeled at high resolution because
only these boundaries would be visible in the rendering.
A second advantageof this method is that it makes the modeling of some sur-
faces unnecessary. If a single surface forms the boundary between two objects
only the higher priority object needs to define this boundary. Consider gas bub-
bles completely surrounded by water. Previously it would have been necessary
to model a border for the water surrounding the bubbles as well as modeling the
bubbles themselves. However, using our technique, if one gives the gas bubbles
a higher priority than the surrounding water only the bubbles would need to be
modeled. As a result, careful ordering of priorities can actually reduce the num-
ber of boundaries against which intersection calculations must be performed.
A third advantage is that, because false intersections do not require color
calculations, rendering time can actually be reduced in some models. Again,
consider a glass with water in it. In a normal ray tracer, color values would be
calculated when the ray entered the glass, exited the glass, and entered the water
for a total of three calculations. Using our algorithm, one of these intersections
would be false and would receive no further computation. As a result, the same
set of ray intersections would result only in two color computations.
3.2 Implementation and Limitations
In order to keep track of which objects a ray is inside, our implementation simply
toggles interior status of an object each time a ray crosses its boundary. If a ray
intersects an object and the object is not in the interior list then the ray must be
entering the object. If the intersected object is already in the interior list, the ray
is currently travelingthroughthe object’s interior and hence would exit the object
at this point. This technique fails when the ray has a singular intersection with
an object, such as along the object’s silhouette. The use of a more sophisticated
algorithm for determining which objects an ray was interior to at a given point
could most likely eliminate these errors. However, even when using our simple
toggle method, we found that standard anti-aliasing techniques removed most
The primary disadvantageof the algorithm is the constraint that nested geom-
etry must have overlapping borders. This requirement can provide some added
complexity, especially if the surrounding material is very thin. In most cases,
however, a simple scaling of the interior object by a small amount will be a suf-
ficient solution.
3.3 Efficiency
Our algorithm requires very little additional overhead. In our implementation,
when a false intersection is encountered, we simply moved the base of the ray to
the location of the false intersection and re-cast the ray in the same direction. This
process is repeated until the nearest intersection is a true intersection. Despite the
inefficiency of this method we found that the use of this algorithm had a minimal
impact on the overall time of the rendering and could, in some cases, actually
reduce the rendering time. Specifically, in scenes with no dielectrics we found
the algorithm to be only about 0.8% slower, while scenes with multiply nested
refractive objects, such as the glass in Figure 3,could have their overallrendering
time reduced by more than 5% compared to an unmodified ray tracer.
Figure 3: Glass with nested dielectrics. Priorities (from highest to lowest) are:
the glass, the ice cube, the air bubbles under the water, and the water.
Our implementation uses a short array of pointers to scene objects as the in-
terior list. Because it is unlikely that a ray will start from inside more than a
handful of objects the interior list need only be large enough to contain a few
elements. We found that the computations related to maintaining the interior list
accounted for less than 0.4% of the runtime of the program,even for scenes with
multiply nested objects.
Acknowledgments. Special thanks to Margarita Bratkova for creating the glass
and ice cubemodels. This material is based upon work supported by theNational
Science Foundation under Grants: 9977218 and 9978099.
[1] Henrik Wann Jensen. Realistic Image Synthesis Using Photon Mapping. A
K Peters, 2001.
[2] Peter Shirley. Realistic Ray Tracing. A K Peters, 2000.
[3] Turner Whitted. An improved illumination model for shaded display. Com-
munications of the ACM, 23(6):343–349,1980.
Web Information:
Charles Schmidt, University of Utah, School of Computing, 50 S. Central Cam-
pus Dr, Salt Lake City, UT (
Brian Budge, University of Utah, School of Computing, 50 S. Central Campus
Dr, Salt Lake City, UT (
... Our discussion of overlapping volumes was inspired by the treatment of nested dielectrics by Schmidt and Budge (2002), which describes a system for rendering refractive objects within each other. In fact, a system which implements index of refraction tracking and intersection priorities as described in that paper can be easily extended to track volumetric materials: a ???sh inside water contained within glass can be robustly rendered with volumetric scattering (the thin body of the ???sh), and with absorption (liquid and glass), while correctly tracking the relative indices of refraction at each interface, and not su???ering from precision problems at the geometric boundaries. ...
Conference Paper
Full-text available
This document might be out of date, please check online for an updated version. With significant advances in techniques, along with increasing computational power, path tracing has now become the predominant rendering method used in movie production. Thanks to these advances, volume rendering can now take full advantage of the path tracing revolution, allowing the creation of photoreal images that would not have been feasible only a few years ago. However, volume rendering also provides its own set of unique challenges that can be daunting to path tracer developers and researchers accustomed to dealing only with surfaces. While recent texts and materials have covered some of these challenges, to the best of our knowledge none have comprehensively done so, especially when confronted with the complexity and scale demands required by production. For example, the last volume rendering course at SIGGRAPH in 2011 discussed ray marching and precomputed lighting and shadowing, none of which are techniques advisable for production purposes in 2017.
... This hit distance is used to resolve the nesting of solids, so we can shade the cap with the material of the last entered solid (see mesh M 2 in Figure 40-5). Alternatively, one could use user-assigned priorities to resolve the nesting of solids [4]. ...
Full-text available
When inspecting or presenting detailed scenes, it is often necessary to clip away parts of the geometry to get a better view of the internals of a model. Although clipping can be performed directly on the geometry, this is a costly and complex operation, often preventing interactive visualizations. In this chapter we'll discuss how to accelerate complex Boolean visibility operations using the NVIDIA OptiX API. The method presented here does not require any preprocessing of the geometry and supports arbitrary Boolean clipping operations using arbitrary visibility shapes in real time. All ideas presented in this chapter apply equally well to the DirectX Raytracing and Vulkan Ray Tracing APIs.
Full-text available
Nested dielectrics refer to non-metallic objects which do not conduct electricity modelled within other non-metallic objects. It is a difficult problem to render in this situation, especially transparent objects. In 3D rendering, when nested dielectric objects need different physical rendering properties such as a glass of cola and ice for having realistic results from rendering, it can cause confusion in rendering and results in negative learning effects for students. In this research, we use 5E inquiry to teach nested dielectrics objects rendering. The assignment is given to the students to evaluate their understanding. We divide the rubric score into 3 parts: key concepts in physics of light absorption, refractive index followed by the 3D modelling approach, and finally, applying physics concepts for nested dielectric objects rendering. The results were analysed from students’ scores in each part. It is found that learning with this sequence, 20 percent of students can understand clearly, 68 percent partially understand and 12 percent misunderstand.
Conference Paper
In the past few years the movie industry has switched over from stochastic rasterisation approaches to using physically based light transport simulation: path tracing in production has become ubiquitous across studios. The new approach came with undisputed advantages such as consistent lighting, progressive previews, and fresh code bases. But also abandoning 30 years of experience meant some hard cuts affecting all stages such as lighting, look development, geometric modelling, scene description formats, the way we schedule for multi-threading, just to name a few. This means there is a rich set of people involved and as an expert in either one of these aspects it is easy to lose track of the big picture. This is part I of a full-day course, and it focuses on the necessary background knowledge. In this part, we would like to provide context for everybody interested in understanding the challenges behind writing renderers intended for movie production work. In particular we will give an insight into movie production requirements for new students and academic researchers. On the other side we will lay a solid mathematical foundation to develop new ideas to solve problems in this context. To further illustrate, part II of the course will focus on materials (acquisition and production requirements) and showcase practical efforts by prominent professionals in the field, pointing out unexpected challenges encountered in new shows and unsolved problems as well as room for future work wherever appropriate.
The Manuka rendering architecture has been designed in the spirit of the classic reyes rendering architecture: to enable the creation of visually rich computer generated imagery for visual effects in movie production. Following in the footsteps of reyes over the past 30 years, this means supporting extremely complex geometry, texturing, and shading. In the current generation of renderers, it is essential to support very accurate global illumination as a means to naturally tie together different assets in a picture. This is commonly achieved with Monte Carlo path tracing, using a paradigm often called shade on hit, in which the renderer alternates tracing rays with running shaders on the various ray hits. The shaders take the role of generating the inputs of the local material structure, which is then used by path-sampling logic to evaluate contributions and to inform what further rays to cast through the scene. We propose a shade before hit paradigm instead and minimise I/O strain on the system, leveraging locality of reference by running pattern generation shaders before we execute light transport simulation by path sampling. We describe a full architecture built around this approach, featuring spectral light transport and a flexible implementation of multiple importance sampling (mis), resulting in a system able to support a comparable amount of extensibility to what made the reyes rendering architecture successful over many decades.
Sony Imageworks’ implementation of the Arnold renderer is a fork of the commercial product of the same name, which has evolved independently since around 2009. This article focuses on the design choices that are unique to this version and have tailored the renderer to the specific requirements of film rendering at our studio. We detail our approach to subdivision surface tessellation, hair rendering, sampling, and variance reduction techniques, as well as a description of our open source texturing and shading language components. We also discuss some ideas we once implemented but have since discarded to highlight the evolution of the software over the years.
The creation of photorealistic images of three-dimensional models is central to computer graphics. Photon mapping, an extension of ray tracing, makes it possible to efficiently simulate global illumination in complex scenes. Photon mapping can simulate caustics (focused light, like shimmering waves at the bottom of a swimming pool), diffuse inter-reflections (e.g., the bleeding of colored light from a red wall onto a white floor, giving the floor a reddish tint), and participating media (such as clouds or smoke). This book is a practical guide to photon mapping; it provides both the theory and the practical insight necessary to implement photon mapping and simulate all types of direct and indirect illumination efficiently.
The creation of photorealistic images of three-dimensional models is central to computer graphics. Photon mapping, an extension of ray tracing, makes it possible to efficiently simulate global illumination in complex scenes. Photon mapping can simulate caustics (focused light, like shimmering waves at the bottom of a swimming pool), diffuse inter-reflections (e.g., the bleeding of colored light from a red wall onto a white floor, giving the floor a reddish tint), and participating media (such as clouds or smoke). This book is a practical guide to photon mapping; it provides both the theory and the practical insight necessary to implement photon mapping and simulate all types of direct and indirect illumination efficiently.
To accurately render a scene, global illumination information that affects the intensity of each pixel of the image must be known at the time the intensity is calculated. In a simplified form, this information is stored in a tree of “rays” extending from the viewer to the first surface encountered and from there to other surfaces and to the light sources. The visible surface algorithm creates this tree for each pixel of the display and passes it to the shader. The shader then traverses the tree to determine the intensity of the light received by the viewer. Consideration of all of these factors allows the shader to accurately simulate true reflection, shadows, and refraction as well as the effects simulated by conventional shaders. Anti-aliasing is included as an integral part of the visibility calculations. Surfaces displayed include curved as well as polygonal surfaces.