Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.

Slides:



Advertisements
Similar presentations
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 4 View Projection Taku Komura.
Advertisements

Computer Graphics (Fall 2008) COMS 4160, Lecture 18: Illumination and Shading 1
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 21: Radiometry Many slides courtesy Pat Hanrahan.
Physically Based Illumination Models
Advanced Computer Graphics (Spring 2013) CS 283, Lecture 8: Illumination and Reflection Many slides courtesy.
1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
Torrance Sparrow Model of Reflectance + Oren Nayar Model of Reflectance.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
Computer Graphics - Class 10
IMGD 1001: Illumination by Mark Claypool
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
Lighting and Shading Wen-Chieh (Steve) Lin
6.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 6 Physically Based Reflection Model.
Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
Computer Graphics (Fall 2004) COMS 4160, Lecture 16: Illumination and Shading 2 Lecture includes number of slides from.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Course Website: Computer Graphics 16: Illumination.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
CS 445 / 645: Introductory Computer Graphics
COMP 261 Lecture 14 3D Graphics 2 of 2. Doing better than 3x3? Translation, scaling, rotation are different. Awkward to combine them. Use homogeneous.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Shading / Light Thanks to Srinivas Narasimhan, Langer-Zucker, Henrik Wann Jensen, Ravi Ramamoorthi, Hanrahan, Preetham.
MIT EECS 6.837, Durand and Cutler Local Illumination.
-Global Illumination Techniques
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Advanced Illumination Models Chapter 7 of “Real-Time Rendering, 3 rd Edition”
Diffuse Reflections from Rough Surfaces Lecture #5
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Material Representation K. H. Ko School of Mechatronics Gwangju Institute.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Computer Graphics (Spring 2003) COMS 4160, Lecture 18: Shading 2 Ravi Ramamoorthi Guest Lecturer: Aner Benartzi.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Local Illumination and Shading
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
Illumination Model How to compute color to represent a scene As in taking a photo in real life: – Camera – Lighting – Object Geometry Material Illumination.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Illumination Study of how different materials reflect light Definition of radiance, the fundamental unit of light transfer in computer graphics How the.
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Reflection Models (1) Physically-Based Illumination Models (2)
Computer Graphics: Illumination
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Computer Graphics Chapter 9 Rendering.
Advanced Computer Graphics
Chapter 14 Shading Models.
CSC461: Lecture 23 Shading Computation
CS5500 Computer Graphics May 29, 2006
Computer Graphics Material Colours and Lighting
Computer Graphics (Fall 2003)
Chapter 14 Shading Models.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action & Behaviour

Taku KomuraComputer Graphics Last Lecture… Hidden Surface Removal  Back face culling  Painter’s algorithm  BSP Tree  Z-buffer

Taku KomuraComputer Graphics Back Face Culling Light(L), view (V), and normal(N) Cull faces according to L.N and V.N Cull if V.N < 0 Cull if L.N > 0 (if only one light, and no ambient light)

Taku KomuraComputer Graphics Turning on and off Z-buffer in OpenGL ON OFF

Taku KomuraComputer Graphics Today is about calculating the color of objects The incident light Position of light source Direction Color The object Reflectance Viewer Position

Taku KomuraComputer Graphics Overview Illumination (how to calculate the color) Shading (how to color the whole surface)? BRDF (how to simulate the reflection of real objects)

Taku KomuraComputer Graphics Illumination Simple 3 parameter model  The sum of 3 illumination terms: Ambient : 'background' illumination Specular : bright, shiny reflections Diffuse : non-shiny illumination and shadows Object Light source (here point light source)‏ surface normal (specifies surface orientation)‏ 'Virtual' camera

Taku KomuraComputer Graphics Ambient Lighting  Light from the environment  light reflected or scattered from other objects  simple approximation to complex 'real-world' process  Result: globally uniform colour for object — I = resulting intensity — I a = light intensity — k a = reflectance Object Uniform Light source IN camera Example: sphere

Taku KomuraComputer Graphics Diffuse Lighting Also known as Lambertian reflection –considers the angle of incidence of light on surface (angle between light and surface normal)‏ –Result: lighting varies over surface with orientation to light Object Infinite point light source N LnLn I  No dependence on camera angle! Example: sphere (lit from left)‏

Taku KomuraComputer Graphics Specular Lighting Direct reflections of light source off shiny object –specular intensity n = shiny reflectance of object –Result: specular highlight on object Object N I = output color R n = camera position α : angle between R n and S R (Reflection)‏  Infinite point light source LnLn No dependence on object colour. α 

Taku KomuraComputer Graphics Specular Light

Taku KomuraComputer Graphics Combined Lighting Models Summing it altogether : Phong Illumination Model ++ = Ambient (colour)‏ Diffuse (directional)‏ Specular (highlights)‏ RcRc

