Indirect Illumination

Similar documents
Indirect Illumination

Global Illumination. Connelly Barnes CS 4810: Graphics

Ray-Tracing. Misha Kazhdan

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

Illumination. Courtesy of Adam Finkelstein, Princeton University

Modeling Transformations

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

COMP371 COMPUTER GRAPHICS

Modeling Transformations

Lighting and Reflectance COS 426

3D Rendering and Ray Casting

3D Rendering and Ray Casting

Ray Tracing. Kjetil Babington

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

Illumination. Thomas Funkhouser Princeton University C0S 426, Fall 2000

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

Photorealism: Ray Tracing

Global Illumination. COMP 575/770 Spring 2013

Lecture 10: Ray tracing

Raytracing. COSC 4328/5327 Scott A. King

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

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

COMP30019 Graphics and Interaction Ray Tracing

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

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

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

Illumination Algorithms

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

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

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

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

Lighting and Shading

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

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

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

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

The Rendering Equation. Computer Graphics CMU /15-662

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

Ray tracing. EECS 487 March 19,

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

CS-184: Computer Graphics. Administrative

03 RENDERING PART TWO

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required: Watt, sections , (handout) Further reading:

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

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

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

Chapter 11. Caustics and Global Illumination

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

Lecture 18: Primer on Ray Tracing Techniques

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

Lighting affects appearance

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

Intro to Ray-Tracing & Ray-Surface Acceleration

Surface Rendering Methods

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

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

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required:

To Do. Advanced Computer Graphics. Course Outline. Course Outline. Illumination Models. Diffuse Interreflection

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Raycast Rendering Maya 2013

The Rendering Equation and Path Tracing

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

The Rendering Equation & Monte Carlo Ray Tracing

Introduction to Visualization and Computer Graphics

Photon Mapping. Michael Doggett Department of Computer Science Lund university

Ray Tracing. Brian Curless CSEP 557 Fall 2016

Implementation Issues

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

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

Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics

Assignment 6: Ray Tracing

Lecture 19: All Together with Refraction

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

The Rendering Equation. Computer Graphics CMU /15-662, Fall 2016

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

Monte-Carlo Ray Tracing. Antialiasing & integration. Global illumination. Why integration? Domains of integration. What else can we integrate?

Today. Part 1: Ray casting Part 2: Lighting Part 3: Recursive Ray tracing Part 4: Acceleration Techniques

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

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

Global Illumination The Game of Light Transport. Jian Huang

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

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

Local vs. Global Illumination & Radiosity

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

Recall: Basic Ray Tracer

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

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

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

Ray tracing Tutorial. Lukas Herzberger

Voxel-Based Global-Illumination

Last Time? Ray Casting. Administrivia: Lab & Office Hours. Notes on Assignments. Ray Casting. Overview of Today

CS5620 Intro to Computer Graphics

Ray Tracing Part 1. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar & Kevin Gibson

CPSC GLOBAL ILLUMINATION

Path Tracing part 2. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

Sung-Eui Yoon ( 윤성의 )

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

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

Recursion and Data Structures in Computer Graphics. Ray Tracing

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

Transcription:

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

Announcements Midterm on October 17 th Office hours: Misha: Monday 2-3 Malone 229 Sing Chun: Friday 9-10 Malone 216 Steve: Tuesday 12-1 Malone 122 Yan: Wednesday 1-2 Malone 122

Surface Illumination Calculation Multiple light source: 2 Viewer N 1 V I = I E + K A I A + K D N, + K S V, R n I

Overview Direct Illumination Emission at light sources Direct light at surface points Global illumination Shadows Transmissions Inter-object reflections

Shadows Shadow term tells if light sources are blocked Cast ray towards each light source i. If the ray is blocked, do not consider the contribution of the light.

Shadows Shadow term tells if light sources are blocked Cast ray towards each light source i S i = 0 if ray is blocked, S i = 1 otherwise 1 0 Shadow Term I = I E + K A I A + K D N, + K S V, R n I S

Shadows Shadow term tells if light sources are blocked Cast ray towards each light source i S i = 0 if ray is blocked, S i = 1 otherwise 1 S 0 = 1: 0 contributes I = I E + 0 K A I A + K D N, + K S V, R n Shadow Term I S

Shadows Shadow term tells if light sources are blocked Cast ray towards each light source i S i = 0 if ray is blocked, S i = 1 otherwise 1 S 0 = 1: 0 contributes S 1 = 0: 1 doesn t contribute I = I E + 0 K A I A + K D N, + K S V, R n Shadow Term I S

Ray Casting Trace primary rays from camera Direct illumination from unblocked lights only

