From e65f4a9952616a0bb9b6f86a6a4ac0c53b408c59 Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 5 Oct 2009 08:01:43 +0000 Subject: [PATCH] while I am at it, also dp_specularscalemod git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9306 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 1 + model_shared.c | 7 +++++++ model_shared.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/gl_rmain.c b/gl_rmain.c index 0af9edb5..251572af 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -5508,6 +5508,7 @@ texture_t *R_GetCurrentTexture(texture_t *t) t->specularpower = r_shadow_gloss2exponent.value; } } + t->specularscale *= t->specularscalemod; t->specularpower *= t->specularpowermod; // lightmaps mode looks bad with dlights using actual texturing, so turn diff --git a/model_shared.c b/model_shared.c index 2a0895a7..ea729592 100644 --- a/model_shared.c +++ b/model_shared.c @@ -1416,6 +1416,7 @@ void Mod_LoadQ3Shaders(void) shader.reflectfactor = 1; Vector4Set(shader.reflectcolor4f, 1, 1, 1, 1); shader.r_water_wateralpha = 1; + shader.specularscalemod = 1; shader.specularpowermod = 1; strlcpy(shader.name, com_token, sizeof(shader.name)); @@ -1815,6 +1816,10 @@ void Mod_LoadQ3Shaders(void) Vector4Set(shader.reflectcolor4f, atof(parameter[8]), atof(parameter[9]), atof(parameter[10]), 1); shader.r_water_wateralpha = atof(parameter[11]); } + else if (!strcasecmp(parameter[0], "dp_specularscalemod") && numparameters >= 2) + { + shader.specularscalemod = atof(parameter[1]); + } else if (!strcasecmp(parameter[0], "dp_specularpowermod") && numparameters >= 2) { shader.specularpowermod = atof(parameter[1]); @@ -1927,6 +1932,7 @@ qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qbool texflagsmask &= ~TEXF_PICMIP; if(!(defaulttexflags & TEXF_COMPRESS)) texflagsmask &= ~TEXF_COMPRESS; + texture->specularscalemod = 1; // unless later loaded from the shader texture->specularpowermod = 1; // unless later loaded from the shader if (shader) @@ -2062,6 +2068,7 @@ nothing GL_ZERO GL_ONE texture->reflectfactor = shader->reflectfactor; Vector4Copy(shader->reflectcolor4f, texture->reflectcolor4f); texture->r_water_wateralpha = shader->r_water_wateralpha; + texture->specularscalemod = shader->specularscalemod; texture->specularpowermod = shader->specularpowermod; } else if (!strcmp(texture->name, "noshader") || !texture->name[0]) diff --git a/model_shared.h b/model_shared.h index c5489910..5808872b 100644 --- a/model_shared.h +++ b/model_shared.h @@ -386,6 +386,7 @@ typedef struct q3shaderinfo_s float r_water_wateralpha; // additional wateralpha to apply when r_water is active // gloss + float specularscalemod; float specularpowermod; #define Q3SHADERINFO_COMPARE_END specularpowermod } @@ -519,6 +520,7 @@ typedef struct texture_s float r_water_wateralpha; // additional wateralpha to apply when r_water is active // gloss + float specularscalemod; float specularpowermod; } texture_t; -- 2.39.2