Repository navigation
Streaming a world as the camera moves: readAsset, a binding that syncs what changed, the in-place rules it needs - #196
Merged
Merged
Conversation
…s what changed, the in-place rules it needs - `readAsset(path, offset?, length?)` (@threert/scene, `__engine.readAsset`): a file under the asset root, whole or a range, as an ArrayBuffer (native only); `THREERT_SCRIPT_MB` sizes the script's heap (1 GiB by default). - The scene binding syncs what changed: objects added or removed since the last sync are bound or dropped with their subtrees; the graph is walked whole only at the first sync. A city of ~40 k objects that adds and removes a few hundred a frame spent >50 ms walking it (and was interrupted mid-sync). - `World::remove` counts each object's children and skips the scan for a childless one. - glTF `KHR_materials_unlit`: shown, never lit nor lighting; with an emission it shows that (far lit windows that are no emitters: each commit that adds emitters rewrites the CDF over all of them). - The edit room grows to the largest buffer that fits where doubling would pass the device's limit, instead of rebuilding. - `THREERT_EDIT_LOG=1` names where a world change or an edit decided on a rebuild. - docs/RUNTIME.md "Streaming": what adds in place and what still rebuilds. Measured on a streamed Shinjuku (598 cells of 128 m, three levels; threert/tokyo-1980), M3 Max, a 90 s flight at 0.5-0.6 scale: before, a rebuild of 10-15 s every ~12 s and frame scripts interrupted; after, no rebuild, frame interval p50 21 ms / p95 53 ms by night (23 / 39 by day). Tests: renderer lib 223 passed (one GPU test fails now and then with all threads, as on main: Metal's 32 timestamp query sets a process); npm test 166 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s assets), so the engine API stays the native one, one for one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d the page's) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
doodlewind
force-pushed
the
city-streaming
branch
from
November 23, 2026 05:30
239ad9a to
9fd0b14
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.
readAsset(path, offset?, length?)(@threert/scene,__engine.readAsset): a file under the asset root, whole or arange, as an ArrayBuffer (native only);
THREERT_SCRIPT_MBsizes the script's heap (1 GiB by default).subtrees; the graph is walked whole only at the first sync. A city of ~40 k objects that adds and removes a few
hundred a frame spent >50 ms walking it (and was interrupted mid-sync).
World::removecounts each object's children and skips the scan for a childless one.KHR_materials_unlit: shown, never lit nor lighting; with an emission it shows that (far lit windows that are noemitters: each commit that adds emitters rewrites the CDF over all of them).
rebuilding.
THREERT_EDIT_LOG=1names where a world change or an edit decided on a rebuild.Measured on a streamed Shinjuku (598 cells of 128 m, three levels; threert/tokyo-1980), M3 Max, a 90 s flight at
0.5-0.6 scale: before, a rebuild of 10-15 s every ~12 s and frame scripts interrupted; after, no rebuild, frame
interval p50 21 ms / p95 53 ms by night (23 / 39 by day).
Tests: renderer lib 223 passed (one GPU test fails now and then with all threads, as on main: Metal's 32 timestamp
query sets a process); npm test 166 passed.
🤖 Generated with Claude Code