Shading & Material Appearance

Similar documents
Experimental Validation of Analytical BRDF Models

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

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

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

CS 5625 Lec 2: Shading Models

w Foley, Section16.1 Reading

Shading. Brian Curless CSE 557 Autumn 2017

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

Illumination & Shading: Part 1

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

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

BRDF Computer Graphics (Spring 2008)

Sung-Eui Yoon ( 윤성의 )

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

Illumination and Shading

Simple Lighting/Illumination Models

Computer Graphics. Illumination and Shading

Shading / Light. Thanks to Srinivas Narasimhan, Langer-Zucker, Henrik Wann Jensen, Ravi Ramamoorthi, Hanrahan, Preetham

Reflection models and radiometry Advanced Graphics

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

Surface Reflection Models

Complex Shading Algorithms

Lecture 4: Reflection Models

CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Illumination in Computer Graphics

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

Timothy Walsh. Reflection Models

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

CPSC 314 LIGHTING AND SHADING

Illumination and Shading - II

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

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

Lighting affects appearance

And if that 120MP Camera was cool

CSE 681 Illumination and Phong Shading

Shading. Brian Curless CSE 457 Spring 2017

Local Reflection Models

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

Illumination & Shading

Lighting and Materials

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

Radiometry and reflectance

Computer Graphics (CS 543) Lecture 8 (Part 1): Physically-Based Lighting Models

Lighting and Reflectance COS 426

CS6670: Computer Vision

Image Formation: Light and Shading. Introduction to Computer Vision CSE 152 Lecture 3

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

02 Shading and Frames. Steve Marschner CS5625 Spring 2016

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Lecture 22: Basic Image Formation CAP 5415

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

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

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

Visual Appearance and Color. Gianpaolo Palma

CS5620 Intro to Computer Graphics

Photometric Stereo.

CS6670: Computer Vision

Shading 1: basics Christian Miller CS Fall 2011

Materials & Shadows. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Winter 2017

Illumination. Illumination CMSC 435/634

Illumination & Shading

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Local vs. Global Illumination & Radiosity

Light Reflection Models

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

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

Rendering Light Reflection Models

Shading, lighting, & BRDF Theory. Cliff Lindsay, PHD

Lab 9 - Metal and Glass

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

Announcements. Image Formation: Light and Shading. Photometric image formation. Geometric image formation

CPSC / Illumination and Shading

Ray Tracing: shading

Radiometry & BRDFs CS295, Spring 2017 Shuang Zhao

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

Fundamentals of Rendering - Reflectance Functions

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

Lighting affects appearance

Illumination Models & Shading

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

Computer Graphics. Illumination and Shading

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

Shaders. Oscar. 1/43 Apodaca and Gritz, Advanced RenderMan

Rendering Light Reflection Models

Virtual Reality for Human Computer Interaction

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

Visualisatie BMT. Rendering. Arjan Kok

Comp 410/510 Computer Graphics. Spring Shading

Shading I Computer Graphics I, Fall 2008

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

Introduction Rasterization Z-buffering Shading. Graphics 2012/2013, 4th quarter. Lecture 09: graphics pipeline (rasterization and shading)

Shading. Brian Curless CSE 457 Spring 2015

Subsurface Scattering & Complex Material Properties

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

Raytracing. COSC 4328/5327 Scott A. King

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

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

Transcription:

Shading & Material Appearance ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. MIT EECS 6.837 Matusik 1

Lighting and Material Appearance Input for realistic rendering Geometry, Lighting and Materials Material appearance Intensity and shape of highlights Glossiness Color Spatial variation, i.e., texture (next Tuesday) source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Slide Addy Ngan 2

Unit Issues - Radiometry We will not be too formal in this class Issues we will not really care about Directional quantities vs. integrated over all directions Differential terms: per solid angle, per area Power? Intensity? Flux? Color All math here is for a single wavelength only; we will perform computations for R, G, B separately Do not panic, that just means we will perform every operation three times, that is all 3

Light Sources Today, we only consider point light sources Thus we do not need to care about solid angles For multiple light sources, use linearity We can add the solutions for two light sources I(a+b) = I(a) + I(b) We simply multiply the solution when we scale the light a intensity b I(s a) = s I(a) Yet again, linearity is our friend! 4

Intensity as Function of Distance 1/r 2 fall-off for isotropic point lights Why? An isotropic point light outputs constant power per solid angle ( into all directions ) Must have same power in all concentric spheres Sphere s surface area grows with r 2 => energy obeys 1/r 2 but in graphics we often cheat with or ignore this. Why? Ideal point lights are kind of harsh Intensity goes to infinity when you get close not great! In particular, 1/(ar 2 +br+c) is popular r1 r2 5

Incoming Irradiance The amount of light energy received by a surface depends on incoming angle Bigger at normal incidence, even if distance is const. Similar to winter/summer difference How exactly? Cos θ law Dot product with normal n θ Surface 6

Incoming Irradiance for Pointlights Let s combine this with the 1/r 2 fall-off: I in is the irradiance ( intensity ) at surface point x I light is the intensity of the light θ is the angle between light direction l and surface normal n r is the distance between light and x. n θ l x Surface 7

Directional Lights Pointlights that are infinitely far No falloff, just one direction and one intensity I in is the irradiance at surface point x from the directional light n θ l I light is the intensity of the light θ is the angle between light direction l and surface normal n Only depends on n, not x! x Surface 8

Spotlights Pointlights with non-uniform directional emission Usually symmetric about a central direction d, with angular falloff Often two angles Hotspot angle: No attenuation within the central cone Falloff angle: Light attenuates from full intensity to zero intensity between the hotspot and falloff angles Plus your favorite distance falloff curve 9 d

Spotlight Geometry (direction d) hotspot angle Adapted from POVRAY documentation 10

Questions? 11

Quantifying Reflection BRDF Bidirectional Reflectance Distribution Function Ratio of light coming from one direction that gets reflected in another direction Pure reflection, assumes no light scatters into the material ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Incoming direction Focuses on angular aspects, not spatial variation of the material How many dimensions? Outgoing direction 12

BRDF f r 13

BRDF f r 14

BRDF f r Relates incident irradiance from every direction to outgoing light. How? l = light direction (incoming) v = view direction (outgoing) 15

BRDF f r Relates incident irradiance from every direction to outgoing light. How? l = light direction (incoming) v = view direction (outgoing) Let s combine with what we know already of pointlights: 16

2D Slice at Constant Incidence For a fixed incoming direction, view dependence is a 2D spherical function Here a moderate specular component ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. highlight incoming incoming Courtesy of Mitsubishi Electric Researh Laboratories, Inc. Used with permission. Example: Plot of PVC BRDF at 55 incidence 17

Demo 18

Isotropic vs. Anisotropic When keeping l and v fixed, if rotation of surface around the normal does not change the reflection, the material is called isotropic Surfaces with strongly oriented microgeometry elements are anisotropic Examples: brushed metals, hair, fur, cloth, velvet Westin et.al 92 19

Demo 20

How do we obtain BRDFs? One possibility: Gonioreflectometer 4 degrees of freedom Source: Greg Ward ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 21

How Do We Obtain BRDFs? Another possibility: Take pictures of spheres coated with material, rotate light around a 1D arc This gives 3DOF => isotropic materials only Matusik et al. 22

Parametric BRDFs BRDFs can be measured from real data But tabulated 4D data is too cumbersome for most uses Therefore, parametric BRDF models represent the relationship between incident and outgoing light by some mathematical formula The appearance can then be tuned by setting parameters Shininess, anisotropy, etc. Physically-based or Phenomenological They can model with measured data (examples later) Popular models: Diffuse, Blinn-Phong, Cook- Torrance, Lafortune, Ward, Oren-Nayar, etc. 23

Questions? 24

Ideal Diffuse Reflectance Assume surface reflects equally in all directions. An ideal diffuse surface is, at the microscopic level, a very rough surface. Example: chalk, clay, some paints Surface 25

Ideal Diffuse Reflectance Ideal diffuse reflectors reflect light according to Lambert s cosine law The reflected light varies with cosine even if distance to light source is kept constant 26

