]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
reduced offsetmapping from 4 sample to 3 sample to make it work within Radeon 9500...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 29 Jan 2005 02:21:52 +0000 (02:21 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 29 Jan 2005 02:21:52 +0000 (02:21 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4982 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index 8a1693a6a729526c71f9bed5b5d9bfd27952beef..d12b3c9c034c44e7bf5b77acc7a20ec934720087 100644 (file)
@@ -354,11 +354,11 @@ const char *builtinshader_light_frag =
 "#endif\n"
 "\n"
 "#ifdef USEOFFSETMAPPING\n"
-"      vec2 OffsetVector = normalize(EyeVector).xy * vec2(-1, 1);\n"
+"      // this is 3 sample because of ATI Radeon 9500-9800/X300 limits\n"
+"      vec2 OffsetVector = normalize(EyeVector).xy * vec2(-0.333, 0.333);\n"
 "      vec2 TexCoordOffset = TexCoord + OffsetVector * (OffsetMapping_Bias + OffsetMapping_Scale * texture2D(Texture_Normal, TexCoord).w);\n"
 "      TexCoordOffset += OffsetVector * (OffsetMapping_Bias + OffsetMapping_Scale * texture2D(Texture_Normal, TexCoordOffset).w);\n"
 "      TexCoordOffset += OffsetVector * (OffsetMapping_Bias + OffsetMapping_Scale * texture2D(Texture_Normal, TexCoordOffset).w);\n"
-"      TexCoordOffset += OffsetVector * (OffsetMapping_Bias + OffsetMapping_Scale * texture2D(Texture_Normal, TexCoordOffset).w);\n"
 "#define TexCoord TexCoordOffset\n"
 "#endif\n"
 "\n"
@@ -1661,9 +1661,8 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                }
                if (perm & SHADERPERMUTATION_OFFSETMAPPING)
                {
-                       // these are * 0.25 because the offsetmapping shader does the process 4 times
-                       qglUniform1fARB(qglGetUniformLocationARB(prog, "OffsetMapping_Scale"), r_shadow_glsl_offsetmapping_scale.value * 0.25);CHECKGLERROR
-                       qglUniform1fARB(qglGetUniformLocationARB(prog, "OffsetMapping_Bias"), r_shadow_glsl_offsetmapping_bias.value * 0.25);CHECKGLERROR
+                       qglUniform1fARB(qglGetUniformLocationARB(prog, "OffsetMapping_Scale"), r_shadow_glsl_offsetmapping_scale.value);CHECKGLERROR
+                       qglUniform1fARB(qglGetUniformLocationARB(prog, "OffsetMapping_Bias"), r_shadow_glsl_offsetmapping_bias.value);CHECKGLERROR
                }
                CHECKGLERROR
                GL_LockArrays(0, numverts);