projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
616f470
)
Remove _BaseAlpha, fix reflect lighting bug.
author
Keith Whitwell
<keith@tungstengraphics.com>
Sat, 28 Jul 2001 19:28:49 +0000
(19:28 +0000)
committer
Keith Whitwell
<keith@tungstengraphics.com>
Sat, 28 Jul 2001 19:28:49 +0000
(19:28 +0000)
src/mesa/main/light.c
patch
|
blob
|
history
src/mesa/main/mtypes.h
patch
|
blob
|
history
src/mesa/main/rastpos.c
patch
|
blob
|
history
src/mesa/swrast/s_context.c
patch
|
blob
|
history
src/mesa/tnl/t_vb_lighttmp.h
patch
|
blob
|
history
src/mesa/x86/gen_matypes.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/light.c
b/src/mesa/main/light.c
index 6a0619c62c914f6baa15a9648937619a93bd9b06..8f4c607af5a3a20cd2e71d74f430a29c58258a7b 100644
(file)
--- a/
src/mesa/main/light.c
+++ b/
src/mesa/main/light.c
@@
-1,4
+1,4
@@
-/* $Id: light.c,v 1.4
4 2001/05/09 12:24:51
keithw Exp $ */
+/* $Id: light.c,v 1.4
5 2001/07/28 19:28:49
keithw Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-664,7
+664,6
@@
void _mesa_update_material( GLcontext *ctx,
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat->Diffuse );
}
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];
}
if (bitmask & BACK_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
@@
-672,7
+671,6
@@
void _mesa_update_material( GLcontext *ctx,
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat->Diffuse );
}
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 */
}
/* update material specular values */
@@
-801,7
+799,6
@@
void _mesa_update_color_material( GLcontext *ctx,
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat->Diffuse );
}
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) {
}
if (bitmask & BACK_DIFFUSE_BIT) {
@@
-810,7
+807,6
@@
void _mesa_update_color_material( GLcontext *ctx,
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat->Diffuse );
}
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 */
}
/* update light->_MatSpecular = light's specular * material's specular */
@@
-1216,9
+1212,6
@@
_mesa_update_lighting( GLcontext *ctx )
ACC_SCALE_3V(ctx->Light._BaseColor[side],
ctx->Light.Model.Ambient,
mat->Ambient);
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) {
}
foreach (light, &ctx->Light.EnabledList) {
diff --git
a/src/mesa/main/mtypes.h
b/src/mesa/main/mtypes.h
index 9bf185f7f39616301677bbfdd81e8255fd2e7bfa..9325934a070de33fb7b76df12ae1e79c477f6906 100644
(file)
--- a/
src/mesa/main/mtypes.h
+++ b/
src/mesa/main/mtypes.h
@@
-1,4
+1,4
@@
-/* $Id: mtypes.h,v 1.
49 2001/07/13 20:07:37 brianp
Exp $ */
+/* $Id: mtypes.h,v 1.
50 2001/07/28 19:28:49 keithw
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-496,7
+496,6
@@
struct gl_light_attrib {
GLboolean _NeedVertices; /* Use fast shader? */
GLuint _Flags; /* LIGHT_* flags, see below */
GLfloat _BaseColor[2][3];
GLboolean _NeedVertices; /* Use fast shader? */
GLuint _Flags; /* LIGHT_* flags, see below */
GLfloat _BaseColor[2][3];
- GLfloat _BaseAlpha[2];
};
};
diff --git
a/src/mesa/main/rastpos.c
b/src/mesa/main/rastpos.c
index 83f84683141fd8ade357c527dea3dd1ddf49a17e..841e539a6a94c7d030349b8c8d350a3abc27a175 100644
(file)
--- a/
src/mesa/main/rastpos.c
+++ b/
src/mesa/main/rastpos.c
@@
-1,4
+1,4
@@
-/* $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
/*
* Mesa 3-D graphics library
@@
-126,7
+126,6
@@
shade_rastpos(GLcontext *ctx,
GLuint *Rindex)
{
GLfloat (*base)[3] = ctx->Light._BaseColor;
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;
struct gl_light *light;
GLfloat diffuseColor[4], specularColor[4];
GLfloat diffuse = 0, specular = 0;
@@
-135,7
+134,7
@@
shade_rastpos(GLcontext *ctx,
_mesa_validate_all_lighting_tables( ctx );
COPY_3V(diffuseColor, base[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) {
ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 0.0);
foreach (light, &ctx->Light.EnabledList) {
diff --git
a/src/mesa/swrast/s_context.c
b/src/mesa/swrast/s_context.c
index 76be114f0ac091ab2c0a66f0acf6e37511eec71d..4191dee2cf6d8cd44892606758fd2d0c34eed545 100644
(file)
--- a/
src/mesa/swrast/s_context.c
+++ b/
src/mesa/swrast/s_context.c
@@
-1,4
+1,4
@@
-/* $Id: s_context.c,v 1.2
4 2001/07/17 19:39:32
keithw Exp $ */
+/* $Id: s_context.c,v 1.2
5 2001/07/28 19:28:49
keithw Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-541,9
+541,10
@@
_swrast_print_vertex( GLcontext *ctx, const SWvertex *v )
v->win[0], v->win[1], v->win[2], v->win[3]);
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
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",
#if CHAN_TYPE == GL_FLOAT
fprintf(stderr, "color %f %f %f %f\n",
diff --git
a/src/mesa/tnl/t_vb_lighttmp.h
b/src/mesa/tnl/t_vb_lighttmp.h
index 87e00ddf08af2d7d99e1e5edabeebb7512155036..ff3dead13ef7ffa42cae867980039daeca826721 100644
(file)
--- a/
src/mesa/tnl/t_vb_lighttmp.h
+++ b/
src/mesa/tnl/t_vb_lighttmp.h
@@
-1,4
+1,4
@@
-/* $Id: t_vb_lighttmp.h,v 1.1
3 2001/07/17 19:39:32
keithw Exp $ */
+/* $Id: t_vb_lighttmp.h,v 1.1
4 2001/07/28 19:28:49
keithw Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-116,8
+116,6
@@
static void TAG(light_rgba_spec)( GLcontext *ctx,
(void) vstride;
(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__ ); */
/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
@@
-134,10
+132,12
@@
static void TAG(light_rgba_spec)( GLcontext *ctx,
VB->ColorPtr[0] = &store->LitColor[0];
VB->SecondaryColorPtr[0] = &store->LitSecondary[0];
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];
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?
}
/* Side-effects done, can we finish now?
@@
-158,8
+158,12
@@
static void TAG(light_rgba_spec)( GLcontext *ctx,
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
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 );
_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]);
COPY_3V(sum[0], base[0]);
ZERO_3V(spec[0]);
@@
-331,9
+335,6
@@
static void TAG(light_rgba)( GLcontext *ctx,
color[0] = Fcolor;
color[1] = Bcolor;
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 );
if (IDX & LIGHT_COLORMATERIAL) {
if (VB->ColorPtr[0]->Type != GL_FLOAT)
import_color_material( ctx, stage );
@@
-343,8
+344,12
@@
static void TAG(light_rgba)( GLcontext *ctx,
}
VB->ColorPtr[0] = &store->LitColor[0];
}
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];
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 (stage->changed_inputs == 0)
return;
@@
-362,8
+367,12
@@
static void TAG(light_rgba)( GLcontext *ctx,
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
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 );
_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(sum[0], base[0]);
@@
-565,13
+574,15
@@
static void TAG(light_fast_rgba_single)( GLcontext *ctx,
COPY_3V(base[0], light->_MatAmbient[0]);
ACC_3V(base[0], ctx->Light._BaseColor[0] );
UNCLAMPED_FLOAT_TO_RGB_CHAN( basechan[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]);
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 {
}
do {
@@
-652,8
+663,8
@@
static void TAG(light_fast_rgba)( GLcontext *ctx,
(void) nr;
(void) nstride;
(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 (IDX & LIGHT_COLORMATERIAL) {
if (VB->ColorPtr[0]->Type != GL_FLOAT)
@@
-680,9
+691,13
@@
static void TAG(light_fast_rgba)( GLcontext *ctx,
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
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 );
_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)
COPY_3V(sum[0], ctx->Light._BaseColor[0]);
if (IDX & LIGHT_TWOSIDE)
diff --git
a/src/mesa/x86/gen_matypes.c
b/src/mesa/x86/gen_matypes.c
index d92a54f4d897447a7e4e4580df6177dd53d77e2f..f2403c8c02ef4b28f3a8838029ae21ea36e0061d 100644
(file)
--- a/
src/mesa/x86/gen_matypes.c
+++ b/
src/mesa/x86/gen_matypes.c
@@
-1,4
+1,4
@@
-/* $Id: gen_matypes.c,v 1.
2 2001/03/29 03:41:40 gareth
Exp $ */
+/* $Id: gen_matypes.c,v 1.
3 2001/07/28 19:28:49 keithw
Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-106,7
+106,6
@@
int main( int argc, char **argv )
OFFSET( "CTX_LIGHT_NEED_VERTS ", GLcontext, Light._NeedVertices );
OFFSET( "CTX_LIGHT_FLAGS ", GLcontext, Light._Flags );
OFFSET( "CTX_LIGHT_BASE_COLOR ", GLcontext, Light._BaseColor );
OFFSET( "CTX_LIGHT_NEED_VERTS ", GLcontext, Light._NeedVertices );
OFFSET( "CTX_LIGHT_FLAGS ", GLcontext, Light._Flags );
OFFSET( "CTX_LIGHT_BASE_COLOR ", GLcontext, Light._BaseColor );
- OFFSET( "CTX_LIGHT_BASE_ALPHA ", GLcontext, Light._BaseAlpha );
/* struct vertex_buffer offsets:
/* struct vertex_buffer offsets: