Lecture 40-Pre-Read
Lecture 40-Pre-Read
Lecture 40
• Global Illumination models: take • Only consider the light, the observer
into account the interaction of light position, and the object material
from all the surfaces in the scene. properties
Basic Illumination Model
• The light that is the result from the light reflecting off other surfaces in the
environment
• A general level of brightness for a scene that is independent of the light
positions or surface directions -> ambient light
• Has no direction
• Each light source has an ambient light contribution, Ia
• For a given surface, we can specify how much ambient light the surface
can reflect using an ambient reflection coefficient : Ka (0 < Ka < 1)
Ambient Light
glMaterialfv( GL_FRONT_AND_BACK,
GL_AMBIENT, black);
glMaterialfv( GL_FRONT_AND_BACK,
GL_DIFFUSE, white8);
glMaterialfv( GL_FRONT_AND_BACK,
GL_SPECULAR, white2);
glMaterialfv( GL_FRONT_AND_BACK,
GL_SHININESS, mat_shininess);
OpenGL Lighting
GLfloat white[] = {1., 1., 1., 1.};
GLfloat light0_position[] = {1., 1., 5., 0.}; /* directional light (w=0) */
glEnable(GL_LIGHTING);