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

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

Shading. Brian Curless CSE 557 Autumn 2017

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

w Foley, Section16.1 Reading

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

Shading. Brian Curless CSE 457 Spring 2017

Shading. Brian Curless CSE 457 Spring 2015

Shading. CSE 457 Winter 2015

Comp 410/510 Computer Graphics. Spring Shading

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

Illumination & Shading

Shading I Computer Graphics I, Fall 2008

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

CS 5625 Lec 2: Shading Models

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

WHY WE NEED SHADING. Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like.

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

Shading. Why we need shading. Scattering. Shading. Objectives

Computer Graphics. Illumination and Shading

Simple Lighting/Illumination Models

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Illumination in Computer Graphics

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

CS6670: Computer Vision

Introduction to Computer Graphics 7. Shading

CS6670: Computer Vision

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

CSE 681 Illumination and Phong Shading

Illumination Models & Shading

Lecture 4: Reflection Models

CPSC 314 LIGHTING AND SHADING

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

Illumination. Illumination CMSC 435/634

Lighting affects appearance

CS5620 Intro to Computer Graphics

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

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

Lighting affects appearance

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

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

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

Illumination & Shading I

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Sung-Eui Yoon ( 윤성의 )

Local Reflection Models

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

Shading & Material Appearance

Virtual Reality for Human Computer Interaction

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

CS770/870 Spring 2017 Color and Shading

Ligh%ng and Reflectance

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

Shading 1: basics Christian Miller CS Fall 2011

Lighting. Figure 10.1

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

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

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics V. Guoying Zhao 1 / 65

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

Illumination & Shading: Part 1

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

Illumination and Shading

Interactive Real-Time Raycasting

Capturing light. Source: A. Efros

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

Timothy Walsh. Reflection Models

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

CS Computer Graphics: Illumination and Shading I

CS Computer Graphics: Illumination and Shading I

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

Illumination and Shading - II

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

7: Rendering (1) COMP Computer Graphics and Image Processing. Local illumination model. Global illumination model. Direct Direct.

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

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

The Rendering Equation. Computer Graphics CMU /15-662

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

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

Overview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL

Lighting and Materials

Reflection models and radiometry Advanced Graphics

Rendering Light Reflection Models

Light. Properties of light. What is light? Today What is light? How do we measure it? How does light propagate? How does light interact with matter?

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

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

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

Reflection and Shading

Visualisatie BMT. Rendering. Arjan Kok

Computer Graphics. Illumination and Shading

Radiometry Measuring Light

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

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

Raytracing CS148 AS3. Due :59pm PDT

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

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

BRDF Computer Graphics (Spring 2008)

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

Radiometry and reflectance

Transcription:

Shading

Introduction Affine transformations help us to place objects into a scene. Before creating images of these objects, we ll look at models for how light interacts with their surfaces. Such a model is called a shading model. Other names: Lighting model Light reflection model Local illumination model Reflectance model BRDF

An abundance of photons Properly determining the right color is really hard. Look around the room. Each light source has different characteristics. Trillions of photons are pouring out every second. These photons can: interact with the atmosphere, or with things in the atmosphere strike a surface and be absorbed be reflected (scattered) cause fluorescence or phosphorescence. interact in a wavelength-dependent manner generally bounce around and around University of Texas at Austin CS354 - Computer Graphics Don Fussell #

Break problem into two parts Part 1: What happens when photons interact with a particular point on a surface? Local illumination model Part 2: How do photons bounce between surfaces? And, what is the final result of all of this bouncing? Global illumination model Today we re going to focus on Part 1.

Strategy for today We re going to build up to an approximation of reality called the Phong illumination model. It has the following characteristics: not physically based gives a first-order approximation to physical light reflection very fast widely used We will assume local illumination, i.e., light goes: light source -> surface -> viewer. No interreflections, no shadows.

Setup Given: a point P on a surface visible through pixel p The normal N at P The lighting direction, L, and intensity, I l,at P The viewing direction, V, at P The shading coefficients (material properties) at P Compute the color, I, of pixel p. Assume that the direction vectors are normalized: N = L = V = 1

Iteration zero The simplest thing you can do is Assign each polygon a single color: where I is the resulting intensity k e is the emissivity or intrinsic shade associated with the object This has some special-purpose uses, but not really good for drawing a scene. [Note: k e is omitted in Watt.] I = k e

Iteration one Let s make the color at least dependent on the overall quantity of light available in the scene: I = k e + k a I a k a is the ambient reflection coefficient. really the reflectance of ambient light ambient light is assumed to be equal in all directions I a is the ambient intensity. Physically, what is ambient light?

