summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-04-15 12:57:23 +0000
committerKeith Whitwell <[email protected]>2005-04-15 12:57:23 +0000
commit78803b2667c1dfe1dc47e09b61a4c29303e09d0b (patch)
treee77fb3e2816280155e7bcbf1c8283d0ad4a2c62c
parenta131d50fb76cfa4c129c2a9d6ec2a0c83d51b85a (diff)
Fix alpha value of STATE_LIGHTMODEL_SCENECOLOR. From the spec:
The "w" component of the program parameter variable is filled with the alpha component of the front diffuse material color. Make sure matrix inverses are uptodate also.
-rw-r--r--src/mesa/shader/program.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 2d398212ebb..e406e1090c5 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -648,20 +648,22 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
if (state[1] == 0) {
/* front */
GLint i;
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 3; i++) {
value[i] = ctx->Light.Model.Ambient[i]
* ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT][i]
+ ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION][i];
}
+ value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
}
else {
/* back */
GLint i;
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 3; i++) {
value[i] = ctx->Light.Model.Ambient[i]
* ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_AMBIENT][i]
+ ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_EMISSION][i];
}
+ value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
}
return;
case STATE_LIGHTPROD:
@@ -806,7 +808,9 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
}
if (modifier == STATE_MATRIX_INVERSE ||
modifier == STATE_MATRIX_INVTRANS) {
- /* XXX be sure inverse is up to date */
+ /* Be sure inverse is up to date:
+ */
+ _math_matrix_analyse( matrix );
m = matrix->inv;
}
else {