Ideal Diffuse Reflectance Ideal diffuse reflectors reflect light according to Lambert s cosine law The reflected light varies with cosine even if distance to light source is kept constant Remembering that incident irradiance depends on cosine, what is the BRDF of an ideally diffuse surface? 27

Ideal Diffuse Reflectance The ideal diffuse BRDF is a constant f r (l, v) = const. What constant ρ/π, where ρ is the albedo Coefficient between 0 and 1 that says what fraction is reflected Usually just called diffuse color k d You have already implemented this by taking dot products with the normal and multiplying by the color! 28

Ideal Diffuse Reflectance This is the simplest possible parametric BRDF One parameter: k d (One for each RGB channel) 29

Ideal Diffuse Reflectance Math Single Point Light Source k d : diffuse coefficient (color) n: Surface normal. l: Light direction. L i : Light intensity light source r: Distance to source L o : Shaded color n θ l r Surface 30

Ideal Diffuse Reflectance Math Single Point Light Source k d : diffuse coefficient (color) n: Surface normal. l: Light direction. L i : Light intensity r: Distance to source L o : Shaded color Do not forget to normalize your n and l! n We do not want light r from below the l surface! From now on we always assume (on this lecture) that dot products are clamped to zero and Surface light source skip writing out the max(). 31

Questions? 32

Ideal Specular Reflectance Reflection is only at mirror angle View dependent Microscopic surface elements are usually oriented in the same direction as the surface itself. Examples: mirrors, highly polished metals. light source n r θ θ l Surface 33

Recap: How to Get Mirror Direction Reflection angle = light angle Both R & L have to lie on one plane R = L + 2 (L N) N N light source L R θ L θ R L N N -L L N N 34

Ideal Specular BRDF Light only reflects to the mirror direction A Dirac delta multiplied by a specular coefficient k s Not very useful for point lights, only for reflections of other surfaces Why? You cannot really see a mirror reflection of an infinitely small light! 35

Non-ideal Reflectors Real glossy materials usually deviate significantly from ideal mirror reflectors Highlight is blurry They are not ideal diffuse surfaces either 36

Non-ideal Reflectors Simple Empirical Reasoning for Glossy Materials We expect most of the reflected light to travel in the direction of the ideal mirror ray. However, because of microscopic surface variations we might expect some of the light to be reflected just slightly offset from the ideal reflected ray. As we move farther and farther, in the angular sense, from the reflected ray, we expect to see less light reflected. 37

The Phong Specular Model How much light is reflected? Depends on the angle between the ideal reflection direction r and the viewer direction v. r n light source Camera v θ θ l Surface 38

The Phong Specular Model Parameters k s : specular reflection coefficient q : specular reflection exponent r n light source Camera v θ θ l Surface 39

The Phong Model Effect of q the specular reflection exponent 40

Terminology: Specular Lobe The specular reflection distribution is usually called a lobe For Phong, its shape is light source Surface 41

The Complete Phong Model Sum of three components: ideal diffuse reflection + specular reflection + ambient. light source Surface 42

Ambient Illumination Represents the reflection of all indirect illumination. This is a total hack! Avoids the complexity of indirect ( global ) illumination 43

Putting It All Together Phong Illumination Model Leonard McMillan. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 44

Putting It All Together Phong Illumination Model Is it physically based? No, does not even conserve energy, may well reflect more energy than what goes in Furthermore, it does not even conform to the BRDF model directly (we are taking the proper cosine for diffuse, but not for specular) And ambient was a total hack 45

Phong Examples The spheres illustrate specular reflections as the direction of the light source and the exponent q (amount of shininess) is varied. 46

Fresnel Reflection Increasing specularity near grazing angles. Most BRDF models account for this. Source: Lafortune et al. 97 ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 47

Questions? 48

Blinn-Torrance Variation of Phong Uses the halfway vector h between l and v. h n Light source Camera l v Surface 49

Lobe Comparison Half vector lobe Gradually narrower when approaching grazing Mirror lobe Always circular Half vector lobe Mirror lobe 50

Half Vector Lobe is Better More consistent with what is observed in measurements (Ngan, Matusik, Durand 2005) Courtesy of Mitsubishi Electric Researh Laboratories, Inc. Used with permission. Example: Plot of PVC BRDF at 55 incidence 51

