Repository navigation
Graphic Improvement and Adaptability Per Device - #1
Open
miracles2motion wants to merge 8 commits into
Open
miracles2motion wants to merge 8 commits into
miracles2motion wants to merge 8 commits into
Conversation
…dio, and Vercel build
…d optimize GTAO/shadows
…ng, and auto performance
…une vercel config
Author
|
feat(perf, mobile): adaptive device profiling, dynamic resolution governor, and mobile/thermal optimizations
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(perf, mobile): adaptive device profiling, dynamic resolution governor, and mobile/thermal optimizations
Summary
This PR introduces an adaptive, device-relative performance architecture and mobile gameplay enhancements designed to eliminate thermal runaway on laptops, stabilize frame rates at a steady 60 FPS across all hardware tiers, and provide a polished mobile/touch experience.
Key Improvements
1. Adaptive Device Profiling & Dynamic Resolution Governor
src/core/devicePerf.js): Benchmarks GPU unmasked renderer strings, CPU concurrency, device memory, battery presence, and display density into capability classes (enthusiast,high,medium,low).src/config.js,src/core/renderer.js): Quality presets (Auto,Low,Medium,High,Ultra) scale relative to the device's hardware and thermal constraints:PerformanceGovernorto maintain a locked 60 FPS.2. Thermal & Idle Power Savers
src/main.js): Suspends rendering when the browser tab is hidden or minimized (if (document.hidden) return;).3. Mobile & Touch Controls Overhaul
styles/touch.css,index.html): Added viewport-fit support andenv(safe-area-inset-*)handling to prevent aspect ratio distortion and notch overlap.src/core/touch.js): Separated pointer IDs for movement, aim look, and weapon firing to prevent touch coordinate jumps during simultaneous actions.src/core/input.js): Prevents mobile touches from spuriously requesting desktop pointer lock or causing pause on pointer unlock.4. Shaders, Actor LOD & Audio Optimizations
src/world/inkShading.js,src/world/levelMaterial.js): Added#ifdef INK_QUALITY_LOWshader path that bypasses bicubic filtering, gel micro-surface, and complex clearcoat specular math on mobile/low settings.src/game/actor.js,src/game/character.js,src/game/bots.js):discardon mobile to preserve GPU Early-Z and tile cache efficiency.src/audio/audio.js): Bypasses heavy convolution reverb on mobile/low to prevent buffer underruns and audio clicking/stuttering; applies 24m spatial distance culling and tighter voice caps.5. Tooling
tools/build-dist.py): Added explicit UTF-8 encoding with error fallback when reading source files, resolvingUnicodeDecodeErroron Windows systems.Verification & Testing
npm run check: Passed cleanly on all 180 modules (node tools/check-syntax.mjs).npm run build: Succeeded with code 0 (dist ready: 19 addon files + 2 diagnostics).