Illumination. Courtesy of Adam Finkelstein, Princeton University

Similar documents
Illumination. Thomas Funkhouser Princeton University C0S 426, Fall 2000

Lighting and Reflectance COS 426

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

Ray-Tracing. Misha Kazhdan

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

Indirect Illumination

Indirect Illumination

Global Illumination. Connelly Barnes CS 4810: Graphics

CS5620 Intro to Computer Graphics

Lighting and Shading

Raytracing. COSC 4328/5327 Scott A. King

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

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

COMP371 COMPUTER GRAPHICS

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

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

CS 5625 Lec 2: Shading Models

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

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

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

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

CSE 681 Illumination and Phong Shading

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

Capturing light. Source: A. Efros

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

Illumination Models and Surface-Rendering Methods. Chapter 10

Supplement to Lecture 16

Lighting affects appearance

The Rendering Equation. Computer Graphics CMU /15-662

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

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

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

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

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

Global Illumination. COMP 575/770 Spring 2013

Surface Rendering Methods

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

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

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

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

3D Rendering. Course Syllabus. Where Are We Now? Rendering. 3D Rendering Example. Overview. Rendering. I. Image processing II. Rendering III.

Reflection and Shading

Illumination in Computer Graphics

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

Simple Lighting/Illumination Models

Virtual Reality for Human Computer Interaction

Illumination Models & Shading

Lecture 19: All Together with Refraction

Understanding Variability

Global Illumination The Game of Light Transport. Jian Huang

Illumination & Shading

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

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

Implementation Issues

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

Visualisatie BMT. Rendering. Arjan Kok

Comp 410/510 Computer Graphics. Spring Shading

Shading I Computer Graphics I, Fall 2008

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

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

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

3D Rendering and Ray Casting

Given: scene specification (object positions, optical properties p of the surface, viewer position, viewing direction, )

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

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

Illumination and Shading

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

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Introduction to Computer Vision. Introduction CMPSCI 591A/691A CMPSCI 570/670. Image Formation

Illumination Models. To calculate the color of an illuminated position on the

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

CS 325 Computer Graphics

Rendering. Generate an image from geometric primitives II. Rendering III. Modeling IV. Animation. (Michael Bostock, CS426, Fall99)

CS 488. More Shading and Illumination. Luc RENAMBOT

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

Ray Tracing: Special Topics CSCI 4239/5239 Advanced Computer Graphics Spring 2018

CS770/870 Spring 2017 Color and Shading

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

Ray Tracing. Kjetil Babington

Lecture 10: Ray tracing

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

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

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

Illumination & Shading: Part 1

Turn on the Lights: Reflectance

Photorealism: Ray Tracing

Computer Vision Systems. Viewing Systems Projections Illuminations Rendering Culling and Clipping Implementations

Lecture 15: Shading-I. CITS3003 Graphics & Animation

6. Illumination, Lighting

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

Reflection and Refraction

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

Reflection and Refraction

Lighting. Figure 10.1

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

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

Transcription:

llumination Courtesy of Adam Finkelstein, Princeton University

Ray Casting mage RayCast(Camera camera, Scene scene, int width, int height) { mage image = new mage(width, height); for (int i = 0; i < width; i) { for (int j = 0; j < height; j) { Ray ray = ConstructRayThroughPixel(camera, i, j); ntersection hit = Findntersection(ray, scene); image[i][j] = GetColor(scene, ray, hit); } } return image; } Wireframe

Ray Casting mage RayCast(Camera camera, Scene scene, int width, int height) { mage image = new mage(width, height); for (int i = 0; i < width; i) { for (int j = 0; j < height; j) { Ray ray = ConstructRayThroughPixel(camera, i, j); ntersection hit = Findntersection(ray, scene); image[i][j] = GetColor(scene, ray, hit); } } return image; } Without llumination

Ray Casting mage RayCast(Camera camera, Scene scene, int width, int height) { mage image = new mage(width, height); for (int i = 0; i < width; i) { for (int j = 0; j < height; j) { Ray ray = ConstructRayThroughPixel(camera, i, j); ntersection hit = Findntersection(ray, scene); image[i][j] = GetColor(scene, ray, hit); } } return image; } With llumination

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

Goal Must derive computer models for... o Emission at light sources o Scattering at surfaces o Reception at the camera Desirable features o Concise o Efficient to compute o Accurate

Overview Direct llumination o Emission at light sources o Scattering at surfaces Global illumination o Shadows o Refractions o nter-object reflections Direct llumination

Modeling ight Sources (x,y,z,θ,φ,λ)... o describes the intensity of energy, o leaving a light source, o arriving at location(x,y,z),... o from direction (θ,φ),... o with wavelength λ (x,y,z) ight

Empirical Models deally measure irradiant energy for all situations o Too much storage o Difficult in practice λ

OpenG ight Source Models Simple mathematical models: o Point light o Directional light o Spot light