Questions? 52

Microfacet Theory Example Think of water surface as lots of tiny mirrors (microfacets) Bright pixels are Microfacets aligned with the vector between sun and eye But not the ones in shadow And not the ones that are occluded Image of sunset removed due to copyright restrictions. 53

Microfacet Theory Model surface by tiny mirrors [Torrance & Sparrow 1967] 54

Microfacet Theory Value of BRDF at (L,V) is a product of number of mirrors oriented halfway between L and V 55

Microfacet Theory Value of BRDF at (L,V) is a product of number of mirrors oriented halfway between L and V 56

Microfacet Theory Value of BRDF at (L,V) is a product of number of mirrors oriented halfway between L and V 57

Microfacet Theory Value of BRDF at (L,V) is a product of number of mirrors oriented halfway between L and V ratio of the un(shadowed/masked) mirrors 58

Microfacet Theory Value of BRDF at (L,V) is a product of number of mirrors oriented halfway between L and V ratio of the un(shadowed/masked) mirrors Fresnel coefficient 59

Shadowing and Masking Some facets are hidden from viewpoint Some are hidden from the light hidden from viewpoint hidden from viewpoint 60

Microfacet Theory-based Models Develop BRDF models by imposing simplifications [Torrance-Sparrow 67], [Blinn 77], [Cook-Torrance 81], [Ashikhmin et al. 2000] Model the distribution p(h) of microfacet normals Also, statistical models for shadows and masking spherical plot of a Gaussian-like p(h) 61

Full Cook-Torrance Lobe ρ s is the specular coefficient (3 numbers RGB) D is the microfacet distribution δ is the angle between the half vector H and the normal N m defines the roughness (width of lobe) G is the shadowing and masking term Need to add a diffuse term 62

Questions? Designer BRDFs by Ashikhmin et al. ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 63

BRDF Examples from Ngan et al. Acquired data Lighting Material Dark blue paint Courtesy of Mitsubishi Electric Researh Laboratories, Inc. Used with permission. 64

Dark Blue Paint Acquired data Blinn-Phong Courtesy of Mitsubishi Electric Researh Laboratories, Inc. Used with permission. Finding the BRDF model parameters that best reproduce the real material Material Dark blue paint 65

Dark Blue Paint Acquired data Cook-Torrance Courtesy of Mitsubishi Electric Researh Laboratories, Inc. Used with permission. Finding the BRDF model parameters that best reproduce the real material Material Dark blue paint 66

Observations Some materials impossible to represent with a single lobe Acquired data Cook-Torrance Material Red Christmas Ball Courtesy of Mitsubishi Electric Researh Laboratories, Inc. Used with permission. 67

Adding a Second Lobe Some materials impossible to represent with a single lobe Acquired data Cook-Torrance 2 lobes Material Red Christmas Ball Courtesy of Mitsubishi Electric Researh Laboratories, Inc. Used with permission. 68

Image-Based Acquisition A Data-Driven Reflectance Model, SIGGRAPH 2003 The data is available http://people.csail.mit.edu/wojciech/brdfdatabase/ ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 69

Questions? T. Weyrich et al., Fabricating Microgeometry for Custom Surface Reflectance, SIGGRAPH 2009 Images of Fig. 1 and Fig. 6 in Weyrich T. et al, "Fabricating Microgeometry for Custom Surface Reflectance." SIGGRAPH '09 ACM SIGGRAPH 2009 papers; Article No. 32 --removed due to copyright restrictions. 70

Phong Normal Interpolation (Not Phong Shading) Interpolate the average vertex normals across the face and use this in shading computations Again, use barycentric interpolation! 71

That s All for Today! Images from the movie, The Matrix, removed due to copyright restrictions. 72

Spatial Variation All materials seen so far are the same everywhere In other words, we are assuming the BRDF is independent of the surface point x No real reason to make that assumption More next time ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Courtesy of Fredo Durand. Used with permission. 73

MIT OpenCourseWare http://ocw.mit.edu 6.837 Computer Graphics Fall 2012 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.