Lighting and Shading - PowerPoint PPT Presentation

1 / 39
About This Presentation
Title:

Lighting and Shading

Description:

Lighting and Shading Week 6 ISVR – PowerPoint PPT presentation

Number of Views:109
Avg rating:3.0/5.0
Slides: 40
Provided by: fcetStaff7
Category:

less

Transcript and Presenter's Notes

Title: Lighting and Shading


1
Lighting and Shading
  • Week 6
  • ISVR

2
Topics
  • Illumination in Imaging pipeline
  • Surface Rendering
  • Shading
  • Reflectance and refraction properties
  • Light Sources
  • VRML

3
Lighting, Shading and reflectance
  • shadowing and shading give realism and depth
  • Combination of surface properties and the light
    sources used
  • Surfaces are constructed to reflect or refract
    the light
  • Colour and texture used with different methods to
    render result

4
(No Transcript)
5
Example
6
Wireframe model Orthographic views
7
Perspective View
8
Depth Cue
9
Hidden Line Removal add colour
10
Constant Shading - Ambient
11
Faceted Shading - Flat
12
Gouraud shading, no specular highlights
13
Specular highlights added
14
Phong shading
15
Texture Mapping
16
Texture Mapping
17
Reflections, shadows Bump mapping
18
Lighting, Shading
  • Lighting and shading give objects shape
  • Important effects
  • shading
  • shiny highlights
  • reflections
  • shadows
  • Local techniques simplify these effects to
    improve performance

19
Shading/ lighting
  • Diffuse ambient light creates no shading...
    Simplest
  • Illumination can vary by angle between N (normal
    to the polygon) and L (the source)
  • Source of illumination can be a point or a region
    (expressed as cosn ?). The larger the n the
    narrower the beam
  • Compute N and L across polygon face

20
Shading
  • Can interpolate shade across a polygon
  • Gouraud shading interpolates shade across edges,
    reduces effect of intensity change.
  • Phong shading (and illumination) interpolates
    surface normal vector across polygons then
    interpolates illumination.

21
(No Transcript)
22
Gouraud Shading
  • Compute shading for each pixel by averaging
    shading based on distance and shading of vertices.

23
Different Illumination
24
Different Illumination
25
Global illumination
  • Global techniques provide more accuracy by
    simulating light propagation among all surfaces
    in a 3D world.
  • Local shading (Gauroud shading, Phong shading)
    does not calculate global effect (shadow,
    reflection, refraction, scattering, etc)
  • Technique
  • ray tracing
  • radiosity

26
Solid Modeling
  • Which surfaces should be drawn?
  • Object space methods
  • Hidden Surface Removal
  • Painters Algorithm
  • BSP Trees
  • Image space methods
  • Z-Buffering
  • Ray Casting

27
(No Transcript)
28
Ray Tracing
  • Image space technique that mimics physical
    processes of light
  • Extremely computationally intensive, but
    beautiful
  • Hidden surface removal
  • Transparency
  • Reflections
  • Refraction
  • Ambient lighting
  • Point source lighting
  • Shadows

29
Shadows and beyond
  • Can be computationally intensive, project each
    polygon on light source find projection on other
    polygons
  • 3D shadows, transparency, fog and atmospherics
    all complicate the computation.

30
Why Lighting?
  • What light source is used and how the object
    response to the light makes difference
  • Ocean looks bright bluish green in sunny day but
    dim gray green in cloudy day
  • Lighting gives you a 3D view to an object
  • A unlit sphere looks no different from a 2D disk
  • To get realistic pictures, the color computation
    of pixels must include lighting calculations

31
Types of Light
  • Ambient
  • Light thats been scattered so much by the
    environment that its direction is impossible to
    determine - it seems to come from all directions
  • Diffuse
  • Light that comes from one direction, but it gets
    scattered equally in all directions
  • Specular
  • Light comes from a particular direction, and its
    tends to bounce off the surface in a preferred
    direction

32
Materials Colors
  • A materials color depends on the percentage of
    the incoming different lights it reflects
  • Materials have different ambient, diffuse and
    specular reflectances
  • Material can also have an emissive color which
    simulates light originating from an object
  • Headlights on a automobile

33
VRML Lighting Model
  • Lighting has four independent components that are
    computed independently
  • Emissive, Ambient, Diffuse, and Specular
  • VRML approximates lighting as if light can be
    broken into red, green, and blue components
  • The RGB values for lights mean different than for
    materials
  • For light, the numbers correspond to a percentage
    of full intensity for each color
  • For materials, the numbers correspond to the
    reflected proportions of those colors

34
Theory of Illumination
  • Not only knowledge about light but also about
    what happens when light is reflected from an
    object into our eyes is important to obtain
    realistic images
  • The general problem is to compute the apparent
    color at each pixel that corresponds to part of
    the object on the screen
  • The color produced by lighting a vertex (or an
    object) has several contributions
  • Emission
  • Global ambient light
  • Contributions from light sources

35
Adding Lighting to the Scene
  • Define normal vectors for each vertex of each
    object
  • Create, select, and position one ore more light
    sources
  • Create and select a lighting model
  • Define material properties for the objects in the
    scene

36
Multiple Lights
  • You can define up to eight light sources
  • Need to specify all the parameters defining the
    position and characteristics of the light
  • VRML performs calculations to determine how much
    light each vertex from each source
  • Increasing numbers of lights affects performance

37
Controlling a Lights Position and Direction
  • A light source is subject to the same matrix
    transformations as a geometric model
  • Position or direction is transformed in the same
    way that an element of geometry is.
  • Keeping the light stationary
  • Specify the light position
  • Independently moving the light
  • Set the light position after the modeling
    transformation that you want to apply for light
  • Moving the light together with the viewpoint
  • route the light position to the same movement as
    the viewpoint

38
Defining Material Properties
  • Specifying the ambient, diffuse, and specular
    colors, the shininess, and the color of any
    emitted light
  • Diffuse and ambient reflection
  • Gives color
  • Specular reflection
  • Produces highlights
  • Emission
  • Make an object glow (to simulate lamps and other
    light sources

39
VRML material node
Material exposedField SFFloat ambientIntensity
0.2  0,1 exposedField SFColor diffuseColor
0.8 0.8 0.8  0,1 exposedField SFColor
emissiveColor 0 0 0  0,1 exposedField
SFFloat shininess 0.2  0,1 exposedField
SFColor specularColor 0 0 0  0,1
exposedField SFFloat transparency 0  0,1
Write a Comment
User Comments (0)
About PowerShow.com