Simple Nested Dielectrics in Ray Traced Images

Similar documents
Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Ray Tracing. Brian Curless CSEP 557 Fall 2016

CS 465 Program 5: Ray II

Shadows. COMP 575/770 Spring 2013

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

Photorealism: Ray Tracing

Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

Investigation 21A: Refraction of light

Point Cloud Filtering using Ray Casting by Eric Jensen 2012 The Basic Methodology

Ray Tracing. Outline. Ray Tracing: History

Lecture 11: Ray tracing (cont.)

Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

Building a Fast Ray Tracer

Ray Tracing. Kjetil Babington

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

Advanced Graphics. Path Tracing and Photon Mapping Part 2. Path Tracing and Photon Mapping

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

Computer Graphics and Image Processing Ray Tracing I

Ray tracing. EECS 487 March 19,

MIT Ray Tracing Ray Tracing

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Sung-Eui Yoon ( 윤성의 )

Ray Tracer Due date: April 27, 2011

COMPUTER GRAPHICS COURSE. Rendering Pipelines

CS 325 Computer Graphics

CS 4620 Program 4: Ray II

Review. Stephen J. Guy

The Rendering Equation. Computer Graphics CMU /15-662

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Photorealistic 3D Rendering for VW in Mobile Devices

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Lesson Plan: Refraction of light at boundaries OVERVIEW

Physically Realistic Ray Tracing

Raycast Rendering Maya 2013

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1

Computer Graphics. Ray Tracing. Based on slides by Dianna Xu, Bryn Mawr College

Ray Tracing I. Internet Raytracing Competition

Reading. 8. Distribution Ray Tracing. Required: Watt, sections 10.6,14.8. Further reading:

Intro to Ray-Tracing & Ray-Surface Acceleration

Lecture 10: Ray tracing

Photon Mapping. Michael Doggett Department of Computer Science Lund university

Distribution Ray Tracing

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Raytracing & Epsilon. Today. Last Time? Forward Ray Tracing. Does Ray Tracing Simulate Physics? Local Illumination

Computer Graphics Ray Casting. Matthias Teschner

EDAN30 Photorealistic Computer Graphics. Ray tracing. Michael Doggett Department of Computer Science Lund university. Copyright 2011 Michael Doggett

Refraction of Light Finding the Index of Refraction and the Critical Angle

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

REAL-TIME GPU PHOTON MAPPING. 1. Introduction

Improved Illumination Estimation for Photon Maps in Architectural Scenes

Rendering Hair-Like Objects with Indirect Illumination

521493S Computer Graphics. Exercise 3

Rendering. Mike Bailey. Rendering.pptx. The Rendering Equation

This work is about a new method for generating diffusion curve style images. Although this topic is dealing with non-photorealistic rendering, as you

Global Illumination. Why Global Illumination. Pros/Cons and Applications. What s Global Illumination

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

The Rendering Equation & Monte Carlo Ray Tracing

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Advanced Ray Tracing

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Lecture 7 Notes: 07 / 11. Reflection and refraction

Advanced Graphics. Global Illumination. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

Recall: Basic Ray Tracer

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

Ray Tracing With Adaptive Supersampling in Object Space

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

Assignment 6: Ray Tracing

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

What is it? How does it work? How do we use it?

Stencil Shadow Volumes

COMP371 COMPUTER GRAPHICS

Midterm Exam CS 184: Foundations of Computer Graphics page 1 of 11

Lecture 2 - Acceleration Structures

Solid Modeling. Ron Goldman Department of Computer Science Rice University

MITOCW MIT6_172_F10_lec18_300k-mp4

Ray Tracing. Shandong University

CS559 Computer Graphics Fall 2015

Visible-Surface Detection Methods. Chapter? Intro. to Computer Graphics Spring 2008, Y. G. Shin

CS 431/636 Advanced Rendering Techniques

CSCI 4972/6963 Advanced Computer Graphics Quiz 2 Tuesday April 17, 2007 noon-1:30pm

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

COMP 175 COMPUTER GRAPHICS. Lecture 11: Recursive Ray Tracer. COMP 175: Computer Graphics April 9, Erik Anderson 11 Recursive Ray Tracer

Approximating Refraction Kenneth Hurley Please send me comments/questions/suggestions

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. Radiosity

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Ray Tracing Performance Derby Final Project

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

MR Shaders Dielectric Materials Rendering Glass and Simple Caustics

4) Finish the spline here. To complete the spline, double click the last point or select the spline tool again.

Practical 2: Ray Tracing

COMPUTER GRAPHICS AND INTERACTION

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

Transcription:

Simple Nested Dielectrics in Ray Traced Images Charles M. Schmidt and Brian Budge University of Utah Abstract 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. 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]. However, most dielectric objects are part of a more complex scene and may be nested in other objects. For example, consider an ice cube partially submerged in a glass of water. The ice, water, and glass each have different indices of refraction which 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. 1

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 potentially 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 ensures they overlap. For example, if rendering a glass filled with water, the boundary 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 region would be treated as part of the glass. To determine which object a ray is effectively traveling 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 2

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 modifications 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 calculations refer to the spawning of reflection and refraction rays, lighting, shadowing, and other similar calculations that would contribute to the color discovered by 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 geometry. The only computation made 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 normal ray tracer. Unlike a standard ray 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 (depending on whether the refraction ray is entering or exiting this object respectively). 3

glass Interior list: water 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. glass water 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). Because 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. glass water Interior list: Glass, Water glass water The ray next strikes the other side of the glass. Because the glass is equal to the highest priority object in the interior list (itself) this is a true intersection. 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. The refraction ray from continues into the water. Interior list: 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. 4

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 ray is traveling outside all geometry. Usually this space is given the refractive index of air, although any index could be assigned. 3 Discussion The key contribution of this algorithm is that it allows objects to overlap in 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 significantly simplify the modeling of nested dielectrics. Consider 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 proposed 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 resolution. Only the glass boundaries would be modeled at high resolution because only these boundaries would be visible in the rendering. A second advantage of this method is that it makes the modeling of some surfaces unnecessary. If a single surface forms the boundary between two objects only the higher priority object needs to define this boundary. Consider gas bubbles 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 number of boundaries against which intersection calculations must be performed. 5

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 traveling through the 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 artifacts. The primary disadvantage of the algorithm is the constraint that nested geometry 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 sufficient 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 overall rendering time reduced by more than 5% compared to an unmodified ray tracer. 6

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 interior 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 cube models. This material is based upon work supported by the National Science Foundation under Grants: 9977218 and 9978099. 7

References [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. Communications of the ACM, 23(6):343 349, 1980. Web Information: http://www.acm.org/jgt/papers/schmidtbudge02 Charles Schmidt, University of Utah, School of Computing, 50 S. Central Campus Dr, Salt Lake City, UT (cms@cs.utah.edu) Brian Budge, University of Utah, School of Computing, 50 S. Central Campus Dr, Salt Lake City, UT (budge@cs.utah.edu) 8