computer graphics (PowerPoint download)

Document Sample
computer graphics (PowerPoint download) Powered By Docstoc
					   Texture mapping helped to enhance the overall appearance
    of an object but failed to convey any real sense of depth.
   For example, when looking at the two flat objects in Figure
    9-1(a), it is clear that the three-dimensional nature of the
    scene, a wall positioned perpendicular on a floor, is not being
    conveyed properly. Figure 9-1(b) shows this same scene
    illuminated by a properly defined light source.
   This lack of depth is the result of uniform lighting, i.e. the
    equal illumination of all surfaces.
   Figure 9-2(a) shows a uniform lit sphere and Figure 9-2(b)
    the same sphere with basic lighting enabled.
   The shaded sphere is the result of graduations in the sphere’s
    color based on the color of the light source.
     In this case the color grey is incrementally decreased from dark grey
      to white.
   Light can be emitted through either self-
    emission or reflection.
   Light sources are categorized by their light
    emitting direction and the energy emitted at
    each wavelength – determining the color of
    the light.
 Objects can absorb or reflect light emitted from a
  light source depending on the reflecting object’s
  material properties.
 Light will thus only be ‘visible’ when illuminated
  surfaces have the ability to reflect or absorb the said
 Material properties are user-defined parameters
  built around rules determining the amount of
  scattering or reflection of incident light.
   The type of light source also plays an
    important role in addition to the object’s
    material properties.
   A light type property specifies the type of
    light to place in a scene.
     This property simply denotes a light source as a
     point light, spotlight, or directional light (also
     called a parallel light).
   The illumination function:
   A lighting model defines light-object
    interactions based on the type of light source
    and the material properties of the object.
   The basic graphics pipeline is constrained to
    the use of just one lighting model, the fixed
    function lighting model.
     This lighting model is basically an extended
     version of the Phong lighting model
   A point light emits light uniformly in 360
   Point lights have fixed color and position
    values and are omnidirectional in nature.
   Spotlights are specified by a color, spatial
    position and some specific direction and
    range in which light is emitted.
   A spotlight is basically a point light with its
    emitting light constrained within an angle
 A parallel or directional light illuminates objects
  through a series of parallel light rays.
 These light sources can be considered as point lights
  located a significant distance from the surface of an
   Emissive light is radiated (can be considered
    self-reflecting) light originating from an
    object’s surface.
   This type of light blends with our other light
    types, resulting in a surface smoothly colored
    through the combination of all global light
    color components.
1)   Light travels in straight lines
2)   Light travels much faster than sound
3)   We see things because they reflect light into
     our eyes
4)   Shadows are formed when light is blocked by
     an object
     Reflection from a mirror:

Incident ray                                        Reflected ray

               Angle of incidence       Angle of

                  The Law of Reflection

       Angle of incidence = Angle of reflection

In other words, light gets reflected from a surface at ____ _____
angle it hits it.

                                                     The same !!!
   Smooth, shiny surfaces
    have a clear reflection:

Rough, dull surfaces have a diffuse reflection.

Diffuse reflection is when light is scattered in
different directions
   Two examples:

                         2) A car headlight

        1) A periscope
   White light is not a single colour; it is made up
    of a mixture of the seven colours of the

We can demonstrate this by
splitting white light with a

This is how rainbows are formed:
sunlight is “split up” by
  Red
 Orang
 Yellow
 Green
  Blue
 Indigo
 Violet
      White light can be split up to make separate colours.
       These colours can be added together again.

      The primary colours of light are red, blue and green:
Adding blue and red                           Adding blue and green
makes magenta                                 makes cyan (light blue)

Adding red and                                      Adding all three
green makes                                           makes white
yellow                                                        again
   The colour an object appears depends on the colours of
    light it reflects.

For example, a red book only reflects red light:

            White                                  Only red light is
            light                                     reflected
