Repository navigation
volume_render: one volume, its renderer (VTK, volren, volslice) switched by a key - #1480
Merged
Merged
Conversation
…hed by a key
Joe asked to change which renderer draws a scene's volume in 3D, VTK's mapper,
volren or volslice, for any scene's volume.
- cvcGL VolumeRenderNode: one volume (a shared_ptr<const cvc::volume>, its
voxels shared, published as <node>.volume) drawn by a child VolumeNode,
VolRenNode or VolSliceNode that <node>.renderer picks (vtk, the default;
volren; volslice; none), replaced on the next tick when the key changes.
Each child is named for its kind, so its settings keys stay under
<node>.children.<kind>; a volren made again reads its settings back, and the
first one is lit (volren's default draws a black silhouette). A new volume is
handed to the renderer drawing; rendererVersion() moves on each make or hand.
- tf_binding: an optional model_key (empty: the node's own, as before) and
make_transfer_function, which registers a binding without adding a scene
tick, so a renderer swapped from inside a tick can be bound again.
- Ariadne type volume_render: source: { data | state | node } resolved into
<node>.source.volume and followed (as volume_grid's, by node, lastMod,
payload type and pointee); { node } takes its volume, else its grid.volume.
One binding for <node>.transfer_function at a time, made again for each new
renderer, so an edit carries over a switch; with none it keeps the range.
- volume_grid: display.render (none by default) draws the grid's own volume in
the 3D view through a VolumeRenderNode in the surfaces group the slice views
hide; the grid's single binding moves to that renderer, bound to the grid's
model, so the planes and the volume colour through one transfer function.
The Transfer function tab gets a 3D volume combo and the renderer's status.
- Demo examples/ariadne/documents/volume_render.ari: the bunny's SDF with a
Renderer combo and the transfer function editor.
The VolumeNode, VolRenNode and VolSliceNode classes and scene_realize's
built-in volume, volren and volslice branches are unchanged, so the built-in
types, terrain clouds and One World draw as before.
Tests: cvcgl_volume_render (the three renderers switched with the volume and
model carried over, none, a bad name, a new volume, { node } on a grid, the
grid's display.render, two apps; offscreen, each renderer draws), and
ariadne_loader_test's VolumeRenderDemoLoadsClean. Rerun and passing:
cvcgl_volume_grid, cvcgl_ariadne_volume_grid, cvcgl_tf_binding,
cvcgl_tf_editor, cvcgl_volren_node, cvcgl_volslice_node, cvcgl_ariadne_realize,
cvcgl_ariadne_scenes, cvcgl_ariadne_views, cvcgl_world_geometry_nodes,
cvcgl_physics_scene_binding, cvcgl_volume_slice, volume_grid_test,
multi_app_integration_test. The goldens are unchanged (display.render is none).
On D1 (#1446), volume_render drops its own copy of the follower and source parsing: volume_data_source names the source (a volume_grid realized before it by its grid.volume, else a node's volume), VolumeFollower follows <node>.source.volume and publishes <node>.volume, and wait_for_datasets keeps the scene's pending work while a dataset loads. A volren handed a new volume takes it through VolRenNode::setVolume, keeping its settings. cvcgl_volume_render 24/24, cvcgl_volume_grid, cvcgl_ariadne_volume_grid, cvcgl_shared_volume, cvcgl_tf_binding and ariadne_loader_test pass.
transfix
enabled auto-merge (squash)
November 23, 2026 06:47
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
…p9/volume-grid-segment VolumeGridNode keeps both the segmentation and the VolumeRenderNode: both includes, both forward declarations, both ticks; the surfaces group's comment (header and ARIADNE.md) names the volume, the contours' and the segments.
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.
Joe asked to be able to switch which renderer draws a scene's volume in 3D (VTK's mapper, volren or volslice) for any scene's volume, not only the volume_grid's. This is a P8 follow-up, built on D1 (#1446).
VolumeRenderNode: one volume (ashared_ptr<const cvc::volume>, its voxels shared, published as<node>.volume). It is drawn by a childVolumeNode,VolRenNodeorVolSliceNode, chosen by<node>.renderer(vtkis the default; alsovolren,volslice,none). The child is replaced on the next tick when the key changes.<node>.children.<kind>, and a renderer you switch back to finds them as it left them.VolRenNode::setVolume.tf_binding:model_keyandmake_transfer_function, so one model stays bound across a renderer swap. The swap happens from inside a tick.type: volume_render:source: { data | state | node }is followed with D1'svolume_data_source,VolumeFollowerandwait_for_datasets.<node>.transfer_function, so an edit carries over a switch.display.render(noneby default) draws the grid's own volume in the 3D view, through aVolumeRenderNodein thesurfacesgroup that the slice views hide. It is added after P10's contour curves and surfaces.examples/ariadne/documents/volume_render.ari.What doesn't change:
VolumeNode,VolRenNodeandVolSliceNodeclasses, and scene_realize's built-involume,volrenandvolslicebranches. So the built-in types, terrain clouds and One World draw as before. The One World session confirmed that its open stack touches none of this code.display.renderisnoneby default.Tests (Windows Release, local):
cvcgl_volume_render: the three renderers switched with the volume and model carried over,none, a bad name, a new volume,{ node }on a grid, the grid'sdisplay.render, and two apps. Offscreen, each renderer draws.ariadne_loader_test'sVolumeRenderDemoLoadsClean.cvcgl_volume_grid_contours;