Recursive Ray Tracing Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 Recall: The specularity of a surface, K S, measures how mirror-like it is. 0 I = I E + K A I A + K D N, + K S V, R n I S

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 0 Radiance for mirror reflection ray I = I E + K A I A + K D N, + K S V, R n I S + K s I R

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 0 Radiance for mirror reflection ray I = I E + K A I A + K D N, + K S V, R n I S + K s I R

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 0 Radiance for mirror reflection ray I = I E + K A I A + K D N, + K S V, R n I S + K s I R

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays

Transparent Refraction Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 0 Radiance for refraction ray I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparent Refraction Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 0 Radiance for refraction ray I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparent Refraction Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 0 Radiance for refraction ray I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparent Refraction Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 0 Radiance for refraction ray I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparent Refraction Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays 1 0 Radiance for refraction ray I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparent Refraction Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays

Transparency and Shadow Problem: If a surface is transparent, then rays to the light source may pass through the object Over-shadowing

Transparency and Shadow Problem: If a surface is transparent, then rays to the light source may pass through the object Need to modify the shadow term so that instead of representing a binary (0/1) value, it gives the fraction of light passing through. Accumulate transparency values as the ray travels to the light source. I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparency and Shadow Accumulate transparency values as the ray travels to the light source. 1 S 0 = 1: 0 contributes fully 0 I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparency and Shadow Accumulate transparency values as the ray travels to the light source. 1 S 0 = 1: 0 contributes fully S 1 =?: 0 I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparency and Shadow Accumulate transparency values as the ray travels to the light source. 1 S 0 = 1: 0 contributes fully S 1 = 1 K T?: K T 0 I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparency and Shadow Accumulate transparency values as the ray travels to the light source. 1 S 0 = 1: 0 contributes fully S 1 = 1 K T K T?: K T 0 I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparency and Shadow Accumulate transparency values as the ray travels to the light source. 1 K T S 0 = 1: 0 contributes fully S 1 = 1 K T K T : 1 contributes partially 0 I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparency and Shadow Accumulate transparency values as the ray travels to the light source. 1 K T S 0 = 1: 0 contributes fully S 1 = 1 K T K T : 1 contributes partially For solid models can use the distance travelled through the surface instead: S = e d K T 0 I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Transparency and Shadow Accumulate transparency values as the ray travels to the light source.

Transparent Refraction When a light of light passes through a transparent object, the ray of light can bend, (θ i θ r ). N θ i T θ r

Snell s aw The way that light bends is determined by the indices of refraction of the internal and external materials η i and η r : N η r sin θ r = η i sin θ i θ i T θ r The index of refraction of air is η = 1.

Snell s aw The way that light bends is determined by the indices of refraction of the internal and external materials η i and η r : N η r sin θ r = η i sin θ i θ i T θ r T = η i η r cos θ i cos θ r N η i η r

Snell s aw The way that light bends is determined by the indices of refraction of the internal and external materials η i and η r : η r sin θ r = η i sin θ i 1 0

Snell s aw The way that light bends is determined by the indices of refraction of the internal and external materials η i and η r :

Snell s aw and Shadows Problem (Caustics): If a surface is transparent, then rays to the light source may not travel in a straight line This is difficult to address with ray-tracing

Termination Criteria How do we determine when to stop recursing? Depth of iteration» Bounds the number of times a ray will bounce around the scene Cut-off value» Ignores contribution from bounces that contribute very little

Termination Criteria Pixel GetColor( scene, ray, ir, depth, cutoff ) { Pixel p(0,0,0) Ray reflect, refract Intersection hit = FindIntersection( ray, scene ) if ( hit ) { p += GetSurfaceColor( hit.position ) reflect.direction = Reflect( ray.direction, hit.normal ) reflect.position = hit.position + reflect.direction* if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec } refract.direction = Refract( ray.direction, hit.normal, ir, hit.ir ) refract.position = hit.position + refract.direction* if( depth >0 && hit.ktran>cutoff ) p += GetColor( scene, refract, hit.ir, depth-1, cutoff/hit.ktran ) *hit.ktran } return p

Termination Criteria Pixel GetColor( scene, ray, ir, depth, cutoff ) { Pixel p(0,0,0) Ray reflect, refract Intersection hit = FindIntersection( ray, scene ) if ( hit ) { p += GetSurfaceColor( hit.position ) reflect.direction = Reflect( ray.direction, hit.normal ) reflect.position = hit.position + reflect.direction* if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec } refract.direction = Refract( ray.direction, hit.normal, ir, hit.ir ) refract.position = hit.position + refract.direction* if( depth >0 && hit.ktran>cutoff ) p += GetColor( scene, refract, hit.ir, depth-1, cutoff/hit.ktran ) *hit.ktran } return p I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Termination Criteria Pixel GetColor( scene, ray, ir, depth, cutoff ) { Pixel p(0,0,0) Ray reflect, refract Intersection hit = FindIntersection( ray, scene ) if ( hit ) { p += GetSurfaceColor( hit.position ) reflect.direction = Reflect( ray.direction, hit.normal ) reflect.position = hit.position + reflect.direction* if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec } refract.direction = Refract( ray.direction, hit.normal, ir, hit.ir ) refract.position = hit.position + refract.direction* if( depth >0 && hit.ktran>cutoff ) p += GetColor( scene, refract, hit.ir, depth-1, cutoff/hit.ktran ) *hit.ktran } return p I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Termination Criteria if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec; The first reflected ray should be cast if it can contribute an intensity greater than the cut-off. K S 1 > cut-off 1 K S 1 0

