Game Development Reference
In-Depth Information
Table 4.1 OpenGL light parameters
Parameter name
Default value
Meaning
GL_AMBIENT
(0.0, 0.0, 0.0, 1.0)
Ambient RGBA levels
GL_DIFFUSE
(1.0, 1.0, 1.0, 1.0)
Diffuse RGBA levels
GL_SPECULAR
(1.0, 1.0, 1.0, 1.0)
Specular RGBA levels
GL_POSITION
(0.0, 0.0, 1.0, 0.0)
( x , y , z , w ) position of light
GL_SPOT_DIRECTION
(0.0, 0.0, -1.0)
( x , y , z ) direction of spotlight
GL_SPOT_EXPONENT
0.0
Spotlight exponent
GL_SPOT_CUTOFF
180.0
Spotlight cut-off angle
GL_CONSTANT_ATTENUATION
1.0
Constant attenuation factor
GL_LINEAR_ATTENUATION
0.0
Linear attenuation factor
GL_QUADRATIC_ATTENUATION
0.0
Quadratic attenuation factor
of this software for demonstration purposes; please remember that as a
developer you have full control over all four components of the ambient,
diffuse and specular levels. If you take a moment to play with the
demonstration program then you will realize that it is the combination of
light properties and materials properties that controls the way that
polygons are rendered. Notice that by ramping up the emission level of a
material it acts as though it has its own internal lighting. Try turning the
diffuse level of the light right down but turning the emission level of the
Figure 4.2 GLLighting demo.
 
Search Nedrilad ::




Custom Search