Ray Tracing through Viewing Portals

Similar documents
Topics and things to know about them:

Spatial Data Structures

Lighting. Figure 10.1

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

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

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

Spatial Data Structures

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

CPSC GLOBAL ILLUMINATION

Recursive Ray Tracing. Ron Goldman Department of Computer Science Rice University

Global Illumination The Game of Light Transport. Jian Huang

Spatial Data Structures

Ray Tracing. Kjetil Babington

Spatial Data Structures

The Traditional Graphics Pipeline

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Introduction to 3D Concepts

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

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

Spatial Data Structures

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

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

CS 325 Computer Graphics

Speeding up your game

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

Photorealism: Ray Tracing

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Graphics for VEs. Ruth Aylett

Lecture 11: Ray tracing (cont.)

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

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

Virtual Reality for Human Computer Interaction

The feature set you are required to implement in your ray tracer is as follows (by order from easy to hard):

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 457 Autumn 2017

BCC Sphere Transition

1999, Denis Zorin. Ray tracing

Ray Tracer Due date: April 27, 2011

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

Scalable multi-gpu cloud raytracing with OpenGL

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

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

Shading, Advanced Rendering. Week 7, Wed Feb 28

COMP371 COMPUTER GRAPHICS

Lecture 12: Advanced Rendering

Computer Graphics Project

A Brief Overview of. Global Illumination. Thomas Larsson, Afshin Ameri Mälardalen University

CS 563 Advanced Topics in Computer Graphics QSplat. by Matt Maziarz

Computer Graphics Ray Casting. Matthias Teschner

Chapter 32 Light: Reflection and Refraction. Copyright 2009 Pearson Education, Inc.

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Rendering Smoke & Clouds

Computer Graphics. Lecture 9 Environment mapping, Mirroring

CEng 477 Introduction to Computer Graphics Fall

Graphics for VEs. Ruth Aylett

Supplement to Lecture 16

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

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

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Global Illumination. COMP 575/770 Spring 2013

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

Physically-Based Laser Simulation

Homework #2. Shading, Ray Tracing, and Texture Mapping

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

Assignment 6: Ray Tracing

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

Ray-Tracing. Misha Kazhdan

Light: Geometric Optics

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

CS 428: Fall Introduction to. Raytracing. Andrew Nealen, Rutgers, /18/2009 1

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

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

Local vs. Global Illumination & Radiosity

Draw Guide. Chapter 7 Working with 3D Objects

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

Distribution Ray Tracing

Computer Graphics. Illumination and Shading

Programming projects. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer

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.

Ray Tracing. Shandong University

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Shading, lighting, & BRDF Theory. Cliff Lindsay, PHD

Comp 410/510 Computer Graphics. Spring Shading

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

Shading. Brian Curless CSE 557 Autumn 2017

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

Image-based Lighting

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

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

Transcription:

Ray Tracing through Viewing Portals Introduction Chris Young Igor Stolarsky April 23, 2008 This paper presents a method for ray tracing scenes containing viewing portals circular planes that act as windows between two disassociated view points in 3D space. In this regard, we implement them using recursive ray tracing and the casting of shadow rays through portals. Related Works Inspiration for this paper was drawn from the Valve Corporation video game Portal which implemented a similar idea with a non-ray traced, camera based method. This paper also employs and builds upon traditional distributed ray tracing methods as described by Cook et al (1984) [1]. Motivation We wanted to extend the ray tracing method to allow for the inclusion of portals, which would allow scenes that simultaneously depict multiple viewpoints within the scene. In doing this, we endeavored to define how these portals would intuitively work and achieve a faithful representation of that in the rendering. This would enable new possibilities in ray traced scene creation that would that otherwise be unavailable. For example, it would allow for an object to be shown from multiple angles while still retaining spatial relationships, an effect that would not be achievable simply with mirrors. This could then be applied to architectural or artistic modeling, in which such spatial relations could be important. Technique Portal Definition In our implementation, a portal is a two dimensional circle in space and is linked with another portal. Each portal has a front face that it can be viewed from and a baseline, which define the up direction for image seen through it. When looking through a portal, the scene in the portal should appear as though one were looking out of the front face of the linked portal with the view aligned with the up direction of the baseline. Portals can thus be seen as a window split into two disassociated panes which each contain a scene from the point of view of the other as though they were still connected.

