Skip to content

cloud_sky: wire new meshes when the scene's tree changes, not once a second - #1030

Merged
transfix merged 1 commit into
masterfrom
feat/cloud-receivers-announce
Nov 6, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/cloud-receivers-announce

Conversation

@transfix

@transfix transfix commented Nov 6, 2026

Copy link
Copy Markdown
Owner

cloud_sky used to walk its receivers once a second (every 60 frames) to find meshes made after it was realized: LOD rungs made late, a regenerated world's parts. A new mesh went unshaded for up to a second, and a settled scene still paid for the walk (about 1.5 ms on the 11.2 km world).

Now the scene says when its tree changes:

  • SceneGraph::treeVersion() / markTreeChanged(): a counter that goes up whenever a node joins or leaves the tree. That covers a graphics node registered or removed, and a child added to or removed from any node in the scene. It stays put for moves, visibility and geometry swaps, which keep a node's decoration. It is distinct from contentVersion(), which also moves on those.
  • GraphicsNode::addGraphicsChild / removeGraphicsChild bump it when the parent is in a scene. A subtree built off the scene bumps it once, when it joins.
  • cloud_sky's tick walks its receivers when the counter has moved since its last walk, and never on a timer. It reads the version before walking, so a mesh added during the walk is found on the next frame. The ground's extent check stays on its 60-frame stride.

Tests:

  • New headless test cvcgl_tree_version: the counter moves on register, child add (also a grandchild, and a subtree joining) and child/graphics removal. It holds still for setPosition, setVisible, setGeometry and a subtree built off the scene.
  • cvcgl_ariadne_realize: after the sky's first tick, a GeometryNode added under the ground is shaded by the very next tick. The old 60-frame walk fails this.

The roadmap (GENERATED-WORLD-ROADMAP) records it as landed. What remains for the clouds is the browser measurement and the GLSL ES compile check (on the gallery once #1029 deploys), then evolving coverage (LSYSTEM 4.7).

…second

SceneGraph::treeVersion() moves whenever a node joins or leaves the tree
(registered or removed, or a child added or removed anywhere in the scene)
and holds still for moves, visibility and geometry swaps. cloud_sky walks
its receivers when it has moved, so an LOD rung or a regenerated world's
part is shaded on its first frame and a settled scene never walks.

Tests: cvcgl_tree_version (new, headless); cvcgl_ariadne_realize shades a
mesh added under the ground on the next tick.
@transfix
transfix enabled auto-merge (squash) November 6, 2026 21:30
@transfix
transfix merged commit c925198 into master Nov 6, 2026
13 of 27 checks passed
@transfix
transfix deleted the feat/cloud-receivers-announce branch November 6, 2026 22:18
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