Repository navigation
cvcGL(ariadne): forest/sea/sky L-system node types + register_cvcgl_extensions hook (Phase 2b) - #563
Merged
Merged
Conversation
…ok (Phase 2b-1)
Promote the lsystem_forest demo's TREE scene node out of the example .cpp into cvcGL as a library
node type that renders the cvc::lsys generators — the first piece of making the forest a pure .ari
that runs in the generic ariadne_hello shell.
- lsystem_nodes.{h,cpp}: register_lsystem_node_types() installs "forest_trees" — a thin realizer that
reads node props, calls cvc::lsys::grow_forest (the Phase-1 generator), and wires the wood mesh
(per-vertex colour GeometryNode) + needle-LINES node + a per-frame wind re-pose tick
(repose_forest, driven by the scene world clock so pausing the sim freezes the sway). The terrain
height sampler is ported alongside.
- extensions.{h,cpp}: register_cvcgl_extensions(app) — the single hook by which cvcGL contributes its
Ariadne functionality (shader presets + L-system node types) so a host wires everything with one
call. ariadne_hello now calls it, so a pure .ari can use these node types + the shader surface with
no bespoke host C++. Takes app for the app-scoped intrinsics to come.
- scene_realize: apply_shader moved from the built-in geometry branch to the SHARED tail, so a CUSTOM
node type whose realizer returns a GeometryNode (forest_trees) is shaded by its `shader:` block too
— this is how the tree bark becomes declarative (shader: { preset: bark }) instead of host code.
(+ a GeometryNode forward-decl in scene_realize.h so a TU that only needs the ShaderPreset type
compiles without pulling in GeometryNode.h.)
Tests: cvcgl_ariadne_realize +6 — the bundle installs forest_trees + the bark preset; a forest_trees
node realizes wood + needle nodes, registers a wind tick, and plants on a heightfield. Native + wasm
(ariadne_hello) compile clean.
transfix
enabled auto-merge (squash)
October 4, 2026 07:15
Complete the move of the forest demo's scene node types into cvcGL: the two environment VOLUMES now join forest_trees as library-registered Ariadne node types, each a thin wrapper over the Phase-1 cvc::lsys field generators. - wave_sea — a water-depth VolumeNode re-filled each frame from cvc::lsys::sea_field (the terrain floor sampled once from the ground node), with the demo's time-varying blue-water TF. Rolls in world (sim) time; refill on a 2-frame stride, TF breathe on a 16-frame stride. - cloud_sky — a drifting cloud VolumeNode: two cvc::lsys::cloud_field maps crossfaded + scrolled at runtime (SkyModel, the cheap animation the library leaves to the consumer), plus the baked cloud→ground shadow (ray-march × terrain albedo) textured onto the terrain. 3-frame stride. Both are registered by register_lsystem_node_types() (so register_cvcgl_extensions / ariadne_hello pick them up), read world-clock time, and carry the TerrainHeights sampler (now with band-albedo lookup for the shadow). This is everything a pure .ari forest needs from cvcGL — Phase 3 can now gut the demo host. Tests: cvcgl_ariadne_realize — wave_sea + cloud_sky register and realize VolumeNodes alongside the forest, each pushing a per-frame tick. Native + wasm compile.
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 — Phase 2b of the lsystem-forest refactor
Moves all three of the forest demo's scene node types out of the example
.cppinto cvcGL as library-registered Ariadne node types, each a thin wrapper over the Phase-1cvc::lsysgenerators, plus the cvcGL→Ariadne extension hook. After this, a pure.arican render the whole forest under the genericariadne_helloshell — which is what lets Phase 3 delete the custom host.New node types (
lsystem_nodes.{h,cpp}, registered byregister_lsystem_node_types())forest_trees—cvc::lsys::grow_forest→ wood (per-vertex colourGeometryNode) + needle-LINES node + a per-frame wind re-pose tick (repose_forest, on the scene world clock).wave_sea— a water-depthVolumeNodere-filled each frame fromcvc::lsys::sea_field(terrain floor sampled from the ground node), with the time-varying blue-water TF.cloud_sky— a drifting cloudVolumeNode: twocvc::lsys::cloud_fieldmaps crossfaded + scrolled (SkyModel), plus the baked cloud→ground shadow textured onto the terrain.The extension hook (
extensions.{h,cpp})register_cvcgl_extensions(app)— the single call by which cvcGL contributes its Ariadne functionality (shader presets + L-system node types).ariadne_hellonow calls it, so a pure.arigets these node types + theshader:surface with no bespoke host C++.Shaders on custom nodes
apply_shadermoved from the built-in geometry branch to the shared tail ofrealize_node, so a custom node whose realizer returns aGeometryNode(forest_trees) is shaded by itsshader:block too — this is how the tree bark becomes declarative (shader: { preset: bark }).Tests
cvcgl_ariadne_realize: the bundle installs all three node types + thebark/terrain_bumppresets;forest_trees/wave_sea/cloud_skyrealize (wood+needle GeometryNodes, two VolumeNodes), each registering a per-frame tick; the forest plants on a heightfield. Native + wasm (ariadne_hello) compile clean.