From: MirceaKitsune Date: Thu, 17 Nov 2011 12:33:20 +0000 (+0200) Subject: Add a permanent post-processing cartoon effect (previously visible when you had the... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1d79bcda67d6ccf0749a269cb4a46343f5d0059b;p=voretournament%2Fvoretournament.git Add a permanent post-processing cartoon effect (previously visible when you had the Strength or Invincible powerups). Instead, draw white lines rather than black ones when a powerup is present, but always show the effect. --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 07285a28..b4eb373a 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -1152,7 +1152,8 @@ 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(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_cartoon 0 "cartoon effect, reverses when you own a powerup" +seta hud_cartoon_tolerance 0.1 "where to apply the cartoon effect between bright and dark areas" seta hud_saturation 0 "saturation changes based on the amount of armor you have" diff --git a/data/effects-high.cfg b/data/effects-high.cfg index c99d62ca..ddf45dcc 100644 --- a/data/effects-high.cfg +++ b/data/effects-high.cfg @@ -11,7 +11,7 @@ mod_q3bsp_nolightmaps 0 r_bloom 1 r_coronas 1 hud_postprocessing_maxbluralpha 0.5 -hud_powerup 0.25 +hud_cartoon 1 hud_saturation 0 r_depthfirst 2 r_drawdecals_drawdistance 500 diff --git a/data/effects-low.cfg b/data/effects-low.cfg index 112f6c19..a627d960 100644 --- a/data/effects-low.cfg +++ b/data/effects-low.cfg @@ -11,7 +11,7 @@ mod_q3bsp_nolightmaps 1 r_bloom 0 r_coronas 1 hud_postprocessing_maxbluralpha 0 -hud_powerup 0 +hud_cartoon 0 hud_saturation 0 r_depthfirst 0 r_drawdecals_drawdistance 200 diff --git a/data/effects-med.cfg b/data/effects-med.cfg index 9de94c74..dc779547 100644 --- a/data/effects-med.cfg +++ b/data/effects-med.cfg @@ -11,7 +11,7 @@ mod_q3bsp_nolightmaps 0 r_bloom 0 r_coronas 1 hud_postprocessing_maxbluralpha 0 -hud_powerup 0 +hud_cartoon 0 hud_saturation 0 r_depthfirst 0 r_drawdecals_drawdistance 300 diff --git a/data/effects-normal.cfg b/data/effects-normal.cfg index f244dbfa..b49270d2 100644 --- a/data/effects-normal.cfg +++ b/data/effects-normal.cfg @@ -11,7 +11,7 @@ mod_q3bsp_nolightmaps 0 r_bloom 0 r_coronas 1 hud_postprocessing_maxbluralpha 0 -hud_powerup 0 +hud_cartoon 0 hud_saturation 0 r_depthfirst 1 r_drawdecals_drawdistance 300 diff --git a/data/effects-omg.cfg b/data/effects-omg.cfg index 8b2b231b..0d59ff7a 100644 --- a/data/effects-omg.cfg +++ b/data/effects-omg.cfg @@ -11,7 +11,7 @@ mod_q3bsp_nolightmaps 1 r_bloom 0 r_coronas 1 hud_postprocessing_maxbluralpha 0 -hud_powerup 0 +hud_cartoon 0 hud_saturation 0 r_depthfirst 0 r_drawdecals_drawdistance 100 diff --git a/data/effects-ultimate.cfg b/data/effects-ultimate.cfg index 9f9020a7..8f467f76 100644 --- a/data/effects-ultimate.cfg +++ b/data/effects-ultimate.cfg @@ -11,7 +11,7 @@ mod_q3bsp_nolightmaps 0 r_bloom 1 r_coronas 1 hud_postprocessing_maxbluralpha 0.5 -hud_powerup 0.25 +hud_cartoon 1 hud_saturation 1 r_depthfirst 2 r_drawdecals_drawdistance 500 diff --git a/data/effects-ultra.cfg b/data/effects-ultra.cfg index 7b2ba69b..0c7aafed 100644 --- a/data/effects-ultra.cfg +++ b/data/effects-ultra.cfg @@ -11,7 +11,7 @@ mod_q3bsp_nolightmaps 0 r_bloom 1 r_coronas 1 hud_postprocessing_maxbluralpha 0.5 -hud_powerup 0.25 +hud_cartoon 1 hud_saturation 1 r_depthfirst 2 r_drawdecals_drawdistance 500 diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index e5104c4e..113d8c54 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -253,7 +253,7 @@ float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time, vore_flas float spawnfov_current; float myhealth, myhealth_prev, myhealth_flash; float contentavgalpha, liquidalpha_prev; -float old_blurradius, old_bluralpha, old_sharpen_intensity; +float old_blurradius, old_bluralpha, old_cartoon_intensity; float stomachsplash_alpha; float volume_modify_1, volume_modify_2, volume_modify_default_1, volume_modify_default_2; float volume_modify_changed_1, volume_modify_changed_2; @@ -882,8 +882,8 @@ void CSQC_UpdateView(float w, float h) // 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)); + if(cvar("r_glsl_postprocess_uservec2_enable") != (cvar("hud_cartoon") != 0)) + cvar_set("r_glsl_postprocess_uservec2_enable", ftos(cvar("hud_cartoon") != 0)); // lets apply the postprocess effects from the previous two functions if needed if((damage_blurpostprocess_x || content_blurpostprocess_x) && cvar("chase_active") >= 0) // not while the event chase camera is active @@ -904,26 +904,27 @@ void CSQC_UpdateView(float w, float h) 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(cvar("hud_powerup") && sharpen_intensity > 0 && cvar("chase_active") >= 0) // not while the event chase camera is active + if(cvar("hud_cartoon")) { - 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 + // When having the strength or invincible powerups, cartoon lines will be white instead of black. + // As powerup time goes under 5 seconds (warning time), lines will fade from white to nothing then from nothing back to black. + float cartoon_intensity, cartoon_powerup; + cartoon_intensity = -cvar("hud_cartoon"); + cartoon_powerup = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 5) + bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 5); + cartoon_powerup = bound(0, cartoon_powerup, 5); + if (cartoon_powerup && cvar("chase_active") >= 0) // not while the event chase camera is active + cartoon_intensity *= 1 - cartoon_powerup / 2.5; // cycle between -1 and 1 + + if(cartoon_intensity != old_cartoon_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; + cvar_set("r_glsl_postprocess_uservec2", strcat("0 ", ftos(cartoon_intensity), " ", cvar_string("hud_cartoon_tolerance"), " 0")); + old_cartoon_intensity = cartoon_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; + old_cartoon_intensity = 0; } } @@ -934,7 +935,7 @@ void CSQC_UpdateView(float w, float h) cvar_set("r_glsl_postprocess_uservec1", "0 0 0 0"); cvar_set("r_glsl_postprocess_uservec1_enable", "0"); } - if(cvar("hud_postprocessing") && !cvar("hud_powerup")) + if(cvar("hud_postprocessing") && !cvar("hud_cartoon")) if(cvar("r_glsl_postprocess_uservec2_enable")) { // don't allow sharpen to get stuck on if we disable the cvar while powered up diff --git a/data/qcsrc/menu/voret/dialog_settings_effects.c b/data/qcsrc/menu/voret/dialog_settings_effects.c index d14e43db..e18f9699 100644 --- a/data/qcsrc/menu/voret/dialog_settings_effects.c +++ b/data/qcsrc/menu/voret/dialog_settings_effects.c @@ -180,8 +180,8 @@ void fillVoretEffectsSettingsTab(entity me) e.savedValue = 0.5; // default me.TD(me, 1, 2, s); me.TR(me); + me.TD(me, 1, 1, e = makeVoretCheckBoxEx(1, 0, "hud_cartoon", "Cartoon lines")); me.TD(me, 1, 1, e = makeVoretCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", "Damage & Water blur")); - me.TD(me, 1, 1, e = makeVoretCheckBoxEx(0.25, 0, "hud_powerup", "Powerup sharpen")); me.TD(me, 1, 1, e = makeVoretCheckBox(0, "hud_saturation", "Armor saturation")); me.gotoRC(me, me.rows - 1, 0); diff --git a/docs/Release notes.txt b/docs/Release notes.txt index 549f86bd..cb9a67a3 100644 --- a/docs/Release notes.txt +++ b/docs/Release notes.txt @@ -283,3 +283,5 @@ Features: - Improvements to the vixen mesh. Models have been switched from zym to iqm (better and newer format), polygon count has been doubled, stomach bulges are more detailed, and the vixens are a bit more chubby and fluffy. - 4 new Nexuiz maps, including race. + +- Post-processing: Add a permenent cartoon effect to the menu, previously visible when having the Strength or Shield powerups. Instead, the effect is always visible now, but the cartoon lines are white instead of black while you own a powerup.