Home | History | Annotate | Download | only in tnl

Lines Matching full:light

29 #include "main/light.h"
122 /*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor;
123 const struct gl_light *light;
128 ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3], 0.0F, 1.0F );
131 foreach (light, &ctx->Light.EnabledList) {
133 GLfloat VP[3]; /* vector from vertex to light pos */
137 if (!(light->_Flags & LIGHT_POSITIONAL)) {
138 /* light at infinity */
139 COPY_3V(VP, light->_VP_inf_norm);
140 attenuation = light->_VP_inf_spot_attenuation;
143 /* local/positional light */
146 /* VP = vector from vertex pos to light[i].pos */
147 SUB_3V(VP, light->_Position, vertex);
157 attenuation = 1.0F / (light->ConstantAttenuation + d *
158 (light->LinearAttenuation + d *
159 light->QuadraticAttenuation));
161 if (light->_Flags & LIGHT_SPOT) {
162 GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection);
164 if (PV_dot_dir<light->_CosCutoff) {
168 GLfloat spot = powf(PV_dot_dir, light->SpotExponent);
180 ACC_SCALE_SCALAR_3V(diffuseColor, attenuation, light->_MatAmbient[0]);
185 COPY_3V(diffuseContrib, light->_MatAmbient[0]);
186 ACC_SCALE_SCALAR_3V(diffuseContrib, n_dot_VP, light->_MatDiffuse[0]);
195 if (ctx->Light.Model.LocalViewer) {
203 else if (light->_Flags & LIGHT_POSITIONAL) {
209 h = light->_h_inf_norm;
218 shine = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0];
222 if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
224 light->_MatSpecular[0]);
228 light->_MatSpecular[0]);
445 if (ctx->Light.Enabled) {