Illumination.

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

SI23 Introduction to Computer Graphics
5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.
Computer Graphics I, Fall 2010 Shading II.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 6.
CS 480/680 Computer Graphics Shading 2 Dr. Frederick C Harris, Jr.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Graphics Graphics Korea University cgvr.korea.ac.kr Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.
Light Issues in Computer Graphics Presented by Saleema Amershi.
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.
University of New Mexico
Computer Graphics - Class 10
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading II Week.
Rendering (彩現 渲染).
Shading II CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
IMGD 1001: Illumination by Mark Claypool
3/23/2005 © Dr. Zachary Wartell 1 Illumination Models and Surface- Rendering Methods.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2006 Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
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.
Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
LIGHTING JEFF CHASTINE 1. WHAT IS LIGHT? A very complex process Find a dark area – how is it being lit? Light bounces (mirrors, shiny objects) Light refracts.
Illumination.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
CS 445 / 645: Introductory Computer Graphics
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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.
MIT EECS 6.837, Durand and Cutler Local Illumination.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
David Luebke 1 10/26/2015 Lighting CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
11/04/04© University of Wisconsin, CS559 Fall 2004 Last Time Visibility –Z-Buffer and transparency –A-buffer –Area subdivision –BSP Trees –Exact Cell-Portal.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Introduction to Computer Graphics with WebGL
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Cornell CS465 Spring 2004 Lecture 4© 2004 Steve Marschner 1 Shading CS 465 Lecture 4.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
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
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
CS552: Computer Graphics Lecture 33: Illumination and Shading.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics: Illumination
7. Illumination Phong Illumination Diffuse, Specular and Ambient
CSE 470 Introduction to Computer Graphics Arizona State University
Isaac Gang University of Mary Hardin-Baylor
Lighting and Shading (I)
CS 480/680 Computer Graphics Shading.
Lighting Calculations
Presentation transcript:

Illumination

Basic Terms Illumination: the transport of energy from light sources to surfaces & points Local illumination Global illumination Lighting model or Illumination model: Express the factors determining a surface’s color or luminous intensity (outgoing or reflected light) at a particular 3D point We calculate intensity of a point (light reflected from that point)

Components of Illumination Two components of illumination: Light sources Surface properties Light source described by a luminance/intensity ‘I’ Each color is described separately I = [I r I g I b ] T (I for intensity) Types of Light Sources: Ambient Light Diffuse Light Spot Light

Ambient Light No identifiable source or direction Product of multiple reflections of light from the many surfaces present in the environment Computationally inexpensive The scenes we observe around us always seem to be bathed in some soft non-directional light  Ambient light Global ambient light – sunlight comes through window, get reflected from several surfaces Local ambient light – tube light get reflected from several surface

Ambient Light Categories: Global ambient light Local ambient light Independent of light source Lights entire scene Example: reflection of sunlight from several surfaces Local ambient light Contributed by additional light sources Can be different for each light and primary color Example: Reflection of fluorescent lamps from several surfaces The scenes we observe around us always seem to be bathed in some soft non-directional light  Ambient light Global ambient light – sunlight comes through window, get reflected from several surfaces Local ambient light – tube light get reflected from several surface

Diffuse Light Point Source Directional Source Given by a point Light emitted equally in all directions Intensity decreases with square of distance Point source [x y z 1]T At point p, intensity received Directional Source Given by a direction Simplifies some calculations Intensity dependents on angle between surface normal and direction of light Distant source [x y z 0]T Point Source: I is proportional to 1/d2

Ambient light vs Diffuse light

Spot Light Intensity falls off directionally Spotlight is a point source that emits light in restricted set of directions, Requires color, point, direction, falloff parameter usually direction boundary forms a cone shape. Here θ is Cutoff Cone. No light is seen at points lying outside Cutoff angle. Intensity falls off directionally

Intensity at P = I cosε(β) Spot Light Consider, a spot light aimed at direction d. β is the angle between aimed direction d and a line from source to object P Source has cut off angle α and intensity I Intensity of spot light received at P is d P α β Intensity at P = I cosε(β)

