Lines Matching defs:light

30 #include "light.h"
92 * per-light state.
100 struct gl_light *light;
103 light = &ctx->Light.Light[lnum];
138 light->_Flags |= LIGHT_POSITIONAL;
140 light->_Flags &= ~LIGHT_POSITIONAL;
150 * light.EyePosition.w should be 0 for infinite lights.
190 light->_Flags |= LIGHT_SPOT;
192 light->_Flags &= ~LIGHT_SPOT;
254 _mesa_Lightf( GLenum light, GLenum pname, GLfloat param )
259 _mesa_Lightfv( light, pname, fparam );
264 _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
267 GLint i = (GLint) (light - GL_LIGHT0);
271 _mesa_error( ctx, GL_INVALID_ENUM, "glLight(light=0x%x)", light );
325 _mesa_Lighti( GLenum light, GLenum pname, GLint param )
330 _mesa_Lightiv( light, pname, iparam );
335 _mesa_Lightiv( GLenum light, GLenum pname, const GLint *params )
371 _mesa_Lightfv( light, pname, fparam );
377 _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params )
380 GLint l = (GLint) (light - GL_LIGHT0);
426 _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params )
429 GLint l = (GLint) (light - GL_LIGHT0);
683 struct gl_light *light = &ctx->Light.Light[i];
685 SCALE_3V( light->_MatAmbient[0], lu->Ambient,
694 struct gl_light *light = &ctx->Light.Light[i];
696 SCALE_3V( light->_MatAmbient[1], lu->Ambient,
719 struct gl_light *light = &ctx->Light.Light[i];
721 SCALE_3V( light->_MatDiffuse[0], lu->Diffuse,
730 struct gl_light *light = &ctx->Light.Light[i];
732 SCALE_3V( light->_MatDiffuse[1], lu->Diffuse,
742 struct gl_light *light = &ctx->Light.Light[i];
744 SCALE_3V( light->_MatSpecular[0], lu->Specular,
753 struct gl_light *light = &ctx->Light.Light[i];
755 SCALE_3V( light->_MatSpecular[1], lu->Specular,
938 * Also, precompute some lighting values such as the products of light
956 struct gl_light *light = &ctx->Light.Light[i];
957 flags |= light->_Flags;
1007 * Update state derived from light position, spot direction.
1034 struct gl_light *light = &ctx->Light.Light[i];
1039 COPY_4FV( light->_Position, lu->EyePosition );
1043 TRANSFORM_POINT( light->_Position, ctx->ModelviewMatrixStack.Top->inv,
1047 if (!(light->_Flags & LIGHT_POSITIONAL)) {
1049 COPY_3V( light->_VP_inf_norm, light->_Position );
1050 NORMALIZE_3FV( light->_VP_inf_norm );
1054 ADD_3V( light->_h_inf_norm, light->_VP_inf_norm, ctx->_EyeZDir);
1055 NORMALIZE_3FV( light->_h_inf_norm );
1057 light->_VP_inf_spot_attenuation = 1.0;
1060 /* positional light w/ homogeneous coordinate, divide by W */
1061 GLfloat wInv = 1.0F / light->_Position[3];
1062 light->_Position[0] *= wInv;
1063 light->_Position[1] *= wInv;
1064 light->_Position[2] *= wInv;
1067 if (light->_Flags & LIGHT_SPOT) {
1071 COPY_3V( light->_NormSpotDirection, lu->SpotDirection );
1072 NORMALIZE_3FV( light->_NormSpotDirection );
1078 TRANSFORM_NORMAL( light->_NormSpotDirection,
1083 NORMALIZE_3FV( light->_NormSpotDirection );
1085 if (!(light->_Flags & LIGHT_POSITIONAL)) {
1086 GLfloat PV_dot_dir = - DOT3(light->_VP_inf_norm,
1087 light->_NormSpotDirection);
1090 light->_VP_inf_spot_attenuation =
1094 light->_VP_inf_spot_attenuation = 0;
1176 * Initialize the n-th light data structure.
1179 * \param n number of the light.
1180 * \note The defaults for light 0 are different than the other lights.
1207 * Initialize the light model data structure.