From: havoc Date: Sat, 17 Oct 2009 11:21:37 +0000 (+0000) Subject: limit shadowmap maxsize to a value based on gl_max_size X-Git-Tag: xonotic-v0.1.0preview~1291 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a48f52f2bec00ebd2f9fa79c671abeb42c72c189;p=xonotic%2Fdarkplaces.git limit shadowmap maxsize to a value based on gl_max_size git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9344 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_shadow.c b/r_shadow.c index ea6d596f..a167d360 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -367,10 +367,11 @@ cachepic_t *r_editlights_sprnoshadowlight; cachepic_t *r_editlights_sprcubemaplight; cachepic_t *r_editlights_sprcubemapnoshadowlight; cachepic_t *r_editlights_sprselection; +extern cvar_t gl_max_size; void R_Shadow_SetShadowMode(void) { - r_shadow_shadowmapmaxsize = bound(1, r_shadow_shadowmapping_maxsize.integer, 2048); + r_shadow_shadowmapmaxsize = bound(1, r_shadow_shadowmapping_maxsize.integer, gl_max_size.integer / 4); r_shadow_shadowmapvsdct = r_shadow_shadowmapping_vsdct.integer != 0; r_shadow_shadowmapfilterquality = r_shadow_shadowmapping_filterquality.integer; r_shadow_shadowmaptexturetype = r_shadow_shadowmapping_texturetype.integer; @@ -4188,7 +4189,7 @@ void R_DrawRTLight(rtlight_t *rtlight, qboolean visible) 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, 2048); + size = bound(1, size, r_shadow_shadowmapping_maxsize.integer); borderbias = r_shadow_shadowmapborder / (float)(size - r_shadow_shadowmapborder); if (numsurfaces) @@ -4334,7 +4335,7 @@ void R_ShadowVolumeLighting(qboolean visible) dlight_t *light; size_t range; - if (r_shadow_shadowmapmaxsize != bound(1, r_shadow_shadowmapping_maxsize.integer, 2048) || + if (r_shadow_shadowmapmaxsize != r_shadow_shadowmapping_maxsize.integer || (r_shadow_shadowmode != R_SHADOW_SHADOWMODE_STENCIL) != (r_shadow_shadowmapping.integer && r_glsl.integer && gl_support_fragment_shader && gl_support_ext_framebuffer_object) || r_shadow_shadowmapvsdct != (r_shadow_shadowmapping_vsdct.integer != 0) || r_shadow_shadowmaptexturetype != r_shadow_shadowmapping_texturetype.integer ||