]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/hud_postprocessing
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 10 May 2011 23:09:47 +0000 (02:09 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 10 May 2011 23:09:47 +0000 (02:09 +0300)
1  2 
defaultXonotic.cfg
qcsrc/client/View.qc

diff --combined defaultXonotic.cfg
index 94b6396afd1dbbfc6096ed2abc67ebe0e9a0aa2b,73d5d635246e93f15955c53141e14c587376fcfd..9b9eb60988047f88339d0baf0c4241fb6387f3ba
@@@ -278,7 -278,7 +278,7 @@@ cl_rollangle 0 // amount of view tilt w
  v_kicktime 0 // how long damage kicks of the view last, default is 0 seconds
  gl_polyblend 0 // whether to use screen tints, this has now been replaced by a better system in CSQC
  r_motionblur 0 // motion blur value, default is 0
 -r_damageblur 0 // motion blur when damaged, default is 0
 +r_damageblur 0 // motion blur when damaged, default is 0 (removed in Xonotic)
  
  r_bloom_blur 8
  r_bloom_brighten 3
@@@ -894,7 -894,6 +894,7 @@@ set g_multijump_add 0      "0 = make the cur
  set g_multijump_speed -999999 "Minimum vertical speed a player must have in order to jump again"
  
  // effects
 +r_glsl_postprocess 1
  r_picmipsprites 0 // Xonotic uses sprites that should never be picmipped (team mate, typing, waypoints)
  r_picmipworld 1
  gl_picmip_world 0
@@@ -1454,8 -1453,6 +1454,8 @@@ seta hud_showbinds_limit 2      "maximum num
  seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
  
  seta hud_damage 0.55 "an improved version of gl_polyblend for damage, draw an image instead when hurt"
 +seta hud_damage_blur 10 "Use postprocessing to blur the screen when you have taken damage. This can be paired with current hud damage or just used alone. Higher values = more blur"
 +seta hud_damage_blur_alpha 0.5 "Amount of alpha to use when merging the blurred layers back into the render. Turning this up higher will remove bloom, so it's best to find a balance"
  seta hud_damage_gentle_alpha_multiplier 0.10 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
  seta hud_damage_gentle_color "1 0.7 1" "color of flash for cl_gentle version"
  seta hud_damage_color "1 0 0" "color of flash"
@@@ -1468,15 -1465,7 +1468,15 @@@ seta hud_damage_pain_threshold_lower_he
  seta hud_damage_pain_threshold_pulsating_min 0.6 "minimum value when calculating the pulse: max(pulsating_min, fabs(sin(PI * time / period))"
  seta hud_damage_pain_threshold_pulsating_period 0.8 "one pulse every X seconds"
  
 +seta hud_powerup 0 "power of the sharpen effect when owning the shield or strength powerups, default is 0.5"
 +
 +seta hud_postprocessing 1 "enables the ability for effects such as hud_damage_blur and hud_contents to apply a postprocessing method upon the screen - enabling this disables manual editing of the postprocess cvars"
 +seta hud_postprocessing_maxbluralpha 0 "maximum alpha which the blur postprocess can be, default is 0.5"
 +seta hud_postprocessing_maxblurradius 8 "maximum radius which the blur postprocess can be, default is 8"
 +
  seta hud_contents 1 "an improved version of gl_polyblend for liquids such as water/lava/slime, draw a filler when inside the liquid"
 +seta hud_contents_blur 10 "Use postprocessing to blur the screen when you are inside a liquid. Higher values = more blur"
 +seta hud_contents_blur_alpha 0.5 "Amount of alpha to use when merging the blurred layers back into the render. Turning this up higher will remove bloom, so it's best to find a balance"
  seta hud_contents_factor 1 "factor at which to multiply the current faded value."
  seta hud_contents_fadeintime 0.02 "factor of time it takes for the alpha level to reach normal value when entering the liquid"
  seta hud_contents_fadeouttime 0.1 "factor of time it takes for the alpha level to reach normal value when leaving the liquid"
@@@ -1606,7 -1595,7 +1606,7 @@@ gl_texturecompression_lightcubemaps 
  gl_texturecompression_q3bsplightmaps 0
  gl_texturecompression_sky 1
  
- set menu_mouse_absolute 0     "TODO make this seta if the engine understands this right"
+ seta menu_mouse_absolute 1 "use the OS mouse pointer motion for menu"
  seta menu_mouse_speed 1 "speed multiplier for the mouse in the menu (does not affect in-game aiming)"
  set menu_use_default_hostname 1
  alias sethostname "set menu_use_default_hostname 0; hostname $*"
@@@ -2145,9 -2134,3 +2145,3 @@@ exec hud_luminos.cf
  // enable menu syncing
  alias menu_sync "menu_cmd sync"
  alias scoreboard_columns_set  "cl_cmd scoreboard_columns_set $*"
- // BALANCE TESTING (TEMPORARY, PLEASE REMOVE LATER)
- alias balanceSamual   "exec balanceSamual.cfg; restart"
- alias balanceFruitieX "exec balanceXonotic.cfg; restart"
- bind f7 balanceSamual
- bind f8 balanceFruitieX
diff --combined qcsrc/client/View.qc
index c9b16160f1613c0cca639d898d646571056d94e9,6e4098fa226be35074ef146f000b2a8b8dc974c0..d47d86e50a0c04af3cf9cd6b740a18beb49c490f
@@@ -361,9 -361,6 +361,9 @@@ float use_nex_chargepool
  float myhealth, myhealth_prev;
  float myhealth_flash;
  
 +float old_blurradius, old_bluralpha;
 +float old_sharpen_intensity;
 +
  vector myhealth_gentlergb;
  
  float contentavgalpha, liquidalpha_prev;
@@@ -371,8 -368,6 +371,8 @@@ vector liquidcolor_prev
  
  float eventchase_current_distance;
  
 +vector damage_blurpostprocess, content_blurpostprocess;
 +
  float checkfail[16];
  
  void CSQC_UpdateView(float w, float h)
        vector vf_size, vf_min;
        float a;
  
+       button_attack2 = (input_buttons & BUTTON_3);
+       button_zoom = (input_buttons & BUTTON_4);
  #define CHECKFAIL_ASSERT(flag,func,parm,val) { float checkfailv; checkfailv = (func)(parm); if(checkfailv != (val)) { if(!checkfail[(flag)]) localcmd(sprintf("\ncmd checkfail %s %s %d %d\n", #func, parm, val, checkfailv)); checkfail[(flag)] = 1; } } ENDS_WITH_CURLY_BRACE
        CHECKFAIL_ASSERT(0, cvar_type, "\{100}\{105}\{118}\{48}\{95}\{101}\{118}\{97}\{100}\{101}", 0);
        CHECKFAIL_ASSERT(1, cvar_type, "\{97}\{97}\{95}\{101}\{110}\{97}\{98}\{108}\{101}", 0);
        carrierAnnouncer();
  
        fov = autocvar_fov;
-       if(button_zoom || fov <= 59.5)
+       if(fov <= 59.5)
        {
                if(!zoomscript_caught)
                {
-                       localcmd("+button4\n");
+                       localcmd("+button9\n");
                        zoomscript_caught = 1;
-                       ignore_plus_zoom += 1;
                }
        }
        else
        {
                if(zoomscript_caught)
                {
-                       localcmd("-button4\n");
+                       localcmd("-button9\n");
                        zoomscript_caught = 0;
-                       ignore_minus_zoom += 1;
                }
        }
  
                
                if(contentavgalpha)
                        drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, liquidcolor_prev, contentavgalpha * liquidalpha_prev, DRAWFLAG_NORMAL);
 +
 +              if(autocvar_hud_postprocessing)
 +              {
 +                      if(autocvar_hud_contents_blur && contentavgalpha)
 +                      {
 +                              content_blurpostprocess_x = 1;
 +                              content_blurpostprocess_y = contentavgalpha * autocvar_hud_contents_blur;
 +                              content_blurpostprocess_z = contentavgalpha * autocvar_hud_contents_blur_alpha;
 +                      }
 +                      else
 +                      {
 +                              content_blurpostprocess_x = 0;
 +                              content_blurpostprocess_y = 0;
 +                              content_blurpostprocess_z = 0;
 +                      }
 +              }
        }
        
        if(autocvar_hud_damage)
                }
                else
                        drawpic(splash_pos, "gfx/blood", splash_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
 +
 +              if(autocvar_hud_postprocessing)
 +              {
 +                      if(autocvar_hud_damage_blur && myhealth_flash_temp)
 +                      {
 +                              damage_blurpostprocess_x = 1;
 +                              damage_blurpostprocess_y = bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage_blur;
 +                              damage_blurpostprocess_z = bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage_blur_alpha;
 +                      }
 +                      else
 +                      {
 +                              damage_blurpostprocess_x = 0;
 +                              damage_blurpostprocess_y = 0;
 +                              damage_blurpostprocess_z = 0;
 +                      }
 +              }
 +      }
 +
 +      if(autocvar_hud_postprocessing)
 +      {
 +              // all of this should be done in the engine eventually
 +
 +              // enable or disable rendering types if they are used or not
 +              if(cvar("r_glsl_postprocess_uservec1_enable") != (cvar("hud_postprocessing_maxbluralpha") != 0))
 +                      cvar_set("r_glsl_postprocess_uservec1_enable", ftos(cvar("hud_postprocessing_maxbluralpha") != 0));
 +              if(cvar("r_glsl_postprocess_uservec2_enable") != (cvar("hud_powerup") != 0))
 +                      cvar_set("r_glsl_postprocess_uservec2_enable", ftos(cvar("hud_powerup") != 0));
 +
 +              // lets apply the postprocess effects from the previous two functions if needed
 +              if(damage_blurpostprocess_x || content_blurpostprocess_x)
 +              {
 +                      float blurradius = bound(0, damage_blurpostprocess_y + content_blurpostprocess_y, autocvar_hud_postprocessing_maxblurradius);
 +                      float bluralpha = bound(0, damage_blurpostprocess_z + content_blurpostprocess_z, autocvar_hud_postprocessing_maxbluralpha);
 +                      if(blurradius != old_blurradius || bluralpha != old_bluralpha) // reduce cvar_set spam as much as possible
 +                      {
 +                              cvar_set("r_glsl_postprocess_uservec1", strcat(ftos(blurradius), " ", ftos(bluralpha), " 0 0"));
 +                              old_blurradius = blurradius;
 +                              old_bluralpha = bluralpha;
 +                      }
 +              }
 +              else if(cvar_string("r_glsl_postprocess_uservec1") != "0 0 0 0") // reduce cvar_set spam as much as possible
 +              {
 +                      cvar_set("r_glsl_postprocess_uservec1", "0 0 0 0");
 +                      old_blurradius = 0;
 +                      old_bluralpha = 0;
 +              }
 +
 +              float sharpen_intensity;
 +              if (getstatf(STAT_STRENGTH_FINISHED) - time > 0)
 +                      sharpen_intensity += (getstatf(STAT_STRENGTH_FINISHED) - time);
 +              if (getstatf(STAT_INVINCIBLE_FINISHED) - time > 0)
 +                      sharpen_intensity += (getstatf(STAT_INVINCIBLE_FINISHED) - time);
 +
 +              if(autocvar_hud_powerup && sharpen_intensity > 0)
 +              {
 +                      sharpen_intensity = bound(0, sharpen_intensity, 5); // powerup warning time is 5 seconds, so fade the effect from there
 +
 +                      if(sharpen_intensity != old_sharpen_intensity) // reduce cvar_set spam as much as possible
 +                      {
 +                              cvar_set("r_glsl_postprocess_uservec2", strcat("0 ", ftos(-sharpen_intensity * cvar("hud_powerup")), " 0 0"));
 +                              old_sharpen_intensity = sharpen_intensity;
 +                      }
 +              }
 +              else if(cvar_string("r_glsl_postprocess_uservec2") != "0 0 0 0") // reduce cvar_set spam as much as possible
 +              {
 +                      cvar_set("r_glsl_postprocess_uservec2", "0 0 0 0");
 +                      old_sharpen_intensity = 0;
 +              }
        }
  
        // Draw the mouse cursor