Types of surface Interaction between light and material can be classified as Specular surfaces – Ideal mirror Diffuse surfaces – Reflected light is ideally reflected to all directions uniformly Translucent surfaces – allow some lights to penetrate the surface – refraction – glass, water So far what we have seen is the intensity of incident light at some surface point. Now we will compute intensity of reflected light at some surface point. Spec: incident light is fully reflected

Defuse Reflectance, Specular Reflectance Reflection Defuse Reflectance, Specular Reflectance We mainly calculate intensity of reflected light

Ideal Diffuse Reflectance Assumes surface reflects equally in all directions. An ideal diffuse surface is, at the microscopic level, a very rough surface. Example: chalk, clay, some paints Surface

Ideal Diffuse Reflectance Ideal diffuse reflectors reflect light according to Lambert's cosine law. Lambert's law determines how much of the incoming light energy is reflected. The reflected intensity is independent of the viewing direction. But reflected light intensity depends on incident angle of light.

Ideal Diffuse Reflectance Suppose light is incident on diffuse surface S. m = direction of Normal of the surface v = viewer’s direction s = direction of incident light θ = incident angle Is = Intensity of Light Source Intensity of reflected light, Id Id= Is Þd (s.m/|s||m|) , where Þd is the diffuse reflectance coefficient. If θ is negative, then Id= max(Is Þd (s.m/|s||m|) ,0) s θ m v

Specular Reflection Specular reflection accounts for the highlight that you see on some objects It is particularly important for smooth, shiny surfaces, such as: Metal Polished stone Plastics Apples

Ideal Specular Reflection Reflection is only at mirror angle. An ideal mirror is a purely specular reflector. View dependent reflection. That is, reflected light’s intensity varies with viewr’s position. Intensity of refelcted light is strong near mirror angle and strongest at mirror angle. An Ideal specular reflection follows Snell’s Law. Snell’s Laws: The incoming ray and reflected ray lie in a plane with the surface normal The angle that the reflected ray forms with the surface normal equals the angle formed by the incoming ray and the surface normal.

Non-ideal Reflectors Simple Empirical Model: We expect most of the reflected light to travel in the direction of the ideal ray. However, because of microscopic surface variations we might expect some of the light to be reflected just slightly offset from the ideal reflected ray. As we move farther and farther, in the angular sense, from the reflected ray we expect to see less light reflected.

Non-ideal Reflectors Phong model approximates the fall off of specular reflection. The cosine term is maximum when the surface is viewed from the mirror direction and falls off to 0 when viewed at 90 degrees away from it. The scalar nshiny controls the rate of this fall off

Phong Model Compute the combined impact of ambient, diffuse and specular reflectance at a point on surface Also called Local Illuminatin model as its main focus is on the direct impact of light coming from a source. This model has no physical basis, yet it is one of the most commonly used illumination models in computer graphics.

Phong Model Also models secondary effect of light. Consider a point light source p and viewpoint v. What should be color of light reflected into viewer’s eye from point Q of the surface? Consider diffuse component, specular component of the incident light and ambient light present in the environment N P R V L θ θ φ Q

Mathematical Calculation of Phong Model First we consider, 2 extreme cases of light reflection. Diffuse Reflection : Id cosθ = Ip kd cosθ = Ip kd (L.N) Specular Reflection: Is (cosφ )k = Ip ks (cosφ )k = Ip ks (R.V)k N ᴕ P R V L θ θ φ ᴕ Q

Mathematical Calculation of Phong Model We need to ircorporate the effect light present in environment. Thus total refelcted light also includes ambient component. Ambient Component = Iaka Total reflected light intensity from Q, I = Ambient Component + Diffuse Component + Specular Component = Iaka + Ip kd (L.N) + Ip ks (R.V)k = Iaka + Ip [kd max {(L.N),0} + ks max{(R.V)k ,0}]

Additional Issues When there are n light sources in the scene, their effects are cumulative: Intensity at Q, I = Iaka + ∑(i=1 to n) Ipi {kd (L.N) + ks (R.V)k } The intesnsity of red, green and blue component of reflected light, Ir = Iakar + Ip kdr (L.N) + Ip ks (R.V)k Ig = Iakag + Ip kdg (L.N) + Ip ks (R.V)k Ib = Iakab + Ip kdb (L.N) + Ip ks (R.V)k ks is same as color of specular component is same as color of light source, not affected by surface color.

