Computer Graphics: Illumination

Slides:



Advertisements
Similar presentations
SI23 Introduction to Computer Graphics
Advertisements

Computer Vision Radiometry. Bahadir K. Gunturk2 Radiometry Radiometry is the part of image formation concerned with the relation among the amounts of.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 6.
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.
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
Light Issues in Computer Graphics Presented by Saleema Amershi.
Illumination and Shading
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
Rendering (彩現 渲染).
IMGD 1001: Illumination by Mark Claypool
Lighting and Shading Wen-Chieh (Steve) Lin
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.
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.
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.
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.
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.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
Basic Illumination BRANCH :- ELECTRICAL (C11) Gohil Amit M. ( ) Joshi Jay P. ( ) Barot Mahesh P. ( ) Pandya Bhrugu I.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
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.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Shading.
Local Illumination and Shading
Cornell CS465 Spring 2004 Lecture 4© 2004 Steve Marschner 1 Shading CS 465 Lecture 4.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Illumination and Shading Sang Il Park Sejong University.
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.
Computer Graphics Lecture 30 Mathematics of Lighting and Shading - IV Taqdees A. Siddiqi
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
7. Illumination Phong Illumination Diffuse, Specular and Ambient
Shading CS 465 Lecture 4 © 2004 Steve Marschner • 1.
Isaac Gang University of Mary Hardin-Baylor
Advanced Computer Graphics
Lighting and Shading (I)
Computer Graphics Material Colours and Lighting
CS 480/680 Computer Graphics Shading.
Presentation transcript:

Computer Graphics: Illumination

Illumination VS Shading Illumination (lighting) model: determine the color of a surface point by simulating some light attributes. Shading model: applies the illumination models at a set of points and colors the whole image.

Light plays an important part in computer graphics for rendering realistic images. Using lighting models, we can simulate shading, reflection and refraction of light, comparable to what we see in the real world.

Global Light Model Global Illumination models: take into account the interaction of light from all the surfaces in the scene.

Global Light Model Global illumination refers to the interaction of light between all surfaces in a scene. Calculate direct light from source to object Calculate mutual reflection among the various objects in the scene Huge computational complexity Highly realistic Example: Recursive ray tracing

Local Light Model Local illumination refers to direct interaction between one light source and one object surface Only consider the light, the observer position, and the object material properties

Local Light Model Simple and fast method for calculating surface intensity at a given point Lighting calculation are based on: The background lighting conditions The light source specification: color, position Optical properties of surfaces: Glossy OR matte Opaque OR transparent (control refection and absorption)

Local Light Model Only compute direct light from source to object Avoid mutual reflections For lighting the scene assume constant ambient light Less mathematical cost Reduced realism TRADEOFF: Use local model in graphics and animation.

Contents Today we will start to look at illumination models in computer graphics Why do we need illumination models? Different kinds of lights Different kinds of reflections Basic lighting model

Why Lighting? If we don’t have lighting effects nothing looks three dimensional!

Why Lighting? (cont…)

Surface Lighting Effects The amount of incident light reflected by a surface depends on the type of material Shiny materials reflect more of the incident light and dull surfaces absorb more of the incident light For transparent surfaces some of the light is also transmitted through the material

Global Illumination by Local Light Model Ambient reflection: Crude approximation to global effects of light. Accounts for the general brightness in a scene from light scattering in all directions from all surfaces.

Diffuse Reflection Surfaces that are rough or grainy tend to reflect light in all directions This scattered light is called diffuse reflection

Specular Reflection Additionally to diffuse reflection some of the reflected light is concentrated into a highlight or bright spot This is called specular reflection

Ambient Light A surface that is not exposed to direct light may still be lit up by reflections from other nearby objects – ambient light The total reflected light from a surface is the sum of the contributions from light sources and reflected light

Example

Example Ambient Diffuse Final Image Specular

Basic Illumination Model We will consider a basic illumination model (using local light model) which gives reasonably good results and is used in most graphics systems The important components are: Ambient light Diffuse reflection Specular reflection For the most part we will consider only monochromatic light Illumination equation: I=ki I is resulting illumination and ki is intrinsic intensity

Ambient Light To incorporate background light we simply set a general brightness level for a scene This approximates the global diffuse reflections from various surfaces within the scene We will denote this value as Ia And the illumination equation becomes I=Ia . Ka (i)

Diffuse Reflection First we assume that surfaces reflect incident light with equal intensity in all directions Such surfaces are referred to as ideal diffuse reflectors or Lambertian reflectors

