]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
powerup sharpen/blur: do not always set r_glsl_postprocess 1, only enable it if needed
authorRudolf Polzer <divverent@xonotic.org>
Thu, 16 Feb 2012 16:53:00 +0000 (17:53 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 16 Feb 2012 16:53:00 +0000 (17:53 +0100)
defaultXonotic.cfg
qcsrc/client/View.qc

index 734f9c8bbd100ac367a9acd4caa1c30f8fe3aaa6..30c70dd0b111e6fa9ac99c54fa0f1a32eb8eb6d2 100644 (file)
@@ -785,7 +785,7 @@ set g_multijump_speed -999999       "Minimum vertical speed a player must have in orde
 
 // effects
 r_glsl_vertextextureblend_usebothalphas 1 // allows to abuse texture blending as detail texture
-r_glsl_postprocess 1
+r_glsl_postprocess 0 // but note, hud_postprocessing enables this
 r_picmipsprites 0 // Xonotic uses sprites that should never be picmipped (team mate, typing, waypoints)
 r_picmipworld 1
 gl_picmip_world 0
index f1112b33aa47fbb574dea670058a1ef191dca75c..f0810e5e29c3efbe230837c51997feea08c8bbb8 100644 (file)
@@ -917,12 +917,14 @@ void CSQC_UpdateView(float w, float h)
                }
        }
 
-       if(autocvar_hud_postprocessing) // TODO: Remove this code and re-do the postprocess handling in the engine, where it properly belongs.
+       float e1 = (autocvar_hud_postprocessing_maxbluralpha != 0);
+       float e2 = (autocvar_hud_powerup != 0);
+       if(autocvar_hud_postprocessing && (e1 || e2)) // TODO: Remove this code and re-do the postprocess handling in the engine, where it properly belongs.
        {
                // enable or disable rendering types if they are used or not
-               if(cvar("r_glsl_postprocess_uservec1_enable") != (autocvar_hud_postprocessing_maxbluralpha != 0)) { cvar_set("r_glsl_postprocess_uservec1_enable", ftos(autocvar_hud_postprocessing_maxbluralpha != 0)); }
-               if(cvar("r_glsl_postprocess_uservec2_enable") != (autocvar_hud_powerup != 0)) { cvar_set("r_glsl_postprocess_uservec2_enable", ftos(autocvar_hud_powerup != 0)); }
-               
+               if(cvar("r_glsl_postprocess_uservec1_enable") != e1) { cvar_set("r_glsl_postprocess_uservec1_enable", ftos(e1)); }
+               if(cvar("r_glsl_postprocess_uservec2_enable") != e2) { cvar_set("r_glsl_postprocess_uservec2_enable", ftos(e2)); }
+
                // blur postprocess handling done first (used by hud_damage and hud_contents)
                if((damage_blurpostprocess_x || content_blurpostprocess_x) && autocvar_chase_active >= 0) // not while the event chase camera is active
                {
@@ -962,7 +964,12 @@ void CSQC_UpdateView(float w, float h)
                        cvar_set("r_glsl_postprocess_uservec2", "0 0 0 0");
                        old_sharpen_intensity = 0;
                }
+
+               if(cvar("r_glsl_postprocess") == 0)
+                       cvar_set("r_glsl_postprocess", "2");
        }
+       else if(cvar("r_glsl_postprocess") == 2)
+               cvar_set("r_glsl_postprocess", "0");
 
        if(menu_visible)
                menu_show();