1 of 19

Shading

Instructor: Christopher Rasmussen (cer@cis.udel.edu)

Course web page:

http://goo.gl/XXHixg

March 10, 2016 ❖ Lecture 10

2 of 19

Outline

  • HW #2 math fix -- normalize() after cross product in Creature.cpp
  • Radiometry
  • Surface properties
    • Diffuse vs. specular
    • Bidirectional reflectance distribution function (BRDF)
  • Simplified local model

  • Marschner, 10-10.2.1, 20-20.2

3 of 19

Shading

  • Geometry of perspective projection explains location of scene point in image, but what about its intensity and color?

  • Radiometry is about the measurement of electromagnetic radiation, in this case visible light (Marschner, 20-20.2)
  • Photometry quantifies camera/eye sensitivity (Marschner 20.3)

x

O

C

L

4 of 19

Lighting Objects

5 of 19

Lighting Objects

6 of 19

What is Light?

  • A photon is a quantum of light with a:
    • 3-D position
    • 3-D direction of propagation
    • Wavelength λ
  • Energy q carried by one photon is proportional to 1/λ
  • Power is energy per unit of time; units are watts W
  • Spectral power is watts per unit of wavelength
    • In the following slides this is the kind of power we are talking about unless otherwise noted

7 of 19

Incoming and Outgoing Light at a Surface

  • Irradiance E (Wm-2)
    • Light power (watts) arriving at a point on a surface from all visible directions
    • An image samples the irradiance at the pinhole
    • Book uses variable H
  • Radiosity B (Wm-2)
    • Light leaving a surface in all directions (per patch)
    • Also called “radiant exitance”

n

t

x

O

8 of 19

Perspective Projection

from Forsyth & Ponce

c

Instead of single direction d characteristic of parallel projections,

rays emanating from single point c define perspective projection

9 of 19

Radiance

  • Irradiance doesn’t tell us where light came from
  • Radiance L (Wm-2sr-1)
    • Power at a point in space in a given direction, per solid angle, foreshortened
    • Can be incoming or outgoing
    • Does not attenuate with distance in vacuum
  • What is stored in one pixel—the light energy arriving along a particular ray at a particular point
    • After photometric considerations

10 of 19

Foreshortening

  • The more a surface is tilted away, the larger the area light energy is distributed over (and therefore is “diluted”)
    • In 2-D, received intensity is proportional to cosine of angle between light direction l and surface normal n
    • Received intensity is greatest when l and n are parallel
  • 3-D foreshortening factor for light coming from direction (θ, φ) is cos θ , aka dot product n . l

from Akenine-Moller & Haines

11 of 19

Object surface properties

  • General
    • Light/dark/color
    • Reflectivity (e.g., matte/ Lambertian vs. shiny)
  • Space-varying pattern
    • I.e., are above characteristics different in different locations?
    • We’ll get to this when we cover texture-mapping

12 of 19

Detailed Surface Properties: BRDF

  • Bidirectional Reflectance Distribution Function (BRDF): Ratio of outgoing radiance in one direction to incident irradiance from another

n

13 of 19

BRDF Properties

  • Energy leaving ≤ Energy arriving (albedo is fraction reflected)
  • For a perfectly diffuse/Lambertian surface, the BRDF is a constant—incoming light is scattered equally in all directions
  • Generally, only the difference between incident and emitted angle Φ (as well as polar angles) is significant
    • Dependence on absolute Φ Anisotropy (e.g., brushed metal, fur)

n

14 of 19

Anisotropic BRDF examples

blenderguru.com

max planck institute

15 of 19

Reflectance equation

  • Radiance for a viewing direction given all incoming light (also called rendering equation in Marschner 20.2):

  • This is expensive to compute in general, so the standard local approach is approximation:
    • Approximate incoming light as ambient (whole hemisphere) + set of point light sources
    • Approximate BRDF of surface as combination of diffuse (matte) and specular (shiny) factors

16 of 19

Illumination models

  • Interaction between light sources and objects in scene that results in perception of intensity and color at eye
  • Local vs. global models
    • Local illumination: Perception of a particular primitive only depends on light sources directly affecting that one primitive
      • Geometry
      • Material properties
    • Global illumination: Also take into account indirect effects on light of other objects in the scene
      • Shadows cast
      • Light reflected/refracted
      • More when we get to ray tracing

17 of 19

Light sources

  • Properties
    • Intensity (total radiosity)
    • Color (intensity / wavelength)
  • Geometry
    • Point: Shoots light in all directions
    • Spotlight: Angle-limited point source
    • Directional: Source distant enough that light rays are roughly parallel (e.g., like the sun relative to earth)
    • Area: Behaves like a continuous configuration of point sources inside, say, a polygon

from Akenine-Moller & Haines

Some light source types

Light source types: Induced shading

18 of 19

Standard local model for graphics

  • Final perceived brightness is a combination of diffuse and specular reflectance, plus an ambient term to approximate global lighting effects

Ambient

Diffuse

Specular

Total

19 of 19

Reflectance equation: Total illumination

  • For greater control of appearance, a different light radiance is typically specified in OpenGL for each type of reflectance

  • Actual light at a pixel is combination of three effects:

from Wikipedia