From d10c5fef2a6d805018734507a76c83d8c5ef1e1d Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 14 Jan 2024 22:30:27 +0100 Subject: [PATCH 1/2] remove gr_vhseffect cvar the vhs effect can be toggled off in opengl with cv_vhseffect anyways, so having cvars to do the same thing is kinda unecessary --- src/hardware/hw_main.c | 3 --- src/hardware/hw_main.h | 1 - src/m_menu.c | 7 +------ src/v_video.c | 2 +- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index be4a6ca0d..8ecc6975f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -124,7 +124,6 @@ consvar_t cv_secbright = {"secbright", "0", CV_SAVE, secbright_cons_t, consvar_t cv_grfovchange = {"gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_grvhseffect = {"gr_vhseffect", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // values for the far clipping plane static float clipping_distances[] = {1024.0f, 2048.0f, 4096.0f, 6144.0f, 8192.0f, 12288.0f, 16384.0f}; @@ -6392,8 +6391,6 @@ void HWR_AddCommands(void) CV_RegisterVar(&cv_grpaletteshader); CV_RegisterVar(&cv_grflashpal); - - CV_RegisterVar(&cv_grvhseffect); } // -------------------------------------------------------------------------- diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 3dc18ccf8..6a62295f8 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -198,7 +198,6 @@ extern consvar_t cv_grflashpal; extern consvar_t cv_grportals; extern consvar_t cv_nostencil; extern consvar_t cv_secbright; -extern consvar_t cv_grvhseffect; extern CV_PossibleValue_t granisotropicmode_cons_t[]; diff --git a/src/m_menu.c b/src/m_menu.c index d851801a4..a35b68a7d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1443,8 +1443,7 @@ static menuitem_t OP_ExpOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "FFloorclip", &cv_ffloorclip, 85}, {IT_STRING | IT_CVAR, NULL, "Spriteclip", &cv_spriteclip, 95}, #ifdef HWRENDER - {IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_grscreentextures, 65}, - {IT_STRING | IT_CVAR, NULL, "VHS effect", &cv_grvhseffect, 75}, + {IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_grscreentextures, 75}, {IT_STRING | IT_CVAR, NULL, "Splitwall/Slope texture fix", &cv_splitwallfix, 95}, {IT_STRING | IT_CVAR, NULL, "Slope midtexture peg fix", &cv_slopepegfix, 105}, @@ -1463,7 +1462,6 @@ static const char* OP_ExpTooltips[] = "Hides Sprites which are not visible\npotentially resulting in a performance boost.", #ifdef HWRENDER "Should the game do Screen Textures? Provides a good boost to frames\nat the cost of some visual effects not working when disabled.", - "Show a VHS-like effect when the game is paused or youre rewinding replays.", "Fixes issues that resulted in Textures sticking from the ground sometimes.\n This may be CPU heavy and result in worse performance in some cases.", "Fixes issues that resulted in Textures not being properly skewed\n example: Fences on slopes that didnt show proper.\n This may be CPU heavy and result in worse performance in some cases.", "Fixes issues that resulted in Textures on Floor over Floors ZFighting heavily.", @@ -1481,7 +1479,6 @@ enum op_exp_sprclip, #ifdef HWRENDER op_exp_grscrtx, - op_exp_grvhs, op_exp_spltwal, op_exp_pegging, op_exp_fofzfight, @@ -4426,7 +4423,6 @@ void M_Init(void) { OP_VideoOptionsMenu[op_video_ogl].status = IT_DISABLED; OP_ExpOptionsMenu[op_exp_grscrtx].status = IT_DISABLED; - OP_ExpOptionsMenu[op_exp_grvhs].status = IT_DISABLED; OP_ExpOptionsMenu[op_exp_spltwal].status = IT_DISABLED; OP_ExpOptionsMenu[op_exp_pegging].status = IT_DISABLED; OP_ExpOptionsMenu[op_exp_fofzfight].status = IT_DISABLED; @@ -4434,7 +4430,6 @@ void M_Init(void) } if (rendermode == render_opengl){ - OP_ExpOptionsMenu[op_exp_vhs].status = IT_DISABLED; OP_ExpOptionsMenu[op_exp_ffclip].status = IT_DISABLED; OP_ExpOptionsMenu[op_exp_sprclip].status = IT_DISABLED; } diff --git a/src/v_video.c b/src/v_video.c index 28a02bcff..53a41c216 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1205,7 +1205,7 @@ void V_DrawVhsEffect(boolean rewind) if (downbary > vid.height) downbary = -barsize; #ifdef HWRENDER - if ((rendermode == render_opengl) && (cv_grvhseffect.value)) + if (rendermode == render_opengl) { HWR_RenderVhsEffect(upbary, downbary, updistort, downdistort, barsize); return; From c1223d767d1e6503ed165f434c7b78961b53aade Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 14 Jan 2024 22:39:50 +0100 Subject: [PATCH 2/2] remove this hacky stuff, just dont interpolate it it barely looked any better, it was actually just faster than it shouldve been --- src/v_video.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 53a41c216..c1f1e21f0 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1186,21 +1186,12 @@ void V_DrawVhsEffect(boolean rewind) if (rewind) V_DrawVhsEffect(false); // experimentation - if (R_UsingFrameInterpolation()) // omg i fucking hate interp so much, its a bit smoother but still not great whatever, atleast like this shit wont completely go nuts when youre on high framerates + if (renderisnewtic) { - if (renderisnewtic) - { - upbary -= FixedMul(vid.dupy * (rewind ? 3 : 1.8f), 22937*3); - downbary += FixedMul(vid.dupy * (rewind ? 2 : 1), 22937*3); - } - } - else - { - upbary -= vid.dupy * (rewind ? 3 : 1.8f); - downbary += vid.dupy * (rewind ? 2 : 1); + upbary -= (vid.dupy * (rewind ? 3 : 1.8f)); + downbary += (vid.dupy * (rewind ? 2 : 1)); } - if (upbary < -barsize) upbary = vid.height; if (downbary > vid.height) downbary = -barsize;