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

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

Illumination & Shading: Part 1

Illumination and Shading

Illumination & Shading

Computer Graphics. Illumination and Shading

Sung-Eui Yoon ( 윤성의 )

CSE 681 Illumination and Phong Shading

w Foley, Section16.1 Reading

CS5620 Intro to Computer Graphics

Illumination Models & Shading

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

CPSC 314 LIGHTING AND SHADING

Shading I Computer Graphics I, Fall 2008

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

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

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

Comp 410/510 Computer Graphics. Spring Shading

Introduction to Computer Graphics 7. Shading

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Illumination & Shading

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

Reflection and Shading

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Illumination and Shading ECE 567

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Simple Lighting/Illumination Models

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

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

CEng 477 Introduction to Computer Graphics Fall

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

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

Visualisatie BMT. Rendering. Arjan Kok

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

Shading & Material Appearance

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

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

Light Transport Baoquan Chen 2017

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

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information

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

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

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

CPSC / Illumination and Shading

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

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

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

Shading. Brian Curless CSE 557 Autumn 2017

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

9. Illumination and Shading

Computer Graphics. Illumination and Shading

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

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

Ray-Tracing. Misha Kazhdan

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

Computer Graphics: 3-Local Illumination Models

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

Illumination and Shading

Lighting. Figure 10.1

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Illumination in Computer Graphics

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

Lighting and Shading

Shading. Brian Curless CSE 457 Spring 2017

CS 5625 Lec 2: Shading Models

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

Classic Rendering Pipeline

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

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

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

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

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

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

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

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

CS770/870 Spring 2017 Color and Shading

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

University of British Columbia CPSC 314 Computer Graphics Sep-Dec Tamara Munzner (guest lecturing) Lighting/Shading

Shading 1: basics Christian Miller CS Fall 2011

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

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

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

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

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

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

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

Illumination Models and Shading

Virtual Reality for Human Computer Interaction

CS 4600 Fall Utah School of Computing

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

INF3320 Computer Graphics and Discrete Geometry

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

CS 325 Computer Graphics

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

CS452/552; EE465/505. Intro to Lighting

specular diffuse reflection.

Shading Intro. Shading & Lighting. Light and Matter. Light and Matter

Today s class. Simple shadows Shading Lighting in OpenGL. Informationsteknologi. Wednesday, November 21, 2007 Computer Graphics - Class 10 1

Ambient reflection. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 407

Transcription:

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

Spot the differences

Terminology Illumination The transport of luminous flux from light sources between points via direct and indirect paths Lighting The process of computing the luminous intensity reflected from a specified 3-D point Shading The process of assigning a color to a pixel Illumination Models Simple approximations of light transport Physical models of light transport

Two Components of Illumination Light Sources Emission Spectrum (color) Geometry (position and direction) Directional Attenuation Surface Properties (Reflectors) Reflectance Spectrum (color) Geometry (position, orientation, and micro-structure) Absorption Transmission

Ambient Light Source Even though an object in a scene is not directly lit it will still be visible. This is because light is reflected indirectly from nearby objects. A simple hack that is commonly used to model this indirect illumination is to use of an ambient light source. Ambient light has no spatial or directional characteristics. The amount of ambient light incident on each object is a constant for all surfaces in the scene. An ambient light can have a color. The amount of ambient light that is reflected by an object is independent of the object's position or orientation. Surface properties are used to determine how much ambient light is reflected.

Directional Light Sources All of the rays from a directional light source have a common direction, and no point of origin. It is as if the light source was infinitely far away from the surface that it is illuminating. Sunlight is an example of an infinite light source. The direction from a surface to a light source is important for computing the light reflected from the surface. With a directional light source this direction is a constant for every surface. A directional light source can be colored.

Point Light Sources The point light source emits rays in radial directions from its source. A point light source is a fair approximation to a local light source such as a light bulb. The direction of the light to each point on a surface changes when a point light source is used. Thus, a normalized vector to the light emitter must be computed for each point that is illuminated.

