Lighting in OpenGL
An Introduction |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
glNormal*()
void glMaterial*(GLenum face, GLenum name, TYPE value)
GLenum
is GL_FRONT
,
GL_BACK
, or GL_FRONT_AND_BACK
GL_AMBIENT
, GL_DIFFUSE
,
GL_AMBIENT_AND_DIFFUSE
, or
GL_SPECULAR
GL_SHININESS
GLfloat
GL_EMISSION
void glLight*(GLenum light, GLenum name, TYPE value)
light
is GL_LIGHT0
...
GL_LIGHT7
GL_AMBIENT
, GL_DIFFUSE
, or
GL_SPECULAR
GL_POSITION
GL_CONSTANT_ATTENUATION
,
GL_LINEAR_ATTENUATION
, or
GL_QUADRATIC_ATTENUATION
GLfloat
GL_SPOT_CUTOFF
GL_SPOT_DIRECTION
GL_SPOT_EXPONENT
GLfloat
void glLightModel*(GLenum name, TYPE value)
GL_LIGHT_MODEL_AMBIENT
GL_LIGHT_MODEL_LOCAL_VIEWER
GL_TRUE
for a local viewer
GL_FALSE
for a viewer at infinity
GL_LIGHT_MODEL_TWO_SIDE
GL_TRUE
to light both sides
or GL_FALSE
to light the front
GL_LIGHT_MODEL_COLOR_CONTROL
GL_SINGLE_COLOR
or
GL_SEPARATE_SPECULAR_COLORS
glEnable(GL_LIGHTING)
void glEnable(GLenum light)
light
is GL_LIGHT0
...
GL_LIGHT7