]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
use r_shadow_shadowmapmaxsize instead of directly accessing cvar r_shadow_shadowmappi...
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 17 Oct 2009 15:43:40 +0000 (15:43 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 17 Oct 2009 15:43:40 +0000 (15:43 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9346 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index 653caced48935d4567f636de25f311e2c47135a5..137e21cf28d81cba6bc19c26f83b253e36aaed62 100644 (file)
@@ -4171,7 +4171,7 @@ void R_DrawRTLight(rtlight_t *rtlight, qboolean visible)
 
        lodlinear = (rtlight->radius * r_shadow_shadowmapping_precision.value) / sqrt(max(1.0f, distance/rtlight->radius));
        //lodlinear = (int)(r_shadow_shadowmapping_lod_bias.value + r_shadow_shadowmapping_lod_scale.value * rtlight->radius / max(1.0f, distance));
-       lodlinear = bound(r_shadow_shadowmapping_minsize.integer, lodlinear, r_shadow_shadowmapping_maxsize.integer);
+       lodlinear = bound(r_shadow_shadowmapping_minsize.integer, lodlinear, r_shadow_shadowmapmaxsize);
 
        if (castshadows && (r_shadow_shadowmode == R_SHADOW_SHADOWMODE_SHADOWMAP2D || r_shadow_shadowmode == R_SHADOW_SHADOWMODE_SHADOWMAPRECTANGLE || r_shadow_shadowmode == R_SHADOW_SHADOWMODE_SHADOWMAPCUBESIDE))
        {
@@ -4185,11 +4185,11 @@ void R_DrawRTLight(rtlight_t *rtlight, qboolean visible)
 
                r_shadow_shadowmaplod = 0;
                for (i = 1;i < R_SHADOW_SHADOWMAP_NUMCUBEMAPS;i++)
-                       if ((r_shadow_shadowmapping_maxsize.integer >> i) > lodlinear)
+                       if ((r_shadow_shadowmapmaxsize >> i) > lodlinear)
                                r_shadow_shadowmaplod = i;
 
-               size = r_shadow_shadowmode == R_SHADOW_SHADOWMODE_SHADOWMAPCUBESIDE ? r_shadow_shadowmapping_maxsize.integer >> r_shadow_shadowmaplod : lodlinear;
-               size = bound(1, size, r_shadow_shadowmapping_maxsize.integer);
+               size = r_shadow_shadowmode == R_SHADOW_SHADOWMODE_SHADOWMAPCUBESIDE ? r_shadow_shadowmapmaxsize >> r_shadow_shadowmaplod : lodlinear;
+               size = bound(1, size, r_shadow_shadowmapmaxsize);
                borderbias = r_shadow_shadowmapborder / (float)(size - r_shadow_shadowmapborder);
 
                if (numsurfaces)