voidglLightModelf(GLenumpname, GLfloatparam) voidglLightModeli(GLenumpname, GLintparam)

*pname*-
Specifies a single-valued lighting model parameter.
**GL_LIGHT_MODEL_LOCAL_VIEWER**and**GL_LIGHT_MODEL_TWO_SIDE**are accepted. *param*-
Specifies the value that
*param*will be set to.

voidglLightModelfv(GLenumpname, const GLfloat *params) voidglLightModeliv(GLenumpname, const GLint *params)

*pname*-
Specifies a lighting model parameter.
**GL_LIGHT_MODEL_AMBIENT**,**GL_LIGHT_MODEL_LOCAL_VIEWER**and**GL_LIGHT_MODEL_TWO_SIDE**are accepted. *params*-
Specifies a pointer to the value that
*params*will be set to.

**GL_LIGHT_MODEL_AMBIENT**-
*params*contains four integer or floating-point values that specify the ambient RGBA intensity of the entire scene. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default ambient scene intensity is (0.2, 0.2, 0.2, 1.0) **GL_LIGHT_MODEL_LOCAL_VIEWER**-
*params*is a single integer or floating-point value that specifies how specular reflection angles are computed. If*params*is 0 (or 0.0), specular reflection angles take the view direction to be parallel to and in the direction of the -*z*axis, regardless of the location of the vertex in eye coordinates. Otherwise specular reflections are computed from the origin of the eye coordinate system. The default is 0. **GL_LIGHT_MODEL_TWO_SIDE**-
*params*is a single integer or floating-point value that specifies whether one- or two-sided lighting calculations are done for polygons. It has no effect on the lighting calculations for points, lines, or bitmaps. If params is 0 (or 0.0), one-sided lighting is specified, and only the front material parameters are used in the lighting equation. Otherwise, two-sided lighting is specified. In this case, vertices of back-facing polygons are lighted using the back material parameters, and have their normals reversed before the lighting equation is evaluated. Vertices of front-facing polygons are always lighted using the front material parameters, with no change to their normals. The default is 0.

The alpha component of the resulting lighted color is set to the alpha value of the material diffuse reflectance.

In color index mode, the value of the lighted index of a vertex ranges from the
ambient to the specular values passed to
**glMaterial** using
**GL_COLOR_INDEXES**. Diffuse and specular coefficients, computed with a
(.30, .59, .11) weighting of the lights' colors, the shininess of the material,
and the same reflection and attenuation equations as in the RGBA case,
determine how much above ambient the resulting index is.

**GL_INVALID_OPERATION** is generated if **glLightModel** is called
between a call to **glBegin** and the
corresponding call to **glEnd**.

back to the **OpenGL index page**

© *1995 Uwe Behrens. All rights reserved.*