Title: CPSC 441: Computer Graphics Lighting
1CPSC 441 Computer GraphicsLighting
23D Rendering pipeline
Modeling transformation
Transform into 3D world system
Illuminate according to lighting and reflectance
lighting
Transform into 3D camera coordinate system
Viewing transformation
Transform into 2D camera system
Project transformation
Clip primitives outside cameras view
Clipping
Draw pixels (includes texturing, hidden surface,
etc.)
Scan conversion
Image
33D Rendering pipeline
Modeling transformation
Transform into 3D world system
Illuminate according to lighting and reflectance
lighting
Transform into 3D camera coordinate system
Viewing transformation
Transform into 2D camera system
Project transformation
Clip primitives outside cameras view
Clipping
Draw pixels (includes texturing, hidden surface,
etc.)
Scan conversion
Image
4Outline
- Ambient, diffuse and specular light
- Light attenuation spot lights
- Readings HB 10-1,10-2,10-3
5Lighting/Illumination
- Color is a function of how light reflects from
surfaces to the eye - Global illumination accounts for light from all
sources as it is transmitted throughout the
environment - Local illumination only accounts for light that
directly hits a surface and is transmitted to the
eye
6Direct and Indirect Light
7Global Illumination II
8Global Illumination II
9Lighting/Illumination
- Color is a function of how light reflects from
surfaces to the eye - Global illumination accounts for light from all
sources as it is transmitted throughout the
environment - Local illumination only accounts for light that
directly hits a surface and is transmitted to the
eye
10Reflection Models
- Definition Reflection is the process by which
light incident on a surface interacts with the
surface such that it leaves on the incident side
without change in frequency.
11Reflection Models
- Definition Reflection is the process by which
light incident on a surface interacts with the
surface such that it leaves on the incident side
without change in frequency.
12Reflection Models
- Definition Reflection is the process by which
light incident on a surface interacts with the
surface such that it leaves on the incident side
without change in frequency.
13Reflection Models
- Definition Reflection is the process by which
light incident on a surface interacts with the
surface such that it leaves on the incident side
without change in frequency.
14Types of Reflection Functions
- Ideal Specular
- Reflection Law
- Mirror
15Types of Reflection Functions
- Ideal Specular
- Reflection Law
- Mirror
- Ideal Diffuse
- Lamberts Law
- Matte
16Types of Reflection Functions
- Ideal Specular
- Reflection Law
- Mirror
- Ideal Diffuse
- Lamberts Law
- Matte
- Specular
- Glossy
- Directional diffuse
17Materials
Plastic
Metal
Matte
From Apodaca and Gritz, Advanced RenderMan
18Illumination Model
- Ambient Light
- Uniform light caused by secondary reflections
- Diffuse Light
- Light scattered equally in all directions
- Specular Light
- Highlights on shiny surfaces
19Ambient Light
-
- A intensity of ambient light
- ka ambient reflection coefficient
- Really 3 equations! (Red, Green, Blue)
- Accounts for indirect illumination
- Determines color of shadows
20Total Illumination
21Diffuse Light
- Assumes that light is reflected equally in all
directions - Handles both local and infinite light sources
- Infinite distance L doesnt change
- Finite distance must calculate L for each point
on surface
Surface
22Diffuse Light
-
- C intensity of point light source
- kd diffuse reflection coefficient
- angle between normal and direction to light
Surface
23Lamberts Law
Beam of Light
Surface
24Lamberts Law
Beam of Light
Surface
25Lamberts Law
Beam of Light
Surface
26Total Illumination
27Total Illumination
28Materials
Plastic
Metal
Matte
From Apodaca and Gritz, Advanced RenderMan
29Specular Light
- Perfect, mirror-like reflection of light from
surface - Forms highlights on shiny objects (metal, plastic)
Surface
30Specular Light
-
- C intensity of point light source
- ks specular reflection coefficient
- angle between reflected vector (R) and eye
(E) - n specular coefficient
Surface
31Finding the Reflected Vector
Surface
32Finding the Reflected Vector
Surface
33Finding the Reflected Vector
Surface
34Finding the Reflected Vector
Surface
35Finding the Reflected Vector
Surface
36Finding the Reflected Vector
Surface
37Total Illumination
38Total Illumination
39Total Illumination
40Total Illumination
41Multiple Light Sources
- Only one ambient term no matter how many lights
- Light is additive add contribution of multiple
lights (diffuse/specular components)
42Total Illumination
43Total Illumination
44Attenuation
- Decrease intensity with distance from light
- d distance to light
- r radius of attenuation for light
45Attenuation
46Attenuation
47Spot Lights
- Eliminate light contribution outside of a cone
Surface
48Spot Lights
- Eliminate light contribution outside of a cone
Surface
49Attenuation
50Spot Lights
51Spot Lights
52Implementation Considerations
Surface
53Implementation Considerations
- Typically choose
- Clamp each color component to 0,1
54Opengl Functions
- See section 10-20
- how to set up light sources (light source pos
- - light source position and type
- - light source colors
- - radial-intensity attenuation
- - spotlights
- how to specify global lighting parameters
- how to specify surface properties
55Next Lecture
- Shading
- Texture mapping others
- Readings HB 10-10, 10-17, 10-18