Skip to content

cvcGL: the camera's clipping-range fit no longer runs every mesh's pipeline - #1479

Merged
transfix merged 1 commit into
masterfrom
perf/cvcgl-clipping-range-bounds
Nov 23, 2026
Merged

transfix merged 1 commit into
masterfrom
perf/cvcgl-clipping-range-bounds

Conversation

@transfix

@transfix transfix commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

The camera (CameraController) re-fits its clipping range on each frame in which anything moved (applyNeeded: the scene's contentVersion). The fit (vtkRenderer::ResetCameraClippingRange) asks every actor for its bounds. A GeometryNode's mapper answered by updating its input's pipeline first, though its input is the node's own polydata: set once with SetInputData, changed in place, and with no pipeline above it. With two dozen moving vehicles on a city, that fit was most of the Ariadne runtime's frame (AriRuntime::frame, where CameraController::update runs).

What changed

  • GeometryNode's mapper is Static (vtkMapper::Static). Its bounds and its draws read the polydata as it is: vtkPolyDataMapper::GetBounds and RenderPiece skip only the pipeline update, and ComputeBounds (streaming nodes' beforeComputeBounds included) runs as before. Every GeometryNode, streaming ones too, wires its mapper to its own polydata in the constructor, and nothing reconnects it.
  • GraphicsNode::updateTransform no longer sets m_vtkTransform, a vtkTransform that nothing read. Each set rebuilt its concatenation (vtkTransformConcatenation), allocating and freeing VTK objects on every pose.

Measured

The bench is an Ariadne document with 24 posed vehicles on the small Austin data city, plus ribbons, links, markers and labels. rt.frame() was timed natively at 1/60 s frames, at 1280x720, with a scratch timer that is not in this PR. Measured on #1478's branch, which already makes the drain cheap, with only this change toggled, so the camera is what's left:

without this with this
rt.frame, wall time, two runs 5.2–5.8 ms (p50 4.8–5.3) 2.2–2.7 ms (p50 2.1–2.6)

Under callgrind, the clipping-range fit was 5.4 M of the frame's 7.8 M instructions before this change (GeometryActor::GetBounds → vtkAlgorithm::UpdatePiece, per actor per frame); with it, 0.69 M of 2.98 M. It is 5.4 M of 15.9 M on master too.

Tests

  • cvcgl_camera_idle already pins the fit's correctness: the range re-fits to a mesh replaced in place, a node moved, added, shown and hidden, and a streaming node's growing box. It passes, as does the rest of cvcGL's ctest.
  • Locally, the only cvcGL failures are this machine's: no cvc::planar (the contour tiler) and the goldens' GPU pixel counts. They are the same with and without this change.

…peline

The camera re-fits its clipping range on each frame in which anything moved, and the fit asks
every actor for its bounds. A GeometryNode's mapper answered by updating its input's pipeline
first, though its input is the node's own polydata, changed in place, with no pipeline above it.
With two dozen moving vehicles on a city that was most of the Ariadne runtime's frame. The mapper
is now Static (vtkMapper::Static): its bounds and its draws read the polydata as it is.

GraphicsNode also stops setting a vtkTransform on every pose that nothing read; each set rebuilt
its concatenation, allocating and freeing VTK objects.
@transfix

Copy link
Copy Markdown
Owner Author

I've taken this PR over. It came from a session that stood down when the runtime frame went to #1477; that session closed its own duplicate, #1478.

This is part of the cheaper runtime frame Joe approved to merge when green. It's separate from #1477 and touches none of its files. It goes into 4.0.6 with #1477.

What I checked:

  • Every GeometryNode mapper is fed by SetInputData with the node's own polydata.
  • Nothing reconnects those mappers or puts a pipeline above them.
  • The one VTK filter pipeline in cvcGL, swarm_nodes.cpp's decimator, runs offline.
  • Nothing read m_vtkTransform.

@transfix
transfix enabled auto-merge (squash) November 23, 2026 06:47
@transfix
transfix merged commit 7949692 into master Nov 23, 2026
33 checks passed
@transfix
transfix deleted the perf/cvcgl-clipping-range-bounds branch November 23, 2026 10:45
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.
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