Lines Matching refs:light

103    struct gl_light *light;  in _mesa_light()  local
106 light = &ctx->Light.Light[lnum]; in _mesa_light()
110 if (TEST_EQ_4V(light->Ambient, params)) in _mesa_light()
113 COPY_4V( light->Ambient, params ); in _mesa_light()
116 if (TEST_EQ_4V(light->Diffuse, params)) in _mesa_light()
119 COPY_4V( light->Diffuse, params ); in _mesa_light()
122 if (TEST_EQ_4V(light->Specular, params)) in _mesa_light()
125 COPY_4V( light->Specular, params ); in _mesa_light()
129 if (TEST_EQ_4V(light->EyePosition, params)) in _mesa_light()
132 COPY_4V(light->EyePosition, params); in _mesa_light()
133 if (light->EyePosition[3] != 0.0F) in _mesa_light()
134 light->_Flags |= LIGHT_POSITIONAL; in _mesa_light()
136 light->_Flags &= ~LIGHT_POSITIONAL; in _mesa_light()
140 if (TEST_EQ_3V(light->SpotDirection, params)) in _mesa_light()
143 COPY_3V(light->SpotDirection, params); in _mesa_light()
148 if (light->SpotExponent == params[0]) in _mesa_light()
151 light->SpotExponent = params[0]; in _mesa_light()
155 if (light->SpotCutoff == params[0]) in _mesa_light()
158 light->SpotCutoff = params[0]; in _mesa_light()
159 light->_CosCutoff = (cosf(light->SpotCutoff * M_PI / 180.0)); in _mesa_light()
160 if (light->_CosCutoff < 0) in _mesa_light()
161 light->_CosCutoff = 0; in _mesa_light()
162 if (light->SpotCutoff != 180.0F) in _mesa_light()
163 light->_Flags |= LIGHT_SPOT; in _mesa_light()
165 light->_Flags &= ~LIGHT_SPOT; in _mesa_light()
169 if (light->ConstantAttenuation == params[0]) in _mesa_light()
172 light->ConstantAttenuation = params[0]; in _mesa_light()
176 if (light->LinearAttenuation == params[0]) in _mesa_light()
179 light->LinearAttenuation = params[0]; in _mesa_light()
183 if (light->QuadraticAttenuation == params[0]) in _mesa_light()
186 light->QuadraticAttenuation = params[0]; in _mesa_light()
198 _mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) in _mesa_Lightf() argument
203 _mesa_Lightfv( light, pname, fparam ); in _mesa_Lightf()
208 _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) in _mesa_Lightfv() argument
211 GLint i = (GLint) (light - GL_LIGHT0); in _mesa_Lightfv()
215 _mesa_error( ctx, GL_INVALID_ENUM, "glLight(light=0x%x)", light ); in _mesa_Lightfv()
269 _mesa_Lighti( GLenum light, GLenum pname, GLint param ) in _mesa_Lighti() argument
274 _mesa_Lightiv( light, pname, iparam ); in _mesa_Lighti()
279 _mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ) in _mesa_Lightiv() argument
315 _mesa_Lightfv( light, pname, fparam ); in _mesa_Lightiv()
321 _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ) in _mesa_GetLightfv() argument
324 GLint l = (GLint) (light - GL_LIGHT0); in _mesa_GetLightfv()
370 _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ) in _mesa_GetLightiv() argument
373 GLint l = (GLint) (light - GL_LIGHT0); in _mesa_GetLightiv()
627 struct gl_light *light = &ctx->Light.Light[i]; in _mesa_update_material() local
628 SCALE_3V( light->_MatAmbient[0], light->Ambient, in _mesa_update_material()
637 struct gl_light *light = &ctx->Light.Light[i]; in _mesa_update_material() local
638 SCALE_3V( light->_MatAmbient[1], light->Ambient, in _mesa_update_material()
661 struct gl_light *light = &ctx->Light.Light[i]; in _mesa_update_material() local
662 SCALE_3V( light->_MatDiffuse[0], light->Diffuse, in _mesa_update_material()
671 struct gl_light *light = &ctx->Light.Light[i]; in _mesa_update_material() local
672 SCALE_3V( light->_MatDiffuse[1], light->Diffuse, in _mesa_update_material()
682 struct gl_light *light = &ctx->Light.Light[i]; in _mesa_update_material() local
683 SCALE_3V( light->_MatSpecular[0], light->Specular, in _mesa_update_material()
692 struct gl_light *light = &ctx->Light.Light[i]; in _mesa_update_material() local
693 SCALE_3V( light->_MatSpecular[1], light->Specular, in _mesa_update_material()
892 struct gl_light *light = &ctx->Light.Light[i]; in _mesa_update_lighting() local
893 flags |= light->_Flags; in _mesa_update_lighting()
963 struct gl_light *light = &ctx->Light.Light[i]; in compute_light_positions() local
967 COPY_4FV( light->_Position, light->EyePosition ); in compute_light_positions()
971 TRANSFORM_POINT( light->_Position, ctx->ModelviewMatrixStack.Top->inv, in compute_light_positions()
972 light->EyePosition ); in compute_light_positions()
975 if (!(light->_Flags & LIGHT_POSITIONAL)) { in compute_light_positions()
977 COPY_3V( light->_VP_inf_norm, light->_Position ); in compute_light_positions()
978 NORMALIZE_3FV( light->_VP_inf_norm ); in compute_light_positions()
982 ADD_3V( light->_h_inf_norm, light->_VP_inf_norm, ctx->_EyeZDir); in compute_light_positions()
983 NORMALIZE_3FV( light->_h_inf_norm ); in compute_light_positions()
985 light->_VP_inf_spot_attenuation = 1.0; in compute_light_positions()
989 GLfloat wInv = 1.0F / light->_Position[3]; in compute_light_positions()
990 light->_Position[0] *= wInv; in compute_light_positions()
991 light->_Position[1] *= wInv; in compute_light_positions()
992 light->_Position[2] *= wInv; in compute_light_positions()
995 if (light->_Flags & LIGHT_SPOT) { in compute_light_positions()
999 COPY_3V( light->_NormSpotDirection, light->SpotDirection ); in compute_light_positions()
1000 NORMALIZE_3FV( light->_NormSpotDirection ); in compute_light_positions()
1004 COPY_3V(spotDir, light->SpotDirection); in compute_light_positions()
1006 TRANSFORM_NORMAL( light->_NormSpotDirection, in compute_light_positions()
1011 NORMALIZE_3FV( light->_NormSpotDirection ); in compute_light_positions()
1013 if (!(light->_Flags & LIGHT_POSITIONAL)) { in compute_light_positions()
1014 GLfloat PV_dot_dir = - DOT3(light->_VP_inf_norm, in compute_light_positions()
1015 light->_NormSpotDirection); in compute_light_positions()
1017 if (PV_dot_dir > light->_CosCutoff) { in compute_light_positions()
1018 light->_VP_inf_spot_attenuation = in compute_light_positions()
1019 powf(PV_dot_dir, light->SpotExponent); in compute_light_positions()
1022 light->_VP_inf_spot_attenuation = 0; in compute_light_positions()