Illumination Models & Shading

Similar documents
CS5620 Intro to Computer Graphics

Shading Models. Simulate physical phenomena

Shading I Computer Graphics I, Fall 2008

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Illumination & Shading

CS Illumination and Shading. Slide 1

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

w Foley, Section16.1 Reading

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

Comp 410/510 Computer Graphics. Spring Shading

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

CPSC 314 LIGHTING AND SHADING

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

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

Introduction to Computer Graphics 7. Shading

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

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

Illumination & Shading: Part 1

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

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

Illumination and Shading

Illumination and Shading

CEng 477 Introduction to Computer Graphics Fall

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Visualisatie BMT. Rendering. Arjan Kok

CPSC / Illumination and Shading

Computer Graphics. Illumination and Shading

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

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

9. Illumination and Shading

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

Lighting and Shading

Reflection and Shading

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

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

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

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

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

Interpolation using scanline algorithm

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

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

Illumination and Shading

University of Victoria CSC 305 Shading. Brian Wyvill 2016

CS 4600 Fall Utah School of Computing

Illumination Models and Shading

Turn on the Lights: Reflectance

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

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

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

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

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

Why we need shading?

Virtual Reality for Human Computer Interaction

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

CS 5625 Lec 2: Shading Models

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

Illumination. Illumination CMSC 435/634

Computer Graphics. Illumination and Shading

How do we draw a picture?

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Light Sources. Spotlight model

Shading , Fall 2004 Nancy Pollard Mark Tomczak

Shading. Brian Curless CSE 457 Spring 2017

Sung-Eui Yoon ( 윤성의 )

CGT520 Lighting. Lighting. T-vertices. Normal vector. Color of an object can be specified 1) Explicitly as a color buffer

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

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

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Ray-Tracing. Misha Kazhdan

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

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

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

Illumination in Computer Graphics

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

2001, Denis Zorin. Subdivision Surfaces

Shading and Illumination

CS770/870 Spring 2017 Color and Shading

Illumination and Shading

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

Rendering Light Reflection Models

Shading. Brian Curless CSE 557 Autumn 2017

Level of Details in Computer Rendering

Light Reflection Models

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

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

Lighting. Figure 10.1

Rendering Light Reflection Models

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

Light Transport Baoquan Chen 2017

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

Simple Lighting/Illumination Models

CS 130 Final. Fall 2015

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

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

Illumination & Shading

Transcription:

Illumination Models & Shading

Lighting vs. Shading Lighting Interaction between materials and light sources Physics Shading Determining the color of a pixel Computer Graphics ZBuffer(Scene) PutColor(x,y,Col(P)); end Shading usually determined by lighting Could use other methods (e.g. visualizing a function, NPR) 2

The Physics 3

Local vs. Global Illumination Models Local model direct and local interaction of each object with the light. Global model: interactions and exchange of light energy between all objects. 4

Light Sources Point source (A): All light originates at a point Rays hit planar surface at different incidence angles Parallel source (B): All light rays are parallel Rays hit a planar surface at identical incidence angles May be modeled as point source at infinity Also called directional source Area source (C): Light originates at finite area in space. In between the point and parallel sources B Also called distributed source A C 5

Material Reflection Type Specular reflection Smooth surface Reflects light at defined angle Diffuse reflection Rough surface Reflects light in all directions Demo Ambient light Light reflected many times, comes equally from all directions 6

Light/Reflection Types 7

Illumination Equation Looking for a value I(p) per point on the surface Represents the total contribution of all lights in the scene Takes into consideration Position of the viewer Position of the lights Color of the lights 8

Assume non-directional light in the environment Object illuminated with same light everywhere Looks like silhouette Ambient Light The Illumination equation: I = I a k a I a - ambient light intensity k a - fraction of ambient light reflected from surface. Also defines object color 9

Diffuse Light Dull surfaces such as solid matte plastic reflects incoming light uniformly in all directions Called diffuse or Lambertian reflection For light source normalized direction L and a surface with normal N, the amount of reflected light per unit surface area is proportional to N L = cos (independent of viewing direction) 1 L N 1/cos 10

Illumination equation is now: Diffuse Reflection I I k I k ( N L) I k I k cos a a p d a a p d I p k d - point light source s intensity - surface diffuse reflection coefficient 11

Specular Reflection Shiny objects (e.g. metallic) reflect light in preferred direction R determined by surface normal N. L N R V Most objects are not ideal mirrors also reflect in the immediate vicinity of R Phong Model approximate attenuation by the form of cos n (no real physical basis) 12

Specular Reflection (Phong Model) Illumination equation: k s n I I k I k ( N L) k ( R V) n a a p d s N - Specular reflection coefficient - Specularity exponent 13

Exponent n of cosine controls decay factor of attenuation function No physical basis but looks good Specular Reflection 14

For multiple light sources: I p of all light sources are added together Precautions should be taken from overflows More on Illumination Equation n p s p d p p a a V R k L N k I k I I ) ( ) ( 15

Given the lights in the scene Shading Algorithms How to compute the color at a given point on a triangle Three main types Flat shading. Gouraud shading. Phong shading. These roughly correspond to: Per-polygon shading. Per-vertex shading. Per-pixel shading. 16

Flat Shading Applied to piecewise linear polygonal models Simple surface lighting approximated over polygons Illumination value depends only on polygon normal each polygon is colored with a uniform intensity Looks non-smooth (worsened by Mach band effect) 17

Normal per Vertex If a polyhedron is an approximation of smooth surface: Assign to each vertex the normal of original surface at that point If surface is not available use estimated normal (e.g. average of neighboring faces). 18

Gouraud Shading Compute illumination intensity at vertices using normals Linearly interpolate intensity over polygon interior 19

Gouraud Shading Linearly interpolate lighting intensities at the vertices over interior pixels of the polygon, in the image plane Question: Can Gouraud shading support specular lighting? 20

Phong Shading Interpolate (at the vertices in image space) normal vectors instead of illumination intensities Apply the illumination equation for each interior pixel with its own (interpolated) normal 21

Comparison 22

Comparison phong flat gourard flat gourard phong 23