Load planet textures progressively for faster startup - #55
Merged
Merged
Conversation
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.
Planet maps no longer hold the loading screen open. The rack starts with colored surfaces, downloads 512-pixel WebP previews alongside room assets, then upgrades existing textures to the original resolution in the background. Companion-only previews follow the rack, and full-resolution transfers run two at a time.
The previews total 547,724 bytes versus 11,532,863 bytes for the original maps. A cold local production-build comparison at 390×844, Fast 4G, and 4× CPU slowdown reduced time to attract mode from 19.8 s to 8.6 s (57%). This improves startup latency; the original detail maps still download afterward.
Texture updates preserve shared live/replay materials, ball positions, and collection selection. Resolution changes release the old GPU allocation; updates refresh cached shadows. Missing downloads keep the previous appearance, and teardown releases late arrivals without starting queued work. Includes a reproducible preview-generation script and pipeline documentation.
Validation: all 353 tests and the production build pass. New coverage checks progressive arrival, replay sharing, GPU allocation release, missing-preview recovery, concurrency, and late-disposal cleanup. Browser checks covered mobile startup, desktop previews with all detailed downloads held back, and resuming detail downloads during a game; no WebGL errors occurred. Existing Vite bundle-size/config warnings remain.