An Introduction to the Lighting
Model
Lecture 23
Wed, Oct 22, 2003
Types of Light Source
Ambient
 No position in space.
Point Source
 At a point in space.
 Equal intensity in all directions.
Directional Source
 Source is “at infinity.”
 Has direction only.
Calculation of Lighting
We will look at the details of how
lighting is calculated later.
For now, we just want to be familiar
with the kinds of lighting and how it
relates to a polygonal mesh.
Ambient Light
Ambient light illuminates objects equally
in all directions.
In real life, ambient light is light that
has been reflected off so many surfaces
that it is impossible to identify the
source.
Computing Ambient Reflection
The ambient reflection depends on
 The ambient light inherent in the scene.
 The ambient light given off by the light
sources.
 The ambient property of the surface.
Point and Directional Sources
At each point of a surface, the light has
a direction.
 Point source – direction varies with position
on surface.
 Directional source – direction does not vary
with position on surface.
With a point source, the intensity may
also depend on distance from the
source.
Computing Diffuse Reflection
Intensity of reflected light
 Depends on angle of incidence.
 Is equal in all directions, i.e., does not
depend on the viewing angle.
It can be computed more efficiently if
the light is directional, since there is
one less variable.
Specular Reflection
Intensity of reflected light varies with
viewing direction.
Maximum intensity is in the direction
pointing directly back to the light
source.
Specular Reflection
Specular reflection creates the
appearance of “shininess.”
Surfaces with a high specular reflection
appear very shiny.
Surfaces with a low specular reflection
appear matte.
Computing Specular Reflection
Computing specular reflection is less
efficient than computing diffuse
reflection, since it depends on the
direction to the light source and the
direction to the viewer.
The calculations can be speeded up if
the viewer is “at infinity.”
Emissive Lighting
Emissive lighting is light that emitted by
the surface itself.
It is used for objects that are meant to
glow.
It is independent of all light sources and
directions.
Lighting in OpenGL
Since the ambient, diffuse, and specular
reflections depend on light sources,
there is a separate contribution for each
light source.
Furthermore, there is a separate color
component for each type of light.
 Red, green, blue.
Finding the Shade of a Surface
The total reflection from a point, both
color and brightness, is the sum of the
ambient, diffuse, and specular
reflections and the emissive light.
This is a combination of properties that
are intrinsic to the surface and
properties that are intrinsic to the light
source.
Shading a Mesh
To shade a mesh, the program must
shade each polygon in the mesh
independently.
For large meshes (between 1 million
and 1 billion polygons), this can
consume a significant amount of time.
Animations are out the window.
Example: Lighting a Sphere
LightingDemo.cpp

23 Introduction to the Lighting Model.ppt

  • 1.
    An Introduction tothe Lighting Model Lecture 23 Wed, Oct 22, 2003
  • 2.
    Types of LightSource Ambient  No position in space. Point Source  At a point in space.  Equal intensity in all directions. Directional Source  Source is “at infinity.”  Has direction only.
  • 3.
    Calculation of Lighting Wewill look at the details of how lighting is calculated later. For now, we just want to be familiar with the kinds of lighting and how it relates to a polygonal mesh.
  • 4.
    Ambient Light Ambient lightilluminates objects equally in all directions. In real life, ambient light is light that has been reflected off so many surfaces that it is impossible to identify the source.
  • 5.
    Computing Ambient Reflection Theambient reflection depends on  The ambient light inherent in the scene.  The ambient light given off by the light sources.  The ambient property of the surface.
  • 6.
    Point and DirectionalSources At each point of a surface, the light has a direction.  Point source – direction varies with position on surface.  Directional source – direction does not vary with position on surface. With a point source, the intensity may also depend on distance from the source.
  • 7.
    Computing Diffuse Reflection Intensityof reflected light  Depends on angle of incidence.  Is equal in all directions, i.e., does not depend on the viewing angle. It can be computed more efficiently if the light is directional, since there is one less variable.
  • 8.
    Specular Reflection Intensity ofreflected light varies with viewing direction. Maximum intensity is in the direction pointing directly back to the light source.
  • 9.
    Specular Reflection Specular reflectioncreates the appearance of “shininess.” Surfaces with a high specular reflection appear very shiny. Surfaces with a low specular reflection appear matte.
  • 10.
    Computing Specular Reflection Computingspecular reflection is less efficient than computing diffuse reflection, since it depends on the direction to the light source and the direction to the viewer. The calculations can be speeded up if the viewer is “at infinity.”
  • 11.
    Emissive Lighting Emissive lightingis light that emitted by the surface itself. It is used for objects that are meant to glow. It is independent of all light sources and directions.
  • 12.
    Lighting in OpenGL Sincethe ambient, diffuse, and specular reflections depend on light sources, there is a separate contribution for each light source. Furthermore, there is a separate color component for each type of light.  Red, green, blue.
  • 13.
    Finding the Shadeof a Surface The total reflection from a point, both color and brightness, is the sum of the ambient, diffuse, and specular reflections and the emissive light. This is a combination of properties that are intrinsic to the surface and properties that are intrinsic to the light source.
  • 14.
    Shading a Mesh Toshade a mesh, the program must shade each polygon in the mesh independently. For large meshes (between 1 million and 1 billion polygons), this can consume a significant amount of time. Animations are out the window.
  • 15.
    Example: Lighting aSphere LightingDemo.cpp