Lighting and Reflectance COS 426

Similar documents
Illumination. Courtesy of Adam Finkelstein, Princeton University

Illumination. Thomas Funkhouser Princeton University C0S 426, Fall 2000

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

CS 5625 Lec 2: Shading Models

Indirect Illumination

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CSE 681 Illumination and Phong Shading

Lighting and Shading

Raytracing. COSC 4328/5327 Scott A. King

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

Simple Lighting/Illumination Models

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

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

Lighting affects appearance

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

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

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

Lecture 4: Reflection Models

Local 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!

CS5620 Intro to Computer Graphics

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

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

Capturing light. Source: A. Efros

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

Implementation Issues

Understanding Variability

Local Reflection Models

Illumination Models and Surface-Rendering Methods. Chapter 10

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

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

COMP371 COMPUTER GRAPHICS

Shading & Material Appearance

Radiometry. Radiometry. Measuring Angle. Solid Angle. Radiance

Reflection models and radiometry Advanced Graphics

Global Illumination. Connelly Barnes CS 4810: Graphics

6. Illumination, Lighting

Shading. Brian Curless CSE 557 Autumn 2017

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Supplement to Lecture 16

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

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

Radiometry. Reflectance & Lighting. Solid Angle. Radiance. Radiance Power is energy per unit time

Illumination in Computer Graphics

The Rendering Equation. Computer Graphics CMU /15-662

Surface Rendering Methods

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

CPSC 314 LIGHTING AND SHADING

Reflection and Shading

Lecture 10: Ray tracing

Visualisatie BMT. Rendering. Arjan Kok

Global Illumination The Game of Light Transport. Jian Huang

Global Illumination. COMP 575/770 Spring 2013

Illumination & Shading

Photometric Stereo.

Complex Shading Algorithms

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

CS770/870 Spring 2017 Color and Shading

Local vs. Global Illumination & Radiosity

Virtual Reality for Human Computer Interaction

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

Radiance. Radiance properties. Radiance properties. Computer Graphics (Fall 2008)

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

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

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

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

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

And if that 120MP Camera was cool

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

CS 488. More Shading and Illumination. Luc RENAMBOT

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

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

w Foley, Section16.1 Reading

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

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

Photorealism: Ray Tracing

Radiometry and reflectance

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

Color and Light. CSCI 4229/5229 Computer Graphics Summer 2008

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

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

Illumination and Shading - II

Shading I Computer Graphics I, Fall 2008

EE Light & Image Formation

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

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

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

Announcement. Lighting and Photometric Stereo. Computer Vision I. Surface Reflectance Models. Lambertian (Diffuse) Surface.

Illumination & Shading: Part 1

Lighting and Materials

Announcements. Light. Properties of light. Light. Project status reports on Wednesday. Readings. Today. Readings Szeliski, 2.2, 2.3.

BRDF Computer Graphics (Spring 2008)

A question from Piazza

Transcription:

ighting and Reflectance COS 426

Ray Casting R2mage *RayCast(R3Scene *scene, int width, int height) { R2mage *image = new R2mage(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { R3Ray ray = ConstructRayThroughPixel(scene->camera, i, j); R3Rgb radiance = ComputeRadiance(scene, &ray); image->setpixel(i, j, radiance); } } return image; } Without llumination

Ray Casting R3Rgb ComputeRadiance(R3Scene *scene, R3Ray *ray) { R3ntersection intersection = Computentersection(scene, ray); return ComputeRadiance(scene, ray, intersection); } With llumination

llumination How do we compute radiance for a sample ray once we know what it hits? ComputeRadiance(scene, ray, intersection) Angel Figure 6.2

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

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

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

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

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

Point ight Source Models omni-directional point source intensity ( 0 ), position (p x, p y, p z ), coefficients (c a, l a, q a ) for attenuation with distance (d) d ight (p x, p y, p z ) = c a + l a 0 d + q a d 2

Point ight Source = c a + l a 0 d + q a d 2 Physically-based: inverse square law c a = l a = 0 Use c a and l a 0 for (non-physical) artistic effects

Directional ight Source Models point light source at infinity intensity ( 0 ), direction (d x,d y,d z ) (d x, d y, d z ) No attenuation with distance = 0

Spot ight Source Models point light source with direction intensity ( 0 ), position (p x, p y, p z ), direction (d x, d y, d z ) attenuation with distance falloff (sd), and cutoff (sc) d (p x, p y, p z ) Θ = cos -1 ( D) D sc = c a sd 0(cosΘ) if Θ sc, 2 + lad + qad 0 otherwise

Cosine obes k (cos Θ) Common model for blob at origin

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

Scattering at Surfaces Bidirectional Reflectance Distribution Function f r (θ i,φ i,θ o,φ o,λ)... describes the aggregate fraction of incident energy, arriving from direction (θ i,φ i ),... leaving in direction (θ o,φ o ), with wavelength λ (θ o,φ o ) Surface λ (θ i,φ i )

Empirical Models deally measure BRDF for all combinations of angles: θ i,φ i,θ o,φ o Difficult in practice Too much storage

Parametric Models Approximate BRDF with simple parametric function that is fast to compute. Phong [75] Blinn-Phong [77] Cook-Torrance [81] He et al. [91] Ward [92] afortune et al. [97] Ashikhmin et al. [00] etc. afortune [97] Cook-Torrance [81]

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

OpenG 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 What is brightness of surface? Depends on angle of incident light θ Surface

Diffuse Reflection What is brightness of surface? Depends on angle of incident light d = dacosθ θ d da Surface

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

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

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

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

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

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

Emission Represents light emanating directly from surface Note: does not automatically act as light source! Does not affect other surfaces in scene! Emission 0

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

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

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

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

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

OpenG Reflectance Model Good model for plastic surfaces,

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

Direct llumination Calculation Multiple light sources: N Viewer 1 Note: 2 all of the V K and are RGB colors E A A ( n K ( N ) + K ( V R ) ) = + K + D i S i

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

Global llumination Greg Ward

Ray Casting (last lecture) Trace primary rays from camera Direct illumination from unblocked lights only ( ) n i S i D A A E R V K N K K + + + = ) ( ) (

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

Recursive Ray Tracing Also trace secondary rays from hit surfaces Mirror reflection and transparency ( ) T T R S n i S i D A A E K K S R V K N K K + + + + + = ) ( ) (

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

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

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

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

Refractive Tranparency For solid objects, apply Snell s law: η sin Θ = η sin Θ r r 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 i S i D A A E K K S R V K N K K + + + + + = ) ( ) (

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

Recursive Ray Tracing ComputeRadiance is called recursively R3Rgb ComputeRadiance(R3Scene *scene, R3Ray *ray, R3ntersection& hit) { R3Ray specular_ray = SpecularRay(ray, hit); R3Ray refractive_ray = RefractiveRay(ray, hit); R3Rgb radiance = Phong(scene, ray, hit) + Ks * ComputeRadiance(scene, specular_ray) + Kt * ComputeRadiance(scene, refractive_ray); return radiance; }

Example Turner Whitted, 1980

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

llumination Terminology Radiant power [flux] (Φ) Rate at which light energy is transmitted (in Watts). Radiant ntensity () Power radiated onto a unit solid angle in direction (in Watts/sr)» e.g.: energy distribution of a light source (inverse square law) Radiance () 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) ncident flux density on a locally planar area (in Watts/m 2 )» e.g.: light hitting a surface at a point Radiosity (B) Exitant flux density from a locally planar area (in Watts/m 2 )