A pair of purple trousers would reflect purple light (and red and
            blue, as purple is made up of red and blue):

                                           Purple light

          A white hat would reflect all seven colours:

   If we look at a coloured object in coloured
    light we see something different. For
    example, consider a football kit:

                               Shirt looks red


                                       Shorts look blue
   The light reflected from the surface of an
    object depends on several factors
     Degree of reflectivity of the object (shiny vs. dull
     Surface texture properties
     Color reflectance coefficients (e.g. color of the
   A surface is only visible when it has the ability to reflect or absorb light.
     This ability is the result of the surface’s material properties, i.e. rules determining
       the amount of scattering and/or reflection of incident light.
   We can specify:
     material properties for any surface, the most common types being the Phong
      reflection model, ambient reflection, diffuse reflection, specular reflection, and
     our own per-vertex or per-pixel reflection models via either Cg or HLSL shaders

   The basic illumination model we will learn in this course includes
    three components
     Ambient Light
     Diffuse Reflection
     Specular Reflection
                                                      Ambient lighting only

   Reflected light from the environment and the
    nearby objects cause other objects to
   Also called background light.
 Ambient reflection, also called
  continuous reflection, occurs whenever
  light emitted from a source is reflected so
  much that its origin is impossible to
 Ambient light is omnidirectional in

   Constant color reflected from all points on the
   Tells us how bright the surface will look like
    when no light source can directly reach the
   When used alone, does not produce very
    interesting pictures
   We can use an ambient intensity parameter Ia
    that describes the level of ambient light in a
   Every object in the scene will be illuminated
    by this amount independent of the surface
    orientation and viewer location.
   But different surfaces may reflect different
    amount of ambient light based on their
    absorbance/reflectance properties. We can
    model this by a constant factor for each
                      ka I a
 The light that is reflected in all directions is called diffuse reflection.
 The reflected light is independent of the viewing position (equally bright from all viewing
 But the light position with respect to the surface orientation is important to deter
● When an object is illuminated with white light the original color of the object is what we
  see as the diffuse reflection.
●   If a blue object is illuminated with red light, it will appear black.
 mine the light reflected from the surface.
 Diffuse reflections occur when incoming light is reflected in arbitrary directions.
 The main contributing factor to this form of reflection is an uneven or rough surface.
 A diffuse surface appears identical to all viewers, regardless of their respective point of
 This type of reflection is common for matte or uneven surfaces (such as carpets or
  brushed metal) and is used for shading surfaces in such a way as to convey a sense of
    For matte (non-shiny) objects
    Examples
      Matte paper, newsprint
      Unpolished wood
      Unpolished stones
    Color at a point on a matte object does not
     change with viewpoint.

October 29, 2010
    Incoming light is partially absorbed and partially
     transmitted equally in all directions

October 29, 2010
                   N                                        90 - 
                               dA                    dAcos()

                                                    90 - 

                   Surface 1        Surface 2

October 29, 2010
                                            90 - 

                                 dAcos()

                                    90 - 

                    Surface 2

      Cp= ka (SR, SG, SB) + kd NL (SR, SG, SB)

October 29, 2010
N = (x-cx, y-cy, z-cz)
   |(x-cx, y-cy, z-cz)|

                               (x, y, z)


                          (cx, cy, cz)

   October 29, 2010
    Orientation of the surface determines the amount of light incident
     on the surface

    Given the angle  between the surface normal and the incident
     light direction, we can write the diffuse reflection equation as:

                          I l ,diff  kd I l ,incident
                                   kd I l cos
             ka I a  kd I l (N  L),         if N  L  0
I l ,diff   
              ka I a ,                        if N  L  0

                          Psource  Psurface
                          Psource  Psurface
Ambient lighting only   With diffuse lighting
   Light reflected from a certain spot on the
    object is concentrated and appears as a lot
    brighter compared to other spots. This is
    due to specular reflection and is an
    important property of shiny object.
   Specular reflection is both dependent
    on the light direction, surface
    orientation, and viewer position.
   Specular reflection occurs whenever light, from
    a single incoming direction, is reflected at a
    single outgoing direction.
   Specular reflection is characterized by bright
    highlights on the surface of an object reflected
    in the direction of the view vector.
       Let us try to picture specular reflection

●   The specular reflection angle equals angle of
●   The specular reflection is visible only at
    directions close to R. Shiny surfaces like
    mirrors have a narrow specular reflection
    range (given as parameter ns, specular-
    reflection exponent.)
             k s I l (V  R) ns ,   if V  R  0 and N  L  0
I l , spec  
              0.0,                  if V  R  0 and N  L  0
Diffuse Reflection   Diffuse and Specular
 The Phong model is an illumination model that
  controls the shading of individual pixels; it is
  computationally efficient and leads to realistic
  looking reflections.
 Phong’s goal was to create realistic looking objects
  in as close to real time as possible.
 The Phong reflection model basically combines
  ambient, specular and diffuse lighting components
  to closely approximate real world reflections.
       Considering objects that can emit light and
        multiple light sources in the scene
I  I surfemission  I ambdiff   f l ,radaten f l ,angaten ( I l ,diff  I l , spec )
                                     l 1
●   Also, note that, if you consider different colors
    of light and surfaces, you should use similar
    equations (possibly with different parameters)
    and apply it to each color component (R,G,B).

Shared By: