Illumination and Shading

Similar documents
CS Illumination and Shading. Slide 1

Graphics and Interaction Surface rendering and shading

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

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

Illumination Models & Shading

Introduction to Computer Graphics 7. Shading

CS5620 Intro to Computer Graphics

How do we draw a picture?

9. Illumination and Shading

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

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

CPSC 314 LIGHTING AND SHADING

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

Reflection and Shading

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

Pipeline Operations. CS 4620 Lecture 10

CS 130 Final. Fall 2015

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

Simple Lighting/Illumination Models

Lighting and Shading

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

CS 325 Computer Graphics

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

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

Illumination and Shading

Comp 410/510 Computer Graphics. Spring Shading

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

Lighting/Shading III. Week 7, Wed Mar 3

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

Illumination & Shading

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

Interpolation using scanline algorithm

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

CS770/870 Spring 2017 Color and Shading

Illumination & Shading I

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

Graphics for VEs. Ruth Aylett

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

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

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

CEng 477 Introduction to Computer Graphics Fall

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

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

Graphics for VEs. Ruth Aylett

Illumination & Shading: Part 1

Pipeline Operations. CS 4620 Lecture 14

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

Virtual Reality for Human Computer Interaction

Illumination and Shading

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

CPSC / Illumination and Shading

w Foley, Section16.1 Reading

CS 4600 Fall Utah School of Computing

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

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

CS Computer Graphics: Illumination and Shading I

CS Computer Graphics: Illumination and Shading I

Level of Details in Computer Rendering

Shading Models. Simulate physical phenomena

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

University of Victoria CSC 305 Shading. Brian Wyvill 2016

Spring 2012 Final. CS184 - Foundations of Computer Graphics. University of California at Berkeley

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

Chapter 7 - Light, Materials, Appearance

Computer Graphics. Illumination and Shading

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

Visualisatie BMT. Rendering. Arjan Kok

Illumination in Computer Graphics

Illumination. Illumination CMSC 435/634

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

Topics and things to know about them:

Why we need shading?

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

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

CS 4731: Computer Graphics Lecture 16: Phong Illumination and Shading. Emmanuel Agu

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

Illumination and Shading

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Computer Graphics. Illumination and Shading

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

Computer Graphics (CS 543) Lecture 8a: Per-Vertex lighting, Shading and Per-Fragment lighting

Scan Conversion- Polygons

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

Illumination Models and Shading

Graphics and Visualization

Illumination and Shading

Homework #2. Shading, Ray Tracing, and Texture Mapping

University of British Columbia CPSC 314 Computer Graphics Sep-Dec Tamara Munzner (guest lecturing) Lighting/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

Shading II. CITS3003 Graphics & Animation

Graphics Hardware and Display Devices

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Sung-Eui Yoon ( 윤성의 )

CS 498 VR. Lecture 19-4/9/18. go.illinois.edu/vrlect19

Shading Techniques Denbigh Starkey

Fast Phong Shading by Gary Bishop

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

Shading. Brian Curless CSE 457 Spring 2017

Transcription:

Illumination and Shading Illumination and Shading z Illumination Models y Ambient y Diffuse y Attenuation y Specular Reflection z Interpolated Shading Models y Flat, Gouraud, Phong y Problems CS4451: Fall 2002 1

Illumination Models: Ambient Light z Simple illumination model I = k i z Use nondirectional lights I = I a k a z I a = ambient light intensity z k a = ambient-reflection coefficient z Uniform across surface Diffuse Light z Account for light position y Ignore viewer position z Proportional to cosq between N and L I = I p k d cosq = I p k d (N L) z Model: I = I a k a + I p k d (N L) CS4451: Fall 2002 2

Attenuation: Distance z f att models distance from light I = I a k a + f att I p k d (N L) z Realistic f att = 1/(d L2 ) z Hard to control, so OpenGL uses f att = 1/(c 1 + c 2 d L + c 3 d L2 ) Attenuation: Atmospheric (fog, haze) z z f and z b : near/far depth-cue plane z s f and s b : scale factors z I dc : depth cue color z Given z f > z 0 > z b interpolate s f > s 0 > s b z Adjust intensity I = s 0 I + (1 - s 0 )I dc CS4451: Fall 2002 3

Colored Lights (slightly different, but equivalent, to book) z O d : diffuse color y (O dr, O dg, O db ) z Compute for each component z i.e. red compenent is I R = I ar k a O dr + f att I pr k d O dr (N L) z Note: use O d for ambient and diffuse Specular Reflection: Phong Model z Account for viewer position y Create highlights z Based on cos n a = (R V) n L N R y Larger n, smaller highlight z k s : specular reflection coef. Q Q a V I = I a k a O d + f att I p [ k d O d (N L) + k s (R V) n ] CS4451: Fall 2002 4

Multiple Light Sources z Obvious summation over m lights: I = I a k a O d + S f atti I pi [ k d O d (N L i ) + k s (R i V) n ] 1 0 m Shading Models: Flat Shading z Compute one color for polygon y Use polygon normal in lighting eqs. z Every pixel is assigned same color z Fast and simple z Shade of polygons independent CS4451: Fall 2002 5

Gouraud Shading N 3 N 4 Navg N 1 N 2 z Compute vertex normals y Average normals of abutting polygons z Use vertex normal in lighting eqs. z Linearly interpolate vertex intensities y Along edges y Along scan lines V 1 V 2 A V is B V 4 V 3 CS4451: Fall 2002 6

Gouraud Shading z Often appears dull, chalky y Lacks accurate specular component x If included, will be averaged over entire polygon z Mach banding y Artifact at discontinuities in intensity or intensity slope CS4451: Fall 2002 7

Phong Shading z Linearly interpolate vertex normals y Compute lighting eqs. at each pixel x Normals must be backmapped to WC z Can use specular component CS4451: Fall 2002 8

CS4451: Fall 2002 9

Closeup: Flat, Gouraud, Phong Problems with Interpolated Shading z Polygonal silhouette z Perspective distortion V 1 V 2 A V is B V 4 V 3 CS4451: Fall 2002 10

Problems with Interpolated Shading z Scanline/orientation dependent y Creates temporal aliasing when used to render animation frames: =? 8 4 Problems with Interpolated Shading z Shared vertices A B C z Unrepresentative vertex normals y Missed specular highlights y Missed geometry CS4451: Fall 2002 11

Lighting, in practice z z z z Full lighting equation: I = I a k a O d + S f atti I pi [ k d O d (N L i ) + k s (R i V) n ] 1 0 m Ignore specular for now Each surface: O d, k a, k d, v i (i=0..n), N Each light: I a or d, f att (c 1, c 2, c 3 ), P L (position) At a given point z Start with ambient: I a k a O d y R/G/B using I ar, I ag, I ab, O dr, O dg, O db z For each Light, compute: f att I p k d O d (N L i ) y Position (P P ), normal (N P ) y L vector y d L y f att = 1/(c 1 + c 2 d L + c 3 d L2 ) y R/G/B using I pr, I pg, I pb, O dr, O dg, O db CS4451: Fall 2002 12

Light Intensity Values z I a, I d yrepresent intensity yhave R,G,B components ydo not need to fall in the 0..1 range! x Often need I d >1 x Final computed I 1 Specular z A light might have a diffuse and specular specification, say I s y Allow slightly different colors, more control x Remember, it s a hack anyway! z I s would have RGB parts, as with I a, I d z Illumination formula becomes I = I a k a O d + S f atti [I pdi k d O d (N L i ) + I psi k s (R i V) n ] 1 0 m CS4451: Fall 2002 13