Upload
christine-fleming
View
217
Download
2
Tags:
Embed Size (px)
Citation preview
LIGHTING AND ILLUMINATION
Dr. Aree Ali Mohammed Assistant Professor 2014-20153rd [email protected]
University of Sulaimani - School of Science - Computer Dept.1
What is Lighting?
University of Sulaimani - School of Science - Computer Dept. 2
Example 1. Find the cubic polynomial or that passes through the four points and satisfies
1. As a photon
Metal Insulator
What is Lighting?
University of Sulaimani - School of Science - Computer Dept. 3
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.
2. As a wave
What is a Illumination?
University of Sulaimani - School of Science - Computer Dept. 4
Example 1. Find the cubic polynomial or that passes through the four points and satisfies
Interactions between light sources and the object surface
An “illumination model” describes inputs, assumptions, and outputs used to calculate illumination (color / brightness) of surface elements
Usually includesLight attributes (intensity, color, position, direction, shape)Object surface properties (color, reflectivity, transparency, etc.)Interaction between lights and objects
Basic Light Sources
University of Sulaimani - School of Science - Computer Dept. 5
Example 1. Find the cubic polynomial or that passes through the four points and satisfies
The amount that a light illuminates an object decreases with the square of the distance between them. This is known as Light Attenuation.
As part of illumination models, one can specify whether the light intensity varies with the distance between the object and the light source
Illumination Models
Local Illumination Takes only direct lighting information refers to direct interaction between one light source and one object
surface.
Global Illumination refers to the interaction of light between all surfaces in a scene. Most light striking a surface element comes directly from a light emitting
source (direct illumination) Sometimes light from a source is blocked by another object, resulting in
shadows However, objects in the shadow can still receive light from light bouncing
off other objects (indirect illumination)
University of Sulaimani - School of Science - Computer Dept. 6
Example 1: Local Illumination
• Only considers the light, the observer position, and the object’s material properties
• OpenGL does this.
University of Sulaimani - School of Science - Computer Dept.
Example 2: Global Illumination
• Takes into account of the interaction of light from all the surfaces in the scene
• Recursive ray tracing is an example. It models light rays bouncing between objects
University of Sulaimani - School of Science - Computer Dept.
Local Illumination Model
University of Sulaimani - School of Science - Computer Dept. 9
In computer graphics, single object-light interaction is approximated through local illumination models.Basic model used is the Phong model which breaks local illumination into 3 components:
Ambient reflectionDiffuse reflectionSpecular reflection
For every point, or small surface area, of an object, we want to calculate the light due to these three components.
Ambient Reflection
University of Sulaimani - School of Science - Computer Dept. 10
Example 1. Find the cubic polynomial or that passes through the four points and satisfies
Ambient light = background light, it is used to simulate indirect lighting
• Ambient component• Independent of
Object’s position Viewer’s positionLight source’s position
• Dependent of A constant factor (in each of the R, G, B channels)
Diffuse Reflection• Diffuse light = illumination that a surface receives from a light
source that reflects equally in all directions
• Independent of:• Viewer’s position
• Dependent of:• Light’s position• Surface property (normal, reflectance property)
University of Sulaimani - School of Science - Computer Dept. 11
Lambert’s Law• Need to know how much light a point on the object receives from the
light source• Solution based on Lambert’s Law
University of Sulaimani - School of Science - Computer Dept. 12
Point receives more light Point receives less light
Diffuse = Kd*I*cos(theta)
Specular Reflection I
Specular light = light reflection from shiny surfaces Color depends on material and how it scatters light
Shiny surfaces (metal, mirror, etc.) reflect more light Specular light depends on both light source position and
view position
University of Sulaimani - School of Science - Computer Dept. 13
Example 1. Find the cubic polynomial or that passes through the four points and satisfies
Specular Reflection II
•
University of Sulaimani - School of Science - Computer Dept. 14
Example 1. Find the cubic polynomial or that passes through the four points and satisfies
Variation in Diffuse and Specular in Local Model• Putting Diffuse and Specular together in a local
illumination model
University of Sulaimani - School of Science - Computer Dept. 15
Example 1. Find the cubic polynomial or that passes through the four points and satisfies