From 17a441b49d9ef6438c39ecad64aa13a27c82e461 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 10 Dec 2008 15:21:33 +0000 Subject: [PATCH] bug fix, sorry, mikeeusa... but make dotproduct*scale actually behave the intended way. In existing shaders, replace dotProduct2scale ( x y z min max ) by dotProduct2scale ( x y z max 0 ) because that's what the old code actually caused git-svn-id: svn://svn.icculus.org/netradiant/trunk@139 61c419a2-8eb2-4b30-bcec-8cead039b335 --- tools/quake3/q3map2/shaders.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index 26d4b20d..72d23b00 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -100,7 +100,7 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ) case CM_COLOR_DOT_PRODUCT_SCALE: c = DotProduct( dv->normal, cm2->data ); - c = cm2->data[4] + c * (cm2->data[5] - cm2->data[4]); + c = (c - cm2->data[3]) / (cm2->data[4] - cm2->data[3]); VectorSet( mult, c, c, c ); break; @@ -110,7 +110,7 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ) case CM_ALPHA_DOT_PRODUCT_SCALE: c = DotProduct( dv->normal, cm2->data ); - c = cm2->data[4] + c * (cm2->data[5] - cm2->data[4]); + c = (c - cm2->data[3]) / (cm2->data[4] - cm2->data[3]); mult[ 3 ] = c; break; @@ -123,7 +123,7 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ) case CM_COLOR_DOT_PRODUCT_2_SCALE: c = DotProduct( dv->normal, cm2->data ); c *= c; - c = (c - cm2->data[4]) / (cm2->data[5] - cm2->data[4]); + c = (c - cm2->data[3]) / (cm2->data[4] - cm2->data[3]); VectorSet( mult, c, c, c ); break; @@ -135,7 +135,7 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ) case CM_ALPHA_DOT_PRODUCT_2_SCALE: c = DotProduct( dv->normal, cm2->data ); c *= c; - c = (c - cm2->data[4]) / (cm2->data[5] - cm2->data[4]); + c = (c - cm2->data[3]) / (cm2->data[4] - cm2->data[3]); mult[ 3 ] = c; break; @@ -1776,7 +1776,7 @@ static void ParseShaderFile( const char *filename ) else if( !Q_stricmp( token, "dotProductScale" ) ) { cm->type = CM_COLOR_DOT_PRODUCT_SCALE + alpha; - Parse1DMatrixAppend( shaderText, 3, cm->data ); + Parse1DMatrixAppend( shaderText, 5, cm->data ); } /* dotProduct2 ( X Y Z ) */ -- 2.39.2