From 7f4ee9715c9dedfd391d797797ec08dc46a96d7c Mon Sep 17 00:00:00 2001 From: eihrul Date: Sun, 12 Feb 2012 20:17:59 +0000 Subject: [PATCH] fix some weird incidental finding in the bloom code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11686 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=45808e8faa21d21e4349e9e45d0f545da0c1efbb --- gl_rmain.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 5a3b3293..961bb702 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -6045,7 +6045,7 @@ static void R_Bloom_StartFrame(void) // set bloomwidth and bloomheight to the bloom resolution that will be // used (often less than the screen resolution for faster rendering) - r_fb.bloomwidth = bound(1, r_bloom_resolution.integer, vid.height); + r_fb.bloomwidth = bound(1, r_bloom_resolution.integer, vid.width); r_fb.bloomheight = r_fb.bloomwidth * vid.height / vid.width; r_fb.bloomheight = bound(1, r_fb.bloomheight, vid.height); r_fb.bloomwidth = bound(1, r_fb.bloomwidth, (int)vid.maxtexturesize_2d); @@ -6151,7 +6151,7 @@ static void R_Bloom_StartFrame(void) } // bloom texture is a different resolution - r_fb.bloomwidth = bound(1, r_bloom_resolution.integer, r_refdef.view.height); + r_fb.bloomwidth = bound(1, r_bloom_resolution.integer, r_refdef.view.width); r_fb.bloomheight = r_fb.bloomwidth * r_refdef.view.height / r_refdef.view.width; r_fb.bloomheight = bound(1, r_fb.bloomheight, r_refdef.view.height); r_fb.bloomwidth = bound(1, r_fb.bloomwidth, r_fb.bloomtexturewidth); @@ -6218,12 +6218,15 @@ static void R_Bloom_MakeTexture(void) float colorscale = r_bloom_colorscale.value; r_refdef.stats.bloom++; - + +#if 0 + // this copy is unnecessary since it happens in R_BlendView already if (!r_fb.fbo) { R_Mesh_CopyToTexture(r_fb.colortexture, 0, 0, r_refdef.view.viewport.x, r_refdef.view.viewport.y, r_refdef.view.viewport.width, r_refdef.view.viewport.height); r_refdef.stats.bloom_copypixels += r_refdef.view.viewport.width * r_refdef.view.viewport.height; } +#endif // scale down screen texture to the bloom texture size CHECKGLERROR -- 2.39.2