Representation A portal is represented in 3D space through an extension of spherical coordinates. As such, it is modeled by six parameters: 3D center position, theta, phi, rho, radius, and a reference to the portal linked to this one, all drawn from a modified.obj format. By default, a portal is a circle flat on the x-y plane with a normal along the z-axis and a baseline along the x-axis. The baseline provides an angular reference point for points on the portal. The portal can then be defined by the area swept out by the rotation of the baseline about the normal. A portal is then oriented by taking the standard definition provided above and rotating the normal and baseline phi radians in x-z plane and theta radians in the x-y plane, in that order. Thus, the swept area of the baseline and normal can be made to face any direction. However, the position of the baseline relative to the normal cannot be set through these rotations alone. For this, the internal angular offset of rho (a rotation about the normal) is used to align the baseline to the proper orientation within the portal. Ray Tracing Ray-portal intersection is computed by solving the implicit portal equation and explicit ray equation. To do this, first apply transformations to align the portal in the x-y plane, by rotating the portal according to its parameters. Then apply the same transformation to the ray. Finally, solve the implicit portal (circle) equation and explicit ray equation for the point of intersection relative to the portal in radial coordinates the angle from the baseline and distance from the center. Once the relative point of intersection has been found on the portal hit by the ray, the respective point on the link portal is found by applying the relative coordinates of the intersection to the global parameters of the linked portal. Note that because the portals are connected back to back, this means that the relative position and direction of the ray in the linked portal will be reversed across the plane of the baseline and the normal. A new ray is then created at that point with the direction of the original, intersection similarly transformed in the same manner as the intersection location and traced through the scene. The answer is then recursively passed back to the original ray.

Lighting Intuitively, light coming through a portal would result in a cone of light being emitted through the linked portal, like light coming into a room through a window. To attempt to create this effect, we applied several methods of lighting through portals. The first method was a very naïve treatment of each portal as an area light source. To determine the amount of light emitted by a portal, the amount of light reaching its linked portal from light sources in the scene was calculated by the following equation: cosθ cosθ l p i emit = lemit * Vlp * 2 l r Ai A p Note that this is to some extent derived from the radiosity equation for computing form-factors. Some liberty was taken, however, in order to achieve acceptable results. Each point would then, in addition to shooting shadow rays towards all light sources in the scene, shoot shadow rays towards all portals in the scene and process the shadow in the same way. The results of this method, described in the following section, were unsatisfactory, as they did not capture the desired conic property any point to which the portal was visible was lit. The second method was to recursively cast shadow ray towards the center of all portals in the scene to determine if they hit a light source. The shadow rays were transformed in the same method as visible rays going through portals and recursively reported any emitted light that they struck. This nearly captures the conic effect predicted above, but will only create lit areas in the shape of the area light. To achieve a smoother, more accurate visual at the cost of time, stochastic sampling was applied, shooting multiple rays randomly towards each portal. The stochastic method resulted in marked improvement over the other methods, as delineated below. Results To demonstrate our implementation, a number of scenes were created to show some of the different possibilities with this technique. All scenes used two reflective spheres, the smaller of which was tinted red, in a large white plane with a blue background as subject matter.

Basic A portal facing the viewer was placed behind the sphere and a second portal, also facing the viewer was placed above the spheres. The spheres can be seen in the second portal as visible from the first. Infinite Hallway The two portals are placed facing each other with the spheres in between, creating an infinite hallway effect similar to standing in between two mirrors. Infinite Spiral Similar to Infinite Hallway, but one of the portals baselines is offset slightly, leading each successive image to be rotated by that offset from the last. Aerial A portal is placed above the spheres, facing down and another, larger portal is placed in the air facing the viewer. The spheres appear to be larger in the portal facing the viewer. The orientation of the portals allows for complex ray paths to be traced. Light (with Area Light) One portal is placed in the air, directly beneath and facing a light source and the other is placed on the ground near the spheres. When traced with the naïve approach to lighting, light is even across the entire visible range of the portal. Tracing a single shadow through portals results in a lit area in the shape of the scene s light source because the only pixels getting light are the ones positioned to hit the light in a one to one ratio. Stochastic sampling yields the best looking result, giving a gradient of light that reflects more accurately which points would actually be lit through the portal, but needs a very high sampling rate in order to look good. Light (without Area Light) The same as Light (with Area Light) but the area light source blocked from reaching the scene, leaving the land bound portal as the only source of light. This accentuates the individual characteristics of each lighting model. The naïve method is completely nondirectional, a single shadow ray isn t very smooth, and stochastic sampling yields the best, though most expensive result. Conclusion While relatively undeveloped, this technique shows much promise. Portals were rendered to pleasing effect and basic lighting was implemented without tremendous effort in a

relatively short period of time and without excessively high computation time. Slight short comings were found in the lighting implementation in the sense that a large quantity of shadow rays must be employed to yield a good result, greatly slowing down the rendering. The method described in this paper leaves a lot of possibility for extension. Some possibilities for future work include: adding portal attributes such as clouding, scattering of intersecting rays, transparency, etc; developing a more effective lighting model, one that better represents light coming from the source through a portal such as photon mapping; adding interaction between portals and objects; radiosity through portals for ambient light. Work Breakdown Most of the project was a combined effort with both contributors working simultaneously. The following is the breakdown of individual tasks. Igor -.obj Modification and data loading - OpenGL portal representation - Lighting via shadow rays through portals Chris - Portal object - Ray tracing - Naïve lighting References [1] Cook R., Porter T., Carpenter L. Distributed Ray Tracing July, 1984. Computer Graphics (Proceeding of SIGGRAPH 84) 18, 3, 137-144.

Screenshots Basic portal scene Infinite hallway scene Infinite Spiral scene

Aerial portal scene

Plain light scene

Blocked light scene