More Lighting in OpenGL
Tom Kelliher, CS 320
Apr. 23, 2003
Collect exams.
Read Read 7.1--7.6.
Final project.
Exam.
- Walk-through code.
- Lab.
Texture mapping.
- Lines 13--24: The experiments.
- Lines 76--78: Disable all lighting to render the sphere representing
the moving light as a 2-D object.
- Lines 143--144: Disable and enable the fixed spotlight.
- Lines 210--216: Specifying
GL_LIGHT1
's position here, before
the call to gluLookAt()
results in the light being positioned in eye
coordinates.
- Line 227:
glLightModel*(pname, param)
:
- This call correctly computes specular reflections by correctly
determining the viewer angle. Otherwise, the viewer is assumed to be at
infinity and the view angle will be along the -z axis.
- Other
pname
s:
-
GL_LIGHT_MODEL_AMBIENT
: Set global ambient parameters.
-
GL_LIGHT_MODEL_TWO_SIDE
: Set to !0 to enable two-sided
lighting using back material parameters.
Translucence?
For details, RTFM.
- Lines 228--230: Note that lighting and individual lights are enabled
separately.
Refer to source code.
Thomas P. Kelliher
Wed Apr 23 08:33:14 EDT 2003
Tom Kelliher