How to get vector R ? Find a formula to compute R, the reflection of vector L with respect to normal vector? R = 2 (L.N)N – L (see Solved Problem 11.10 in Schaum(2nd edition))

Blinn and Torrence Variation Calculation of R is computaionally expensive. So in phong model the term R.V is somtimes replaced by N. H , where H is a unit vector that bisect the angle between L and V. angle between N and H measures the falloff of intensity. Though calculation of N.H is is computaionally inexpensive relative to R.V, but N.H is not always equal to R.V . In that case calculation of specular component will be approximate. (see Solved Problem 11.11 in Schaum(2nd edition)))

Effect of the reflection coefficients

Diffuse Reflection Coefficient Id = max {Is ρd cos ϴ,0} Source intensity is 1.0 Background intensity is 0.4 Sphere reflecting diffuse light, for six reflection coefficients: 0, 0.2, 0.4, 0.6, 0.8, and 1. Angle ϴ between surface normal and incident light is > 90o Note that the sphere is totally black when ρd is 0.0, the shadow in its bottom half is also black. Since there the angle between surface normal and incident light is > 90 (dot product is negative)

Ambient Reflection Coefficient Effect of adding ambient light to the diffuse light reflected by a sphere Diffuse source intensity is 1.0 Diffuse reflection coefficient is 0.4 Ambient source intensity is 1.0 Moving from left to right the ambient reflection coefficient takes on values: 0.0, 0.1, 0.3, 0.5, and 0.7 Too little ambient light makes shadows appear too deep and harsh Too much makes the picture look washed out and bland

Specular Reflection Coefficient The ambient and diffuse reflection coefficients are 0.1 and 0.4 for all spheres. Id = Is ρs cos(φ)f More shiny and more highly concentrated along the direction r Exponent f 3 6 9 25 200 More mirror like, more focused reflection with increasing exponent 0.25 As f increases, the reflection becomes more mirror-like and is more highly concentrated along the direction r The reflection coefficient ρs varies from top to bottom with values 0.25, 0.5, and 0.75  exponent: user-chosen value that controls the apparent smoothness of the surface.  distribution of microfacet normals  reflection coefficient ρs 0.5 0.75

Color

Adding Color Color is constructed by adding certain amounts of red, green, and blue light light sources have three “types” of color:

Adding Color Surface has two sets of reflection co-efficient Color of the specular component is often the same as that of the light source – mirror like: ρsr , ρsg , ρsb = ρs Glossy red apple when illuminated by a yellow light is yellow rather than red

What makes an apple red?

Adding Color By “color” of a surface we mean the color that is reflected from it when the illumination is white light The ambient and diffuse reflection coefficients are based on the color of the surface itself. a surface is red if it appears red when bathed in white light. If bathed in some other color it can exhibit an entirely different color.

Color of an object Color of a teapot is 40% red, 25% green, and 35% blue Ambient light in environment: White light (Isr= Isg= Isb = I) Sphere’s ambient and diffuse reflection coefficients: Iar=Idr=0.4K Iag=Idg=0.25K Iab=Idb=0.35K The individual ambient components have intensities: Iar= 0.4 K I Iag= 0.25 K I Iab= 0.35 K I K is some scaling value that determines the overall fraction of incident light that is reflected from the sphere

Color of an object Color of a teapot is 40% red, 25% green, and 35% blue Diffuse light in environment : White light (Isr= Isg= Isb = I) The individual Diffuse components have intensities: Idr= 0.4 K I cos ϴ Idg= 0.25 K I cos ϴ Idb= 0.35 K I cos ϴ Diffuse Light K is some scaling value that determines the overall fraction of incident light that is reflected from the sphere

Color of an object Color of a teapot is 40% red, 25% green, and 35% blue For specular reflection, Intensity of light Source I Set ρs to .5 for a medium shiny object or more higher value for higher shiny object

Reddish Object in Greenish Light ? Think!

Reference Hill: 8.2.1 - 8.2.6