update_modelview_scale( struct gl_context *ctx )
{
ctx->_ModelViewInvScale = 1.0F;
+ ctx->_ModelViewInvScaleEyespace = 1.0F;
if (!_math_matrix_is_length_preserving(ctx->ModelviewMatrixStack.Top)) {
const GLfloat *m = ctx->ModelviewMatrixStack.Top->inv;
GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10];
ctx->_ModelViewInvScale = 1.0f / sqrtf(f);
else
ctx->_ModelViewInvScale = sqrtf(f);
+ ctx->_ModelViewInvScaleEyespace = 1.0f / sqrtf(f);
}
}
ctx->_NeedEyeCoords = GL_FALSE;
ctx->_ForceEyeCoords = GL_FALSE;
ctx->_ModelViewInvScale = 1.0;
+ ctx->_ModelViewInvScaleEyespace = 1.0;
}
/** \name Derived state */
GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */
GLfloat _EyeZDir[3];
- GLfloat _ModelViewInvScale;
+ GLfloat _ModelViewInvScale; /* may be for model- or eyespace lighting */
+ GLfloat _ModelViewInvScaleEyespace; /* always factor defined in spec */
GLboolean _NeedEyeCoords;
GLboolean _ForceEyeCoords;
return;
case STATE_NORMAL_SCALE:
- ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1);
+ ASSIGN_4V(value, ctx->_ModelViewInvScaleEyespace, 0, 0, 1);
return;
case STATE_INTERNAL: