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

Similar documents
Ray-Tracing. Misha Kazhdan

Illumination. Courtesy of Adam Finkelstein, Princeton University

Lighting and Reflectance COS 426

Illumination. Thomas Funkhouser Princeton University C0S 426, Fall 2000

Indirect Illumination

Indirect Illumination

CS5620 Intro to Computer Graphics

Global Illumination. Connelly Barnes CS 4810: Graphics

Illumination Models & Shading

Shading I Computer Graphics I, Fall 2008

CS230 : Computer Graphics Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Illumination & Shading

Visualisatie BMT. Rendering. Arjan Kok

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

3D Rendering and Ray Casting

Raytracing. COSC 4328/5327 Scott A. King

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

CS 5625 Lec 2: Shading Models

Turn on the Lights: Reflectance

w Foley, Section16.1 Reading

CSE 681 Illumination and Phong Shading

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Simple Lighting/Illumination Models

Lighting and Shading

Lighting affects appearance

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Shading. Brian Curless CSE 557 Autumn 2017

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Computer Graphics. Illumination and Shading

3D Rendering and Ray Casting

Modeling Transformations

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

Illumination in Computer Graphics

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

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

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Comp 410/510 Computer Graphics. Spring Shading

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

Shading. Reading. Pinhole camera. Basic 3D graphics. Brian Curless CSE 557 Fall Required: Shirley, Chapter 10

Module 5: Video Modeling Lecture 28: Illumination model. The Lecture Contains: Diffuse and Specular Reflection. Objectives_template

CPSC 314 LIGHTING AND SHADING

Modeling Transformations

Local Reflection Models

Lighting affects appearance

Sung-Eui Yoon ( 윤성의 )

Introduction. Lighting model Light reflection model Local illumination model Reflectance model BRDF

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

Illumination & Shading: Part 1

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

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

Reflection and Shading

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

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Lights, Surfaces, and Cameras. Light sources emit photons Surfaces reflect & absorb photons Cameras measure photons

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

Ray Tracing. Kjetil Babington

Local vs. Global Illumination & Radiosity

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading.

Global Illumination. COMP 575/770 Spring 2013

COMP371 COMPUTER GRAPHICS

Photorealism: Ray Tracing

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

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Shading Models. Welcome!

Illumination. The slides combine material from Andy van Dam, Spike Hughes, Travis Webb and Lyn Fong

Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces

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

CS770/870 Spring 2017 Color and Shading

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

dq dt I = Irradiance or Light Intensity is Flux Φ per area A (W/m 2 ) Φ =

The Rendering Equation. Computer Graphics CMU /15-662

CS452/552; EE465/505. Intro to Lighting

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Shading Models. Simulate physical phenomena

Lighting. Figure 10.1

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

Reading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5.

Virtual Reality for Human Computer Interaction

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

Overview. Radiometry and Photometry. Foundations of Computer Graphics (Spring 2012)

Shading & Material Appearance

Illumination Models and Shading

Illumination and Shading

Shading and Illumination

Computer Graphics. Illumination and Shading

surface: reflectance transparency, opacity, translucency orientation illumination: location intensity wavelength point-source, diffuse source

Light Transport CS434. Daniel G. Aliaga Department of Computer Science Purdue University

Assignment #2. (Due date: 11/6/2012)

Today we will start to look at illumination models in computer graphics

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

Illumination and Shading

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

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

CS635 Spring Department of Computer Science Purdue University

Capturing light. Source: A. Efros

Transcription:

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

Ray Casting Image RayCast(Camera camera, Scene scene, int width, int height) { 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); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(scene, ray, hit); } return image; } Without Illumination

Ray Casting Image RayCast(Camera camera, Scene scene, int width, int height) { 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); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(scene, ray, hit); } return image; } With Illumination

Illumination How do we compute radiance for a sample ray? image[i][j] = GetColor( scene, ray, hit ); Angel Figure 6.2

Goal Must derive models for... Emission at light sources Direct light on surface points Scattering at surfaces Reception at the camera Desirable features Concise Efficient to compute Accurate

Overview Direct Illumination Emission at a light source Reflection off the surface Global illumination Shadows Inter-object reflections Transmissions Intersection Testing

Overview Direct Illumination Emission at light sources Reflection off the surface Global illumination Shadows Inter-object reflections Transmissions Lambertian Shading

Overview Direct Illumination Emission at light sources Reflection off the surface Global illumination Shadows Inter-object reflections Transmissions Phong Shading

Overview Direct Illumination Emission at light sources Reflection off the surface Global illumination Shadows Inter-object reflections Transmissions Shadow Computation

Overview Direct Illumination Emission at light sources Reflection off the surface Global illumination Shadows Inter-object reflections Transmissions Reflective Bouncing

