From b4769fc444391ab01f58892d4a025c8ba8a89b34 Mon Sep 17 00:00:00 2001 From: Rain Date: Thu, 10 Sep 2026 22:36:22 +0300 Subject: [PATCH 1/4] Make cl_neo_background_pan scale instead of bool Convert the cl_neo_background_pan from boolean on/off option into a float scale for adjusting the pan strength. The CAMERA_MOVEMENT_MULTIPIER remains unchanged, so the default "enabled" value of 1 keeps the same strength as before, for user config compatibility. The max value is capped to prevent users from turning too much, and revealing unmapped areas of the 3D background maps. --- src/game/client/view.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/game/client/view.cpp b/src/game/client/view.cpp index 7e792a1f17..f12c5310c1 100644 --- a/src/game/client/view.cpp +++ b/src/game/client/view.cpp @@ -724,7 +724,9 @@ float CViewRender::GetZFar() #ifdef NEO -ConVar cl_neo_background_pan("cl_neo_background_pan", "1", FCVAR_ARCHIVE, "Pan the camera with the cursor in the main menu background maps"); +// The max pan scale value is arbitrary, chosen to prevent turning so much to see unmapped areas of the 3D background. +ConVar cl_neo_background_pan("cl_neo_background_pan", "1", FCVAR_ARCHIVE, + "Scale by which to pan the camera with the cursor in the main menu background maps", true, 0, true, 10); #endif // NEO //----------------------------------------------------------------------------- // Sets up the view parameters @@ -776,7 +778,8 @@ void CViewRender::SetUpViews() } #endif #if defined NEO - else if (engine->IsLevelMainMenuBackground() && cl_neo_background_pan.GetBool()) + // float compare because background pan can be scalar + else if (engine->IsLevelMainMenuBackground() && cl_neo_background_pan.GetFloat() != 0) { if (pPlayer) { @@ -794,7 +797,10 @@ void CViewRender::SetUpViews() flX = (1 / (1 + pow(2, -CURVE_STEEPNESS * flX))) - 0.5; flY = (1 / (1 + pow(2, -CURVE_STEEPNESS * flY))) - 0.5; - constexpr int CAMERA_MOVEMENT_MULTIPIER = 3; + // Originally, the multiplier was 3 and cl_neo_background_pan was a bool (instead of scale), + // so doing it this way instead of defaulting the cvar to 3 keeps user configs compatible. + const float CAMERA_MOVEMENT_MULTIPIER = 3 * cl_neo_background_pan.GetFloat(); + flX *= CAMERA_MOVEMENT_MULTIPIER; flY *= CAMERA_MOVEMENT_MULTIPIER; From 1d914dcccc34c90b61d6e18514b708537b6b0302 Mon Sep 17 00:00:00 2001 From: Rain Date: Thu, 10 Sep 2026 22:45:56 +0300 Subject: [PATCH 2/4] Add cvar cl_neo_background_lerp Add new cvar `cl_neo_background_lerp` to accompany `cl_neo_background_pan`. The lerp defaults to 1 (i.e. no lerp), but can be lowered to get a softer pan instead of being strictly locked to the cursor position. Lerp value of 0 uses frame interval (to disable the feature entirely, use `cl_neo_background_pan 0`, instead). --- src/game/client/view.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/game/client/view.cpp b/src/game/client/view.cpp index f12c5310c1..b9f28b164f 100644 --- a/src/game/client/view.cpp +++ b/src/game/client/view.cpp @@ -727,6 +727,8 @@ float CViewRender::GetZFar() // The max pan scale value is arbitrary, chosen to prevent turning so much to see unmapped areas of the 3D background. ConVar cl_neo_background_pan("cl_neo_background_pan", "1", FCVAR_ARCHIVE, "Scale by which to pan the camera with the cursor in the main menu background maps", true, 0, true, 10); +ConVar cl_neo_background_lerp("cl_neo_background_lerp", "1", FCVAR_ARCHIVE, + "Scale by which to lerp the camera pan, or 0 to use frametime.", true, 0, true, 1); #endif // NEO //----------------------------------------------------------------------------- // Sets up the view parameters @@ -804,8 +806,18 @@ void CViewRender::SetUpViews() flX *= CAMERA_MOVEMENT_MULTIPIER; flY *= CAMERA_MOVEMENT_MULTIPIER; - viewEye.angles.y += flX; - viewEye.angles.x -= flY; + static Vector2D lerpedOffs(0, 0); + viewEye.angles.x -= lerpedOffs.y; + viewEye.angles.y += lerpedOffs.x; + + float lerpScale = cl_neo_background_lerp.GetFloat(); + if (!lerpScale) + lerpScale = Min(gpGlobals->frametime, 1.f); + Assert(IN_BETWEEN_EQ(0, lerpScale, 1)); + // if lerpScale==1, then this is just an unlerped assignment + lerpedOffs.x = Lerp(lerpScale, lerpedOffs.x, flX); + lerpedOffs.y = Lerp(lerpScale, lerpedOffs.y, flY); + Assert(lerpedOffs.IsValid()); } } else From 59a55576348fc7d02d8e62a55f4da732f8aba14a Mon Sep 17 00:00:00 2001 From: Rain Date: Thu, 10 Sep 2026 23:01:52 +0300 Subject: [PATCH 3/4] improve comment --- src/game/client/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/client/view.cpp b/src/game/client/view.cpp index b9f28b164f..0a9fe0b7c0 100644 --- a/src/game/client/view.cpp +++ b/src/game/client/view.cpp @@ -780,7 +780,7 @@ void CViewRender::SetUpViews() } #endif #if defined NEO - // float compare because background pan can be scalar + // float compare because background pan can be scalar, and .GetBool() casts via int which would round down for values 0-1 else if (engine->IsLevelMainMenuBackground() && cl_neo_background_pan.GetFloat() != 0) { if (pPlayer) From 860d531b896b371c9b0f4b2e423fb81dbe34fc75 Mon Sep 17 00:00:00 2001 From: Rain Date: Thu, 10 Sep 2026 23:42:54 +0300 Subject: [PATCH 4/4] feedback: allow negative pan scale inverts pan direction --- src/game/client/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/client/view.cpp b/src/game/client/view.cpp index 0a9fe0b7c0..8286b67629 100644 --- a/src/game/client/view.cpp +++ b/src/game/client/view.cpp @@ -726,7 +726,7 @@ float CViewRender::GetZFar() #ifdef NEO // The max pan scale value is arbitrary, chosen to prevent turning so much to see unmapped areas of the 3D background. ConVar cl_neo_background_pan("cl_neo_background_pan", "1", FCVAR_ARCHIVE, - "Scale by which to pan the camera with the cursor in the main menu background maps", true, 0, true, 10); + "Scale by which to pan the camera with the cursor in the main menu background maps", true, -10, true, 10); ConVar cl_neo_background_lerp("cl_neo_background_lerp", "1", FCVAR_ARCHIVE, "Scale by which to lerp the camera pan, or 0 to use frametime.", true, 0, true, 1); #endif // NEO