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

Modeling Transformations

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

Lighting and Reflectance COS 426

COMP371 COMPUTER GRAPHICS

3D Rendering and Ray Casting

3D Rendering and Ray Casting

Ray Tracing. Kjetil Babington

Illumination. Thomas Funkhouser Princeton University C0S 426, Fall 2000

Lecture 10: Ray tracing

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

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

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. COMP 575/770 Spring 2013

Raytracing. COSC 4328/5327 Scott A. King

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

Illumination Algorithms

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

COMP30019 Graphics and Interaction Ray Tracing

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

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

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

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

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

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

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

Lighting and Shading

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

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

03 RENDERING PART TWO

The Rendering Equation. Computer Graphics CMU /15-662

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.

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

Lecture 18: Primer on Ray Tracing Techniques

Ray tracing. EECS 487 March 19,

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

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

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

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

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

Raycast Rendering Maya 2013

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

Chapter 11. Caustics and Global Illumination

Surface Rendering Methods

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

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

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

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

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

The Rendering Equation and Path Tracing

Introduction to Visualization and Computer Graphics

CS-184: Computer Graphics. Administrative

Ray Tracing. Brian Curless CSEP 557 Fall 2016

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

Lighting affects appearance

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

Implementation Issues

Intro to Ray-Tracing & Ray-Surface Acceleration

Voxel-Based Global-Illumination

Lecture 19: All Together with Refraction

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

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

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

Recursion and Data Structures in Computer Graphics. Ray Tracing

The Rendering Equation & Monte Carlo Ray Tracing

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

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

Global Illumination The Game of Light Transport. Jian Huang

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

Recall: Basic Ray Tracer

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

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

Supplement to Lecture 16

Recap: Refraction. Amount of bending depends on: - angle of incidence - refractive index of medium. (n 2 > n 1 ) n 2

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

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

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

Assignment 3: Path tracing

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking

Ray tracing Tutorial. Lukas Herzberger

Sung-Eui Yoon ( 윤성의 )

CPSC GLOBAL ILLUMINATION

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

Assignment 6: Ray Tracing

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

Reflection & refraction

Photon Mapping. Michael Doggett Department of Computer Science Lund university

Transcription:

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

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 Test for shadows 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. 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 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 η r η 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 ) depth-- 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, 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, 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 ) depth-- if ( hit ) { p += GetSurfaceColor( hit.position ) } return p } I = I E + 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, 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, cutoff/hit.ktran ) *hit.ktran 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 ) depth-- if ( hit ) { p += GetSurfaceColor( hit.position ) } return p } I = I E + 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, 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, cutoff/hit.ktran ) *hit.ktran 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 ) depth-- if ( hit ) { p += GetSurfaceColor( hit.position ) } return p } I = I E + 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, 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, cutoff/hit.ktran ) *hit.ktran 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 ) depth-- 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, 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, 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 ) depth-- 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, 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, 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!