]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
sorry... dp_refract parameters should work THAT way round
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Oct 2007 09:30:52 +0000 (09:30 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Oct 2007 09:30:52 +0000 (09:30 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7607 d7cf8633-e32d-0410-b094-e92efae38249

darkplaces.txt
gl_rmain.c
model_brush.c
model_shared.c
model_shared.h

index 666475e40ab706312781877201f03a53dc9bd43a..9fc31c048852fd186af1e212cb8d527cd40170c2 100644 (file)
@@ -1317,11 +1317,11 @@ Shader parameters for DP's own features:
   additive. When the color isn't specified, it defaults to white (full\r
   reflection). If only one color component is specified, it counts as a grey\r
   value.\r
-- dp_refract <reflectmin> <reflectmax> <distort> <r> <g> <b>\r
+- dp_refract <refractmin> <refractmax> <distort> <r> <g> <b>\r
   Marks a surface as "water" for r_glsl_water, that is, add a refraction\r
-  component too. The reflection amount (see dp_reflect) is at least reflectmin\r
-  (when looking straight into it) and at most reflectmax (when looking parallel\r
-  to thhe surface). The default distort is multiplied by distort. The color\r
-  modulates the refraction component. reflectmin defaults to 0 when unspecified,\r
+  component too. The refraction amount (see dp_reflect) is at most refractmax\r
+  (when looking straight into it) and at least refractmin (when looking parallel\r
+  to the surface). The default distort is multiplied by distort. The color\r
+  modulates the refraction component. refractmin defaults to 0 when unspecified,\r
   all others default to 1. If only one color component is specified, it counts\r
   as a grey value.\r
index 50b1d41cc42e3949fbd421002a2edc5c08bef1ff..c294a028fac205d3adb2ba1dbd6ec713b6bedcfa 100644 (file)
@@ -1275,8 +1275,8 @@ int R_SetupSurfaceShader(const vec3_t lightcolorbase, qboolean modellighting, fl
        if (r_glsl_permutation->loc_ScreenCenterRefractReflect >= 0) qglUniform4fARB(r_glsl_permutation->loc_ScreenCenterRefractReflect, r_waterstate.screencenter[0], r_waterstate.screencenter[1], r_waterstate.screencenter[0], r_waterstate.screencenter[1]);
        if (r_glsl_permutation->loc_RefractColor >= 0) qglUniform3fvARB(r_glsl_permutation->loc_RefractColor, 1, rsurface.texture->refractcolor);
        if (r_glsl_permutation->loc_ReflectColor >= 0) qglUniform3fvARB(r_glsl_permutation->loc_ReflectColor, 1, rsurface.texture->reflectcolor);
-       if (r_glsl_permutation->loc_ReflectFactor >= 0) qglUniform1fARB(r_glsl_permutation->loc_ReflectFactor, rsurface.texture->reflectmax - rsurface.texture->reflectmin);
-       if (r_glsl_permutation->loc_ReflectOffset >= 0) qglUniform1fARB(r_glsl_permutation->loc_ReflectOffset, rsurface.texture->reflectmin);
+       if (r_glsl_permutation->loc_ReflectFactor >= 0) qglUniform1fARB(r_glsl_permutation->loc_ReflectFactor, rsurface.texture->refractmax - rsurface.texture->refractmin);
+       if (r_glsl_permutation->loc_ReflectOffset >= 0) qglUniform1fARB(r_glsl_permutation->loc_ReflectOffset, 1 - rsurface.texture->refractmax);
        CHECKGLERROR
        return permutation;
 }
index 3fe4577751edec9c78cf43e30047b491bc5bcb07..b8063634495742459278e4f4d44b72a1059a6d19 100644 (file)
@@ -1541,8 +1541,8 @@ static void Mod_Q1BSP_LoadTextures(lump_t *l)
                                        tx->basematerialflags |= MATERIALFLAG_WATERALPHA | MATERIALFLAG_NOSHADOW | MATERIALFLAG_WATERSHADER;
                                        VectorSet(tx->reflectcolor, 1, 1, 1);
                                        VectorSet(tx->refractcolor, 1, 1, 1);
-                                       tx->reflectmin = 0;
-                                       tx->reflectmax = 1;
+                                       tx->refractmin = 0;
+                                       tx->refractmax = 1;
                                        tx->refractfactor = 1;
                                }
                                tx->basematerialflags |= MATERIALFLAG_WATER | MATERIALFLAG_LIGHTBOTHSIDES | MATERIALFLAG_NOSHADOW;
