From cb08dcbbf29dfa82128c8302f7aa69e90478a5ea Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 13 Sep 2006 17:35:44 +0000 Subject: [PATCH] fix GL_REFLECTION_MAP texgen by not using tex matrix negation when lighting is not enabled (?). This fixes demos/cubemap as well as glean texCube test. --- src/mesa/drivers/dri/r200/r200_state.c | 2 ++ src/mesa/drivers/dri/r200/r200_texstate.c | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index 452d354..658ce63 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -1970,6 +1970,8 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state ) case GL_LIGHTING: r200UpdateSpecular(ctx); + /* for reflection map fixup - might set recheck_texgen for all units too */ + rmesa->NewGLState |= _NEW_TEXTURE; break; case GL_LINE_SMOOTH: diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index acc980c..9c8997a 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -1304,11 +1304,13 @@ static GLboolean r200_validate_texgen( GLcontext *ctx, GLuint unit ) case GL_REFLECTION_MAP_NV: rmesa->TexGenNeedNormals[unit] = GL_TRUE; tgi |= R200_TEXGEN_INPUT_EYE_REFLECT<TexGenEnabled & S_BIT) ? reflect : I, - (texUnit->TexGenEnabled & T_BIT) ? reflect + 4 : I + 4, - (texUnit->TexGenEnabled & R_BIT) ? reflect + 8 : I + 8, - I + 12); + /* pretty weird, must only negate when lighting is enabled? */ + if (ctx->Light.Enabled) + set_texgen_matrix( rmesa, unit, + (texUnit->TexGenEnabled & S_BIT) ? reflect : I, + (texUnit->TexGenEnabled & T_BIT) ? reflect + 4 : I + 4, + (texUnit->TexGenEnabled & R_BIT) ? reflect + 8 : I + 8, + I + 12); break; case GL_NORMAL_MAP_NV: -- 2.7.4