From d77e3f6adae53ff5ba29490e355a0b9a5914d8e9 Mon Sep 17 00:00:00 2001 From: RicardoDeZoete Date: Thu, 5 Mar 2026 17:42:46 +0100 Subject: [PATCH] perf(client): quick-win settings for GPU selection and quality ramp-up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three small tuning changes with outsized user-facing impact: 1. WebGLRenderer powerPreference: 'high-performance' On dual-GPU laptops (most gaming laptops) browsers default to the integrated GPU. This hint requests the discrete GPU, giving an immediate frame-rate boost at zero runtime cost. 2. Quality warmup 10 s → 5 s After joining a world the auto-scaler waits before it begins upgrading quality. 10 seconds is overly conservative — 5 s is enough for the heavy init work to settle while letting players on capable hardware reach higher quality sooner. 3. Quality-up threshold 5 s → 3 s Once the scaler starts, it previously required 5 s of sustained high FPS before upgrading. 3 s still guards against oscillation but lets the client converge on the right quality tier roughly 40 % faster. Made-with: Cursor --- client/src/core/Renderer.ts | 2 +- client/src/settings/SettingsManager.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/core/Renderer.ts b/client/src/core/Renderer.ts index bc742730..57b0d0c7 100644 --- a/client/src/core/Renderer.ts +++ b/client/src/core/Renderer.ts @@ -145,7 +145,7 @@ export default class Renderer { this._ambientLight = { color: new Color(), intensity: 1 }; // Anti-aliasing is handled in post-processing - this._renderer = new WebGLRenderer({ antialias: false }); + this._renderer = new WebGLRenderer({ antialias: false, powerPreference: 'high-performance' }); this._sceneUiRenderer = new CSS2DRenderer({ element: document.getElementById('scene-ui-container')! }); this._scene = new Scene(); this._viewModelScene = new Scene(); diff --git a/client/src/settings/SettingsManager.ts b/client/src/settings/SettingsManager.ts index 7aa794e7..1976c3bc 100644 --- a/client/src/settings/SettingsManager.ts +++ b/client/src/settings/SettingsManager.ts @@ -178,13 +178,13 @@ const LOW_FPS_THRESHOLD_RATIO = 0.50; // If the FPS stays above or below the threshold for the specified duration, we attempt to adjust // quality. Since increasing quality might degrade performance and force us to revert it // later, we apply upgrades more cautiously than downgrades. -const QUALITY_UP_TIME_THRESHOLD = 5; +const QUALITY_UP_TIME_THRESHOLD = 3; const QUALITY_DOWN_TIME_THRESHOLD = 3; // Client and game initialization involve many heavy processes, often causing FPS to drop. // Using FPS values during this time may lead to unnecessarily lowering quality. To avoid this, // quality changes are disabled for a set time after receiving the World Packet. -const QUALITY_ADJUSTMENT_WARMUP_TIME = 10; +const QUALITY_ADJUSTMENT_WARMUP_TIME = 5; // Good FPS may trigger a quality increase, which could then lower FPS and cause a downgrade, // potentially leading to repeated up/down quality switches. This can cause visible flickering