C481 B581 Computer Graphics
Dana Vrajitoru

Material Properties in OpenGL

Custom Lights
GLfloat light_ambient[]={1.0, 0.0, 0.0, 1.0};
GLfloat light_diffuse[]={1.0, 1.0, 0.0, 1.0};
GLfloat light_specular[]={1.0, 1.0, 1.0, 1.0};

Custom Material Properties
GLfloat mat_specular[]={1.0, 1.0, 1.0, 1.0};
GLfloat mat_diffuse[]={0.0, 0.0, 1.0, 1.0};
GLfloat mat_ambient[]={0.0, 0.5, 1.0, 1.0};

Redefining the Material Properties

Lights and glColor

Examples:

Source code: teapot_amb_diff.cc (ambient and diffuse only) and teapot_spec.cc (+specular, shininess of 50).

Last modified: April 12, 2005.
danav@cs.iusb.edu.