]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_shadow.c
moved brushq3.submodel to brush, removed brushq3.data_thismodel (instead looking...
[xonotic/darkplaces.git] / r_shadow.c
index 258c3e33aa29754e0c5d6d3798861a30d1e6b896..31615386f50e285e95643e472a444380aa7c25aa 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"
@@ -3044,7 +3044,7 @@ void R_Shadow_UpdateWorldLight(dlight_t *light, vec3_t origin, vec3_t angles, ve
        light->corona = corona;
        if (!cubemapname)
                cubemapname = "";
-       strlcpy(light->cubemapname, cubemapname, strlen(light->cubemapname));
+       strlcpy(light->cubemapname, cubemapname, sizeof(light->cubemapname));
        light->coronasizescale = coronasizescale;
        light->ambientscale = ambientscale;
        light->diffusescale = diffusescale;