University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Shading.

Slides:



Advertisements
Similar presentations
SI23 Introduction to Computer Graphics
Advertisements

5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.
Computer Vision Radiometry. Bahadir K. Gunturk2 Radiometry Radiometry is the part of image formation concerned with the relation among the amounts of.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Computer Graphics (Fall 2008) COMS 4160, Lecture 18: Illumination and Shading 1
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
The Radiance Equation Mel Slater. Outline Introduction Light Simplifying Assumptions Radiance Reflectance The Radiance Equation Traditional Rendering.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 21: Radiometry Many slides courtesy Pat Hanrahan.
Physically Based Illumination Models
1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.
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 New Mexico
Computer Graphics - Class 10
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading II Week.
Rendering (彩現 渲染).
IMGD 1001: Illumination by Mark Claypool
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
3/23/2005 © Dr. Zachary Wartell 1 Illumination Models and Surface- Rendering Methods.
Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Course Website: Computer Graphics 16: Illumination.
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
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Illumination.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
CS 445 / 645: Introductory Computer Graphics
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
University of Texas at Austin CS395T - Advanced Image Synthesis Spring 2007 Don Fussell Reflection Models I Today Types of reflection models The BRDF and.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
CS559: Computer Graphics Lecture 15: Hierarchical Modeling and Shading Li Zhang Spring 2008.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Ray Tracing.
David Luebke 1 10/26/2015 Lighting CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Illumination.
Announcements Office hours today 2:30-3:30 Graded midterms will be returned at the end of the class.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
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.
Local Illumination and Shading
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Computer Graphics Lecture 30 Mathematics of Lighting and Shading - IV Taqdees A. Siddiqi
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics: Illumination
© University of Wisconsin, CS559 Spring 2004
Isaac Gang University of Mary Hardin-Baylor
Chapter IX Lighting.
Computer Graphics (Fall 2003)
CS 480/680 Computer Graphics Shading.
Presentation transcript:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Shading

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 2 Reading Required: Watt, sections Optional: Watt, chapter 7.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 3 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

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 4 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 CS384G - Computer Graphics Fall 2010 Don Fussell 5 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.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 6 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.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 7 Setup… Given: a point P on a surface visible through pixel p The normal N at P The lighting direction, L, and intensity, I ,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:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 8 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.]

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 9 Iteration one Let’s make the color at least dependent on the overall quantity of light available in the scene: 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?

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 10 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: 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:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 11 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.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 12 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.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 13 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:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 14 Iteration two The incoming energy is proportional to cos(  ), giving the diffuse reflection equations: where: k d is the diffuse reflection coefficient I 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.]

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 15 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)

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 16 Specular reflection “derivation” For a perfect mirror reflector, light is reflected about N, so 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

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 17 Derivation, cont. 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

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 18 Iteration three The next update to the Phong shading model is then: 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.]

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 19 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?

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 20 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. Sometimes, this distance-squared dropoff is considered too “harsh.” A common alternative is: with user-supplied constants for a, b, and c. [Note: not discussed in Watt.]

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 21 Iteration four Since light is additive, we can handle multiple lights by taking the sum over every light. Our equation is now: This is the Phong illumination model.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 22 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) nsns kdkd ksks Metallarge Small, color of metal Large, color of metal Plasticmedium Medium, color of plastic Medium, white Planet0varying0

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 23 BRDF The Phong illumination model is really a function that maps light from incoming (light) directions to outgoing (viewing) directions: 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: and should conserve energy (no light amplification).

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 24 Phong BRDF How do we express Phong model using explicit BRDF?

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 25 More sophisticated BRDF’s Westin, Arvo, Torrance 1992 Cook and Torrance, 1982

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 26 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.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 27 Next time: Ray tracing Topics: How do we model the transport of light within the scene? How do we determine which surfaces are visible from the eye, or shadowed from a light? Read: Watt, sections , T. Whitted. An improved illumination model for shaded display. Communications of the ACM 23(6), , [Course reader, pp ] Optional: A. Glassner. An Introduction to Ray Tracing. Academic Press, [In the graphics research lab, ACES 2.102] K. Turkowski, “Properties of Surface Normal Transformations,” Graphics Gems, 1990, pp [Course reader pp ]