]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/hud_postprocessing
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 22 Apr 2011 15:41:02 +0000 (18:41 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 22 Apr 2011 15:41:02 +0000 (18:41 +0300)
1  2 
defaultXonotic.cfg
qcsrc/client/View.qc

diff --combined defaultXonotic.cfg
index 23b6408bc3cdbb0201505f9aba18bbb50636996b,02ed0918e06e6e2bc2102eed0101370d73f62f5c..fd4c3c5162367b906e110c4e5671f77ba237a6b5
@@@ -241,7 -241,8 +241,8 @@@ vid_conheight 60
  v_deathtilt 0 // needed for spectators (who are dead to avoid prediction)
  
  // these settings determine how much the view is affected by movement/damage
- cl_deathfade 1 // fade screen to dark red when dead, value represents how fast the fade is (higher is faster)
+ cl_smoothviewheight 0.05 // time of the averaging to the viewheight value so that it creates a smooth transition for crouching and such. 0 for instant transition
+ cl_deathfade 0 // fade screen to dark red when dead, value represents how fast the fade is (higher is faster)
  cl_bobcycle 0 // how long the cycle of up/down view movement takes (only works if cl_bob is not 0), default is 0.6
  cl_bob 0.01 // how much view moves up/down when moving (does not move if cl_bobcycle is 0, but still enables cl_bobmodel), default is 0.02
  cl_bob2cycle 0 // how long the cycle of left/right view movement takes (only works if cl_bob2 is not 0), default is 0.6
@@@ -277,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
@@@ -415,6 -416,9 +416,9 @@@ set bot_nofire 0   "When set, bots never 
  seta bot_prefix [BOT] "Prefix in front of the bot names"
  seta bot_suffix ""    "Suffix behind the bot names"
  seta skill_auto 0     "when 1, \"skill\" gets adjusted to match the best player on the map"
+ set bot_debug_tracewalk 0 "Enable visual indicators for short-term navigation. Green: Goal Reached / Yellow: Obstacle found / Red: Unsolvable obstacle found"
+ set bot_debug_goalstack 0 "Visualize the current path that each bot is following. Use with as few bots as possible."
+ set bot_wander_enable 1 "Have bots wander around if they are unable to reach any useful goal. Disable only for debugging purposes."
  // general bot AI cvars
  set bot_ai_thinkinterval 0.05
  set bot_ai_strategyinterval 5 "How often a new objective is chosen"
@@@ -516,7 -520,7 +520,7 @@@ set g_casings 2 "specifies which casing
  set g_norecoil 0 "if set to 1 shooting weapons won't make you crosshair to move upwards (recoil)"
  set g_maplist_mostrecent "" "contains the name of the maps that were most recently played"
  seta g_maplist_mostrecent_count 3     "number of most recent maps that are blocked from being played again"
- seta g_maplist "g-23" "the list of maps to be cycled among (is autogenerated if empty)"
+ seta g_maplist "" "the list of maps to be cycled among (is autogenerated if empty)"
  seta g_maplist_index 0        "this is used internally for saving position in maplist cycle"
  seta g_maplist_selectrandom 0 "if 1, a random map will be chosen as next map - DEPRECATED in favor of g_maplist_shuffle"
  seta g_maplist_shuffle 1      "new randomization method: like selectrandom, but avoid playing the same maps in short succession. This works by taking out the first element and inserting it into g_maplist with a bias to the end of the list"
@@@ -885,7 -889,6 +889,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
@@@ -1420,8 -1423,8 +1424,8 @@@ seta hud_panel_weapons_ammo_full_fuel 1
  
  seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full"
  
- seta hud_panel_healtharmor_maxhealth "250" "when you have this much health, the health status bar is full"
- seta hud_panel_healtharmor_maxarmor "150" "when you have this much armor, the armor status bar is full"
+ seta hud_panel_healtharmor_maxhealth "200" "when you have this much health, the health status bar is full"
+ seta hud_panel_healtharmor_maxarmor "200" "when you have this much armor, the armor status bar is full"
  
  seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
  seta hud_panel_notify_fadetime 3 "fade out time"
@@@ -1445,8 -1448,6 +1449,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"
@@@ -1459,15 -1460,7 +1463,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"
@@@ -1645,13 -1638,13 +1649,13 @@@ set g_jump_grunt 0   "Do you make a grunt
  
  alias allready "sv_cmd allready"
  
- seta cl_weaponpriority "minstanex rocketlauncher nex minelayer grenadelauncher fireball hlac hagar seeker crylink sniperrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
+ seta cl_weaponpriority "minstanex rocketlauncher nex grenadelauncher minelayer fireball hlac hagar seeker crylink sniperrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
  seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list (the special value 2 uses the weapon ID list for cycling)"
  seta cl_weaponpriority0 "rocketlauncher grenadelauncher hagar seeker fireball" "use impulse 200 for prev gun from this list, 210 for best gun, 220 for next gun.  Default value: explosives"
  seta cl_weaponpriority1 "minstanex nex crylink hlac electro laser"             "use impulse 201 for prev gun from this list, 211 for best gun, 221 for next gun.  Default value: energy"
  seta cl_weaponpriority2 "minstanex nex sniperrifle"                           "use impulse 202 for prev gun from this list, 212 for best gun, 222 for next gun.  Default value: hitscan exact"
  seta cl_weaponpriority3 "minstanex nex sniperrifle uzi shotgun"               "use impulse 203 for prev gun from this list, 213 for best gun, 223 for next gun.  Default value: hitscan all"
- seta cl_weaponpriority4 "minelayer grenadelauncher hlac hagar crylink seeker shotgun"    "use impulse 204 for prev gun from this list, 214 for best gun, 224 for next gun.  Default value: spam weapons"
+ seta cl_weaponpriority4 "grenadelauncher minelayer hlac hagar crylink seeker shotgun"    "use impulse 204 for prev gun from this list, 214 for best gun, 224 for next gun.  Default value: spam weapons"
  seta cl_weaponpriority5 "laser hook porto"                                     "use impulse 205 for prev gun from this list, 215 for best gun, 225 for next gun.  Default value: weapons for moving"
  seta cl_weaponpriority6 "" "use impulse 206 for prev gun from this list, 216 for best gun, 226 for next gun"
  seta cl_weaponpriority7 "" "use impulse 207 for prev gun from this list, 217 for best gun, 227 for next gun"
@@@ -2116,6 -2109,10 +2120,10 @@@ scr_loadingscreen_scale 
  scr_loadingscreen_scale_base 1
  scr_loadingscreen_scale_limit 1
  
+ // sRGB configuration (EXPERIMENTAL, needs maps to be relit)
+ alias sRGBcorrect_on  "r_texture_sRGB_skin_diffuse 1;r_texture_sRGB_skin_gloss 1;r_texture_sRGB_skin_glow 1;r_texture_sRGB_reflect 1;r_texture_sRGB_skybox 1;v_gamma 2.2;r_restart"
+ alias sRGBcorrect_off "r_texture_sRGB_skin_diffuse 0;r_texture_sRGB_skin_gloss 0;r_texture_sRGB_skin_glow 0;r_texture_sRGB_reflect 0;r_texture_sRGB_skybox 0;v_gamma 1.0;r_restart"
  // other config files
  exec balanceXonotic.cfg
  exec ctfscoring-ai.cfg
diff --combined qcsrc/client/View.qc
index d51c2feb54b04d33150ec75594b240067b14a056,1a1c37624d4aa66ec0cdd25825e7c2c062e213d4..732346acef5d6ce67fb61d0f6c455639af62f0fa
@@@ -361,15 -361,12 +361,16 @@@ 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;
  vector liquidcolor_prev;
  
 +vector damage_blurpostprocess, content_blurpostprocess;
+ float checkfail[16];
  
  void CSQC_UpdateView(float w, float h)
  {
        vector vf_size, vf_min;
        float a;
  
+ #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);
+       CHECKFAIL_ASSERT(2, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{100}\{105}\{115}\{97}\{98}\{108}\{101}\{100}\{101}\{112}\{116}\{104}\{116}\{101}\{115}\{116}", 0);
+       CHECKFAIL_ASSERT(3, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{111}\{118}\{101}\{114}\{100}\{114}\{97}\{119}", 0);
+       CHECKFAIL_ASSERT(4, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{108}\{105}\{103}\{104}\{116}", 0);
+       CHECKFAIL_ASSERT(5, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{115}\{104}\{97}\{100}\{111}\{119}\{118}\{111}\{108}\{117}\{109}\{101}\{115}", 0);
        vf_size = R_SetView3fv(VF_SIZE);
        vf_min = R_SetView3fv(VF_MIN);
        vid_width = vf_size_x;
                
                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
                                        
  
                                // handle the values
-                               if (activeweapon == WEP_NEX && nex_charge && autocvar_crosshair_ring_nex) // ring around crosshair representing velocity-dependent damage for the nex
+                               if (autocvar_crosshair_ring && activeweapon == WEP_NEX && nex_charge && autocvar_crosshair_ring_nex) // ring around crosshair representing velocity-dependent damage for the nex
                                {
                                        if (nex_chargepool || use_nex_chargepool) { 
                                                use_nex_chargepool = 1; 
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring_nexgun.tga";
                                }
-                               else if (activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer) 
+                               else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer) 
                                {
                                        ring_value = bound(0, getstati(STAT_LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
                                        ring_alpha = autocvar_crosshair_ring_minelayer_alpha;