Other Light Sources Spotlights Point source whose intensity falls off away from a given direction Requires a color, a point, a direction, parameters that control the rate of fall off Area Light Sources Light source occupies a 2-D area (usually a polygon or disk) Generates soft shadows Extended Light Sources Spherical Light Source Generates soft shadows

Area Light Source: Direct Lighting

Area Light Source: Indirect Lighting

Ideal Diffuse Reflection First, we will consider a particular type of surface called an ideal diffuse reflector. An ideal diffuse surface is, at the microscopic level a very rough surface. Chalk is a good approximation to an ideal diffuse surface. Because of the microscopic variations in the surface, an incoming ray of light is equally likely to be reflected in any direction over the hemisphere.

Lambert's Cosine Law Ideal diffuse reflectors reflect light according to Lambert's cosine law, Lambert's law states that the reflected energy from a small surface area in a particular direction is proportional to cosine of the angle between that direction and the surface normal.

Computing Diffuse Reflection The angle between the surface normal and the incoming light ray is called the angle of incidence. I light : intensity of the incoming light. k d : represents the diffuse reflectivity of the surface at that wavelength. What is the range of k d

Specular Reflection When we look at a shiny surface, such as polished metal, we see a highlight, or bright spot. Where this bright spot appears on the surface is a function of where the surface is seen from. The reflectance is view dependent.

Snell's Law Reflection behaves according to Snell's law: The incoming ray, the surface normal, and the reflected ray all lie in a common plane. The angle that the reflected ray forms with the surface normal is determined by the angle that the incoming ray forms with the surface normal, and the relative speeds of light of the mediums in which the incident and reflected rays propagate according to the following expression. (Note: n l and n r are the indices of refraction)

Reflection Reflection is a very special case of Snell's Law where the incident light's medium and the reflected rays medium is the same. Thus angle of incidence = angle of reflection

Non-ideal Reflectors Snell's law, applies only to ideal mirror reflectors. In general, most of the reflected light travels in the direction of the ideal 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.

Phong Illumination Phong Illumination approximates specular fall-off with no physical basis, yet it is one of the most commonly used illumination models in computer graphics. I k I f = f specular light cosn shiny s The cosine term is maximum when the surface is viewed from the mirror direction and falls off to 0 when viewed at 90 degrees away from it. The scalar n shiny controls the rate of this fall off.

Effect of the n shiny coefficient The diagram below shows the how the reflectance drops off in a Phong illumination model. For a large value of the n shiny coefficient, the reflectance decreases rapidly with increasing viewing angle.

Computing Phong Illumination specular light ( ˆ ˆ n = I k I V R s ) shiny

Blinn & Torrance Variation In this equation the angle of specular dispersion is computed by how far the surface's normal is from a vector bisecting the incoming light direction and the viewing direction. specular light ( = ˆ I k I N H s ) shiny ˆ n

Phong Examples

Phong Illumination: The General Equation I o (N,V,L)= k a I a + I i [ k d max(0, N.L) + k s max(0,(v.r ) n )]

Where do we Illuminate? To this point we have discussed how to compute an illumination model at a point on a surface. Which points on the surface is the illumination model applied? Illumination can be costly and then God said let there be shading

Topic 10: Shading Introduction to Shading Flat Shading Interpolative Shading Gouraud shading Phong shading Triangle scan-conversion with shading

Shading: Motivation Suppose we know how to shade any point on an object, for example, using the Phong illumination model. How do we shade an entire polygon mesh? Answer: Shade projected visible pixels using an illumination model. What is good and bad about this?

Flat Shading Apply only one illumination calculation for each face. Which point on the facet do we illuminate? Pros? Cons?

Gouraud Shading Apply the illumination model at vertices and interpolate the color intensity across faces. Remember bilinear interpolation? Pros? Cons?

Phong Shading Not to be confused with Phong Illumination model. Apply the illumination model at every point on the face. Calculate the normal at any point in a face by interpolating the vertex normals.of that face. Pros? Cons? Silhouettes?