From: havoc Date: Mon, 28 Sep 2009 22:09:19 +0000 (+0000) Subject: fix allocation of 2D shadowmap textures when the first light LOD is X-Git-Tag: xonotic-v0.1.0preview~1381 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e4dccc50b97f35d74c858a544d38f1e6036e30f7;p=xonotic%2Fdarkplaces.git fix allocation of 2D shadowmap textures when the first light LOD is below maxsize git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9252 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_shadow.c b/r_shadow.c index c14fbc85..cb551ceb 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -1489,7 +1489,7 @@ void R_Shadow_RenderMode_ShadowMap(int side, qboolean clear, int size) if (!r_shadow_shadowmap2dtexture) { #if 1 - r_shadow_shadowmap2dtexture = R_LoadTextureShadowMap2D(r_shadow_texturepool, "shadowmap", size*2, size*4); + r_shadow_shadowmap2dtexture = R_LoadTextureShadowMap2D(r_shadow_texturepool, "shadowmap", maxsize*2, maxsize*4); qglGenFramebuffersEXT(1, &r_shadow_fbo2d);CHECKGLERROR qglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, r_shadow_fbo2d);CHECKGLERROR qglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, R_GetTexture(r_shadow_shadowmap2dtexture), 0);CHECKGLERROR @@ -1529,7 +1529,7 @@ void R_Shadow_RenderMode_ShadowMap(int side, qboolean clear, int size) if (!r_shadow_shadowmaprectangletexture) { #if 1 - r_shadow_shadowmaprectangletexture = R_LoadTextureShadowMapRectangle(r_shadow_texturepool, "shadowmap", size*2, size*4); + r_shadow_shadowmaprectangletexture = R_LoadTextureShadowMapRectangle(r_shadow_texturepool, "shadowmap", maxsize*2, maxsize*4); qglGenFramebuffersEXT(1, &r_shadow_fborectangle);CHECKGLERROR qglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, r_shadow_fborectangle);CHECKGLERROR qglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_RECTANGLE_ARB, R_GetTexture(r_shadow_shadowmaprectangletexture), 0);CHECKGLERROR @@ -1567,7 +1567,7 @@ void R_Shadow_RenderMode_ShadowMap(int side, qboolean clear, int size) if (!r_shadow_shadowmapcubetexture[r_shadow_shadowmaplod]) { #if 1 - r_shadow_shadowmapcubetexture[r_shadow_shadowmaplod] = R_LoadTextureShadowMapCube(r_shadow_texturepool, "shadowmapcube", size); + r_shadow_shadowmapcubetexture[r_shadow_shadowmaplod] = R_LoadTextureShadowMapCube(r_shadow_texturepool, "shadowmapcube", bound(1, maxsize >> r_shadow_shadowmaplod, 2048)); qglGenFramebuffersEXT(6, r_shadow_fbocubeside[r_shadow_shadowmaplod]);CHECKGLERROR for (i = 0;i < 6;i++) {