Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces

Similar documents
Illumination Models & Shading

CS Illumination and Shading. Slide 1

CS5620 Intro to Computer Graphics

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

Comp 410/510 Computer Graphics. Spring Shading

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

Illumination & Shading

Illumination and Shading

Illumination in Computer Graphics

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

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

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

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

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

Simple Lighting/Illumination Models

Introduction to Computer Graphics 7. Shading

Visualisatie BMT. Rendering. Arjan Kok

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

CEng 477 Introduction to Computer Graphics Fall

Reflection and Shading

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

Objectives. Continue discussion of shading Introduce modified Phong model Consider computation of required vectors

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

Shading I Computer Graphics I, Fall 2008

Illumination Models and Shading

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

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

Illumination & Shading I

Illumination and Shading

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

CPSC 314 LIGHTING AND SHADING

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Objectives. Shading II. Distance Terms. The Phong Reflection Model

Shading II. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Shading Models. Simulate physical phenomena

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

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

University of Victoria CSC 305 Shading. Brian Wyvill 2016

Why we need shading?

Graphics and Visualization

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

w Foley, Section16.1 Reading

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

CS 4600 Fall Utah School of Computing

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

Computer Graphics. Illumination and Shading

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

Shading and Illumination

Shading II. CITS3003 Graphics & Animation

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann

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

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

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

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

Illumination & Shading: Part 1

From Graphics to Visualization

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

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Lighting and Shading

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Lighting and Shading II. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Computer Graphics. Illumination and Shading

Lessons Learned from HW4. Shading. Objectives. Why we need shading. Shading. Scattering

CPSC / Illumination and Shading

CS770/870 Spring 2017 Color and Shading

CS 325 Computer Graphics

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

LIGHTING AND SHADING

Turn on the Lights: Reflectance

Objectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading

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

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

Illumination and Shading

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

Rendering Light Reflection Models

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

Graphics and Interaction Surface rendering and shading

Lecture outline Graphics and Interaction Surface rendering and shading. Shading techniques. Introduction. Surface rendering and shading

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

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

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

Computer Graphics: 3-Local Illumination Models

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

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

Shading. Brian Curless CSE 457 Spring 2017

Module 5: Video Modeling Lecture 28: Illumination model. The Lecture Contains: Diffuse and Specular Reflection. Objectives_template

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

Virtual Reality for Human Computer Interaction

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

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

CS 130 Final. Fall 2015

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

-=Bui Tuong Phong's Lighting=- University of Utah, but with shaders. Anton Gerdelan Trinity College Dublin

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

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

9. Illumination and Shading

Transcription:

Introduction to Computer Graphics Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces

Outline Computational tools Reflection models Polygon shading

Computation tools Surface normals Vector perpendicular to the tangent plane of the surface at particular location Angle of incidence & reflection Irradiance at a surface point is proportional to cosine of incident angle. Incident vector Tangent plane Normal vector θ Reflection angle Incident angle θ Reflected vector Surface patch

Calculating Surface Normals T 2 =df surface (u,/dv T 1 =df surface (u,/du N=T 1 XT 2 Surface: set of points satisfying: {F x (u,,f y (u,,f z (u,} Tangents: df (, ) x( u, dfy u v dfz,, } du du du df (, ) x dfy u v dfz,, } dv dv dv T = { 1 u= u v= v T = { 2 u= u v= v Normal vector: outer product of T 1 & T 2 1, 1, 1 1 S=F surface (u, N =det i dfx du dfx dv df y j du df y dv k df z du dfz dv

Surface Reflection Diffuse reflection Lambertian reflection Light source attenuation Colored lights & surfaces Specular reflection Shiny surfaces highlights

Diffuse Reflection Object s brightness only depends on: Direction of light source Distance from light source Lambertian reflection: (dull, matte surfaces) Equally bright from all viewing angles Reflect light equally in all directions does NOT follow incident/reflected angle law Incident intensity proportional to cosine of incident angle Illumination : I = I p k d cosθ (I p :source intensity, k d :material coefficient) L=P 1 -P 0 P 0 T L N P 1

Diffuse Reflection w/attenuation Light source attenuation factor: f att =(1/(dist) 2 ) Incident intensity also inversely proportional to distance from source Illumination (with ambient light intensity) : I=I a k a + f att I p k d cosθ I a : ambient light intensity I p : point light intensity k a,k d : surface material coefficients Material coefficients depend on surface type for example: wood has a higher diffuse reflection (higher k d ) vs metal which has high specularity

Colored lights and surfaces Colored lights represented by intensity for each red,green,blue component Surface color represented by red,green,blue component Red component illumination: I R =I ar k ar + f att I pr k d O dr cosθ Green component : I G =I ag k ag + f att I pg k d O dg cosθ Blue component : I B =I ab k ab + f att I pb k d O db cosθ K d : diffuse material coefficient O dr,o dg,o db : defines surface s diffuse color NOTE: In OpenGL, diffuse material coefficient is actually k d O dr, k d O dg or k d O db premultiplied

Specular Reflection Specularity: property of shiny surface Light reflected unequally in different directions Example: highlight on an apple Perfectly specular surface: mirror Light reflected only in direction of reflection vector Phong reflectance: maximum brightness if viewing angle = angle of reflection, otherwise falloff by cos n α n: material s specular reflection exponent I=I a k a + f att I p cosθ (k d + k s cos n α ) Direction of incidence Direction of reflection α θ θ Viewing direction

Polygon Shading Models Shading a surface 1. Using normal at each surface point, calculate illumination at that point. Need to render each point! 2. Shade polygons using their normals and illumination model Constant or Flat shading Gouraud shading: intensity interpolated across polygon Phong shading: normal vector interpolated across polygon

Constant Shading Assumptions: 1. Light source at infinity, cosθ is constant across polygon 2. Viewer is at infinity 3. Polygon actually represents a planar surface, not approximation to curved surface Illumination model calculated once per polygon Polygon rasterized with one color based on illumination model

Gouraud Shading Illumination model calculated at each vertex normal Polygon is shaded by linear interpolation 1. Polygon edges are shaded by interpolation between adjacent vertex colors 2. Polygon interior is shaded along each scan line by interpolation between adjacent edges Color interpolation can be easily integrated in scan line algorithms Implemented in hardware

Phong shading Normal vectors between vertices interpolated, rather than intensity Interpolation across edges first Normals then interpolated across each scan line Illumination model computed for each point in scan line Computationally expensive, but much more realistic for specular highlights Still cheaper than evaluating normal at each surface pointæwhy?

Comparison of different shading FLAT GOURAUD PHONG