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

Similar documents
Illumination Models & Shading

University of Victoria CSC 305 Shading. Brian Wyvill 2016

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

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

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

CS5620 Intro to Computer Graphics

Illumination and Shading

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

CS 325 Computer Graphics

CSE 681 Illumination and Phong Shading

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

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

w Foley, Section16.1 Reading

Graphics and Interaction Surface rendering and shading

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

9. Illumination and Shading

CS770/870 Spring 2017 Color and Shading

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

CPSC 314 LIGHTING AND SHADING

Illumination and Shading

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

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

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

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

Visualisatie BMT. Rendering. Arjan Kok

Reflection and Shading

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

Illumination and Shading

Introduction to Computer Graphics 7. Shading

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

Virtual Reality for Human Computer Interaction

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

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

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

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

Simple Lighting/Illumination Models

Illumination & Shading: Part 1

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

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

Lighting and Shading

CPSC / Illumination and Shading

CEng 477 Introduction to Computer Graphics Fall

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

Illumination in Computer Graphics

Shading. Brian Curless CSE 557 Autumn 2017

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

Illumination and Shading

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

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

Shading I Computer Graphics I, Fall 2008

Illumination & Shading

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

Interpolation using scanline algorithm

Lighting affects appearance

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

6. Illumination, Lighting

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

CS 488. More Shading and Illumination. Luc RENAMBOT

Comp 410/510 Computer Graphics. Spring Shading

Shading. Brian Curless CSE 457 Spring 2017

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

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

Computer Graphics. Illumination and Shading

Complex Shading Algorithms

Illumination Models and Surface-Rendering Methods. Chapter 10

Sung-Eui Yoon ( 윤성의 )

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

Pipeline Operations. CS 4620 Lecture 10

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

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

Raytracing CS148 AS3. Due :59pm PDT

Virtual Reality for Human Computer Interaction

Computer Graphics. Illumination and Shading

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

How do we draw a picture?

Shading , Fall 2004 Nancy Pollard Mark Tomczak

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

Computer Graphics I Lecture 11

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

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

Lighting. Figure 10.1

Interactive Real-Time Raycasting

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

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

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

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Chapter 7 - Light, Materials, Appearance

Local vs. Global Illumination & Radiosity

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

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

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

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

OpenGL Lighting Computer Graphics Spring Frank Palermo

Photorealism. Ray Tracing Texture Mapping Radiosity

From Graphics to Visualization

