* _VP_inf_norm
* _h_inf_norm
* _Position
- * _NormDirection
+ * _NormSpotDirection
* _ModelViewInvScale
* _NeedEyeCoords
* _EyeZDir
fcmd[LIT_DIRECTION_W] = 0;
} else {
COPY_4V( &fcmd[LIT_POSITION_X], l->_Position );
- fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0];
- fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1];
- fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2];
+ fcmd[LIT_DIRECTION_X] = -l->_NormSpotDirection[0];
+ fcmd[LIT_DIRECTION_Y] = -l->_NormSpotDirection[1];
+ fcmd[LIT_DIRECTION_Z] = -l->_NormSpotDirection[2];
fcmd[LIT_DIRECTION_W] = 0;
}
* _VP_inf_norm
* _h_inf_norm
* _Position
- * _NormDirection
+ * _NormSpotDirection
* _ModelViewInvScale
* _NeedEyeCoords
* _EyeZDir
fcmd[LIT_DIRECTION_W] = 0;
} else {
COPY_4V( &fcmd[LIT_POSITION_X], l->_Position );
- fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0];
- fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1];
- fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2];
+ fcmd[LIT_DIRECTION_X] = -l->_NormSpotDirection[0];
+ fcmd[LIT_DIRECTION_Y] = -l->_NormSpotDirection[1];
+ fcmd[LIT_DIRECTION_Z] = -l->_NormSpotDirection[2];
fcmd[LIT_DIRECTION_W] = 0;
}
* _VP_inf_norm
* _h_inf_norm
* _Position
- * _NormDirection
+ * _NormSpotDirection
* _ModelViewInvScale
* _NeedEyeCoords
* _EyeZDir
fcmd[LIT_DIRECTION_W] = 0;
} else {
COPY_4V( &fcmd[LIT_POSITION_X], l->_Position );
- fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0];
- fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1];
- fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2];
+ fcmd[LIT_DIRECTION_X] = -l->_NormSpotDirection[0];
+ fcmd[LIT_DIRECTION_Y] = -l->_NormSpotDirection[1];
+ fcmd[LIT_DIRECTION_Z] = -l->_NormSpotDirection[2];
fcmd[LIT_DIRECTION_W] = 0;
}
_mesa_light(ctx, i, GL_DIFFUSE, l->Diffuse);
_mesa_light(ctx, i, GL_SPECULAR, l->Specular );
_mesa_light(ctx, i, GL_POSITION, l->EyePosition);
- _mesa_light(ctx, i, GL_SPOT_DIRECTION, l->EyeDirection);
+ _mesa_light(ctx, i, GL_SPOT_DIRECTION, l->SpotDirection);
_mesa_light(ctx, i, GL_SPOT_EXPONENT, &l->SpotExponent);
_mesa_light(ctx, i, GL_SPOT_CUTOFF, &l->SpotCutoff);
_mesa_light(ctx, i, GL_CONSTANT_ATTENUATION,
break;
case GL_SPOT_DIRECTION:
/* NOTE: Direction already transformed by inverse ModelView! */
- if (TEST_EQ_3V(light->EyeDirection, params))
+ if (TEST_EQ_3V(light->SpotDirection, params))
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
- COPY_3V(light->EyeDirection, params);
+ COPY_3V(light->SpotDirection, params);
break;
case GL_SPOT_EXPONENT:
ASSERT(params[0] >= 0.0);
COPY_4V( params, ctx->Light.Light[l].EyePosition );
break;
case GL_SPOT_DIRECTION:
- COPY_3V( params, ctx->Light.Light[l].EyeDirection );
+ COPY_3V( params, ctx->Light.Light[l].SpotDirection );
break;
case GL_SPOT_EXPONENT:
params[0] = ctx->Light.Light[l].SpotExponent;
params[3] = (GLint) ctx->Light.Light[l].EyePosition[3];
break;
case GL_SPOT_DIRECTION:
- params[0] = (GLint) ctx->Light.Light[l].EyeDirection[0];
- params[1] = (GLint) ctx->Light.Light[l].EyeDirection[1];
- params[2] = (GLint) ctx->Light.Light[l].EyeDirection[2];
+ params[0] = (GLint) ctx->Light.Light[l].SpotDirection[0];
+ params[1] = (GLint) ctx->Light.Light[l].SpotDirection[1];
+ params[2] = (GLint) ctx->Light.Light[l].SpotDirection[2];
break;
case GL_SPOT_EXPONENT:
params[0] = (GLint) ctx->Light.Light[l].SpotExponent;
/* Note: we normalize the spot direction now */
if (ctx->_NeedEyeCoords) {
- COPY_3V( light->_NormDirection, light->EyeDirection );
- NORMALIZE_3FV( light->_NormDirection );
+ COPY_3V( light->_NormSpotDirection, light->SpotDirection );
+ NORMALIZE_3FV( light->_NormSpotDirection );
}
else {
GLfloat spotDir[3];
- COPY_3V(spotDir, light->EyeDirection);
+ COPY_3V(spotDir, light->SpotDirection);
NORMALIZE_3FV(spotDir);
- TRANSFORM_NORMAL( light->_NormDirection,
+ TRANSFORM_NORMAL( light->_NormSpotDirection,
spotDir,
ctx->ModelviewMatrixStack.Top->m);
}
- NORMALIZE_3FV( light->_NormDirection );
+ NORMALIZE_3FV( light->_NormSpotDirection );
if (!(light->_Flags & LIGHT_POSITIONAL)) {
GLfloat PV_dot_dir = - DOT3(light->_VP_inf_norm,
- light->_NormDirection);
+ light->_NormSpotDirection);
if (PV_dot_dir > light->_CosCutoff) {
double x = PV_dot_dir * (EXP_TABLE_SIZE-1);
ASSIGN_4V( l->Specular, 0.0, 0.0, 0.0, 1.0 );
}
ASSIGN_4V( l->EyePosition, 0.0, 0.0, 1.0, 0.0 );
- ASSIGN_3V( l->EyeDirection, 0.0, 0.0, -1.0 );
+ ASSIGN_3V( l->SpotDirection, 0.0, 0.0, -1.0 );
l->SpotExponent = 0.0;
_mesa_invalidate_spot_exp_table( l );
l->SpotCutoff = 180.0;
GLfloat Diffuse[4]; /**< diffuse color */
GLfloat Specular[4]; /**< specular color */
GLfloat EyePosition[4]; /**< position in eye coordinates */
- GLfloat EyeDirection[4]; /**< spotlight dir in eye coordinates */
+ GLfloat SpotDirection[4]; /**< spotlight direction in eye coordinates */
GLfloat SpotExponent;
GLfloat SpotCutoff; /**< in degrees */
GLfloat _CosCutoffNeg; /**< = cos(SpotCutoff) */
GLfloat _Position[4]; /**< position in eye/obj coordinates */
GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */
GLfloat _h_inf_norm[3]; /**< Norm( _VP_inf_norm + <0,0,1> ) */
- GLfloat _NormDirection[4]; /**< normalized spotlight direction */
+ GLfloat _NormSpotDirection[4]; /**< normalized spotlight direction */
GLfloat _VP_inf_spot_attenuation;
GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */
value[3] = ctx->Light.Light[ln].SpotExponent;
return;
case STATE_SPOT_DIRECTION:
- COPY_3V(value, ctx->Light.Light[ln].EyeDirection);
+ COPY_3V(value, ctx->Light.Light[ln].SpotDirection);
value[3] = ctx->Light.Light[ln]._CosCutoff;
return;
case STATE_SPOT_CUTOFF:
/* here, state[2] is the light number */
/* pre-normalize spot dir */
const GLuint ln = (GLuint) state[2];
- COPY_3V(value, ctx->Light.Light[ln]._NormDirection);
+ COPY_3V(value, ctx->Light.Light[ln]._NormSpotDirection);
value[3] = ctx->Light.Light[ln]._CosCutoff;
}
return;
light->QuadraticAttenuation));
if (light->_Flags & LIGHT_SPOT) {
- GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection);
+ GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection);
if (PV_dot_dir<light->_CosCutoff) {
continue;
/* spotlight attenuation */
if (light->_Flags & LIGHT_SPOT) {
- GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection);
+ GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection);
if (PV_dot_dir<light->_CosCutoff) {
continue; /* this light makes no contribution */
/* spotlight attenuation */
if (light->_Flags & LIGHT_SPOT) {
- GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection);
+ GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection);
if (PV_dot_dir<light->_CosCutoff) {
continue; /* this light makes no contribution */
/* spotlight attenuation */
if (light->_Flags & LIGHT_SPOT) {
- GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection);
+ GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection);
if (PV_dot_dir < light->_CosCutoff) {
continue; /* this light makes no contribution */
}
OFFSET( "LIGHT_DIFFUSE ", struct gl_light, Diffuse );
OFFSET( "LIGHT_SPECULAR ", struct gl_light, Specular );
OFFSET( "LIGHT_EYE_POSITION ", struct gl_light, EyePosition );
- OFFSET( "LIGHT_EYE_DIRECTION ", struct gl_light, EyeDirection );
+ OFFSET( "LIGHT_SPOT_DIRECTION ", struct gl_light, SpotDirection );
OFFSET( "LIGHT_SPOT_EXPONENT ", struct gl_light, SpotExponent );
OFFSET( "LIGHT_SPOT_CUTOFF ", struct gl_light, SpotCutoff );
OFFSET( "LIGHT_COS_CUTOFF ", struct gl_light, _CosCutoff );
OFFSET( "LIGHT_POSITION ", struct gl_light, _Position );
OFFSET( "LIGHT_VP_INF_NORM ", struct gl_light, _VP_inf_norm );
OFFSET( "LIGHT_H_INF_NORM ", struct gl_light, _h_inf_norm );
- OFFSET( "LIGHT_NORM_DIRECTION ", struct gl_light, _NormDirection );
+ OFFSET( "LIGHT_NORM_DIRECTION ", struct gl_light, _NormSpotDirection );
OFFSET( "LIGHT_VP_INF_SPOT_ATTEN ", struct gl_light, _VP_inf_spot_attenuation );
printf( "\n" );
OFFSET( "LIGHT_SPOT_EXP_TABLE ", struct gl_light, _SpotExpTable );