Repository navigation
cloud_sky: wire new meshes when the scene's tree changes, not once a second - #1030
Merged
Merged
Conversation
…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.
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.
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 fromcontentVersion(), which also moves on those.GraphicsNode::addGraphicsChild/removeGraphicsChildbump it when the parent is in a scene. A subtree built off the scene bumps it once, when it joins.Tests:
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).