Merge in xonotic/xonotic-data.pk3dir.git: mirceakitsune/hud_postprocessing
git-manager created issue #430 (closed) on 2011-04-27T22:40:13Z:
Purpose of the branch:
Re-submitting for merge request after completing the requirements divVerent provided. I asked several developers on IRC if they are ok with this damage blur replacing the current damage blur from the menu. Everyone said they are fine with it, at least as long as the feature can be turned off and is not defaulted. People I asked include FruitieX, tZork, Morphed, and theShadow (please correct me if I made any mistake).
Repository: xonotic/xonotic-data.pk3dir.git Commit: 9fb9a73b Branch: mirceakitsune/hud_postprocessing
Merge commands:
cd data/xonotic-data.pk3dir
git checkout master
git reset --hard origin/master
git pull && git diff '9fb9a73bac995a188ab19e061b7ad6885760b6b8'..'origin/mirceakitsune/hud_postprocessing'
# please check that the diff you just saw did not contain anything complex that
# needs a new merge request, and review these changes
git merge --no-ff 'origin/mirceakitsune/hud_postprocessing'
# please make sure this merge worked, and if not, fix merge conflicts and git
# commit BEFORE the next command
#
# also, THIS is the point to do final pre-merge testing
#
# use git reset --hard origin/master to bail out
git push && git push --delete origin 'mirceakitsune/hud_postprocessing'
Diffstat:
defaultXonotic.cfg | 13 ++++-
effects-high.cfg | 3 +-
effects-low.cfg | 3 +-
effects-med.cfg | 3 +-
effects-normal.cfg | 3 +-
effects-omg.cfg | 3 +-
effects-ultimate.cfg | 3 +-
effects-ultra.cfg | 3 +-
qcsrc/client/View.qc | 88 ++++++++++++++++++++++++++
qcsrc/client/autocvars.qh | 8 +++
qcsrc/menu/xonotic/dialog_settings_effects.c | 7 +--
11 files changed, 124 insertions(+), 13 deletions(-)
Revision log:
commit 9fb9a73bac995a188ab19e061b7ad6885760b6b8
Merge: 324d1af 9523cb3
Author: Mircea Kitsune
Commit: Mircea Kitsune
Merge branch 'master' into mirceakitsune/hud_postprocessing
commit 324d1afe64b738ee2e6960f6da5174ce11d87753
Merge: 12a8e2b 8e55f49
Author: Mircea Kitsune
Commit: Mircea Kitsune
Merge branch 'master' into mirceakitsune/hud_postprocessing
commit 12a8e2b2fc09cbb1f43aa2185cd367c6415db240
Merge: 71b2295 57c2420
Author: Mircea Kitsune
Commit: Mircea Kitsune
Merge branch 'master' into mirceakitsune/hud_postprocessing
commit 71b2295b8ed7e2d9a5785467e8d9f65b69494b89
Merge: 708a57a 05b7ffd
Author: Mircea Kitsune
Commit: Mircea Kitsune
Merge branch 'master' into mirceakitsune/hud_postprocessing
commit 708a57a09495f9bed1031d58643bbd25bbaa5445
Author: Mircea Kitsune
Commit: Mircea Kitsune
Document defaults
commit 8d398b94664637c49eaba936784e14d88199e05e
Author: Mircea Kitsune
Commit: Mircea Kitsune
Disable the blur and sharpen effects by default. They qualify as fancier rendering effects IMO, and as long as they're in the menu, they're best off I think.
commit ad043055d2df73b7df694a2bee4341bd1a8f7b32
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix uservec*_enable cvars getting set dynamically, causing hiccups. They will now be turned on or off if the features that use them are on or off. This addresses the merge request on the previous commit (when I had not noticed the issue yet).
commit 6d51fec51731c925f1820762b58103b0331e83b4
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix effects not coming back on if toggling them off and back on while they should be active.
commit ed127b2fd4c85a6d2602f45ac83d2865808c0921
Author: Mircea Kitsune
Commit: Mircea Kitsune
Code a check in a more optimal way, reducing some code.
commit 5e8e26f843975d509f2cd7f3e878775dd7c2a4f8
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix something about the menu settings
commit 1418d148372d2e1af64a118838a70a493a6f2cac
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix a last check, and remove the conflict between damage splashes and damage blur, making them independent of one another.
commit 61a9e0a49ab22fb4970810580a5651688cd570a0
Author: Mircea Kitsune
Commit: Mircea Kitsune
Correct menu settings
commit 6be79aad61c8e48a1c92a5fe129448caf12fcbcf
Author: Mircea Kitsune
Commit: Mircea Kitsune
Radius 8 by default
commit f6fe0c940fe4440e1a1a18eeeb865bece34877e9
Author: Mircea Kitsune
Commit: Mircea Kitsune
A spacing that makes sense in the cfg.
commit 04ab05635ef8b410837416eb6262ded5dc38b111
Author: Mircea Kitsune
Commit: Mircea Kitsune
Better name for the menu entry
commit c97489c083cd5e0cfdccb1b74ea3d60d7a1ca351
Author: Mircea Kitsune
Commit: Mircea Kitsune
Simplify code
commit 276035a8d9fce32a28d43e38bf21642224065d02
Author: Mircea Kitsune
Commit: Mircea Kitsune
Limit cvar spam for sharpening effect too
commit 708b23af5be915c35675093c53f210687c4b8537
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix possibility of blur getting stuck on when it's not the case to apply it (eg: your screen remained damage blurred, you restarted Xonotic, and when you connected again you'd be stuck with the last blur state)
commit 90d5074194a4d6cebc1cd1f0e453b74f84c9140f
Author: Mircea Kitsune
Commit: Mircea Kitsune
Reduce the spam on cvar_set for the blur
commit 1029fda234ae552663be5f58c11c19db6a251466
Merge: 0643dff dfa574e
Author: Mircea Kitsune
Commit: Mircea Kitsune
Merge branch 'master' into mirceakitsune/hud_postprocessing
commit 0643dffcff835893e5a9ca1f4e5c7fecf4d99849
Author: Mircea Kitsune
Commit: Mircea Kitsune
Remove * (code forgotten from where I ported this :P)
commit fc852c2cd38ea4c62c4cdb91fde84e2887ddee08
Author: Mircea Kitsune
Commit: Mircea Kitsune
Also update the menu.
commit e480d6b8a6fbf7916e08b0f291cb983b19d9e0f8
Author: Mircea Kitsune
Commit: Mircea Kitsune
Comment old r_damageblur cvar as removed (but leave it in defaultXonotic.cfg, so it's sure it sets it to 0).
commit 95dc6db997b09775c7fac0a22a164916ad65bd74
Author: Mircea Kitsune
Commit: Mircea Kitsune
Update config presets
commit 1803d5365e5877ca538d82cfd9598678227cf0a2
Author: Mircea Kitsune
Commit: Mircea Kitsune
Add the water blur code too
commit 8d2f77bf1b3d01f22625a24a29bb91d572e9c593
Author: Mircea Kitsune
Commit: Mircea Kitsune
Re-merge Samual's HUD post processing effects. Including a new one, using the sharpen / cartoonify effect when having the strength / shield powerups.
User agreed to the GPLv2*.
Diff:
<pre>diff —git a/defaultXonotic.cfg b/defaultXonotic.cfg
index 14c52f9..8ebb388 100644
— a/defaultXonotic.cfg
**+ b/defaultXonotic.cfg
@ -278,7 +278,7
@ cl\_rollangle 0 // amount of view tilt when strafing, default is 2.0
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
@ -889,6 +889,7
@ set g_multijump_add 0 “0 = make the current z velocity equal to jumpvelocity, 1
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
r_picmipworld 1
gl_picmip_world 0
@ -1448,6 +1449,8
@ seta hud_showbinds_limit 2 “maximum number of bound keys to show for a command.
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”
@ -1460,7 +1463,15
@ seta hud_damage_pain_threshold_lower_health 50 “at which health we start lowerin
seta hud_damage_pain_threshold_pulsating_min 0.6”minimum value when calculating the pulse: max)"
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”
diff —git a/effects-high.cfg b/effects-high.cfg
index e4d9632..664fca7 100644
— a/effects-high.cfg
**+ b/effects-high.cfg
@ -8,7 +8,8
@ mod_q3bsp_nolightmaps 0
r_bloom 1
r_coronas 1
r_coronas_occlusionquery 1
-r_damageblur 0.4
*hud_postprocessing_maxbluralpha 0.5
*hud_powerup 0
r_depthfirst 2
r_drawdecals_drawdistance 500
r_drawparticles_drawdistance 2000
diff —git a/effects-low.cfg b/effects-low.cfg
index 0c3fef9..769ca51 100644
— a/effects-low.cfg
**+ b/effects-low.cfg
@ -8,7 +8,8
@ mod_q3bsp_nolightmaps 1
r_bloom 0
r_coronas 1
r_coronas_occlusionquery 0
-r_damageblur 0
*hud_postprocessing_maxbluralpha 0
*hud_powerup 0
r_depthfirst 0
r_drawdecals_drawdistance 200
r_drawparticles_drawdistance 500
diff —git a/effects-med.cfg b/effects-med.cfg
index 5b9ea85..a6e5e7d 100644
— a/effects-med.cfg
**+ b/effects-med.cfg
@ -8,7 +8,8
@ mod_q3bsp_nolightmaps 0
r_bloom 0
r_coronas 1
r_coronas_occlusionquery 0
-r_damageblur 0
*hud_postprocessing_maxbluralpha 0
*hud_powerup 0
r_depthfirst 0
r_drawdecals_drawdistance 300
r_drawparticles_drawdistance 1000
diff —git a/effects-normal.cfg b/effects-normal.cfg
index 1ee62d0..dbad238 100644
— a/effects-normal.cfg
**+ b/effects-normal.cfg
@ -8,7 +8,8
@ mod_q3bsp_nolightmaps 0
r_bloom 0
r_coronas 1
r_coronas_occlusionquery 0
-r_damageblur 0
*hud_postprocessing_maxbluralpha 0
*hud_powerup 0
r_depthfirst 1
r_drawdecals_drawdistance 300
r_drawparticles_drawdistance 1000
diff —git a/effects-omg.cfg b/effects-omg.cfg
index ffd5af7..6e6a1dc 100644
— a/effects-omg.cfg
**+ b/effects-omg.cfg
@ -8,7 +8,8
@ mod_q3bsp_nolightmaps 1
r_bloom 0
r_coronas 1
r_coronas_occlusionquery 0
-r_damageblur 0
*hud_postprocessing_maxbluralpha 0.5
*hud_powerup 0.5
r_depthfirst 0
r_drawdecals_drawdistance 100
r_drawparticles_drawdistance 250
diff —git a/effects-ultimate.cfg b/effects-ultimate.cfg
index e7a2efb..d6e5018 100644
— a/effects-ultimate.cfg
**+ b/effects-ultimate.cfg
@ -8,7 +8,8
@ mod_q3bsp_nolightmaps 0
r_bloom 1
r_coronas 1
r_coronas_occlusionquery 1
-r_damageblur 0.4
*hud_postprocessing_maxbluralpha 0.5
*hud_powerup 0.5
r_depthfirst 2
r_drawdecals_drawdistance 500
r_drawparticles_drawdistance 2000
diff —git a/effects-ultra.cfg b/effects-ultra.cfg
index 2185654..47949e5 100644
— a/effects-ultra.cfg
**+ b/effects-ultra.cfg
@ -8,7 +8,8
@ mod_q3bsp_nolightmaps 0
r_bloom 1
r_coronas 1
r_coronas_occlusionquery 1
-r_damageblur 0.4
*hud_postprocessing_maxbluralpha 0.5
*hud_powerup 0.5
r_depthfirst 2
r_drawdecals_drawdistance 500
r_drawparticles_drawdistance 2000
diff —git a/qcsrc/client/View.qc b/qcsrc/client/View.qc
index 1a1c376..732346a 100644
— a/qcsrc/client/View.qc
**+ b/qcsrc/client/View.qc
@ -361,11 +361,15
@ 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
@ -736,6 +740,22
@ void CSQC_UpdateView
if
drawfill;
*
- 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)
@ -802,6 +822,74
@ void CSQC_UpdateView(float w, float h)
}
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 *= - time);
- if (getstatf(STAT_INVINCIBLE_FINISHED) - time > 0)
- sharpen_intensity *= - 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
diff —git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh
index e11266c..4d404dd 100644
— a/qcsrc/client/autocvars.qh
**+ b/qcsrc/client/autocvars.qh
@ -157,6 +157,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;@ -167,6 +169,8
@ string autocvar_hud_contents_slime_color; 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;@ -178,6 +182,10
@ float autocvar_hud_damage_pain_threshold_lower; 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; diff —git a/qcsrc/menu/xonotic/dialog_settings_effects.c b/qcsrc/menu/xonotic/dialog_settings_effects.c index 53903aa..9e46d16 100644 — a/qcsrc/menu/xonotic/dialog_settings_effects.c **+ b/qcsrc/menu/xonotic/dialog_settings_effects.c@ -184,11 +184,8
@ void XonoticEffectsSettingsTab_fill e.savedValue = 0.5; // default me.TD (me, 1, 2, s); me.TR (me);
- s = makeXonoticSlider;
- me.TD (me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Damage blur:")));
- if
- e.savedValue = 0.4; // default
- me.TD (me, 1, 2, s);
- me.TD (me, 1, 2, e = makeXonoticCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", "Screen blur"));
- me.TD (me, 1, 1, e = makeXonoticCheckBoxEx(0.5, 0, "hud_powerup", "Sharpening")); me.gotoRC(me, me.rows - 1, 0); me.TD (me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), ‘0 0 0’,”vid_restart", COMMANDBUTTON_APPLY));