GLfloat light0_position[] = { 0, 0, 1, 0 };
GLfloat light0_brightness = { 1, 1, 1, 1 };
glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_brightness);
glLightfv(GL_LIGHT0, GL_SPECULAR, light0_brightness);
- Directional light vs. point light - directional has w = 0
- The light position is transformed by modelview
- If light position (or direction) is relative to model, specify it after
transformations
- If light position is relative to camera, specify before transformations
- Can set lots of other fancy stuff with glLightfv and
glLightModelfv
- Can set up more than 1 light - just repeat with GL_LIGHT1,
GL_LIGHT2, etc.