Point ight Source Models omni-directional point source o intensity ( 0 ), o position (px, py, pz), o factors (k c, k l, k q ) for attenuation with distance (d) d ight (px, py, pz) 0 = k c k ld k q d 2

Directional ight Source Models point light source at infinity o intensity ( 0 ), o direction (dx,dy,dz) (dx, dy, dz) No attenuation with distance = 0

Spot ight Source Models point light source with direction o intensity ( 0 ), o position (px, py, pz), o direction (dx, dy, dz) o attenuation d (px, py, pz) ight D γ = ( D 0 k c k ld ) k d q 2

Overview Direct llumination o Emission at light sources o Scattering at surfaces Global illumination o Shadows o Refractions o nter-object reflections Direct llumination

Modeling Surface Reflectance R s (θ,φ,γ,ψ,λ)... o describes the amount of incident energy, o arriving from direction (θ,φ),... o leaving in direction (γ,ψ), o with wavelength λ λ (θ,φ) (ψ,λ) Surface

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

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

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

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

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

Diffuse Reflection How much light is reflected? o Depends on angle of incident light d = dacos Θ θ d da Surface

Diffuse Reflection ambertian model o cosine law (dot product) N θ Surface = ( N ) D D

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

Specular Reflection Reflection is strongest near mirror angle o Examples: mirrors, metals R θ N θ

Specular Reflection How much light is seen? Depends on: o angle of incident light o angle to viewer Viewer V R α θ N θ

Specular Reflection Phong Model o cos(α) n This is a physically-motivated hack! Viewer V R α θ N θ = ( V R) S S n

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

Emission Represents light eminating directly from polygon Emission 0

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

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

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

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

OpenG Reflectance Model Sum diffuse, specular, emission, and ambient eonard McMillan, MT

Surface llumination Calculation Single light source: Viewer V R α θ N θ = E A A D ( N ) ( V S R) n

Surface llumination Calculation Multiple light sources: ) ) ( ) ( ( = i i n i S i i D A A E R V N N 2 V Viewer 1

Overview Direct llumination o Emission at light sources o Scattering at surfaces Global illumination o Shadows o Transmissions o nter-object reflections Global llumination

Global llumination Greg arson

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

Ray Casting Trace primary rays from camera o Direct illumination from unblocked lights only = E A A ( D ( N ) S ( V n R) ) S

T T R S n S D A A E S R V N = ) ) ( ) ( ( Recursive Ray Tracing Also trace secondary rays from hit surfaces o Global illumination from mirror reflection and transparency

Mirror reflections Trace secondary ray in mirror direction o Evaluate radiance along secondary ray and include it into illumination model Radiance for mirror reflection ray n = E A A ( D ( N ) S ( V R) ) S S R T T

Transparency Trace secondary ray in direction of refraction o Evaluate radiance along secondary ray and include it into illumination model T T R S n S D A A E S R V N = ) ) ( ) ( ( Radiance for refraction ray T

T T R S n S D A A E S R V N = ) ) ( ) ( ( Transparency Transparency coefficient is fraction transmitted o T = 1 for translucent object, T = 0 for opaque o 0 < T < 1 for object that is semi-translucent Transparency Coefficient T

Refractive Transparency For thin surfaces, can ignore change in direction o Assume light travels straight through surface N η i η r T Θr Θ i T Θ i T

Refractive Tranparency For solid objects, apply Snell s law: η sin r Θ r = η sin i Θ i N η i η r Θ i T Θr T ηi = ( cos Θi cos Θr ) N η r ηi η r

Recursive Ray Tracing Ray tree represents illumination computation Ray traced through scene Ray tree T T R S n S D A A E S R V N = ) ) ( ) ( (

Recursive Ray Tracing Ray tree represents illumination computation Ray traced through scene Ray tree T T R S n S D A A E S R V N = ) ) ( ) ( (

Recursive Ray Tracing GetColor calls RayTrace recursively mage RayTrace(Camera camera, Scene scene, int width, int height) { mage image = new mage(width, height); for (int i = 0; i < width; i) { for (int j = 0; j < height; j) { Ray ray = ConstructRayThroughPixel(camera, i, j); ntersection hit = Findntersection(ray, scene); image[i][j] = GetColor(scene, ray, hit); } } return image; }

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

llumination Terminology Radiant power [flux] (Φ) o Rate at which light energy is transmitted (in Watts). Radiant ntensity () o Power radiated onto a unit solid angle in direction (in Watts/sr)» e.g.: energy distribution of a light source (inverse square law) Radiance () o Radiant intensity per unit projected surface area (in Watts/m 2 sr)» e.g.: light carried by a single ray (no inverse square law) rradiance (E) o ncident flux density on a locally planar area (in Watts/m 2 )» e.g.: light hitting a surface along a Radiosity (B) o Exitant flux density from a locally planar area (in Watts/ m 2 )