1 / 12

Lighting Models

Lighting Models. Soon Tee Teoh CS 116A. Terminology. Illumination Model (or Lighting Model, or Shading Model): Calculate the color of an illuminated point on the surface of an object

dayo
Download Presentation

Lighting Models

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lighting Models Soon Tee Teoh CS 116A

  2. Terminology • Illumination Model (or Lighting Model, or Shading Model): Calculate the color of an illuminated point on the surface of an object • Surface-Rendering Method: Use the color calculations from an illumination model to determine color of all pixels in the scene

  3. Light Sources • Point light source – Rays emanate from a point • Infinitely Distant Light source – Rays are parallel

  4. Attenuation • Attenuate means “to weaken”. • Light loses energy as it travels further. • In general, amplitude of light at distance d from the light source is 1/d2 of its amplitude at the source. • However, to allow user more control over the attenuation, we let the attenuation be 1/(a0+a1d+a2d2), where the user can choose the coefficients a0, a1 and a2. • We assume that infinite light sources don’t attenuate.

  5. Directional Spotlight • Light source with a specified position, direction, and angle limit q. source Vlight q

  6. Test if a vertex is in the light cone • Suppose that the unit vector of the light direction is Vlight, and the unit vector from the light source to a point is Vobj. • Let the angle between Vlight and Vobj be a. • The point is within the cone (and therefore illuminated by this spotlight) if a < q. • But, • Vobj.Vlight = cos a • Assume that 0o < q < 90o, then the point must be within the cone if cos a > cos q. • Therefore, calculate cos q once, and then for each object, just compare Vobj.Vlight with cos q to figure out if it’s illuminated by the light. Vobj point a source Vlight q

  7. Angular Attenuation • We can also attenuate light as it deviates from the principal direction. • Commonly used angular attenuation factor is: cosa f, where 0o < f < q. • The user can choose the value a, as long as it is positive. f is measured as the angle from the principal light direction. • For a large value of a, the light attenuates quickly as it deviates from the principal direction.

  8. Surface Lighting Effects • How is a surface illuminated? • We consider three ways: • Diffuse reflection: Rough, matte surface – surface appears equally bright from any viewing angle • Specular reflection: Shiny surface, reflected light is highlighted at a bright spot • Ambient light: background light illuminates surface not directly exposed to any light source

  9. Ambient Lighting Model • In this model, we simply set a uniform, global “ambient” light that will light up any surface. • The ambient reflection off a surface is independent of its position and orientation.

  10. Diffuse Reflection • The ideal diffuse reflector (or Lambertian reflector): Incident light is reflected with equal intensity in all directions, regardless of viewing position. • How much light is reflected depends on the “reflectiveness” of the surface. A highly reflective surface reflects most of the light. • Let the “reflectiveness” parameter be k. • Then the ambient reflection is Iref = kIamb, where Iref is the intensity of light reflected, and Iamb is the intensity of ambient light.

  11. Diffuse Reflection • Ambient light alone produces uninteresting flat shading. • Diffuse reflection from directional light is dependent on the relative direction of the light. • Idea: A surface that is perpendicular to the direction of the incident

  12. Diffuse Reflection • The angle between the incoming light and the surface normal is called the angle of incidence q. • The projected area of the surface perpendicular to the light direction is proportional to cos q. • Therefore the amount of incident light falling on a surface from a light source of intensity Isource is: Ifalling = Isource cos q • Therefore diffuse reflection from this light source is Ireflected = kIfalling = kIsource cos q N q Incident light A cos q A q

More Related