University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Lighting Week 5, Mon 29 Sep 2003 recap: picking, light sources lighting.

Slides:



Advertisements
Similar presentations
Computer Vision Radiometry. Bahadir K. Gunturk2 Radiometry Radiometry is the part of image formation concerned with the relation among the amounts of.
Advertisements

1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Local Reflection Model Jian Huang, CS 594, Fall 2002.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 21: Radiometry Many slides courtesy Pat Hanrahan.
Basic Principles of Surface Reflectance
Physically Based Illumination Models
Advanced Computer Graphics (Spring 2013) CS 283, Lecture 8: Illumination and Reflection Many slides courtesy.
Light Issues in Computer Graphics Presented by Saleema Amershi.
Light and Matter For Computer Graphics Comp 770 Lecture Spring 2009.
Torrance Sparrow Model of Reflectance + Oren Nayar Model of Reflectance.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading III Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Lighting/Shading I Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading II Week.
University of Texas at Austin CS395T - Advanced Image Synthesis Spring 2006 Don Fussell Previous lecture Reflectance I BRDF, BTDF, BSDF Ideal specular.
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Lighting/Shading II Week.
3-D Computer Vision CSc83029 / Ioannis Stamos 3-D Computer Vision CSc Radiometry and Reflectance.
Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2
Introduction to Computer Vision CS / ECE 181B Tues, May 18, 2004 Ack: Matthew Turk (slides)
7M836 Animation & Rendering
Basic Principles of Surface Reflectance
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
Computer Graphics (Fall 2004) COMS 4160, Lecture 16: Illumination and Shading 2 Lecture includes number of slides from.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Picking and Lighting Week 4, Fri 26 Sep 2003 recap: viewports and picking.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Lighting affects appearance. Light Source emits photons Photons travel in a straight line When they hit an object they: bounce off in a new direction.
Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Illumination.
CS 445 / 645: Introductory Computer Graphics
MIT EECS 6.837, Durand and Cutler Local Illumination.
CS 445: Introduction to Computer Graphics David Luebke University of Virginia Visibility Calculations and Occlusion Culling.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
CS 445 / 645 Introduction to Computer Graphics Lecture 14 Lighting Lighting.
David Luebke 1 10/26/2015 Lighting CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Advanced Illumination Models Chapter 7 of “Real-Time Rendering, 3 rd Edition”
Illumination.
Announcements Office hours today 2:30-3:30 Graded midterms will be returned at the end of the class.
Reflection models Digital Image Synthesis Yung-Yu Chuang 11/01/2005 with slides by Pat Hanrahan and Matt Pharr.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Material Representation K. H. Ko School of Mechatronics Gwangju Institute.
CSCE 641 Computer Graphics: Reflection Models Jinxiang Chai.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Computer Graphics (Spring 2003) COMS 4160, Lecture 18: Shading 2 Ravi Ramamoorthi Guest Lecturer: Aner Benartzi.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Shading.
02/2/05© 2005 University of Wisconsin Last Time Reflectance part 1 –Radiometry –Lambertian –Specular.
Local Illumination and Shading
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
COMPUTER GRAPHICS CS 482 – FALL 2015 OCTOBER 27, 2015 SCATTERING LIGHT SCATTERING PHYSICALLY BASED SCATTERING SUBSURFACE SCATTERING AMBIENT OCCLUSION.
Lighting/Shading University of British Columbia
Physically-based Illumination Model
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Illumination Study of how different materials reflect light Definition of radiance, the fundamental unit of light transfer in computer graphics How the.
Physically-based Illumination Models (2) CPSC 591/691.
CPSC 314 LIGHTING AND SHADING UGRAD.CS.UBC.CA/~CS314 slide credits: Mikhail Bessmeltsev et al 1.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Computer Graphics Lecture 30 Mathematics of Lighting and Shading - IV Taqdees A. Siddiqi
Computer Graphics: Illumination
7. Illumination Phong Illumination Diffuse, Specular and Ambient
Advanced Computer Graphics
Interactions of Light Waves
Illumination Models Chapter 14 Section 14.1 to 14.2
Presentation transcript:

University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Lighting Week 5, Mon 29 Sep 2003 recap: picking, light sources lighting

Week 5, Mon 29 Sep 03 © Tamara Munzner2 News continue signup for project 1 demo slots extra TA hours in labs –Monday 10-2, 4-5:30 –Tuesday 11-1 –Wednesday 10-1, 4-5:30 –Thursday 11-1 normal lab hours –Wed 1-3

Week 5, Mon 29 Sep 03 © Tamara Munzner3 Picking Select/Hit recap assign (hierarchical) integer key/name(s) small region around cursor as new viewport redraw in selection mode –equivalent to casting pick “tube” –store keys, depth for drawn objects in hit list examine hit list –usually use frontmost, but up to application

Week 5, Mon 29 Sep 03 © Tamara Munzner4 Light Sources recap directional/parallel lights point at infinity: (x,y,z,0) T point lights finite position: (x,y,z,1) T spotlights position, direction, angle ambient lights

