]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/hud_postprocessing
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 21 May 2011 12:15:34 +0000 (15:15 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 21 May 2011 12:15:34 +0000 (15:15 +0300)
1  2 
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh

diff --combined defaultXonotic.cfg
index 2a2bca6b748613d2673dee27eb355d87c32b48f4,b1c99c2409867bc4082db8528f38ef97b23b3788..a13252209fcb94126cd10350eddea72e93fb2029
@@@ -281,7 -281,7 +281,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
@@@ -899,7 -899,6 +899,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
@@@ -1473,8 -1472,6 +1473,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"
@@@ -1487,15 -1484,7 +1487,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"
@@@ -1507,11 -1496,11 +1507,11 @@@ seta hud_contents_water_alpha 0.5 "alph
  seta hud_contents_water_color "0.4 0.3 0.3"
  
  seta hud_shownames 1 "draw names and health/armor of nearby players"
- seta hud_shownames_enemies 2 "1 = draw names of enemies you point at, 2 = draw names of all enemies in view"
- seta hud_shownames_status 2 "1 = draw health/armor status of teammates, 2 = same as 1, but draw health/armor icons with a question mark on enemies in teamgames"
- seta hud_shownames_height 15 "height of icons"
+ seta hud_shownames_enemies 2 "1 = draw names of enemies you point at (TODO), 2 = draw names of all enemies in view"
+ seta hud_shownames_status 1 "1 = draw health/armor status of teammates"
+ seta hud_shownames_statusbar_height 4 "height of status bar"
  seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name"
- seta hud_shownames_fontsize 13 "font size"
+ seta hud_shownames_fontsize 12 "font size"
  seta hud_shownames_decolorize 1 "1 = decolorize name in team games, 2 = decolorize always"
  seta hud_shownames_alpha 0.7 "alpha"
  seta hud_shownames_resize 1 "enable resizing of the names, then the size cvars will correspond to the maximum size"
@@@ -1519,6 -1508,7 +1519,7 @@@ seta hud_shownames_mindistance 1000 "st
  seta hud_shownames_maxdistance 2500 "alpha/size is 0 at this distance"
  seta hud_shownames_antioverlap 1 "if two tags get too close to each other, fade out the one further away from you"
  seta hud_shownames_antioverlap_distance 125 "2d distance to other tag after which to fade out"
+ seta hud_shownames_offset 52 "offset (along z-axis) tag from player origin by this many units"
  
  // scoreboard
  seta scoreboard_columns default
@@@ -1551,7 -1541,7 +1552,7 @@@ seta accuracy_color2 "0 1 0
  // for menu server list (eventually make them have engine support?)
  seta menu_slist_showfull 1 "show servers even if they are full and have no slots to join"
  seta menu_slist_showempty 1 "show servers even if they are no empty and have no opponents to play against"
- set menu_slist_modfilter "=" // set to either: !modname or modname. modname of = means "same as we are running now".
+ seta menu_slist_modfilter "" // set to either: !modname or modname. modname of = means "same as we are running now".
  
  // for menu weapon arena
  set menu_weaponarena_with_laser 0 "also enable the Laser in this weapon arena"
@@@ -2147,7 -2137,7 +2148,7 @@@ alias sRGBcorrect_off "r_texture_sRGB_s
  exec balanceXonotic.cfg
  exec ctfscoring-ai.cfg
  exec effects-normal.cfg
- exec physicsX0.cfg
+ exec physicsX.cfg
  exec turrets.cfg
  
  // hud cvar descriptions
diff --combined qcsrc/client/View.qc
index 173abcb9d3b95e274b7e880df4fbe7065e07e250,029b9460f6f7f7209727efc0019b039fbd9ff77d..ae42a7b18c41dbce9a4a96d4c42faec6fa96f715
@@@ -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)
                
                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) && autocvar_chase_active >= 0) // not while the event chase camera is active
 +              {
 +                      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 && autocvar_chase_active >= 0) // not while the event chase camera is active
 +              {
 +                      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
                if(self.draw2d)
                        self.draw2d();
        self = e;
+       Draw_ShowNames_All();
  
        scoreboard_active = HUD_WouldDrawScoreboard();
  
                                CSQC_common_hud();
  
                // crosshair goes VERY LAST
-               if(!scoreboard_active && !camera_active && intermission != 2) {
+               if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1) {
                        string wcross_style;
                        float wcross_alpha, wcross_resolution;
                        wcross_style = autocvar_crosshair;
index 1b09366845a9b5c37cfc5898bfea7a74d4fa52f2,b2a1602686530db5db228200b390fb5fc1379fff..596e3a3c5e0ebb476a5d7e485670277cff76cc99
@@@ -147,8 -147,6 +147,8 @@@ float autocvar_hud_configure_grid_xsize
  float autocvar_hud_configure_grid_ysize;
  float autocvar_hud_configure_teamcolorforced;
  float autocvar_hud_contents;
 +float autocvar_hud_contents_blur;
 +float autocvar_hud_contents_blur_alpha;
  float autocvar_hud_contents_factor;
  float autocvar_hud_contents_fadeintime;
  float autocvar_hud_contents_fadeouttime;
@@@ -159,8 -157,6 +159,8 @@@ string autocvar_hud_contents_slime_colo
  float autocvar_hud_contents_water_alpha;
  string autocvar_hud_contents_water_color;
  float autocvar_hud_damage;
 +float autocvar_hud_damage_blur;
 +float autocvar_hud_damage_blur_alpha;
  string autocvar_hud_damage_color;
  float autocvar_hud_damage_factor;
  float autocvar_hud_damage_fade_rate;
@@@ -172,10 -168,6 +172,10 @@@ float autocvar_hud_damage_pain_threshol
  float autocvar_hud_damage_pain_threshold_lower_health;
  float autocvar_hud_damage_pain_threshold_pulsating_min;
  float autocvar_hud_damage_pain_threshold_pulsating_period;
 +float autocvar_hud_powerup;
 +float autocvar_hud_postprocessing;
 +float autocvar_hud_postprocessing_maxbluralpha;
 +float autocvar_hud_postprocessing_maxblurradius;
  string autocvar_hud_dock;
  float autocvar_hud_dock_alpha;
  string autocvar_hud_dock_color;
@@@ -289,7 -281,7 +289,7 @@@ float autocvar_hud_showbinds_limit
  float autocvar_hud_shownames;
  float autocvar_hud_shownames_enemies;
  float autocvar_hud_shownames_status;
- float autocvar_hud_shownames_height;
+ float autocvar_hud_shownames_statusbar_height;
  float autocvar_hud_shownames_aspect;
  float autocvar_hud_shownames_fontsize;
  float autocvar_hud_shownames_decolorize;
@@@ -299,6 -291,7 +299,7 @@@ float autocvar_hud_shownames_mindistanc
  float autocvar_hud_shownames_maxdistance;
  float autocvar_hud_shownames_antioverlap;
  float autocvar_hud_shownames_antioverlap_distance;
+ float autocvar_hud_shownames_offset;
  string autocvar_hud_skin;
  float autocvar_loddebug;
  float autocvar_menu_mouse_speed;