Repository navigation
Ariadne views: two demos, per-view override:, and start angles for a view's camera - #1007
Merged
Merged
Conversation
…view's camera
Two example documents exercise the viewport widget:
- viewer_grid.ari: a 2 x 2 grid of views on one scene (front, side, a top-down
map, a close-up), each camera its own: drag, wheel, double-click to reset.
- viewer_looks.ari: one plaza four ways: wireframe, X-ray (see-through
buildings, the people picked out), a plan of the people and their paths only,
and a clay model.
What they need from the widget:
- override: { <node id | tag | "*">: { drawstyle, opacity, color, line_width,
point_size } }, merged in order over a node's subtree. A restyled actor is
drawn by a twin vtkActor with its own vtkProperty over the node's own mapper
(shader property and texture shared too), kept in step with the original
every frame, so no geometry is copied. Viewport::PropFilter now returns the
prop to draw (itself, a stand-in, or nullptr).
- azimuth: / elevation: / zoom: where an orbit camera starts once framed;
a double-click in the view frames it there again.
- caption:, and an outline while the pointer is over the view.
- clear_color: is one colour, not the scene's gradient.
- RealizedScene::tagged is now RealizedScene::nodes: every realized node, so
override: can name untagged nodes by id.
cvcgl_ariadne_views: 34 checks (twins share their original's mapper, "*" and a
tag entry merge, the main view's actors keep their look, the orbit starts at
the widget's azimuth / elevation).
…demos shadowed Shadows. Each viewport view now draws the scene's shadows: a receive-only pass chain (SceneGraph::makeShadowReceiverPass) that reads the maps the main renderer bakes. They are light-space, so any camera reads them; a mirror holds the same lights in the same order and draws after the main layer. A view remakes its pass when shadowReceiverKey() changes (shadows toggled, a new baker, a new softness); `shadows: false` opts a view out. A node a view leaves out still casts there, so the map views in the demos opt out. Named cameras. `scene: cameras:` declares cameras (mode, track, azimuth, elevation, zoom), each at <prefix>.viewers.<id>.camera. A viewport with `camera: <id>` draws from it, so a drag, the wheel or a double-click in any of them moves all of them; `camera: main` draws from (and moves) the main view's camera. A named camera is framed on the whole scene and its clipping range spans the scene. The widget's own camera mode is now `mode:`; `camera: orbit | fly | map | track` still means the mode. scene_view.ari takes `mode` and `camera` args. Demos: viewer_grid, viewer_looks and scene_views cast soft shadows (softness 3, 2048 maps); viewer_looks' Wireframe, X-ray and Clay share one camera. cvcgl_ariadne_views: 43 checks (two views on one camera move together and nothing else does; camera: main moves the main view; a view has a shadow pass, shadows: false none). Shadow suites, ari_golden, viewport suites pass.
…ew:, own-baked view shadows
Several scenes per document, on shared geometry (both ways, as asked):
A. Groups in one scene. `assets:` names meshes (a node's source: and fit:)
that any node draws with `source: { asset: <id> }`: read and fitted once
(SceneAssetCache, one per document in AriRuntime's adapter), the nodes
sharing cvc::geometry's copy-on-write buffers. `main_view: { show, hide }`
on the scene picks the tagged groups the main view draws: SceneViews takes
the others out of the main renderer for the length of its draw (StartEvent
/ EndEvent), so the views, which mirror it, keep them, and frames the main
camera on what it shows.
B. Scenes of their own. `scenes:` entries take every scene: key (nodes,
lights, shadows, background, cameras). AriRuntime's adapter realizes each
into a SceneGraph of its own (state <prefix>.scenes.<id>; binds share the
document's prefix) attached to a viewport of its own, `scene.<id>`, never
shown; a viewport with `scene: <id>` mirrors it (SceneSlot). While its
shadows are on and a view shows, the scene's viewport draws one pixel under
that view so its maps are baked; the views read them. A new document takes
the scenes down. SceneAdapter::realize_scenes (default: warn, unsupported).
Shadows: `shadows: own` gives a view a whole chain of its own
(SceneGraph::makeShadowPasses, factored out of installShadowPasses), baking
what that view draws, for a view that shows what the main view leaves out.
A view that names tags to show is framed on those nodes' world bounds.
Demos: viewer_scenes.ari (day, night, studio from one set of assets) and
viewer_groups.ari (a courtyard in the main view, a gallery in a viewport).
Tests: cvcgl_ariadne_scenes (21: one read per asset across scenes and shared
point buffers; a scene's own viewport, its views mirroring it, its
background and shadows, two views of one scene; main_view's pixels and the
props back after the draw; teardown); AriadneScene.AssetsScenesAndMainView.
…/ariadne-views-demos # Conflicts: # src/cvcGL/ariadne/scene_views.cpp
…/ariadne-views-demos # Conflicts: # inc/cvc/ariadne/scene.h # src/cvc/ariadne/loader.cpp
This was referenced Nov 7, 2026
Ariadne views: transform: overrides, volumes in views, shared VTK arrays, shadows in the demos
#1039
Merged
transfix
added a commit
that referenced
this pull request
Nov 7, 2026
… shared VTK arrays, shadows in the demos (#1039) The leftovers of #1007, and the docs for its components and demos. Overrides. An override: entry may move, turn and scale what it covers (`transform: { position, rotation, scale }`), in the frame of the node it names (a group scales about its own origin; a tag entry in each tagged node's frame; "*" in world space), and `mode: replace` starts over from the node's own look. Entries now apply in order, "*" included. `material: { color, opacity }` spells the look fields too. Volumes in views. A volslice node's slices face the camera they were swept for, so a view from its own camera draws slices of its own (VolSliceNode::viewProp: its own polydata and mapper over the node's shader property, property, textures and uniforms, GeometryNode::observeShaderInputs). A volren node is raycast for the main view and composited into its pixels, so no view draws it (it drew wrong from another camera, and not at all on camera: main). A `type: volume` node takes opacity (a second vtkVolume, with its own property and mapper, every opacity point scaled) and transform. Shared VTK arrays. An asset's nodes draw from the first node's points, cells, normals and texture coordinates (GeometryNode::shareArraysFrom, wired through SceneAssetCache::donors), so VTK uploads them once. Copy-on-write: updateVertices / updateNormals first give the writer arrays of its own, the donor included. Colours stay each node's own. Scenes' shadows. A scenes: entry's viewport stops drawing while the UI is hidden too (no widget walk), and on the first frame a view shows it again its maps are baked for whatever moved meanwhile, whatever its update_interval. Shadows in the demos: on in clip_planes, mesh_lab, fem_gallery and terminal_scene. A volume casts nothing into the scene's maps, so the volume demos get volren's own volumetric shadows instead: a new `volren: { shadows: true | { enabled, strength } }` key, on in volren_bunny and transfer_function. Docs: ARIADNE.md §5.1 (assets, scenes), §5.4 (volumes and shadows), §5.18 (the demos, transform / replace, volumes in views, shared arrays, the scenes' bake, limits), §6.5; the scene_view component takes scene, shadows and caption; examples/README.md lists the views demos; the browser gallery gets cards for the five (web/demos.json, thumbnails); roadmap §9.5 status. Tests: cvcgl_ariadne_views 56 (13 new: transform in a group's frame, replace, a volume's opacity stand-in, volslice and volren in own-camera and camera: main views); cvcgl_ariadne_scenes 29 (8 new: shared arrays and their copy-on-write, the bake on showing a scene again); AriadneScene. VolRenShadowsParse.
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.
Two new example documents use the
viewportwidget from #1005, and the widget gets what they need: per-view restyling (override:) and a starting angle for each view's camera.The demos
examples/ariadne/documents/viewer_grid.ariis a 2 × 2 grid of views on one scene: a bunny in a courtyard of coloured pillars.examples/ariadne/documents/viewer_looks.arishows one plaza four ways. It has buildings, a statue, people (taggedsim) and their planned paths (taggeddebug).The geometry is never copied. Each view draws the same mappers.
Widget changes
override:restyles nodes in one view only."*". It sets any ofdrawstyle(surface / wireframe / points),opacity,color,line_widthandpoint_size.vtkActorandvtkPropertyover the node's mapper, sharing the shader property and the texture too.Viewport::PropFilternow returns the prop to draw: the prop itself, a stand-in, or nullptr. It is new in Ariadne views: a viewport widget, and node tags: that pick what each view draws #1005, so nothing else uses it yet.Camera start:
azimuth:,elevation:andzoom:set where an orbit camera starts once the view is framed, through the camera's ownorbit.*state keys. A double-click in the view frames it there again.Smaller changes
caption:puts a label in the view's corner.clear_color:is now one colour. Before, the copied gradient won.RealizedScene::taggedis nowRealizedScene::nodes, which lists every realized node, so an override can name an untagged node by id.Docs: ARIADNE.md §5.18 (the new keys, an Overrides section, the limits) and the roadmap §9.5 status.
Tested (Windows, Release, cvcGL + arigl)
cvcgl_ariadne_views, 34 checks (was 28):"*"halves the opacity and keeps the node's colour, and a tag entry adds a blue wireframe on top;ariadne_loader_test220, withShippedExamplesDeclareWhatTheyNeedcovering both new documents.cvcgl_ari_switchandcvcgl_ari_golden34, the goldens unchanged.cvcgl_viewport,cvcgl_viewport_input,cvcgl_scene_renderer_facadeandcvcgl_ariadne_realize.arigl checkpasses on both, and I looked atarigl snapshotframes of each.Not run locally: pycvc and the wasm build.
Not in this PR
transform:overrides andmode: replace.volren,volslice) are drawn as they are, since an override restyles actors only.Since opening
a58fe6a: shadows in every view, named cameras, demos shadowed
SceneGraph::makeShadowReceiverPass) that reads the maps the main renderer bakes.shadows: falseopts a view out. A node a view leaves out still casts a shadow there, so the two map views in the demos opt out.scene: cameras:declares cameras, each withmode,track,azimuth,elevationandzoom, at<prefix>.viewers.<id>.camera.camera: <id>draws from that camera, so a drag, the wheel or a double-click in any bound view moves all of them.camera: maindraws from the main view's camera, and moves it.mode:.camera: orbit|fly|map|trackstill means the mode.scene_view.aritakesmodeandcameraargs.viewer_grid,viewer_looksandscene_viewscast soft shadows (softness 3, 2048-pixel maps).viewer_looks' Wireframe, X-ray and Clay views share one camera: turn one and all three turn.cvcgl_ariadne_viewsnow has 43 checks. They cover two views on one camera moving together while the main and other views stay put,camera: mainmoving the main view, and a view having a shadow pass except withshadows: false.cvcgl_shadow*/ city-sun shadow suites,cvcgl_ari_golden34, the viewport suites, loader 220 and runtime 258 all pass.9c62fb6: several scenes per document, on shared assets (both ways)
assets:names meshes, each a node'ssource:andfit:.source: { asset: <id> }.SceneAssetCacheper document. Its nodes sharecvc::geometry's copy-on-write buffers, but each node still builds its own VTK arrays.main_view: { show, hide }onscene:picks the tagged groups the main view draws.scenes:entries take everyscene:key: nodes, lights, shadows, background and cameras.<prefix>.scenes.<id>(binds share the document's prefix), attached to a viewport of its own (scene.<id>) that is never shown.scene: <id>mirrors it: that scene's props, lights, background and shadows.SceneAdapter::realize_scenesdefaults to a warning on hosts that draw one scene.shadows: owngives a view a whole shadow chain of its own (SceneGraph::makeShadowPasses, factored out ofinstallShadowPasses). It bakes only what that view draws, so a view that shows what the main view leaves out gets correct shadows.viewer_scenes.arihas three scenes (day, night and a studio) built from one set of assets, each with its own lights, background and soft shadows.viewer_groups.arishows a courtyard in the main view and a gallery in a viewport with its own shadows, plus a map of both.cvcgl_ariadne_scenes, 21 checks:AriadneScene.AssetsScenesAndMainView.cvcgl_ariadne_views43, the five shadow suites,cvcgl_ari_golden34 and the viewport suites all pass.arigl checkpasses on all five views demos, and I checked snapshots of each.