feat: infinite terrain streaming with 3-chunk radius#13
Merged
Conversation
- streamUpdate: generates all new chunks concurrently via Promise.all instead of sequential await — GPU upload happens progressively - Stream trigger: 256 → 128 units (quarter-chunk for responsiveness) - lastStreamX/Z: initialized to -99999 to force immediate first stream Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- RenderRadius: 512 → 1536 (3-chunk radius, ~28 chunks visible) - DistanceThreshold: 1100 → 2560 (5-chunk eviction hysteresis) - MaxConcurrentChunks: 3 → 64 (no effective throttle) - World.Update(): strip redundant heightmap generation (goGenerateChunk handles it) - Use chunk-center distance for circular frustum (more accurate than corner) - Sort chunksToAdd nearest-first for better load UX - goWorldUpdate: only clean up evicted heightmaps, not populate Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e4acee5 to
1bfd23c
Compare
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.
Summary
Implements true infinite terrain — as the player walks, the world generates ahead of them with no visible edge.
Changes
Go / WASM
goGenerateChunkowns that. Update is now pure coordinate math, returning sorted nearest-first chunk list(cx+0.5)*sizeinstead of corner for more accurate circular loadingTypeScript
streamUpdatenow usesPromise.all— all new chunks in a batch are queued to the WASM worker concurrently (GPU upload happens progressively as each completes)lastStreamX/Zinitialized to -99999 so the render loop triggers a full streaming pass on the very first frameTesting
Reviewable commits
e4acee5— Go world streaming: 3-chunk radius, no throttle, no redundant generation7d1ef58— TypeScript: parallel chunk gen, faster stream trigger, immediate first stream