Week 5, Mon 29 Sep 03 © Tamara Munzner5 Ambient Light Sources scene lit only with an ambient light source Light Position Not Important Viewer Position Not Important Surface Angle Not Important

Week 5, Mon 29 Sep 03 © Tamara Munzner6 Directional Light Sources scene lit with directional and ambient light Light Position Not Important Viewer Position Not Important Surface Angle Important

Week 5, Mon 29 Sep 03 © Tamara Munzner7 Point Light Sources scene lit with ambient and point light source Light Position Important Viewer Position Important Surface Angle Important

Week 5, Mon 29 Sep 03 © Tamara Munzner8 Illumination as Radiative Transfer radiative heat transfer approximation –substitute light for heat –light as packets of energy (photons) particles not waves –model light transport as packet flow heat/light source thermometer/eye reflective objects energy packets

Week 5, Mon 29 Sep 03 © Tamara Munzner9 Light Transport Assumptions geometrical optics (light is photons not waves) –no diffraction –no polarization (some sunglasses) light of all orientations gets through –no interference (packets don’t interact) interference demo: which visual effects does this preclude? light waves single slit new wavefront light particles single slit bent ray?!

Week 5, Mon 29 Sep 03 © Tamara Munzner10 Light Transport Assumptions II color approximated by discrete wavelengths –quantized approx of dispersion (rainbows) –quantized approx of fluorescence (cycling vests) no propagation media (surfaces in vacuum) –no atmospheric scattering (fog, clouds) some tricks to simulate explicitly –no refraction (mirages)

Week 5, Mon 29 Sep 03 © Tamara Munzner11 Light Transport Assumptions III light travels in straight line –no gravity lenses superposition (lights can be added) –no nonlinear reflection models nonlinearity handled separately

Week 5, Mon 29 Sep 03 © Tamara Munzner12 Illumination transport of energy from light sources to surfaces & points – includes direct and indirect illumination Images by Henrik Wann Jensen

Week 5, Mon 29 Sep 03 © Tamara Munzner13 Components of Illumination two components: light sources and surface properties light sources (or emitters) – spectrum of emittance (i.e., color of the light) – geometric attributes position direction shape –directional attenuation –polarization

Week 5, Mon 29 Sep 03 © Tamara Munzner14 Components of Illumination surface properties – reflectance spectrum (i.e., color of the surface) –subsurface reflectance –geometric attributes position orientation micro-structure

Week 5, Mon 29 Sep 03 © Tamara Munzner15 Types of Reflection specular (a.k.a. mirror or regular) reflection causes light to propagate without scattering. diffuse reflection sends light in all directions with equal energy. mixed reflection is a weighted combination of specular and diffuse.

Week 5, Mon 29 Sep 03 © Tamara Munzner16 Types of Reflection retro-reflection occurs when incident energy reflects in directions close to the incident direction, for a wide range of incident directions. gloss is the property of a material surface that involves mixed reflection and is responsible for the mirror like appearance of rough surfaces.

Week 5, Mon 29 Sep 03 © Tamara Munzner17 Reflectance Distribution Model most surfaces exhibit complex reflectances –vary with incident and reflected directions. –model with combination + + = specular + glossy + diffuse = reflectance distribution

Week 5, Mon 29 Sep 03 © Tamara Munzner18 Surface Roughness at a microscopic scale, all real surfaces are rough cast shadows on themselves “mask” reflected light: shadow Masked Light

Week 5, Mon 29 Sep 03 © Tamara Munzner19 Surface Roughness notice another effect of roughness: –each “microfacet” is treated as a perfect mirror. –incident light reflected in different directions by different facets. –end result is mixed reflectance. smoother surfaces are more specular or glossy. random distribution of facet normals results in diffuse reflectance.

Week 5, Mon 29 Sep 03 © Tamara Munzner20 ideal diffuse reflection –very rough surface at the microscopic level real-world example: chalk –microscopic variations mean incoming ray of light equally likely to be reflected in any direction over the hemisphere –what does the reflected intensity depend on? Physics of Reflection

Week 5, Mon 29 Sep 03 © Tamara Munzner21 Lambert’s Cosine Law ideal diffuse surface reflection the energy reflected by a small portion of a surface from a light source in a given direction is proportional to the cosine of the angle between that direction and the surface normal reflected intensity –independent of viewing direction – depends on surface orientation wrt light often called Lambertian surfaces

Week 5, Mon 29 Sep 03 © Tamara Munzner22 Lambert’s Law intuitively: cross-sectional area of the “beam” intersecting an element of surface area is smaller for greater angles with the normal.

Week 5, Mon 29 Sep 03 © Tamara Munzner23 Computing Diffuse Reflection angle between surface normal and incoming light is angle of incidence: I diffuse = k d I light cos  in practice use vector arithmetic I diffuse = k d I light (n l) nl  k d : diffuse component ”surface color”

Week 5, Mon 29 Sep 03 © Tamara Munzner24 Diffuse Lighting Examples Lambertian sphere from several lighting angles: need only consider angles from 0° to 90° –why? –demo: Brown exploratory on reflection