Wavelength dependence Really, k e, k a, and I a are functions over all wavelengths λ. Ideally, we would do the calculation on these functions. We would start with: I(λ) = k e (λ) + k a (λ)i a (λ) then we would find good RGB values to represent the spectrum I(λ). Traditionally, though, k e, k a and I a are represented as RGB triples, and the computation is performed on each color channel separately: I R = k e,r + k a,r I a,r I G = k e,g + k a,g I a,g I B = k e,b + k a,b I a,b

Diffuse reflectors Diffuse reflection occurs from dull, matte surfaces, like latex paint, or chalk. These diffuse or Lambertian reflectors reradiate light equally in all directions. Picture a rough surface with lots of tiny microfacets.

Diffuse reflectors or picture a surface with little pigment particles embedded beneath the surface (neglect reflection at the surface for the moment): The microfacets and pigments distribute light rays in all directions. Embedded pigments are responsible for the coloration of diffusely reflected light in plastics and paints. Note: the figures above are intuitive, but not strictly (physically) correct.

Diffuse reflectors, cont. The reflected intensity from a diffuse surface does not depend on the direction of the viewer. The incoming light, though, does depend on the direction of the light source:

Iteration two The incoming energy is proportional to cos(θ), giving the diffuse reflection equations: I = k e + k a I a + k d I l cos(θ) + = k e + k a I a + k d I l (N L) + where: k d is the diffuse reflection coefficient I l is the intensity of the light source N is the normal to the surface (unit vector) L is the direction to the light source (unit vector) (x) + means max {0, x} [Note: Watt uses I i instead of I l.]

Specular reflection Specular reflection accounts for the highlight that you see on some objects. It is particularly important for smooth, shiny surfaces, such as: metal polished stone plastics apples skin Properties: Specular reflection depends on the viewing direction V. For non-metals, the color is determined solely by the color of the light. For metals, the color may be altered (e.g., brass)

Specular reflection derivation For a perfect mirror reflector, light is reflected about N, so! Il if V = R I = " # 0 otherwise For a near-perfect reflector, you might expect the highlight to fall off quickly with increasing angle φ. Also known as: rough specular reflection directional diffuse reflection glossy reflection

Derivation, cont. cos n s φ 1 0.9 0.8 0.7 0.6 0.5 ns = 1 N 1.0 L 90 120 0.8 0.6 150 0.4 0.2 R V 180 0 60 30 0.4 0.3 0.2 210 330 0.1 ns = 128 0 100 80 60 40 20 0 20 40 60 80 100 φ One way to get this effect is to take (R V), raised to a power n s. As n s gets larger, the dropoff becomes {more,less} gradual gives a {larger,smaller} highlight simulates a {more,less} mirror-like surface 240 300

Iteration three The next update to the Phong shading model is then: I = k e + k a I a + k d I l (N L) + + k s I l (R V) + n s where: k s is the specular reflection coefficient n s is the specular exponent or shininess R is the reflection of the light about the normal (unit vector) V is viewing direction (unit vector) [Note: Watt uses n instead of n s.]

What is incoming light intensity? So far we ve just been considering what happens at the surface itself. How does incoming light intensity change as light moves further away?

Intensity drop-off with distance OpenGL supports different kinds of lights: point, directional, and spot. For point light sources, the laws of physics state that the intensity of a point light source must drop off inversely with the square of the distance. We can incorporate this effect by multiplying I by 1/d 2 l. Sometimes, this distance-squared dropoff is considered too harsh. A common alternative is: f atten (d) = 1 a + bd + cd 2 with user-supplied constants for a, b, and c. [Note: not discussed in Watt.]

Iteration four Since light is additive, we can handle multiple lights by taking the sum over every light. Our equation is now: I = k e + k a I a + j f atten (d j )I l j [ n k d (N L j ) + + k s (R j V) s ] + This is the Phong illumination model.

Choosing the parameters Experiment with different parameter settings. To get you started, here are a few suggestions: Try n s in the range [0,100] Try k a + k d + k s < 1 Use a small k a (~0.1) Metal Plastic n s k d k s Small, Large, large color of color of metal metal medium Medium, color of plastic Planet 0 varying 0 Medium, white

BRDF The Phong illumination model is really a function that maps light from incoming (light) directions to outgoing (viewing) directions: f r (ω in,ω out ) This function is called the Bi-directional Reflectance Distribution Function (BRDF). Here s a plot with ω in held constant: Physically valid BRDF s obey Helmholtz reciprocity: f r (ω in,ω out ) = f r (ω out,ω in ) and should conserve energy (no light amplification).

f r (ω in,ω out ) = f r (L,V) How do we express Phong model using explicit BRDF? I = k e + k a I a + j f atten (d j )I l j [ n k d (N L j ) + + k s (R j V) s ] +

More sophisticated BRDF s Cook and Torrance, 1982 Westin, Arvo, Torrance 1992

Summary Local vs. Global Illumination Models Local Illumination Models: - Phong Physically inspired, but not truly physically correct. - Arbitrary BRDFs In applying the Phong model, we assumed unshadowed point light sources.