Docsity

Illumination - Computer Graphics - Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Illumination - Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

Illumination

Contents

  • Today we will start to look at illumination models in computer graphics - Why do we need illumination models? - Different kinds of lights - Different kinds of reflections - Basic lighting model

Why Lighting? (cont…)

Point Light Sources

  • A point source is the simplest model we can use for a light source
  • We simply define:
    • The position of the light
    • The RGB values for the colour of the light
  • Light is emitted in all directions
  • Useful for small light sources

Radial Intensity Attenuation (cont…)

  • We use instead in inverse quadratic function of the form:
  • where the coefficients a0 , a1 , and a2 can be varied to produce optimal results

2 0 1 2

1 ( ) l l

radatten l a a d a d

f d

=

Infinitely Distant Light Sources

  • A large light source, like the sun, can be modelled as a point light source
  • However, it will have very little directional effect
  • Radial intensity attenuation is not used

Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004) Docsity.com

Directional Light Sources & Spotlights (cont…)

  • We can denote Vlight as the unit vector

in the direction of the light and Vobj

as the unit vector from the light source to an object

  • The dot-product of these two vectors gives us the angle between them
  • If this angle is inside the light’s angular limit then the object is within the spotlight

Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

Vobj ⋅ Vlight = cos α

Angular Intensity Attenuation

  • As well as light intensity decreasing as we move away from a light source, it also decreases angularly
  • A commonly used function for calculating angular attenuation is:

• where the attenuation exponent a l is assigned

some positive value and angle is measured from the cone axis

f angatten (φ ) = cos al φ 0  ≤φ ≤ θ

φ

Surface Lighting Effects

  • The amount of incident light reflected by a surface depends on the type of material
  • Shiny materials reflect more of the incident light and dull surfaces absorb more of the incident light
  • For transparent surfaces some of the light is also transmitted through the material

Diffuse Reflection

  • Surfaces that are rough or grainy tend to reflect light in all directions
  • This scattered light is called diffuse reflection

Ambient Light

  • A surface that is not exposed to direct light may still be lit up by reflections from other nearby objects – ambient light
  • The total reflected light from a surface is the sum of the contributions from light sources and reflected light Docsity.com

Example

Nate Robin’s Tutorial

Nate Robin’s OpenGL Tutorials available at: http://www.xmission.com/~nate/tutors.htmlDocsity.com

Basic Illumination Model

  • We will consider a basic illumination model which gives reasonably good results and is used in most graphics systems
  • The important components are:
    • Ambient light
    • Diffuse reflection
    • Specular reflection
  • For the most part we will consider only monochromatic light