Transcription:

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 1 Illumination and Shading Light reflected from nonluminous objects depends on: surface: reflectance transparency, opacity, translucency orientation illumination: location intensity wavelength point-source, diffuse source can confuse the two (see figure) Shading model - calculates reflected and transmitted light for each small area of image uses an illumination model Illumination Models E = resulting image intensity a) Luminous objects E = k i ki is the object's intrinsic intensity Compute just once for each object

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 2 b) Diffuse Illumination diffuse, nondirectional light source with intensity I a Ea = I aka, E a is the illumination energy from diffuse light ka is the ambient-reflection coefficient for the surface range of 0 to 1 uniformly illuminated - surface orientation not important doesn't look natural (but can be natural!) 3D objects look like 2D Natural conditions that give diffuse lighting? c) Point Light Source illumination varies with surface orientation Ip is the illumination from a point light source i) Lambertian Surface reflect light with equal intensities in all directions N is the surface normal L is the direction of the light source N L is angle between N and L V is the viewing angle V For Lambertian surface: Ep = I p kd cos kd is the lambertian reflection coefficient snow, chalk, human skin, etc. - very matt surfaces

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 3 Why is Intensity just a function of for Lambertian surface and point light source? L da N V da/cos For small area da of light beam, subtends area da/cos on surface Lambert's Law Light reflected by Lambertian surface towards the viewer is directly proportional to cos Amount of surface seen is inversely proportional to cos (Last two cancel each other) Possible range of? no self occlusion Since angles are important in illumination and shading models, must only use transformations on scene models which preserve angles therefore don't sheer or scale differently in x, y or z

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 4 c) Point Light Source, continued ii) Perfect Reflector R N L V R is the ray of the reflected light Angle between L and N equals angle between N and R Must look in direction R to see anything Examples of perfect reflectors? Most surfaces lie between perfect reflectors and perfect Lambertian Example illumination with point source Lambertian surface (see figure) Add diffuse light source to it (see figure) Light source attenuation Light energy falls off with inverse square of distance from source fatt = 1/(d 2 ), where d is distance to light source fatt Ip is the attenuated iluminant While correct, gives small variations if distance to light is large compared to interscene distances Often use other approximations

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 5 c) Point Light Source continued iii) Specular reflection gloss surfaces give varying degrees of specular reflection highlights - color of illuminant Beck's vases (see figure) Phong's model: V R N L energy falls off by cos n n is the specular-reflection exponent n = infinity for perfect reflector n = 1 is the miniumum Ep = W( ) cos n Ip W( ) is the fraction of specularly reflected light (0 to 1) Often set W( ) to a constant, k s, the specular reflection coefficient Not a function of color of object, but of the light source Torrance-Sparrow model is more exact, but is more complex to compute

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 6 Transparency Illumination from behind for a transparent object Et = T p Eb Total energy Eb is the light coming from behind the object Tp is the transmission coefficient of the object (0 to 1) E = E d + E p + E t Thus for each pixel in the image, compute all the energies and sum them to get the total reflected and transmitted energy Very computationally expensive Also must do it for each wavelength to account for color!

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 7 Shading Polygons 1) Constant Shading Compute just one intensity for an entire polygon When is this a valid shading model? a) Light source is at infinity, thus angle between N and L is a constant b) Viewer is at infinity, thus angle between N and V is a constant c) Polygon represents actual surface (not an approximation to a curved surface, etc) Represent object with a polygon mesh if use constant shading, it doesn't look constant see Mach bands Intensity lateral inhibition of eye's sensors does contrast enhancement at edges Perceived intensity (see figure) x

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 8 2) Gouraud Shading Compute correct intensity at each vertex of polygon Need vertex normals Get directly from analytical description or, average the surface normals of the associated faces Use vertex normals to compute surface intensity at each vertex I1 Interpolate intensities along each edge of polygon I2 I2 Ia Ip I1 Ib I3 I3 Ia = I1-(I1-I2)(y1-yp)/(y1-y2) Ib = I1-(I1-I3)(y1-yp)/(y1-y3) Interpolate along a scan-line Ip = Ib-(Ib-Ia)(xb-xp)/(xb-xa) (see plate)

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 9 3) Phong Shading Instead of interpolating the intensities, interpolate the normals Interpolate normals along edges Interpolate normals along scan lines Compute intensity for each point Thus must do shading computation per point, rather than per vertex Phong better, especially for specular reflection (see plate) What happens if specular reflection should be in center Gouraud? If not seen at vertices, won't see it at all Phong? (see figure)

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 10 Problems with Interpolated Shading a) Polygon silhouette can't get rid of straight edges (see plate) partial solution: finer mesh b) Perspective distortion Must do interpolation in 3D screen coordinates Thus perspective foreshortening already done Can effect the shading partial solution: finer mesh c) Rotation dependent Shading can change as rotate object, since done along a scan-line Problem in animation d solution: use only triangular polygons a d c b a b c

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 11 Ray Tracing Image precision algorithm For each pixel, trace ray from eye through pixel to scene Then compute rays from each light source to the point on the object's surface Figure which are shadow rays (intersect another surface before reaching object) Compute the total light energy reflected back to the eye from all light sources Uses a directionless ambient lighting term (difussed illumination) Why not trace all rays from the light sources instead?

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 12 Reflective Surface Screen Transparent Sphere Point Light Source For sphere, get some reflection and some transmission Need to add together all the energy in each color Very time consuming!! Ray Tracing Radiosity Point source light Use ambient light to approximate Lambertian reflection Better model of the physics Includes Lambertian reflection between surfaces Allows surfaces to emit light (luminous objects) Break surfaces of image into small patches Compute radiosity for each patch (all light energy interaction for fixed illumination) Use these radiosities when rendering as are viewer independent Good for animation, as only compute radiosities once per scene