]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
while I am at it, also dp_specularscalemod
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 5 Oct 2009 08:01:43 +0000 (08:01 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 5 Oct 2009 08:01:43 +0000 (08:01 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9306 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
model_shared.c
model_shared.h

index 0af9edb5517abd32d5fbe4dc20dd4a5630170c51..251572afe4a2884e270a84bb13a7d16b1cac6e8a 100644 (file)
@@ -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
index 2a0895a73875526bbc4d18291372615e31dc5963..ea729592e311b50b1b3941fe5cccab65b782ce6f 100644 (file)
@@ -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])
index c5489910a91b2680b0595ab40a15fd13e9bd2e83..5808872b1efeb05367153edcc6d137e074fe8036 100644 (file)
@@ -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;