Termination Criteria if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec; The second reflected ray should be cast if it can contribute an intensity greater than the cut-off. K S 2 K S 1 > cut-off 1 K S 2 > cut-off K S 1 K S 2 K S 1 0

Termination Criteria if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec; The second reflected ray should be cast if it can contribute a global intensity greater than the cut-off. K S 2 K S 1 > cut-off 1 K S 2 > cut-off K S 1 The second reflected ray should be cast if it can reflect 0 at least cut-off K1 of the local intensity S K S 2 K S 1

Termination Criteria Pixel GetColor( scene, ray, ir, depth, cutoff ) { Pixel p(0,0,0) Ray reflect, refract Intersection hit = FindIntersection( ray, scene ) if ( hit ) { p += GetSurfaceColor( hit.position ) reflect.direction = Reflect( ray.direction, hit.normal ) reflect.position = hit.position + reflect.direction* if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec } refract.direction = Refract( ray.direction, hit.normal, ir, hit.ir ) refract.position = hit.position + refract.direction* if( depth >0 && hit.ktran>cutoff ) p += GetColor( scene, refract, hit.ir, depth-1, cutoff/hit.ktran ) *hit.ktran } return p I = I E + K A I A + K D N, + K S V, R n I S + K s I R + K T I T

Termination Criteria Pixel GetColor( scene, ray, ir, depth, cutoff ) { Pixel p(0,0,0) Ray reflect, refract Intersection hit = FindIntersection( ray, scene ) if ( hit ) { p += GetSurfaceColor( hit.position ) Why do we need the terms? To ensure that the new ray does not hit its starting location! reflect.direction = Reflect( ray.direction, hit.normal ) reflect.position = hit.position + reflect.direction* if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec } refract.direction = Refract( ray.direction, hit.normal, ir, hit.ir ) refract.position = hit.position + refract.direction* if( depth >0 && hit.ktran>cutoff ) p += GetColor( scene, refract, hit.ir, depth-1, cutoff/hit.ktran ) *hit.ktran } return p

Termination Criteria Pixel GetColor( scene, ray, ir, depth, cutoff ) { Pixel p(0,0,0) Ray reflect, refract Intersection hit = FindIntersection( ray, scene ) if ( hit ) { p += GetSurfaceColor( hit.position ) reflect.direction = Reflect( ray.direction, hit.normal ) reflect.position = hit.position + reflect.direction* if( depth >0 && hit.kspec>cutoff ) p += GetColor( scene, reflect, ir, depth-1, cutoff/hit.kspec )*hit.kspec } } return p refract.direction = Refract( ray.direction, hit.normal, ir, hit.ir ) refract.position = hit.position + refract.direction* if( depth >0 && hit.ktran>cutoff ) p += GetColor( scene, refract, hit.ir, depth-1, cutoff/hit.ktran ) *hit.ktran Warning: In practice, cutoff is a scalar while hit.ktran/kspec are RGB values.

Illumination Examples Ray tracing (rays to point light source) Courtesy Henrik Wann Jensen

Illumination Examples Soft shadows (rays to area light source) Courtesy Henrik Wann Jensen

Illumination Examples Caustics (rays from light source) Courtesy Henrik Wann Jensen

Illumination Examples Full Global Illumination Courtesy Henrik Wann Jensen

Recursive Ray Tracing GetColor calls RayTrace recursively Image RayTrace( Camera camera, Scene scene, int width, int height, int depth, float cutoff ) { Image image = new Image( width, height ); for( int i = 0 ; i<width ; i++ ) for( int j = 0 ; j<height ; j++ ) { Ray ray = ConstructRayThroughPixel( camera, i, j ); image[i][j] = GetColor( scene, ray, 1, depth, cutoff ); } return image; }

Summary Ray casting (direct Illumination) Usually use simple analytic approximations for light source emission and surface reflectance Recursive ray tracing (global illumination) Incorporate shadows, mirror reflections, and pure refractions All of this is an approximation so that it is practical to compute More on global illumination later!