Diffuse Reflection (cont…) A parameter kd is set for each surface that determines the fraction of incident light that is to be scattered as diffuse reflections from that surface This parameter is known as the diffuse- reflection coefficient or the diffuse reflectivity kd is assigned a value between 0.0 and 1.0 0.0: dull surface that absorbs almost all light 1.0: shiny surface that reflects almost all light

Diffuse Reflection – Ambient Light For background lighting effects we can assume that every surface is fully illuminated by the scene’s ambient light Ia Therefore the ambient contribution to the diffuse reflection is given as: Ambient light alone is very uninteresting so we need some other lights in a scene as well

Diffuse Reflection (cont…) When a surface is illuminated by a light source, the amount of incident light depends on the orientation of the surface relative to the light source direction

Diffuse Reflection The angle between the incoming light direction and a surface normal is referred to as the angle of incidence given as θ Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

Diffuse Reflection (cont…) So the amount of incident light on a surface for diffuse reflections can be modelled as: For normalized N and L cosθ becomes: (ii)

Diffuse Reflection (cont…) Assuming we denote the normal for a surface as N and the unit direction vector to the light source as L then: So: Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

Combining Ambient And Incident Diffuse Reflections By combining the diffuse reflections arising from ambient and incident light ka for ambient light kd for incident light The total diffuse reflection equation for a single point source can then be given as: (iii)

Point Light Sources A point source is the simplest model we can use for a light source We simply define: The position of the light The RGB values for the colour of the light Light is emitted in all directions Useful for small light sources

Light Source Attenuation As light moves from a light source its intensity diminished At any distance dl away from the light source the intensity diminishes by a factor of However, using the factor does not produce very good results so we use something different

Light Source Attenuation (cont…) We use instead in inverse quadratic function of the form: where the coefficients c1, c2, and c3 can be varied to produce optimal results Hence the illumination equation: (iv)

Reflected Light The colours that we perceive are determined by the nature of the light reflected from an object For example, if white light is shone onto a green object most wavelengths are absorbed, while green light is reflected from the object White Light Colours Absorbed Green Light

Examples

Specular Reflection The bright spot that we see on a shiny surface is the result of near total of the incident light in a concentrated region around the specular reflection angle The specular reflection angle equals the angle of the incident light Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

Specular Reflection (cont…) A perfect mirror reflects light only in the specular-reflection direction Other objects exhibit specular reflections over a finite range of viewing positions around vector R Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

The Phong Specular Reflection Model The Phong specular reflection model or Phong model is an empirical model for calculating specular reflection range developed in 1973 by Phong Bui Tuong The Phong model sets the intensity of specular reflection as proportional to the angle between the viewing vector and the specular reflection vector Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

The Phong Specular Reflection Model (cont…) So, the specular reflection intensity is proportional to The angle Φ can be varied between 0° and 90° so that cosΦ varies from 1.0 to 0.0 The specular-reflection exponent, ns is determined by the type of surface we want to display Shiny surfaces have a very large value (>100) Rough surfaces would have a value near 1

The Phong Specular Reflection Model (cont…) The graphs below show the effect of ns on the angular range in which we can expect to see specular reflections Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

The Phong Specular Reflection Model (cont…) For some materials the amount of specular reflection depends heavily on the angle of the incident light Fresnel’s Laws of Reflection describe in great detail how specular reflections behave However, we don’t need to worry about this and instead approximate the specular effects with a constant specular reflection coefficient ks

The Phong Specular Reflection Model (cont…) So the specular reflection intensity is given as: For normalized V and R: And the illumination equation This is also known as Phongs Model

Example

Combining Diffuse & Specular Reflections For a single light source we can combine the effects of diffuse and specular reflections simply as follows:

RGB Colour Considerations For an RGB colour description each intensity specification is a three element vector So, for each light source: Similarly all parameters are given as vectors:

RGB Colour Considerations (cont…) Each component of the surface colour is then calculated with a separate expression For example:

Summary To create realistic (or even semi-realistic) looking scenes we must model light correctly To successfully model lighting effects we need to consider: Ambient light Diffuse reflections Specular reflections

Infinitely Distant Light Sources A large light source, like the sun, can be modelled as a point light source However, it will have very little directional effect Light source att. is not used atmospheric att. used Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

Atmospheric attenuation Depth cueing: More distant objects are rendered with lower intensity than closer ones Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

Exercise Calculate the intensity of reflected light at a point (20, 15, 100) on a sphere when Ia=0.2, ka=0.5, Is=0.8 and kd=0.6. Assume the light source is at (50, 30, 500)