Skip to content

cvcGL(ariadne): forest/sea/sky L-system node types + register_cvcgl_extensions hook (Phase 2b) - #563

Merged
transfix merged 2 commits into
masterfrom
feat/lsys-ariadne-nodes
Oct 4, 2026
Merged

transfix merged 2 commits into
masterfrom
feat/lsys-ariadne-nodes

Conversation

@transfix

@transfix transfix commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

What — Phase 2b of the lsystem-forest refactor

Moves all three of the forest demo's scene node types out of the example .cpp into cvcGL as library-registered Ariadne node types, each a thin wrapper over the Phase-1 cvc::lsys generators, plus the cvcGL→Ariadne extension hook. After this, a pure .ari can render the whole forest under the generic ariadne_hello shell — which is what lets Phase 3 delete the custom host.

New node types (lsystem_nodes.{h,cpp}, registered by register_lsystem_node_types())

  • forest_trees — cvc::lsys::grow_forest → wood (per-vertex colour GeometryNode) + needle-LINES node + a per-frame wind re-pose tick (repose_forest, on the scene world clock).
  • wave_sea — a water-depth VolumeNode re-filled each frame from cvc::lsys::sea_field (terrain floor sampled from the ground node), with the time-varying blue-water TF.
  • cloud_sky — a drifting cloud VolumeNode: two cvc::lsys::cloud_field maps 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_hello now calls it, so a pure .ari gets these node types + the shader: surface with no bespoke host C++.

Shaders on custom nodes

apply_shader moved from the built-in geometry branch to the shared tail of realize_node, so a custom node 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 }).

Tests

cvcgl_ariadne_realize: the bundle installs all three node types + the bark/terrain_bump presets; forest_trees/wave_sea/cloud_sky realize (wood+needle GeometryNodes, two VolumeNodes), each registering a per-frame tick; the forest plants on a heightfield. Native + wasm (ariadne_hello) compile clean.

Next: Phase 3 guts lsystem_forest_ari.cpp into a self-contained lsystem_forest.ari running in ariadne_hello.

…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
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.
@transfix transfix changed the title cvcGL(ariadne): forest_trees node type + register_cvcgl_extensions hook (Phase 2b-1) cvcGL(ariadne): forest/sea/sky L-system node types + register_cvcgl_extensions hook (Phase 2b) Oct 4, 2026
@transfix
transfix merged commit cc2d6b6 into master Oct 4, 2026
14 checks passed
@transfix
transfix deleted the feat/lsys-ariadne-nodes branch October 29, 2026 20:52
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