Taku KomuraComputer Graphics When you implement it… Use dot product of the vectors instead of calculating the angles : Vector from the surface to the viewer : Normal vector at the colored point : Reflection vector : Vector from the light source towards the colored point Object N R  LnLn α  V

Taku KomuraComputer Graphics Color You do the above computation for Red, Green and Blue color Finally color the pixel by the RGB color

Taku KomuraComputer Graphics Demo applets spr04/code/SphereLightApplet.html spr04/code/SphereLightApplet.html topics/PhongApplet/PhongDemoApplet.html

Taku KomuraComputer Graphics Overview Illumination (how to calculate the color) Shading (how to color the whole surface)?

Taku KomuraComputer Graphics How often do we do the computation of illumination? At all the points on the surface? But usually we have normals only at the vertices Depends on the shading model – Flat Shading (once per polygon) (less computation needed) – Gouraud shading (for all the vertices of the polygon) – Phong Shading (all the points) (heavy computation needed)

Taku KomuraComputer Graphics Compute the color at the middle of the polygon All points in the same polygon are colored by the same color Flat Shading

Taku KomuraComputer Graphics Compute the color at each vertex first Compute the color inside the polygon by interpolating the colors of the vertices composing the polygon Gouraud Shading (Smooth Shading)

Taku KomuraComputer Graphics interpolating the normal vectors at the vertices Do the computation of illumination at each point in the polygon Phong Shading

Taku KomuraComputer Graphics

Taku KomuraComputer Graphics Gouraud Shaded Floor Phong Shaded Floor Gouraud shading is not good when the polygon count is low

Taku KomuraComputer Graphics interpolating the normal vectors at the vertices Do the computation of illumination at each point in the polygon Phong Shading

Taku KomuraComputer Graphics Problems with interpolation shading. Problems with computing vertex normals. A,B are shared by all polygons, but C is not shared by the polygon on the left. -Shading information calculated to the right of C will be different from that to the left. - Shading discontinuity. Solution : ? A B C

Taku KomuraComputer Graphics Problems with interpolation shading. Problems with computing vertex normals. Face surface normals and averaged vertex normals shown. Solution:?

Taku KomuraComputer Graphics Exercise Draw a picture by Phong Shading by enhancing the demo program I put up on the web. When doing the rasterization, you do the computation of the illumination

Taku KomuraComputer Graphics Overview Illumination (how to calculate the color) Shading (how to color the whole surface)? BRDF (how to simulate the reflection of real objects)

Taku KomuraComputer Graphics What about real objects? Phong Illumination model is popular but actually it is not accurate True photorealism, requires more sophisticated and elaborate models of surface properties

Taku KomuraComputer Graphics Reflectance of objects The way the light reflects depends on the physical characteristics of the surface Its not uniform

Taku KomuraComputer Graphics Bidirectional Reflectance Distribution Function (BRDF) The reflectance of an object can be represented by a function of the incident and reflected angles This function is called the Bidirectional Reflectance Distribution Function (BRDF) where E is the incoming irradiance and L is the reflected radiance

Taku KomuraComputer Graphics What affects the BRDF? The way light reflecting over the surface The smoothness/roughness of the surface  Single reflection : if smooth, specular  Multiple reflections : diffusive The shadowing effect

Taku KomuraComputer Graphics Isotropic and Anisotropic BRDFs Isotropic:  Can model by diffuse + specular reflection Anisotripic  Brushed metal  Cannot model by diffuse + specular reflection

Taku KomuraComputer Graphics How to get the BRDF? Measure Data Use Analytical models  Empirical models  Microfacet

Taku KomuraComputer Graphics Measuring the BRDF Measured using a device called gonioreflectometer  Casting light from various directions to the object, and capturing the light reflected back

Taku KomuraComputer Graphics Problems with Measured BRDF Includes a lot of error Huge amount of time to capture The data size is enormous  18 hours acquisition time, 30GB raw data  Ngan et al. EGSR ’ 05 -> Fitting the acquired data into analytical models

Taku KomuraComputer Graphics Analytical models Empirical models  Gouraud, Phong models or more complex models Microfacet models  Assuming the surface is composed of a large number of micro mirrors  Each reflect light back to the specular direction

Taku KomuraComputer Graphics Microfacet Theory [Torrance & Sparrow 1967]  Surface modeled by tiny mirrors  Value of BRDF at — # of mirrors oriented halfway between and where is the incoming direction, is the out going direction — Modulated by Fresnel, shadowing/masking [Shirley 97]

Taku KomuraComputer Graphics Examples : Satin

Taku KomuraComputer Graphics Examples : velvet

Taku KomuraComputer Graphics Summary Illumination model  Phong model Shading  Flat,  Gouraud,  Phong Shading BRDF  Measuring  Analytical models — Phong — Microfacet