index 40673a65461321a6b0ca340a555e3f46c9dfcaf4..5c097458d842d7875c5b613ac58b112ecc52c641 100644 (file)
@@ -1137,8 +1137,8 @@ void Mod_LoadQ3Shaders(void)
                        memset(shader, 0, sizeof(*shader));
                        VectorSet(shader->reflectcolor, 1, 1, 1);
                        VectorSet(shader->refractcolor, 1, 1, 1);
-                       shader->reflectmin = 0;
-                       shader->reflectmax = 1;
+                       shader->refractmin = 0;
+                       shader->refractmax = 1;
                        shader->refractfactor = 1;
 
                        strlcpy(shader->name, com_token, sizeof(shader->name));
@@ -1509,9 +1509,9 @@ void Mod_LoadQ3Shaders(void)
                                {
                                        shader->textureflags |= Q3TEXTUREFLAG_WATERSHADER;
                                        if(numparameters >= 2)
-                                               shader->reflectmin = atof(parameter[1]);
+                                               shader->refractmin = atof(parameter[1]);
                                        if(numparameters >= 3)
-                                               shader->reflectmax = atof(parameter[2]);
+                                               shader->refractmax = atof(parameter[2]);
                                        if(numparameters >= 4)
                                                shader->refractfactor = atof(parameter[3]);
                                        if(numparameters >= 5)
@@ -1722,8 +1722,8 @@ nothing                GL_ZERO GL_ONE
                        }
                }
                memcpy(texture->deforms, shader->deforms, sizeof(texture->deforms));
-               texture->reflectmin = shader->reflectmin;
-               texture->reflectmax = shader->reflectmax;
+               texture->refractmin = shader->refractmin;
+               texture->refractmax = shader->refractmax;
                texture->refractfactor = shader->refractfactor;
                VectorCopy(shader->reflectcolor, texture->reflectcolor);
                VectorCopy(shader->refractcolor, texture->refractcolor);
index 9c22db62acecfa8754483b930c991e29ed663ad6..7a28df25913a6aaf345142491f96347954d05b88 100644 (file)
@@ -366,8 +366,8 @@ typedef struct q3shaderinfo_s
        q3shaderinfo_deform_t deforms[Q3MAXDEFORMS];
 
        vec3_t reflectcolor, refractcolor;
-       float reflectmin; // when refraction is used, minimum amount of reflection (when looking straight down)
-       float reflectmax; // when refraction is used, maximum amount of reflection (when looking parallel to water)
+       float refractmin; // when refraction is used, minimum amount of reflection (when looking straight down)
+       float refractmax; // when refraction is used, maximum amount of reflection (when looking parallel to water)
        float refractfactor; // amount of refraction distort (1.0 = like the cvar specifies; note that reflection distort is not configurable because that's what the bumpmap should do)
 }
 q3shaderinfo_t;
@@ -484,8 +484,8 @@ typedef struct texture_s
 
        // reflection
        vec3_t reflectcolor, refractcolor;
-       float reflectmin; // when refraction is used, minimum amount of reflection (when looking straight down)
-       float reflectmax; // when refraction is used, maximum amount of reflection (when looking parallel to water)
+       float refractmin; // when refraction is used, minimum amount of reflection (when looking straight down)
+       float refractmax; // when refraction is used, maximum amount of reflection (when looking parallel to water)
        float refractfactor; // amount of refraction distort (1.0 = like the cvar specifies; note that reflection distort is not configurable because that's what the bumpmap should do)
 }
 texture_t;