]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
r_shadows_shadowmapscale cvar which as a multiple to r_shadow_shadowmapping_precision...
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 14 Feb 2010 23:10:49 +0000 (23:10 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 14 Feb 2010 23:10:49 +0000 (23:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9956 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
r_shadow.c

index 86ff11eacaea70b7338667751c4a417bcdb344d9..c2f1a1cf07dfd179fc0e2af1e3a5f1186da87f7b 100644 (file)
@@ -92,6 +92,7 @@ cvar_t r_shadows_throwdirection = {CVAR_SAVE, "r_shadows_throwdirection", "0 0 -
 cvar_t r_shadows_drawafterrtlighting = {CVAR_SAVE, "r_shadows_drawafterrtlighting", "0", "draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating fast sunlight on large outdoor maps with only one noshadow rtlight. The price is less realistic appearance of dynamic light shadows."};
 cvar_t r_shadows_castfrombmodels = {CVAR_SAVE, "r_shadows_castfrombmodels", "0", "do cast shadows from bmodels"};
 cvar_t r_shadows_focus = {CVAR_SAVE, "r_shadows_focus", "0 0 0", "offset the shadowed area focus"};
+cvar_t r_shadows_shadowmapscale = {CVAR_SAVE, "r_shadows_shadowmapscale", "1", "increases shadowmap quality (multiply global shadowmap precision) for fake shadows. Needs shadowmapping ON."};
 cvar_t r_q1bsp_skymasking = {0, "r_q1bsp_skymasking", "1", "allows sky polygons in quake1 maps to obscure other geometry"};
 cvar_t r_polygonoffset_submodel_factor = {0, "r_polygonoffset_submodel_factor", "0", "biases depth values of world submodels such as doors, to prevent z-fighting artifacts in Quake maps"};
 cvar_t r_polygonoffset_submodel_offset = {0, "r_polygonoffset_submodel_offset", "14", "biases depth values of world submodels such as doors, to prevent z-fighting artifacts in Quake maps"};
@@ -6253,6 +6254,7 @@ void GL_Main_Init(void)
        Cvar_RegisterVariable(&r_shadows_throwdistance);
        Cvar_RegisterVariable(&r_shadows_throwdirection);
        Cvar_RegisterVariable(&r_shadows_focus);
+       Cvar_RegisterVariable(&r_shadows_shadowmapscale);
        Cvar_RegisterVariable(&r_q1bsp_skymasking);
        Cvar_RegisterVariable(&r_polygonoffset_submodel_factor);
        Cvar_RegisterVariable(&r_polygonoffset_submodel_offset);
index 6410fec5666ad29640eec452300d4053b88927d3..bcc699cd111ac0134bdc6dc3c8835adb1ac3fac3 100644 (file)
@@ -4203,6 +4203,7 @@ extern cvar_t r_shadows_castfrombmodels;
 extern cvar_t r_shadows_throwdistance;
 extern cvar_t r_shadows_throwdirection;
 extern cvar_t r_shadows_focus;
+extern cvar_t r_shadows_shadowmapscale;
 
 void R_Shadow_PrepareModelShadows(void)
 {
@@ -4232,7 +4233,7 @@ void R_Shadow_PrepareModelShadows(void)
        }
 
        size = 2*r_shadow_shadowmapmaxsize;
-       scale = r_shadow_shadowmapping_precision.value;
+       scale = r_shadow_shadowmapping_precision.value * r_shadows_shadowmapscale.value;
        radius = 0.5f * size / scale;
 
        Math_atov(r_shadows_throwdirection.string, shadowdir);
@@ -4326,7 +4327,7 @@ void R_DrawModelShadowMaps(void)
        }
 
        size = 2*r_shadow_shadowmapmaxsize;
-       scale = r_shadow_shadowmapping_precision.value / size;
+       scale = (r_shadow_shadowmapping_precision.value * r_shadows_shadowmapscale.value) / size;
        radius = 0.5f / scale;
        nearclip = -r_shadows_throwdistance.value;
        farclip = r_shadows_throwdistance.value;