Skip to content

Ariadne: vehicle, boat and crate models from a document's data: package (cvcpkg) - #1369

Merged
transfix merged 5 commits into
masterfrom
feat/looks-from-data
Nov 20, 2026
Merged

transfix merged 5 commits into
masterfrom
feat/looks-from-data

Conversation

@transfix

@transfix transfix commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

The web gallery now fetches its vehicle, boat and crate models from cvcpkg.org at run time instead of bundling them with the demos. This replaces #1357's preload, which was reverted in #1361.

Models from a document's data: package

A document declares the package once, then names a file in it:

data:
  tactical_boat: { uri: cvcpkg://cy-pca/vehicle-tactical-boat, path: share/cvc-scenes/shared, load: lazy }
  crate:         { uri: cvcpkg://cy-pca/prop-wooden-crate,     path: share/cvc-scenes/shared, load: lazy }
...
look:  { data: humvee, file: Humvee.glb }               # a world vehicle archetype
model: { data: tactical_boat, file: TacticalBoat.glb }  # a boat node
model: { data: crate, file: WoodenCrate.glb }           # a geometry node (the crates)

Core (ariadne):

  • SceneData and Scene::data: the document's data: entries, filled by the loader, with relative sources made absolute.
  • A vehicle look's data: key needs file: and is fitted unless fit: false.
  • resolve_vehicle_looks copies the entry's uri and path: into the look (vehicle_look::uri, subpath). The look is then self-contained, so a client with no document (room_view, through room_entities) can draw it.
  • The catalog publishes look.uri and look.subpath.

cvcGL:

  • vehicle_model_state(app, cache, look, length): reports whether a look's model is ready, pending or failed.
    • It starts the package's load on the first ask.
    • A failed package stays failed. DataStore::load restarts a load in error, so polling with it would have re-fetched the package every frame.
    • When the package can't load, a local install of the file by its name is used.
  • World vehicles: drawn as boxes until their package has loaded, then drawn again with it. The vehicle preview does the same.
  • Boat node: model: { data, file }. It shows its hull while the package loads, and the model replaces the hull once ready.
  • Geometry node model:: draws a model in place of its own geometry, fitted into the box that geometry spans.
    • A .glb or .gltf file's +Y up is turned to +Z, and each axis is scaled to fill the box.
    • The base colour texture is drawn untinted.
    • The model goes in from a scene tick after realize_physics, so the node's body keeps its own shape: terrain_lab's crates float as their boxes and are drawn as the crate.
    • New functions: node_model_look, boxed_model_state and set_boxed_model. The boat's model: parsing now goes through node_model_look.

Documents and the gallery:

  • terrain_lab's launch uses the tactical boat package.
  • Its three crates use prop-wooden-crate: 8,692 triangles and a 2K base colour, published from cy-pca/graphics-assets#20 as 1.0.0+cvc.1.
  • world_lab's Humvee archetype uses vehicle-humvee.
  • The gallery's arigl boots with --net-allow https://cvcpkg.org (demos.json).

Not done here

  • cvcpkg.org CORS: the browser can't fetch from cvcpkg.org until it sends Access-Control-Allow-Origin for public reads. That server change is being handled separately. Until then the gallery draws the boxes and the hull, so it doesn't break.
  • Download caching: cvcpkg.org sends no immutable cache headers on versioned downloads. Browser caching of these downloads waits on that same server change.
  • room_view: carrying look.uri and look.subpath through room_entities is for the local-worlds work, which will call vehicle_model_state.

Tests

On Windows MSVC Release, on the merged tree (14a340a).

  • ariadne_scene_world_test AriadneWorldVehicles.LooksComeFromADataPackage: parsing, resolution, an unknown entry, data: needing file:, and relative sources made absolute.
  • cvcgl_ariadne_physics test_boat_model_from_data: the hull while loading, the model swapped in, and a missing package keeping the hull and reporting failed.
  • cvcgl_ariadne_physics test_node_model_from_data: a box at realize even with the model ready, a body each, the model fitted to the box from a package and from a file, and a missing data: entry keeping the box.
  • ariadne_loader_test and cvcgl_ariadne_realize pass.
  • End to end, native: arigl snapshots of terrain_lab with --net-allow https://cvcpkg.org and no local installs. They downloaded both packages, with archive sha256 matching the registry, and drew the launch as TacticalBoat and crate_b as the wooden crate.
  • Not checked: the browser, which waits on the CORS change above.

…ackage

A vehicle archetype's look and a boat node's model can name a file in a document data: entry's
package, so the web gallery fetches the models from cvcpkg at run time, not bundled with the
demos:

    data:
      tactical_boat: { uri: cvcpkg://cy-pca/vehicle-tactical-boat,
                       path: share/cvc-scenes/shared, load: lazy }
    ... look: { data: humvee, file: Humvee.glb }
    ... model: { data: tactical_boat, file: TacticalBoat.glb }

- scene.h: SceneData, the document's data: entries as the scene's looks name them; the loader
  fills Scene::data (and each scenes: entry's), relative sources made absolute.
- world_rules: a look's data: key (with file:, fitted unless fit: false); resolve_vehicle_looks
  copies the entry's uri and path: into the look (vehicle_look::uri, subpath), so it is whole
  without the document; the catalog publishes look.uri and look.subpath.
- vehicle_view: vehicle_model_state(app, cache, look, length) says whether a look's model is
  ready, pending (its package loading, started on the first ask) or failed; a failed package
  stays failed, and a local install of the file is used when the package does not load. World
  vehicles are drawn as boxes until their package has loaded, then drawn again with it; the
  vehicle preview likewise.
- boat_node: model: { data, file }; the boat shows its hull until the model is ready, then the
  model goes in in its place.
- terrain_lab's launch and world_lab's Humvee use the vehicle-tactical-boat and vehicle-humvee
  packages; the gallery's arigl may reach https://cvcpkg.org (demos.json --net-allow).
- Tests: AriadneWorldVehicles.LooksComeFromADataPackage; cvcgl_ariadne_physics
  test_boat_model_from_data (hull while loading, the model swapped in, a missing package keeps
  the hull and reports failed).
…wooden crate

A geometry node's `model:` draws a model in place of its own geometry, fitted into the box that
geometry spans: stood upright (a .glb/.gltf file's +Y up turned to +Z) and scaled on each axis to
fill it, its base colour texture untinted. The node's body keeps its own shape: the model goes in
from a scene tick, after realize_physics has made the bodies, so a crate floats as its box and is
drawn as the crate. `model:` is `{ data: NAME, file: FILE }` (a document data: entry's package,
loaded when the scene is realized; its own geometry until then, kept if it cannot load), a file,
or an installed model's name.

- vehicle_view: node_model_look (the boat's model: parsing, now shared), boxed_model_state and
  set_boxed_model; the fitted-model cache takes a fit (a vehicle's length or a box).
- scene_realize: draw_node_model for `type: geometry` nodes.
- boat_node: boat_look uses node_model_look.
- terrain_lab: data: crate (cvcpkg://cy-pca/prop-wooden-crate, published from
  cy-pca/graphics-assets#20) and model: { data: crate, file: WoodenCrate.glb } on its three crates.
- docs/ARIADNE.md: "Drawn as a model" under the bodies.
- Test: cvcgl_ariadne_physics test_node_model_from_data (a box at realize even with the model
  ready, a body each, the model fitted to the box from a package and from a file, a missing data:
  entry keeps the box).
@transfix
transfix enabled auto-merge (squash) November 19, 2026 21:57
The CI runner's temp directory comes as a short name (C:\Users\RUNNER~1\...),
which the loader resolves to the long one, so the plain path compare failed.
@transfix
transfix merged commit f50cb9f into master Nov 20, 2026
29 checks passed
@transfix
transfix deleted the feat/looks-from-data branch November 20, 2026 03:50
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