Overview Direct Illumination Emission at light sources Reflection off the surface Global illumination Shadows Inter-object reflections Transmissions Refractive Bouncing

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

Modeling Light Sources I L (x, y, z, θ, φ, λ) describes the intensity of energy (I), leaving a light source (L), at a particular angle (θ, φ) arriving at a location (x, y, z), with a particular wavelength (λ) λ (θ, φ) (x, y, z) Light

Empirical Models Ideally measure irradiant energy for all situations Too much storage Difficult in practice λ (θ, φ) (x, y, z) Light

Simplified Light Source Models Simple mathematical models: Point light Directional light Spot light

Point Light Source Models omni-directional point source intensity I, (typically a three-channel value) position p = (p x, p y, p z ), factors (k c, k l, k q ) for attenuation with distance (δ) I δ (p x, p y, p z ) I L = I k c + k l δ + k q δ 2 Light The light hitting a surface point q comes in from direction q p.

Directional Light Source Models point light source at infinity intensity I, (typically a three-channel value) direction Ԧd = (d x, d y, d z ) I (d x, d y, d z ) No attenuation with distance k c = 1, k l = k q = 0 I L = I

Directional Light Source Models point light source at infinity intensity I, (typically a three-channel value) direction Ԧd = (d x, d y, d z ) I (d x, d y, d z ) No attenuation with distance k c = 1, k l = k q = 0 I L = I The light hitting a surface point q comes in from direction Ԧd.

Spot Light Source Models point light source with direction intensity I, (typically a three-channel value) position p = (p x, p y, p z ), attenuation (k c, k l, k q ) direction Ԧd = (d x, d y, d z ) cut-off and drop-off (γ, α) (p x, p y, p z ) Ԧd Ԧv γ δ How can we modify the intensity of a point light to decrease as g increases? Light I L = I k c + k l δ + k q δ 2

Spot Light Source Models point light source with direction intensity I, position p = (p x, p y, p z ), attenuation (k c, k l, k q ) direction Ԧd = (d x, d y, d z ) cut-off and drop-off (γ, α) (p x, p y, p z ) Ԧd Ԧv γ δ The light hitting a surface point q comes in from direction q p. Light I Ԧd, Ԧv α I L = k c + k l δ + k q δ 2 if Ԧd, Ԧv > cos γ 0 otherwise

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

Modeling Surface Reflectance R S (θ, φ, λ, γ, ψ) describes the fraction of incident energy (R), at the surface (S), arriving from direction (θ, φ), with wavelength (λ), leaving in direction γ, ψ, (γ, ψ) Surface λ (θ, φ)

Empirical Models Ideally measure radiant energy for all combinations of incident angles Too much storage Difficult in practice λ (θ, φ) (γ, ψ) Surface

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Based on model proposed by Phong Surface

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Based on Phong model proposed illumination by model Phong Surface

Diffuse Reflection Assume surface reflects equally in all directions Examples: chalk, clay Surface

Diffuse Reflection How much light is reflected? Depends on angle of incident light aka Lambertian θ Surface

Diffuse Reflection How much light is reflected? Depends on angle of incident light dl = da cos θ θ dl da Surface

Diffuse Reflection Lambertian model cosine law: cos θ = N, L K D is surface property I L is incoming light N θ L Surface I D = K D N, L I L

Diffuse Reflection Note that lights and surface properties have R,G, and B components! So amount of red light reflected is not necessarily equal to amount of green light, etc. You will need to run calculation below on EACH color channel This holds true for all lighting calculations I D Red = K D Red N, L I L Red

Diffuse Reflection Assume surface reflects equally in all directions Examples: chalk, clay

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Surface

Specular Reflection Reflection is strongest near mirror angle Examples: metals, shiny apples Specular

Specular Reflection How much light is seen? Depends on how well the: reflected direction, and direction to the viewer line up. Viewer V R α θ N θ L

Specular Reflection Phong Model cos n α This is a physically-motivated hack! Viewer R α θ N θ L V I S = K S V, R n I L

Specular Reflection Reflection is strongest near mirror angle Examples: metals, shiny apples

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Surface

Emission Represents light emanating directly from a surface that cannot be described by the three light sources Emission 0

Emission I E = I E Emission 0

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Surface

Ambient Term Represents reflection of all indirect illumination This is a total hack (avoids complexity of global illumination)!

Ambient Term Represents reflection of all indirect illumination I A = K A I L A

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Light position dependent Light + viewer position dependent Surface

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Light position dependent Light + viewer position dependent Surface

Surface Illumination Calculation Single light source: Viewer R α θ N θ L V I = I E + K A I L A + K D N, L I L + K S V, R n I L

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