<< Prev page
Next page >>
Rendering
Polygon Shading
Implementation
OpenGL
Enable light sources
glEnable
(GL_LIGHT0)
Light properties
{r g b a}
Glfloat light_diffuse[] = {1.0, 1.0, 1.0, 1.0}
glLightfv
(GL_LIGHT0, GL_DIFFUSE, light_diffuse)
Light position
{x y z w}
Glfloat light_position[] = {-1.0, 1.0, -1.0, 1.0}
glLightfv
(GL_LIGHT0, GL_POSITION, light_position)