]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
changed 3 clamp calls in the GLSL fragment shader to max calls instead, for a small...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 4 Feb 2005 09:23:01 +0000 (09:23 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 4 Feb 2005 09:23:01 +0000 (09:23 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4996 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index 258c3e33aa29754e0c5d6d3798861a30d1e6b896..fba2ad3964cb4863205d466506a4363af24b2695 100644 (file)
@@ -346,7 +346,7 @@ const char *builtinshader_light_frag =
 "      //\n"
 "      // pow(1-(x*x+y*y+z*z), 4) is far more realistic but needs large lights to\n"
 "      // provide significant illumination, large = slow = pain.\n"
-"      float colorscale = clamp(1.0 - dot(CubeVector, CubeVector), 0.0, 1.0);\n"
+"      float colorscale = max(1.0 - dot(CubeVector, CubeVector), 0.0);\n"
 "\n"
 "#ifdef USEFOG\n"
 "      // apply fog\n"
@@ -371,9 +371,9 @@ const char *builtinshader_light_frag =
 "\n"
 "      // calculate shading\n"
 "      vec3 diffusenormal = normalize(LightVector);\n"
-"      vec3 color = colortexel * (AmbientScale + DiffuseScale * clamp(dot(surfacenormal, diffusenormal), 0.0, 1.0));\n"
+"      vec3 color = colortexel * (AmbientScale + DiffuseScale * max(dot(surfacenormal, diffusenormal), 0.0));\n"
 "#ifdef USESPECULAR\n"
-"      color += glosstexel * (SpecularScale * pow(clamp(dot(surfacenormal, normalize(diffusenormal + normalize(EyeVector))), 0.0, 1.0), SpecularPower));\n"
+"      color += glosstexel * (SpecularScale * pow(max(dot(surfacenormal, normalize(diffusenormal + normalize(EyeVector))), 0.0), SpecularPower));\n"
 "#endif\n"
 "\n"
 "#ifdef USECUBEFILTER\n"