-/* $Id: light.c,v 1.44 2001/05/09 12:24:51 keithw Exp $ */
+/* $Id: light.c,v 1.45 2001/07/28 19:28:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat->Diffuse );
}
- ctx->Light._BaseAlpha[0] = CLAMP( mat->Diffuse[3], 0.0, 1.0 );
}
if (bitmask & BACK_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat->Diffuse );
}
- ctx->Light._BaseAlpha[1] = CLAMP( mat->Diffuse[3], 0.0, 1.0 );
}
/* update material specular values */
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat->Diffuse );
}
- ctx->Light._BaseAlpha[0] = CLAMP( mat->Diffuse[3], 0.0, 1.0 );
}
if (bitmask & BACK_DIFFUSE_BIT) {
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat->Diffuse );
}
- ctx->Light._BaseAlpha[1] = CLAMP( mat->Diffuse[3], 0.0, 1.0 );
}
/* update light->_MatSpecular = light's specular * material's specular */
ACC_SCALE_3V(ctx->Light._BaseColor[side],
ctx->Light.Model.Ambient,
mat->Ambient);
-
- ctx->Light._BaseAlpha[side] =
- CLAMP( ctx->Light.Material[side].Diffuse[3], 0.0, 1.0 );
}
foreach (light, &ctx->Light.EnabledList) {
-/* $Id: rastpos.c,v 1.29 2001/07/05 15:31:21 brianp Exp $ */
+/* $Id: rastpos.c,v 1.30 2001/07/28 19:28:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLuint *Rindex)
{
GLfloat (*base)[3] = ctx->Light._BaseColor;
- const GLfloat *sumA = ctx->Light._BaseAlpha;
struct gl_light *light;
GLfloat diffuseColor[4], specularColor[4];
GLfloat diffuse = 0, specular = 0;
_mesa_validate_all_lighting_tables( ctx );
COPY_3V(diffuseColor, base[0]);
- diffuseColor[3] = sumA[0];
+ diffuseColor[3] = CLAMP( ctx->Light.Material[0].Diffuse[3], 0.0, 1.0 );
ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 0.0);
foreach (light, &ctx->Light.EnabledList) {
-/* $Id: s_context.c,v 1.24 2001/07/17 19:39:32 keithw Exp $ */
+/* $Id: s_context.c,v 1.25 2001/07/28 19:28:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
v->win[0], v->win[1], v->win[2], v->win[3]);
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
- fprintf(stderr, "texcoord[%d] %f %f %f %f\n", i,
- v->texcoord[i][0], v->texcoord[i][1],
- v->texcoord[i][2], v->texcoord[i][3]);
+ if (ctx->Texture.Unit[i]._ReallyEnabled)
+ fprintf(stderr, "texcoord[%d] %f %f %f %f\n", i,
+ v->texcoord[i][0], v->texcoord[i][1],
+ v->texcoord[i][2], v->texcoord[i][3]);
#if CHAN_TYPE == GL_FLOAT
fprintf(stderr, "color %f %f %f %f\n",
-/* $Id: t_vb_lighttmp.h,v 1.13 2001/07/17 19:39:32 keithw Exp $ */
+/* $Id: t_vb_lighttmp.h,v 1.14 2001/07/28 19:28:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
(void) vstride;
- UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light._BaseAlpha[0]);
- UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light._BaseAlpha[1]);
/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
VB->ColorPtr[0] = &store->LitColor[0];
VB->SecondaryColorPtr[0] = &store->LitSecondary[0];
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
if (IDX & LIGHT_TWOSIDE) {
VB->ColorPtr[1] = &store->LitColor[1];
VB->SecondaryColorPtr[1] = &store->LitSecondary[1];
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
}
/* Side-effects done, can we finish now?
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
- if ( CHECK_VALIDATE(j) )
+ if ( CHECK_VALIDATE(j) ) {
_mesa_validate_all_lighting_tables( ctx );
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
+ if (IDX & LIGHT_TWOSIDE)
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+ }
COPY_3V(sum[0], base[0]);
ZERO_3V(spec[0]);
color[0] = Fcolor;
color[1] = Bcolor;
- UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light._BaseAlpha[0]);
- UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light._BaseAlpha[1]);
-
if (IDX & LIGHT_COLORMATERIAL) {
if (VB->ColorPtr[0]->Type != GL_FLOAT)
import_color_material( ctx, stage );
}
VB->ColorPtr[0] = &store->LitColor[0];
- if (IDX & LIGHT_TWOSIDE)
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
+
+ if (IDX & LIGHT_TWOSIDE) {
VB->ColorPtr[1] = &store->LitColor[1];
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+ }
if (stage->changed_inputs == 0)
return;
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
- if ( CHECK_VALIDATE(j) )
+ if ( CHECK_VALIDATE(j) ) {
_mesa_validate_all_lighting_tables( ctx );
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
+ if (IDX & LIGHT_TWOSIDE)
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
+ }
COPY_3V(sum[0], base[0]);
COPY_3V(base[0], light->_MatAmbient[0]);
ACC_3V(base[0], ctx->Light._BaseColor[0] );
UNCLAMPED_FLOAT_TO_RGB_CHAN( basechan[0], base[0] );
- UNCLAMPED_FLOAT_TO_CHAN(basechan[0][3], ctx->Light._BaseAlpha[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(basechan[0][3],
+ ctx->Light.Material[0].Diffuse[3]);
if (IDX & LIGHT_TWOSIDE) {
COPY_3V(base[1], light->_MatAmbient[1]);
ACC_3V(base[1], ctx->Light._BaseColor[1]);
UNCLAMPED_FLOAT_TO_RGB_CHAN( basechan[1], base[1]);
- UNCLAMPED_FLOAT_TO_CHAN(basechan[1][3], ctx->Light._BaseAlpha[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(basechan[1][3],
+ ctx->Light.Material[1].Diffuse[3]);
}
do {
(void) nr;
(void) nstride;
- UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light._BaseAlpha[0]);
- UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light._BaseAlpha[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
if (IDX & LIGHT_COLORMATERIAL) {
if (VB->ColorPtr[0]->Type != GL_FLOAT)
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
- if ( CHECK_VALIDATE(j) )
+ if ( CHECK_VALIDATE(j) ) {
_mesa_validate_all_lighting_tables( ctx );
-
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[0], ctx->Light.Material[0].Diffuse[3]);
+ if (IDX & LIGHT_TWOSIDE)
+ UNCLAMPED_FLOAT_TO_CHAN(sumA[1],
+ ctx->Light.Material[1].Diffuse[3]);
+ }
COPY_3V(sum[0], ctx->Light._BaseColor[0]);
if (IDX & LIGHT_TWOSIDE)