]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
make r_hdr behave like r_bloom when r_viewfbo is on
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 1 Apr 2011 08:42:00 +0000 (08:42 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Sun, 3 Apr 2011 20:48:43 +0000 (22:48 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11000 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=030a101c7bfaa41d53c608757817dadbb10205a3

gl_rmain.c

index 1032741d17648ebdfed4dca272893a62dbd54404..4be0e918f9cf17e38e70b3a1b69e5c214666a675 100644 (file)
@@ -5881,10 +5881,10 @@ void R_Bloom_StartFrame(void)
                break;
        }
 
-       if (r_hdr.integer || r_bloom.integer)
+       if ((r_hdr.integer || r_bloom.integer) && r_bloomstate.bloomwidth)
        {
                r_bloomstate.enabled = true;
-               r_bloomstate.hdr = r_hdr.integer != 0;
+               r_bloomstate.hdr = r_hdr.integer != 0 && !r_bloomstate.fbo_framebuffer;
        }
 
        R_Viewport_InitOrtho(&r_bloomstate.viewport, &identitymatrix, r_refdef.view.x, vid.height - r_bloomstate.bloomheight - r_refdef.view.y, r_bloomstate.bloomwidth, r_bloomstate.bloomheight, 0, 0, 1, 1, -10, 100, NULL);
@@ -5967,7 +5967,7 @@ void R_Bloom_MakeTexture(void)
 
        range = r_bloom_blur.integer * r_bloomstate.bloomwidth / 320;
        brighten = r_bloom_brighten.value;
-       if (r_hdr.integer)
+       if (r_bloomstate.hdr)
                brighten *= r_hdr_range.value;
        brighten = sqrt(brighten);
        if(range >= 1)
@@ -6573,7 +6573,7 @@ void R_RenderView(void)
        r_refdef.view.clear = true;
 
        // this produces a bloom texture to be used in R_BlendView() later
-       if (r_hdr.integer && r_bloomstate.bloomwidth)
+       if (r_bloomstate.hdr)
        {
                R_HDR_RenderBloomTexture();
                // we have to bump the texture frame again because r_refdef.view.colorscale is cached in the textures