Illumination & Shading

Similar documents
Comp 410/510 Computer Graphics. Spring Shading

Shading I Computer Graphics I, Fall 2008

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

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

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

Introduction to Computer Graphics 7. Shading

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

Why we need shading?

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

CS452/552; EE465/505. Intro to Lighting

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

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

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

CS 4600 Fall Utah School of Computing

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

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

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

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

Illumination in Computer Graphics

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

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Virtual Reality for Human Computer Interaction

Illumination Models & Shading

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

CS5620 Intro to Computer Graphics

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

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

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

Lighting. Figure 10.1

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

w Foley, Section16.1 Reading

Illumination & Shading I

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

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

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

Introduction to Computer Graphics with WebGL

CS Illumination and Shading. Slide 1

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

CSE 681 Illumination and Phong Shading

Simple Lighting/Illumination Models

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

Graphics and Visualization

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

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

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

Illumination & Shading: Part 1

CS452/552; EE465/505. Lighting & Shading

CHAPTER5. We have learned to build three-dimensional graphical models and to LIGHTING AND SHADING

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

Reflection and Shading

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

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

CS Computer Graphics: Illumination and Shading I

CS Computer Graphics: Illumination and Shading I

Local Reflection Models

Shading. Brian Curless CSE 557 Autumn 2017

Illumination and Shading

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

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

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

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

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Raytracing. COSC 4328/5327 Scott A. King

Computer Graphics. Illumination and Shading

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

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

Turn on the Lights: Reflectance

Visualisatie BMT. Rendering. Arjan Kok

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

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

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

Illumination and Shading

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

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

CS 5625 Lec 2: Shading Models

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Graphics for VEs. Ruth Aylett

University of Victoria CSC 305 Shading. Brian Wyvill 2016

Computer Graphics. Illumination and Shading

Illumination and Shading ECE 567

Supplement to Lecture 16

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

Sung-Eui Yoon ( 윤성의 )

Complex Shading Algorithms

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

Graphics for VEs. Ruth Aylett

Shading. Brian Curless CSE 457 Spring 2017

CEng 477 Introduction to Computer Graphics Fall

Illumination Models and Shading

Shading 1: basics Christian Miller CS Fall 2011

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

OpenGL Lighting Computer Graphics Spring Frank Palermo

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

1.6 Rough Surface Scattering Applications Computer Graphic Shading and Rendering

Transcription:

Illumination & Shading

Goals Introduce the types of light-material interactions Build a simple reflection model---the Phong model--- that can be used with real time graphics hardware

Why we need Illumination and Shading Suppose we build a model of a sphere using many polygons and color it with an assigned color we get: But we want

Shading Why does the image of a real sphere look like Light-material interactions cause each point to have a different color or shade Need to consider? Light sources Material properties Location of viewer Surface orientation

Real Light Scattering Light strikes A Some scattered Some absorbed Some of scattered light strikes B Some scattered Some absorbed Some of this scattered light strikes A and so on

Rendering Equation The infinite scattering and absorption of light can be described by the rendering equation Cannot be solved in general Ray tracing is a special case for perfectly reflecting surface

Global Lighting/Rendering Effects shadow translucent surface multiple reflection

Local vs. Global Lighting Correct shading requires a global calculation involving all objects and light sources Incompatible with pipeline model which shades each polygon independently (local lighting) However, in computer graphics, especially real time graphics, we are happy if things look right Many techniques for approximating global effects

Step 1: Light Sources General light sources are difficult to work with because we must integrate light coming from all points on the source

Light Source Simplifications Point source Model with position and color Directional (Distant) source = infinite distance away (parallel) Ambient light Same amount of light everywhere in scene Models contribution of many sources and reflecting surfaces

Step 2: Light-Material Interactions Light that strikes an object is partially absorbed and partially scattered (reflected) The wavelength and amount reflected determines the color and brightness of the object A surface appears red under white light because the red component of the light is reflected and the rest is absorbed The reflected light is scattered in a manner that depends on the smoothness and orientation of the surface

Surface Properties - Smoothness The smoother a surface, the more reflected light is concentrated in the direction a perfect mirror would reflected the light A very rough surface scatters light in all directions smooth surface rough surface

Phong Illumination Model A simple model that can be computed rapidly has three components Diffuse evenly distr. (rough surface) Specular mirror (smooth surface) Ambient global light Requires four vectors To source To viewer Normal Perfect reflector

Phong Illum Modeling Light Sources Each light source diffuse specular ambient Separate red, green and blue components Hence, 9 coefficients for each point source L dr, L dg, L db, L sr, L sg, L sb, L ar, L ag, L ab

Phong Illumination Material Properties Material properties determine how much light is absorbed and how much reflected and in which directions Material property for each wavelength R dr, R dg, R db, R sr, R sg, R sb, R ar, R ag, R ab

Phong Illumination Equation Total red intensity I r = R ira L ira + R ird L ird + R irs L irs i Intensity of red ambient light (or how much red is coming in) reflectivity of red ambient material (or how much red is going back out)

Ambient Reflection All the other light Intensity is the same at all points on surface Not all light is reflected some is absorbed R = k a a ambient coefficient I = k L (for each r, g, b) 0 < k < 1 a a a

Diffuse Surfaces In a perfectly diffuse reflector (Lambertian Surface), light is scattered equally in all directions appears same to all viewers!! Amount of light reflected is proportional to the vertical (normal) component of incoming light

Diffuse Surface Amount of light energy that falls on a surface area element (and is reflected) is proportional to the cosine of angle of incidence of the light R ~cos θ i cos θ i = l n if vectors normalized There are also three coefficients, k r, k b, k g that show how much of each color component is reflected vs. absorbed I = k ( l n) L d d d l θ n

Specular Surfaces Most surfaces are neither ideal diffusers nor perfectly specular (ideal refectors) Smooth surfaces show specular highlights due to incoming light being reflected in directions concentrated close to the direction of a perfect reflection specular highlight

Modeling Specular Reflections Phong proposed using a term that dropped off as the angle between the viewer and the ideal reflection increased I s = k s L s cos α φ α ( v r) reflected shininess coef intensity incoming intensity reflectivity coef φ

Shininess Coefficient Values of α between 100 and 200 correspond to metals Values between 5 and 10 give surface that look like plastic cos α φ -90 φ 90

Computing Reflection Vector, r Normal is determined by local orientation Angle of incidence = angle of reflection The three vectors must be coplanar r = 2 (l n ) n - l?

Modified Phong Model The specular term in the Phong model is problematic because it requires the calculation of a new reflection vector and view vector for each vertex Blinn suggested an approximation using the halfway vector that is more efficient

The Halfway Vector H is normalized vector halfway between L and V Use it s relationship to N to approx dot(v,r) Highlight occurs when H is near N Note Beta = ½ alpha, so need a new exponent H = L +V L +V Replace (V R) α β α with (N H ) p

Putting it all together For each light source and each color component, the Phong model can be written (without the distance terms) as I =k d L d l n + k s L s (v r ) α + k a L a For each color component we add contributions from all sources

Example Only differences in these teapots are the parameters in the Phong model

Lighting Rules of Thumb Set light s ambient term to 0 Set light s diffuse and specular components to full color of the light (typically white light) Set each material s diffuse and ambient to full color of the object Set material s specular to some amount of white