Repository navigation
fix(forest): keep the Barbara dock drawn when you walk out on it - #512
Merged
Merged
Conversation
…bara dock stays drawn The dock is baked into the chunk at its shore end, but chunk boxes were the 16 m cell. The dock runs 11 m past it, so standing past the cell edge looking out along the dock culled the whole chunk and the deck vanished.
This was referenced Oct 23, 2026
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.
What it does
The lake dock in BARBARA no longer vanishes when you walk out along it.
How it works
The forest bakes the dock into the 16 m chunk at its shore end, but each chunk's cull box was just its cell. The dock runs 11 m past that cell (z 75–91, cell 64–80), so once you stood past the cell edge looking out along it, the box was behind the camera and the whole chunk, dock included, was frustum-culled.
buildForestnow grows each chunk's box over its baked near/far vertices. Only 38 of 484 chunks in the demo world grow, by 0.1–8 m (camp, dock, string lights, logs), so the cost is negligible. Instanced crowns that overhang a cell are left as they were: padding them adds ~15% triangles per frame, which is a separate call.Risk
Low. Bounds only grow, so nothing that drew before stops drawing. Only
ForestView's frustum test reads the box.Proof
packages/kit/forest/build.test.ts: every chunk's box holds all its static vertices (failed with 27 spills before the fix, passes after).capture.ts --shots dockMid(halfway out the dock, looking along it), stills:~/code/home/artifacts/barbara-dock-2026-10-23/dockMid-before.png(no deck, only water) anddockMid-after.png(deck drawn).bun run verify: ok.