Skip to content

distant terrain - #873

Open
Purdze wants to merge 74 commits into
masterfrom
distant-terrain
Open

Purdze wants to merge 74 commits into
masterfrom
distant-terrain

Conversation

@Purdze

@Purdze Purdze commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

terrain past the render distance. every chunk the client sees is kept as 32³ voxel sections at five levels of detail, saved to disk per server or world, meshed on a worker thread from models baked per block state, and drawn by the gpu which walks the section tree each frame, culls against a hi-z, picks the detail by screen size and asks for the meshes it lacks. pomme-only, under the distant terrain option

also in here from measuring the branch against master:

  • streaming hitches fixed: chunk occlusion and the light engine on their own threads, uploads and chunk packets budgeted per frame (a chunk burst is split only across frames that owe no tick, so every packet is still handled before the tick after it), an o(world) unload removed. stream 1% lows at rd 32 went 27 -> 215 fps, at 64 2 -> 146
  • vsync off presents immediately (immediate, then mailbox, then fifo)
  • gpu time per pass in f3 and the harness frame_times step
  • panics written into latest.log
  • the server's view distance is taken as announced (an announcement equal to our request was dropped, so the slider fell back to 32 on a 128 server); the slider passes 32 only for a larger server view distance
  • chunk mesher hides faces as shouldRenderFace decides (same-kind translucent blocks, partial shapes), removes the dots and lines ice and snow showed from above

tests: unit tests for the sections, mesher, node tree, face rule, section cache, tick scheduling, occlusion walker and light worker. world/distant_terrain, world/render_distance, blocks/face_culling and blocks/grass_occlusion in game, the last three match the 26.2 client. the chunk packet budget changes when packets and ticks are handled within a frame, so it needs a peel capture before merging

known gaps as TODOs in the code: generation beyond what's been seen, shader packs, dimensions without sky light

Purdze added 30 commits October 30, 2026 07:37
…ections and bench distant capture and meshing
…rom retaking freed room and test eviction and compaction in game
…offset, side light, cave fill and waterlogged colours
@Purdze
Purdze added this pull request to stack #874 November 3, 2026 20:07
Purdze added 16 commits November 3, 2026 21:33
…ew findings

- a column handed back to evict for holds the room until its mesh uploads,
  so free room split into small gaps can't bounce two columns forever
- allocation takes the draining arena's room before evicting
- the eviction frontier resets once nothing waits
- empty arenas aren't freed while columns wait for room
- a failed arena allocation caps the arena count instead of panicking
- arena order cached per frame, compaction walks only the draining arena's
  columns, retry walks the loaded columns only when it would evict
…fragmented room for waiting columns and retry when an arena goes
…le the failed-add backoff, and settle only once nothing could still come back
…t only with two arenas, and check eviction under a cap
…ly where it can help, and test streaming against a model of the store
…e the frontier and retry code with the model
…ves after uploads, flush what an undrawn frame left, gate block entities on compiled faded-in sections, draw them all in the shadow pass, finish a sort before starting another
…s after a clear, barrier the shadow cull after the camera cull, report frame_times encode time
@github-actions github-actions Bot added the merge conflict Conflicts with the base branch and needs a merge label Nov 4, 2026
Base automatically changed from render-perf to master November 4, 2026 19:30
…split chunk burst, keep occlusion columns over a mesh rebuild, skip stale light reports, bound the distant section cache, keep unlit columns off lit terrain, order node uploads after their sections, clamp distant shader counters
@github-actions github-actions Bot removed the merge conflict Conflicts with the base branch and needs a merge label Nov 4, 2026
…, shade distant faces by dimension, reuse node ids only once written, run the join tick before more packets, crash on a dead light or occlusion thread, flush distant terrain on suspend
…old parent is written, clear each test worker's distant cache before its first client
… slider pass 32 only for a larger one, and give a single-level texture's level 0 its whole view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant