From: MirceaKitsune Date: Tue, 11 Jun 2013 20:00:34 +0000 (+0300) Subject: Use celshading and celoutlines for the cartoon effect. Keep the old system for poweru... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9ed9f9fe9179c135576bc74eda76529e53ab0eeb;p=voretournament%2Fvoretournament.git Use celshading and celoutlines for the cartoon effect. Keep the old system for powerups though --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 7f65b008..c39442dc 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -683,6 +683,7 @@ r_mipsprites 1 r_mipskins 1 r_shadow_realtime_world_lightmaps 1 r_shadow_shadowmapping 1 +r_shadow_deferred 1 seta r_ambient 4 cl_decals_fadetime 1 cl_decals_time 2 @@ -1188,8 +1189,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_cartoon 0 "cartoon effect, reverses when you own a powerup, default is 1.5" -seta hud_cartoon_tolerance 0.15 "where to apply the cartoon effect between bright and dark areas" +seta hud_powerup 0 "cartoon effect, reverses when you own a powerup, default is 1.5" +seta hud_powerup_tolerance 0.15 "where to apply the cartoon effect between bright and dark areas" seta hud_saturation_armor 0 "saturation changes based on the amount of armor you have" seta hud_saturation_death 0 "black and white vision when dead" diff --git a/data/effects-high.cfg b/data/effects-high.cfg index 6c350486..4c7289b7 100644 --- a/data/effects-high.cfg +++ b/data/effects-high.cfg @@ -10,7 +10,9 @@ mod_q3bsp_nolightmaps 0 r_bloom 1 r_coronas 1 hud_postprocessing_maxbluralpha 0.5 -hud_cartoon 1.5 +hud_powerup 1 +r_celshading 1 +r_celoutlines 1 hud_saturation 0 r_depthfirst 2 r_drawdecals_drawdistance 500 diff --git a/data/effects-low.cfg b/data/effects-low.cfg index cc490865..23e4d2a9 100644 --- a/data/effects-low.cfg +++ b/data/effects-low.cfg @@ -10,7 +10,9 @@ mod_q3bsp_nolightmaps 1 r_bloom 0 r_coronas 1 hud_postprocessing_maxbluralpha 0 -hud_cartoon 0 +hud_powerup 0 +r_celshading 0 +r_celoutlines 0 hud_saturation 0 r_depthfirst 0 r_drawdecals_drawdistance 200 diff --git a/data/effects-med.cfg b/data/effects-med.cfg index f7209c57..54c80931 100644 --- a/data/effects-med.cfg +++ b/data/effects-med.cfg @@ -10,7 +10,9 @@ mod_q3bsp_nolightmaps 0 r_bloom 0 r_coronas 1 hud_postprocessing_maxbluralpha 0 -hud_cartoon 0 +hud_powerup 0 +r_celshading 0 +r_celoutlines 0 hud_saturation 0 r_depthfirst 0 r_drawdecals_drawdistance 300 diff --git a/data/effects-normal.cfg b/data/effects-normal.cfg index 887f0e35..dbb49517 100644 --- a/data/effects-normal.cfg +++ b/data/effects-normal.cfg @@ -10,7 +10,9 @@ mod_q3bsp_nolightmaps 0 r_bloom 0 r_coronas 1 hud_postprocessing_maxbluralpha 0 -hud_cartoon 0 +hud_powerup 0 +r_celshading 0 +r_celoutlines 0 hud_saturation 0 r_depthfirst 1 r_drawdecals_drawdistance 300 diff --git a/data/effects-omg.cfg b/data/effects-omg.cfg index c256e722..eb315912 100644 --- a/data/effects-omg.cfg +++ b/data/effects-omg.cfg @@ -10,7 +10,9 @@ mod_q3bsp_nolightmaps 1 r_bloom 0 r_coronas 1 hud_postprocessing_maxbluralpha 0 -hud_cartoon 0 +hud_powerup 0 +r_celshading 0 +r_celoutlines 0 hud_saturation 0 r_depthfirst 0 r_drawdecals_drawdistance 100 diff --git a/data/effects-ultimate.cfg b/data/effects-ultimate.cfg index 1fe14a83..45db9ca2 100644 --- a/data/effects-ultimate.cfg +++ b/data/effects-ultimate.cfg @@ -10,7 +10,9 @@ mod_q3bsp_nolightmaps 0 r_bloom 1 r_coronas 1 hud_postprocessing_maxbluralpha 0.5 -hud_cartoon 1.5 +hud_powerup 1 +r_celshading 1 +r_celoutlines 1 hud_saturation 1 r_depthfirst 2 r_drawdecals_drawdistance 500 diff --git a/data/effects-ultra.cfg b/data/effects-ultra.cfg index c4879200..d6985cb8 100644 --- a/data/effects-ultra.cfg +++ b/data/effects-ultra.cfg @@ -10,7 +10,9 @@ mod_q3bsp_nolightmaps 0 r_bloom 1 r_coronas 1 hud_postprocessing_maxbluralpha 0.5 -hud_cartoon 1.5 +hud_powerup 1 +r_celshading 1 +r_celoutlines 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 bd477120..b6eb14c1 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -904,8 +904,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_cartoon") != 0)) - cvar_set("r_glsl_postprocess_uservec2_enable", ftos(cvar("hud_cartoon") != 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) && cvar("chase_active") >= 0) // not while the event chase camera is active @@ -926,20 +926,24 @@ void CSQC_UpdateView(float w, float h) old_bluralpha = 0; } - if(cvar("hud_cartoon")) + if(cvar("hud_powerup")) { - // 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 + // When having the strength or invincible powerups, enable white outlines + // As powerup time goes under 5 seconds (warning time) the lines fade away + float cartoon_intensity; + + if((getstatf(STAT_STRENGTH_FINISHED) >= time || getstatf(STAT_INVINCIBLE_FINISHED) >= time) && cvar("chase_active") >= 0) + { + // not while the event chase camera is active + cartoon_intensity = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 5) + bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 5); + cartoon_intensity = cvar("hud_powerup") * bound(0, cartoon_intensity, 5); + } + else + cartoon_intensity = 0; if(cartoon_intensity != old_cartoon_intensity) // reduce cvar_set spam as much as possible { - cvar_set("r_glsl_postprocess_uservec2", strcat("0 ", ftos(cartoon_intensity), " ", cvar_string("hud_cartoon_tolerance"), " 0")); + cvar_set("r_glsl_postprocess_uservec2", strcat("0 ", ftos(cartoon_intensity), " ", cvar_string("hud_powerup_tolerance"), " 0")); old_cartoon_intensity = cartoon_intensity; } } @@ -957,7 +961,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_cartoon")) + if(cvar("hud_postprocessing") && !cvar("hud_powerup")) 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 313f8a1e..97f7e983 100644 --- a/data/qcsrc/menu/voret/dialog_settings_effects.c +++ b/data/qcsrc/menu/voret/dialog_settings_effects.c @@ -162,7 +162,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.5, 0, "hud_cartoon", "Cartoon lines")); + me.TD(me, 1, 1, e = makeVoretCheckBoxEx(1, 0, "hud_powerup", "Cartoon")); + makeMulti(e, "r_celshading r_celoutlines"); me.TD(me, 1, 1, e = makeVoretCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", "Content blur")); me.TD(me, 1, 1, e = makeVoretCheckBox(0, "hud_saturation_armor", "Saturation")); makeMulti(e, "hud_saturation_death"); diff --git a/docs/TODO.txt b/docs/TODO.txt index cdae9fd8..d5c41ad7 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -251,3 +251,5 @@ - 0.8 BUG: In player.sounds files, "tag female" is used for the male voices too - 0.8: Fix all the gmqcc warnings when using the default Xonotic parameters + +- 0.9: Port and default the Luminos HUD & menu style from Xonotic