]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix some weird incidental finding in the bloom code
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Feb 2012 20:17:59 +0000 (20:17 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 16 Feb 2012 20:43:56 +0000 (21:43 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11686 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=45808e8faa21d21e4349e9e45d0f545da0c1efbb

gl_rmain.c

index 5a3b32932f4458541e0449c7f52d2485c29c0820..961bb7021b11bd4efd94bb7c19ba177b40bf73b3 100644 (file)
@@ -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