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

Similar documents
COMP371 COMPUTER GRAPHICS

Ray Tracing. Local Illumination. Object Space: Global Illumination. Image Space: Backward Ray Tracing. First idea: Forward Ray Tracing

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

Photorealism: Ray Tracing

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

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

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

Raytracing. COSC 4328/5327 Scott A. King

Global Illumination. COMP 575/770 Spring 2013

Lighting and Shading

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

Rendering Part I (Basics & Ray tracing) Lecture 25 December 1, 2015

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

Supplement to Lecture 16

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

Indirect Illumination

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

Ray Tracing. Kjetil Babington

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

Ray Tracer Due date: April 27, 2011

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

Indirect Illumination

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

COMPLETION OF Z-buffer Graphics Pipeline

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

Lecture 18: Primer on Ray Tracing Techniques

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

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

CS 325 Computer Graphics

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

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

Illumination Algorithms

RAYTRACING. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION. HPCViz, KTH Royal Institute of Technology, Sweden

Implementation Issues

SAMPLING AND NOISE. Increasing the number of samples per pixel gives an anti-aliased image which better represents the actual scene.

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

COMPUTER GRAPHICS AND INTERACTION

Raycast Rendering Maya 2013

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

Ray tracing. EECS 487 March 19,

Global Illumination The Game of Light Transport. Jian Huang

Assignment 6: Ray Tracing

Sung-Eui Yoon ( 윤성의 )

Computer Graphics Lecture 11

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

Ray-Tracing. Misha Kazhdan

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

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

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

Intro to Ray-Tracing & Ray-Surface Acceleration

Shading, Advanced Rendering. Week 7, Wed Feb 28

The Rendering Equation and Path Tracing

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

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

Review for Ray-tracing Algorithm and Hardware

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

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

The Rendering Equation. Computer Graphics CMU /15-662

Introduction to Visualization and Computer Graphics

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

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

Lecture 10: Ray tracing

Chapter 5 Mirror and Lenses

Reflection and Shading

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

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

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

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

Chapter 7 - Light, Materials, Appearance

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

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

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

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

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

Illumination. Courtesy of Adam Finkelstein, Princeton University

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

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

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

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

CS 4204 Computer Graphics

Ray Tracing. Outline. Ray Tracing: History

Questions??? Announcements Assignment 3 due today

03 RENDERING PART TWO

MITOCW MIT6_172_F10_lec18_300k-mp4

Photon Mapping. Due: 3/24/05, 11:59 PM

COMP environment mapping Mar. 12, r = 2n(n v) v

CPSC GLOBAL ILLUMINATION

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

Chapter 11. Caustics and Global Illumination

Recall: Basic Ray Tracer

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

COMP30019 Graphics and Interaction Ray Tracing

Final Project: Real-Time Global Illumination with Radiance Regression Functions

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

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

Specular reflection. Lighting II. Snell s Law. Refraction at boundary of media

Transcription:

CSCI 420 Computer Graphics Lecture 15 Ray Tracing Ray Casting Shadow Rays Reflection and Transmission [Ch. 13.2-13.3] Jernej Barbic University of Southern California 1

Local Illumination Object illuminations are independent No light scattering between objects No real shadows, reflection, transmission OpenGL pipeline uses this 2

Global Illumination Ray tracing (highlights, reflection, transmission) Radiosity (surface interreflections) Photon mapping Precomputed Radiance Transfer (PRT) 3

Object Space: Graphics pipeline: for each object, render Efficient pipeline architecture, real-time Difficulty: object interactions (shadows, reflections, etc.) Image Space: Ray tracing: for each pixel, determine color Pixel-level parallelism Difficulty: very intensive computation, usually off-line 4

First idea: Forward Ray Tracing Shoot (many) light rays from each light source Rays bounce off the objects Simulates paths of photons Problem: many rays will miss camera and not contribute to image! This algorithm is not practical 5

Backward Ray Tracing Shoot one ray from camera through each pixel in image plane 6

Generating Rays Camera is at (0,0,0) and points in the negative z-direction Must determine coordinates of image corners in 3D 7

Generating Rays y aspect ratio = w / h z x ray w y z x center of projection (COP) field of view angle (fov) image plane h side view frontal view 8

Generating Rays z y x z y x y = tan(fov/2) z = -1 COP field of view angle (fov) image plane y = 0 z = 0 f = 1 image plane side view side view y = -tan(fov/2) z = -1 9

Generating Rays z y x a = aspect ratio = w / h x = -a tan(fov/2) y = tan(fov/2) z = -1 x = -a tan(fov/2) y = -tan(fov/2) z = -1 h w x = 0 y = 0 z = -1 frontal view x = a tan(fov/2) y = tan(fov/2) z = -1 x = a tan(fov/2) y = -tan(fov/2) z = -1 10

Determining Pixel Color 1. Phong model (local as before) 2. Shadow rays 3. Specular reflection 4. Specular transmission Steps (3) and (4) require recursion. 11

Shadow Rays Determine if light really hits surface point Cast shadow ray from surface point to each light If shadow ray hits opaque object, no contribution from that light This is essentially improved diffuse reflection light source scene object 2 shadow ray (blocked) n ray camera image plane scene object 1 12

Phong Model camera If shadow ray can reach to the light, apply a standard Phong model light source shadow ray (unblocked) l ray v image plane n scene object 13

Where is Phong model applied in this example? Which shadow rays are blocked? 14

Reflection Rays For specular component of illumination Compute reflection ray (recall: backward!) Call ray tracer recursively to determine color 15

Angle of Reflection Recall: incoming angle = outgoing angle r = 2(l n) n l Compute only for surfaces that are reflective 16

Reflections Example www.yafaray.org 17

Transmission Rays Calculate light transmitted through surfaces Example: water, glass Compute transmission ray Call ray tracer recursively to determine color 18

Transmitted Light Index of refraction is speed of light, relative to speed of light in vacuum Vacuum: 1.0 (per definition) Air: 1.000277 (approximate to 1.0) Water: 1.33 Glass: 1.49 Compute t using Snell s law η l = index for upper material η t = index for lower material 19

Translucency Most real objects are not transparent, but blur the background image Scatter light on other side of surface Use stochastic sampling (called distributed ray tracing) 20

Transmission + Translucency Example www.povray.org 21

The Ray Casting Algorithm Simplest case of ray tracing 1. For each pixel (x,y), fire a ray from COP through (x,y) 2. For each ray & object, calculate closest intersection 3. For closest intersection point p Calculate surface normal For each light source, fire shadow ray For each unblocked shadow ray, evaluate local Phong model for that light, and add the result to pixel color Critical operations Ray-surface intersections Illumination calculation 22

Recursive Ray Tracing Also calculate specular component Reflect ray from eye on specular surface Transmit ray from eye through transparent surface Determine color of incoming ray by recursion Trace to fixed depth Cut off if contribution below threshold 23

Ray Tracing Assessment Global illumination method Image-based Pluses Relatively accurate shadows, reflections, refractions Minuses Slow (per pixel parallelism, not pipeline parallelism) Aliasing Inter-object diffuse reflections require many bounces 24

Raytracing Example I www.yafaray.org 25

Raytracing Example II www.povray.org 26

Raytracing Example III www.yafaray.org 27

Raytracing Example IV www.povray.org 28

Summary Ray Casting Shadow Rays and Local Phong Model Reflection Transmission Next lecture: Geometric queries 29