Week 5, Mon 29 Sep 03 © Tamara Munzner25 diffuse plus specular Specular Reflection shiny surfaces exhibit specular reflection –polished metal –glossy car finish specular highlight –bright spot from light shining on a specular surface view dependent –highlight position is function of the viewer’s position

Week 5, Mon 29 Sep 03 © Tamara Munzner26 Physics of Reflection at the microscopic level a specular reflecting surface is very smooth thus rays of light are likely to bounce off the microgeometry in a mirror-like fashion the smoother the surface, the closer it becomes to a perfect mirror

Week 5, Mon 29 Sep 03 © Tamara Munzner27 Optics of Reflection reflection follows Snell’s Law: –incoming ray and reflected ray lie in a plane with the surface normal –angle the reflected ray forms with surface normal equals angle formed by incoming ray and surface normal  (l)ight =  (r)eflection

Week 5, Mon 29 Sep 03 © Tamara Munzner28 Non-Ideal Specular Reflectance Snell’s law applies to perfect mirror-like surfaces, but aside from mirrors (and chrome) few surfaces exhibit perfect specularity how can we capture the “softer” reflections of surface that are glossy rather than mirror-like? one option: model the microgeometry of the surface and explicitly bounce rays off of it or…

Week 5, Mon 29 Sep 03 © Tamara Munzner29 Empirical Approximation we expect most reflected light to travel in direction predicted by Snell’s Law but because of microscopic surface variations, some light may be reflected in a direction slightly off the ideal reflected ray as angle from ideal reflected ray increases, we expect less light to be reflected

Week 5, Mon 29 Sep 03 © Tamara Munzner30 Empirical Approximation angular falloff how might we model this falloff?

Week 5, Mon 29 Sep 03 © Tamara Munzner31 Phong Lighting most common lighting model in computer graphics (Phong Bui-Tuong, 1975) n shiny : purely empirical constant, varies the rate of falloff no physical basis, works ok in practice v

Week 5, Mon 29 Sep 03 © Tamara Munzner32 Phong Lighting: The n shiny Term Phong reflectance term drops off with divergence of viewing angle from ideal reflected ray what does this term control, visually? Viewing angle – reflected angle

Week 5, Mon 29 Sep 03 © Tamara Munzner33 Phong Examples varying l varying n shiny

Week 5, Mon 29 Sep 03 © Tamara Munzner34 Calculating Phong Lighting compute cosine term of Phong lighting with vectors –v: unit vector towards viewer –r: ideal reflectance direction –k s : specular component highlight color how to efficiently calculate r ? v

Week 5, Mon 29 Sep 03 © Tamara Munzner35 Calculating The R Vector P = N cos θ = projection of L onto N P + S = R N cos θ + S = R S = P – L = N cos θ - L N cos θ + (N cos θ – L) = R 2 ( N cos θ ) – L = R cos θ = N · L 2 ( N (N · L)) – L = R N and R are unit length! L P P R S L N θ S P = N ( N · L ) 2 P = R + L 2 P – L = R 2 (N ( N · L )) - L = R

Week 5, Mon 29 Sep 03 © Tamara Munzner36 The Phong Lighting Model combine ambient, diffuse, specular components commonly called Phong lighting –once per light –once per color component

Week 5, Mon 29 Sep 03 © Tamara Munzner37 Phong Lighting: Intensity Plots

Week 5, Mon 29 Sep 03 © Tamara Munzner38 Blinn-Phong Model variation with better physical interpretation Jim Blinn, 1977 –h : halfway vector –highlight occurs when h near n l n v h

Week 5, Mon 29 Sep 03 © Tamara Munzner39 Lighting Review lighting models –ambient normals don’t matter –Lambert/diffuse angle between surface normal and light –Phong/specular surface normal, light, and viewpoint

Week 5, Mon 29 Sep 03 © Tamara Munzner40 Anisotropy so far we’ve been considering isotropic materials. –reflection and refraction invariant with respect to rotation of the surface about the surface normal vector. –for many materials, reflectance and transmission are dependent on this azimuth angle: anisotropic reflectance/transmission. –examples?

Week 5, Mon 29 Sep 03 © Tamara Munzner41 BRDF Bidirectional Reflectance Distribution Function  (x,  i,  o ) –x is the position. –  i = (  i,  i ) represents the incoming direction. (elevation, azimuth) –  o = (  o,  o ) represents the outgoing direction (elevation, azimuth)

Week 5, Mon 29 Sep 03 © Tamara Munzner42 Properties of the BRDF dependent on both incoming and outgoing directions: bidirectional. always positive: distribution function. invariant to exchange of incoming/outgoing directions: reciprocity principal. in general, BRDFs are anisotropic.

Week 5, Mon 29 Sep 03 © Tamara Munzner43 Dimensionality of BRDF function of position (3D), incoming, outgoing directions (4 angles), wavelength, and polarization. –thus, a 9D function! –usually simplify: ignore polarization (geometric optics!). sometimes ignore wavelength. assume uniform material (ignore position). isotropic reflectance makes one angle go away.