Repository navigation
Ariadne shell SH2: viewport views drawn into textures, so windows stack over them - #1500
Merged
Merged
Conversation
… (shell SH2) An Ariadne `viewport` widget's view used to be drawn into the window's frame under all of the UI, with a hole cut in its window's background, so any window over the view's rect covered it, even one behind the view's window, and the view's first frame was opaque. Each view now draws into a texture of its own (Viewport::setTextureSize, texture()), the widget's size in framebuffer pixels, at the window's own multisampling and resolved as the window's pixels are; the widget draws that texture as an image in its window. The window stacks, clips and scrolls the view like any of its content. The view draws in the window's render after the widget walk placed it, so its first frame shows it: the mirror re-syncs and the throttle (refresh_hz) decides as the render reaches it, and a view made this frame is readied (what it leaves out, its shadows, its framing) by its widget. Picks, pointer probes and the wheel map a point on screen to the view's texture (Viewport::windowToRenderer / rendererToWindow). A scenes: entry's anchor bakes its shadow maps by drawing one pixel into a texture of its own. ImGuiBackend::cut_window_background and its background painting go. Tests: cvcgl_ariadne_view_stacking (a window over a view, a view's window over another window, the first frame, a clipped and a scrolled view against the same picture in full, a pick through the scroll), the view_stacking golden, and the pick and slice-view tests through the new coordinate mapping. cvcgl_ari_frame_bench measures a document's frame cost offscreen. The arigl-web CI job now also runs on changes to how a view draws.
…ed; docs for SH2 syncMirrorProps took every prop out of a mirror and put it back every frame, and the next draw of those props was slower for it. With views now re-synced just before they draw, each view paid that: on viewer_grid.ari a view's draw took 1.6 ms instead of 0.4. The mirror is now left alone when it already holds exactly the props and lights it should draw (same ones, same order), which also takes the cost off the main view where the old order put it. ARIADNE.md 5.18: how a view draws (a texture its window shows), its refresh rate (moving it does not redraw it), a scenes: entry's anchor, what it costs, and the limits (the view under the UI and the opaque first frame are gone). The UI-DSL roadmap's render-to-texture tier notes that rendering a view into a texture is built.
…uad with views drawn into textures Written under Mesa 25.3.6 llvmpipe (cvcpkg's Windows build; it matches the grid, menus, scene, widgets and windows goldens to the pixel). view_stacking is new: a window over a view, a view's window over another window, a clipped view. The other three change around their views: the view's window now shows its border, resize grip, scroll bars and tab-bar separator, which the old background painting around the hole covered, and in volume_grid a slice view's caption that runs past its view is covered by the view beside it. Inside the slice views a few nearest-sampled texels at ties land on the other side under llvmpipe, the view being rasterized at its texture's origin rather than at its place in the window (none on an NVIDIA GPU).
… the view's texture A view's renderer draws into its texture now, so its display coordinates are the texture's pixels; the test maps them to the window (rendererToWindow) before it moves the pointer there, as the pick and slice-view tests do.
…tingUniformsEveryRender) The renderers of a window share its shader programs, and VTK 9.5 keeps a program's light uniforms with only the time they were set (vtkOpenGLRenderer::UpdateLightingUniforms), not whose lights they are. A view and the main view draw the same props, so one of them could draw with the other's lights; which one depended on the order of VTK's modified times, and differed between Linux and Windows. cvcpkg's VTK 9.5.0+cvc.7 (cy-pca/cvcpkg#636) adds an opt-in vtkOpenGLRenderer::UpdateLightingUniformsEveryRender. A compile check (CVC_VTK_HAS_LIGHTING_UNIFORMS_EVERY_RENDER, as for FinishEveryRender) finds it, and Viewport turns it on for every renderer it makes: the main view's, the views', mirrors. An older VTK builds and renders as before. cvcgl_ariadne_view_stacking compares the main view with a window's view and without it (a see-through shell around a box the view shows from its own camera): with the property it checks they match; without it, it reports how many pixels differ (11,667 of 434,700 here, NVIDIA). ARIADNE.md 5.18 lists the older-VTK behaviour as a limit.
…nt to the window master's module-view checks (#1493) took the view's renderer display point as the window's; the view draws into its texture now, so it goes through rendererToWindow, as the test's other sections do.
transfix
added a commit
to cy-pca/cvcpkg
that referenced
this pull request
Nov 23, 2026
…ightingUniformsEveryRender (#636) vtk-renderer-lighting-uniforms-every-render.patch adds vtkOpenGLRenderer::UpdateLightingUniformsEveryRender (default off: VTK renders as before). The renderers of a render window share its shader programs, and UpdateLightingUniforms() caches light uniforms per program by time alone, so a renderer whose lights and camera are older than another renderer's draws with that renderer's lights. On, UpdateLights() counts the lights as modified at the start of every render, so each program gets the renderer's light uniforms once per render. The patch header is written for VTK's reviewers and carries a VTK-style test (TestLightingUniformsEveryRender). libcvc turns the property on for its viewports' renderers (transfix/libcvc#1500).
…ldens on VTK 9.5.0+cvc.7 UpdateLightingUniformsEveryRender moves from Viewport's constructor to ViewportManager, which turns it on for every renderer of a window once the window has a second one, and leaves it on when a view goes (the view's lights may still be in a program). A window that only ever had one renderer keeps VTK's default: nothing else writes its programs' lights. With the property on, VTK sends a program's lights in the first cell-type block that uses it each render; cvcgl_lowmem_fastdraw derives Fast's trace by deleting empty blocks from the AllCellTypes trace, so it could not see those uploads move to the next block (its uniform-state and pixel checks held). Its single-renderer window is back on VTK's default. cvcgl_ariadne_view_stacking checks the property is on for both renderers with a view, and off for the main view alone. Goldens from CI on vtk 9.5.0+cvc.7 (Linux release and release-grpc, identical to 1 LSB). Against the same commit on cvc.5 (Windows), only renderers that drew with another's lights change: the main view in view_stacking, skeleton and molecule_skeleton, and 23 px of the 3-D view in volume_grid_contours.
docs/ARIADNE.md 5.18 limits: master's volren line kept (a volren takes no restyling); the view no longer lies under the whole UI, so that limit stays removed.
…s' box A view without show: was framed on whatever its renderer held: the props ViewportManager primed it with before SceneViews set the view's filter, until the render re-synced it. With a volren that is the main view's picture quad, which spans the main camera's frustum (+-145 in volren_views), so the views framed far out; SH4's golden encodes that, and its zoom: 1.7 was set against it. The view's own picture of a volren (VolRenViewActor, bounded by the volumes' box) joins the renderer only once its first raycast lands, after framing. - ViewportManager::syncMirror(name): a live mirror's re-sync through its filter, now. SceneViews::prepare runs it before framing, so the renderer holds what the view will draw (also what it leaves out: chrome, tags). - The bounds of a view without show: take in each volren node it draws by its volumes' box, known from the first frame. - volren_views.ari drops zoom: 1.7: framed on the rods and the volume's box, its views look as the golden composed them. The golden itself is retaken from CI on vtk 9.5.0+cvc.7 (its rods draw with each view's own lights). - cvcgl_ariadne_node_pick (#1491) maps the view's points through rendererToWindow, as the other pick tests do. Under llvmpipe every other golden's frame is pixel-identical before and after.
…adow cache) Conflict in ViewportManager.cpp: master's #1503 copies a scene's image-based lighting into a mirror; SH2 syncs a mirror's lights only on a change. Both kept, the lights first, then the environment.
…0+cvc.7) Its views are framed on the rods and the volume's box (42eed3b), with zoom: 1.7 dropped from the document, so they keep SH4's composition; the windows show their border and grip over their views; the main view's rods draw with the main view's own lights. From CI run 45326238844 (Linux libcvc-release); Windows's frame is within 3 of it.
Conflict in ci.yml's arigl-web gate: master's #1476 runs it when the clipboard changes, SH2 when how a viewport widget's view draws changes. Both kept.
Conflicts: src/cvcGL/CMakeLists.txt's 8 MB-stack list keeps both sides' tests; volume_grid, volume_grid_contours and volume_grid_quad take master's images (#1452 changed their documents) until CI's frames of the merge are taken.
The timeout counts from before the document loads, and its message names the test only once the test has started. On a slow runner a Debug build spent the whole second loading, so the message had no test in it: the debug lane failed this test on master (f32ae43) and on several branches, while it passed in about 3 s on others.
#1524's package-linux / libcvc-debug failed ExecPool.PL05_ALightGroupIsNotStarved three times: a message's latency was 2 heavy pumps (1 or 2 of 100), against at most the one in progress. The pool's virtual time is pump time, and at the default 2 ms budget a step slowed past it (steps of 2-3 ms were logged in both groups on that runner) ends a light pump before its program takes the message, which then waits out a heavy pump more. A probe with a 20 us budget shows the same latencies here. The case now pumps 20 ms with unbounded steps, so every build's heavy pump takes the whole budget and a light pump outlasts a slow step: 40 of 40 as 4 copies sharing 2 cores, 10 of 10 alone. A steps-only budget was tried and dropped: a light pump could then run long, and a descheduled one put the light group tens of heavy pumps behind (latencies of 12 to 107 under the 2-core squeeze). (cherry picked from commit 67fda68, #1524: the same flake failed #1500's recipe / ubuntu-22.04 / Debug three times at a651d0c)
volume_grid, volume_grid_contours, volume_grid_quad and #1452's volume_grid_segment, from CI run 45482759652 (Linux libcvc-release, vtk 9.5.0+cvc.7). Against SH2's previous images only #1452's panel differs (the Segmentation tab, names and hex colours); against master's, SH2's changes: a view's overlay text stops at its view, a view drawn in its window's order covers the tab bar's rule, and the windows show their border and grip. volume_grid_segment's Bones view is unchanged (within 1).
From ci/full run 45572393826 at 59220fb (package-macos / libcvc-release, vtk 9.5.0+cvc.7; the debug, release-grpc and release-grpc-static lanes' frames are within 1 of it). orthoslicer (a refresh: the view's window shows its border and grip, and the slices' tied texels), view_stacking (new) and volren_views (new: its views are framed on what they draw) change with SH2 itself. skeleton, molecule_skeleton, volume_grid, volume_grid_contours, volume_grid_quad and volume_grid_segment already failed on master's macOS lane; SH2 re-renders them too, so their macOS images are taken at SH2's rendering. #1526's images for these seven are taken at master's and differ from SH2's frames by 2,414 to 16,792 px; its contour_tiler.macos.png is unaffected.
transfix
added a commit
that referenced
this pull request
Nov 25, 2026
#1500 (7480610) re-rendered skeleton, molecule_skeleton, volren_views and the four volume grids for its viewport textures, Linux and macOS goldens both. Those seven .macos.png conflicts take master's side; contour_tiler's stays from this branch. ARIADNE.md and the test's comment name view_stacking's macOS golden too.
This was referenced Nov 25, 2026
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.
Phase SH2 of the Ariadne shell design (
docs/roadmap/ARIADNE_SHELL.md§4.4, "Views drawn into textures"; table row SH2 in §5): everyviewportwidget's view draws into a texture of its own, which its window draws as an image, so windows stack over views correctly. The shell's scene windows (SH3) need this. Every viewport in every document gains from it.The problem
A view was a mirror viewport drawn into the window's frame under all of the UI. Its window got a hole cut in its background (
ImGuiBackend::cut_window_background). ImGui draws every window after the scene, so any window over the view's rect covered it, even a window behind the view's window. The view's first frame was opaque, because the hole came a frame late.What changed
Viewport::setTextureSize(w, h)(cvcGL) draws a viewport into a colour texture of its own instead of into its rect of the window;texture()gives the GL name for a UI to draw.windowToRenderer/rendererToWindowmap a point on screen to the texture and back.refresh_hz) keeps its last picture in the texture. It decides whether it is due, and a mirror re-syncs, as the window's render reaches it (from the renderer's delegate). So a size or a show set by the widget walk inside that render takes effect in the same frame.viewportwidget (scene_views.cpp) sizes the texture to its rect in framebuffer pixels, puts the region where the whole widget is, and draws the texture as an image. No hole is cut. A view made in this frame's walk is readied right away (what it leaves out, its shadows, its framing, as the nextupdate()would), so its first frame shows it. Picks, pointer probes and the wheel land in the view's texture.syncMirrorProps) leaves the mirror alone when it already holds exactly the props and lights it should draw. It used to take every prop out and put it back every frame, and the next draw of those props was slower for it. Measured on viewer_grid.ari: a view re-synced just before it draws took 1.6 ms a draw instead of 0.4. Before this change the main view paid that once a frame; drawing views from the render would have made every view pay it. Now nobody pays it, so documents with views are cheaper than before (numbers below).scenes:anchors bake their shadow maps by drawing one pixel into a texture of their own, instead of a pixel in the window under a view.ImGuiBackend::cut_window_backgroundand its background painting are removed. That painting also covered the window's border, resize grip, scroll bars and tab-bar separator; those now show as on any window.vtkOpenGLRenderer::UpdateLightingUniformsEveryRender. A compile check,CVC_VTK_HAS_LIGHTING_UNIFORMS_EVERY_RENDER(same pattern asCVC_VTK_HAS_FINISH_EVERY_RENDER), finds it.ViewportManagerturns it on for every renderer of a window once the window has a second one, and leaves it on if a view goes (that view's lights may still be in a program). A window that only ever had one renderer keeps VTK's default: no other renderer writes its programs, and VTK sends its lights only when they change. An older VTK builds and renders as before.show:was framed on whatever its renderer held: the propsaddMirrorViewportprimed it with, before SceneViews set the view's filter. With avolrennode that is the main view's picture quad, which spans the main camera's frustum, so views framed far out (master has this too; SH4'svolren_viewsgolden encoded it).ViewportManager::syncMirror(name)re-syncs a view through its filter just before SceneViews frames it, and a view withoutshow:takes in each volren node it draws by its volumes' box (its own picture of the volren joins the renderer only once its first raycast lands, after framing). Under llvmpipe every other golden's frame is pixel-identical before and after.show/hide/bind,override:twins and transforms,camera:(named andmain),mode:(orbit, fly, map, track, slice),shadows: true|own|false,chrome,clear_color,refresh_hz, input (drag, wheel, double-click,input: pick,pointer), views ofscenes:entries, andvolsliceper-view slices (viewProp(renderer)keeps working; the filter now runs just before the view's renderer draws, inside the window's render).Tests
cvcgl_ariadne_view_stacking. It checks pixels directly, so it works on any rasterizer.UpdateLightingUniformsEveryRender, the test checks it, and checks the property is on for both renderers with the view and off for the main view alone. Without it, it reports the difference: 11,667 of 434,700 pixels here (NVIDIA, today's VTK).cvcgl_lowmem_fastdrawfailed 18 of 290 checks on cvc.7 while every renderer had the property on. With it, VTK sends a program's lights in the first cell-type block that uses the program each render; when Fast skips an empty block, the next block sends them. The test derives Fast's trace by deleting empty blocks from the AllCellTypes trace, so it can't see uploads move. Its uniform-state and pixel checks held. Its window has one renderer, so it is back on VTK's default.view_stacking.ari(cvcgl_ari_golden): a window over a view, a view's window over another window, a clipped view.cvcgl_ariadne_pick,cvcgl_ariadne_slice_viewandcvcgl_ariadne_volume_gridproject world points through the view's renderer. Those are now texture pixels, so the tests map them to the window withrendererToWindow. Their checks are unchanged.ctest -R "^cvcgl_|Ariadne|SceneView|Viewport", 1219 tests. All pass except three, which fail the same way with master's build on this machine:cvcgl_contour_labandcvcgl_volume_grid_contours: this build has no cvc::planar.cvcgl_ari_golden: NVIDIA against the llvmpipe goldens. Under llvmpipe, every golden this build can draw matches: grid, menus, orthoslicer, scene, view_stacking, volume_grid, volume_grid_quad, widgets, windows. contour_tiler, skeleton, molecule_skeleton and volume_grid_contours need cvc::planar or mesh_lab.cvcgl_tf_binding,cvcgl_ariadne_view_stacking,cvcgl_ariadne_swarm) failed only when run eight at a time on one GPU; each passes alone.UpdateLightingUniformsEveryRender):cvcgl_ariadne_view_stacking,cvcgl_lowmem_fastdraw,cvcgl_ariadne_pick,cvcgl_viewport,cvcgl_viewport_inputandcvcgl_viewport_refreshpass.cvcgl_ariadne_node_pick(Ariadne: a scene node's own on_pick: #1491, from master) maps the view's points throughrendererToWindow, as the other pick tests do.scene_views.cpp's named cameras keep master's fixednear:/far:(Ariadne: authored viewpoints for scene cameras #1495), and the first frame of a new view honours them too. Master's module-view checks incvcgl_ariadne_pick(Ariadne viewport: pick:, pointer: and axis: resolve in the widget's mount scope #1493) now map the view's point throughrendererToWindow, as the test's other sections do.ViewportManager.cppkeeps SH2's mirror light sync (only on a change) and adds Ariadne: physically based materials and the scene's environment #1503's copy of the scene's image-based lighting after it; ci.yml's arigl-web gate runs on both ariadne: a context menu on text in every backend: Cut, Copy, Paste, Select all (§5.28) #1476's clipboard files and SH2's view-drawing files (CRLF kept; only SH2's lines differ from master). Locally after both: 18 view, pick, viewport, PBR, shadow and lowmem tests pass (cvcgl_ariadne_pbrwith rendering required: the viewport's mirror gets the scene's environment), and of 137 tests for ariadne: a context menu on text in every backend: Cut, Copy, Paste, Select all (§5.28) #1476 and the runtime (cvcgl_imgui_context_menu, entities, physics, menus, widgets, windows, AriadneRuntime, AriadneLoader), 134 pass and 2 skip;cvcgl_imgui_context_menufails here only because this desktop session has no Win32 clipboard (PowerShell'sSet-Clipboardfails too), and it passed on ariadne: a context menu on text in every backend: Cut, Copy, Paste, Select all (§5.28) #1476's Windows CI.volume_grid,volume_grid_contoursandvolume_grid_quadconflicted with volume_grid: the Segmentation tab, labels on the slices, class surfaces in 3D (P9) #1452's images and were retaken from CI (below). Locally 26 SH2-related tests pass, master's animation, prototypes, volume_grid_segment and sdl_attach among them.AriTest.FramesAndTimeout(package-linux / libcvc-debug) gave its stuck document 1 s, andari test's timeout counts from before the document loads, so a slow runner's Debug build never started the test and the message lacked "in test 'waits'". It failed master's debug lane at f32ae43 and other branches too; a651d0c gives it 4 s (ariunchanged: the docs define--timeoutas the whole document's time), and it passed in 4.6 s on the next run. Master's world: a data node's world dataset draws with the generated-world renderer (GB3 part 2) #1508 then fixed the same flake with 5 s, and merging master (59220fb, with Ariadne: a model file's own animation (clips, skins, morph targets) #1520 and CoPH's cars take a new goal after arriving, and run on world documents (C6 part 2b) #1517) kept master's version, so this PR no longer changes that test.ExecPool.PL05_ALightGroupIsNotStarved(recipe / ubuntu-22.04 / Debug, 3 of 3) is the state-exec owner's fix from state_exec: threaded execution's S2b, the router and process control across groups #1524, cherry-picked as 94579e5 (pumps of 20 ms with unbounded steps; 10 of 10 here).Goldens that change, and why
The pixels inside every view are unchanged. Comparing old and new captures of the same documents on one machine: 0 pixels differ inside the views of cvcgl_ariadne_views' frame, and 1 pixel by 1. What changes is the UI around the views, which the old background painting covered:
orthoslicer,skeleton,molecule_skeleton,volume_grid,volume_grid_contours,volume_grid_quad: the view's window now has its border and resize grip; volume_grid's tab-bar separator and scroll bars show; and in volume_grid_contours the slice view's caption, which ran past its view, is now covered by the 3-D view beside it (later content in a window draws over earlier content).orthoslicer.macos.pngfor the same reason.orthoslicerand the newview_stackingwere written under Mesa 25.3.6 llvmpipe, cvcpkg's Windows build, which matches the grid, menus, scene, widgets and windows goldens to the pixel.skeleton,molecule_skeleton,volume_grid_contoursandview_stackingare taken from CI on vtk 9.5.0+cvc.7 (run 45285925180, Linux release and release-grpc lanes, identical to 1 LSB). Against the same commit on cvc.5 (that run's Windows lane), only renderers that had drawn with another renderer's lights change: the main view in view_stacking (its box and sphere had the views' lights; about a fifth of the frame), the main view's surface and sheets in skeleton and molecule_skeleton, and 23 px of volume_grid_contours' 3-D view. The views in view_stacking's, skeleton's and molecule_skeleton's windows are unchanged. volume_grid_contours also changes around its window, as described above. The cause is in VTK, and master has it too:vtkOpenGLRenderer::UpdateLightingUniforms(9.5.0, unchanged on VTK master) skips the upload when the renderer's lights and camera are older than the time the shader program last received lighting uniforms. Every renderer in the window shares those programs, so a renderer can draw with another renderer's lights. The old skeleton goldens show the main view lit with the window view's lights. Drawing views into textures changes which props get the wrong lights, and the order of VTK's modified times now differs between Linux and Windows. A stand-in on llvmpipe (translucent mesh in the main view, a tagged sphere in a window's view) compares the main view with and without the window view: 74k pixels differ on master, 28k on this branch, and 0 when each renderer's camera is touched just before it draws (a throwaway experiment, not part of this PR). The fix is in cvcpkg's VTK (vtk cvc.7 (and vtk-python): opt-in UpdateLightingUniformsEveryRender for renderers that share a window cy-pca/cvcpkg#636, vtk 9.5.0+cvc.7), and this PR turns it on for windows with views (commits 198a9f9 and f7da550). CI installs the catalog's latest VTK. The other view goldens (orthoslicer, volume_grid, volume_grid_quad) match on cvc.7 as they were.volume_grid,volume_grid_contours,volume_grid_quadand volume_grid: the Segmentation tab, labels on the slices, class surfaces in 3D (P9) #1452's newvolume_grid_segmentare from CI run 45482759652 (Linux libcvc-release, vtk 9.5.0+cvc.7), after master's volume_grid: the Segmentation tab, labels on the slices, class surfaces in 3D (P9) #1452 changed their documents. Against SH2's previous images only volume_grid: the Segmentation tab, labels on the slices, class surfaces in 3D (P9) #1452's panel differs (the Segmentation tab, names and hex colours); against master's, SH2's changes as above: a view's overlay text stops at its view, a view covers the tab bar's rule, the windows' border and grip.volume_grid_segment's Bones view is unchanged (within 1). On the next run (45498184143, 997b46b) package-linux and package-windows libcvc-release both passed, so all four match on Windows too.volren_views(SH4's golden) changes for three reasons: its views are now framed on the rods and the volume's box rather than on the main camera's picture quad, so itszoom: 1.7(set against that framing) is dropped and the views look as the golden composed them; the windows show their border and grip; and its rods draw with each renderer's own lights (the main view's rods had a view's). Retaken from CI run 45326238844 on vtk 9.5.0+cvc.7 (Linux libcvc-release; the Windows lane's frame is within 3 of it). On that run every other golden matched on both Linux and Windows,volume_grid_contoursincluded (Windows within 1, where cvc.5 differed by about 30 px), andcvcgl_lowmem_fastdrawpassed.macOS (3de7b0b):
.macos.pngimages for the nine documents SH2 re-renders, from ci/full run 45572393826 at 59220fb (package-macos / libcvc-release on vtk 9.5.0+cvc.7; the debug, release-grpc and release-grpc-static lanes' frames are within 1 of it).orthoslicer(refreshed),view_stackingandvolren_viewschange with SH2 itself.skeleton,molecule_skeleton,volume_grid,volume_grid_contours,volume_grid_quadandvolume_grid_segmentalready failed on master's macOS lane (as didvolren_viewsandcvcgl_imgui_context_menu); SH2 re-renders them, so their images are taken at SH2's rendering. macOS CI: contour_tiler's macOS golden, Cmd+Z in the context-menu test, ci/full for new goldens #1526 (open) adds macOS images for master's failures: its images for seven of these match master's macOS frames but differ from SH2's by 2,414 to 16,792 px, and itscontour_tiler.macos.pngis unaffected. Whichever of the two merges second keeps this PR's seven images and macOS CI: contour_tiler's macOS golden, Cmd+Z in the context-menu test, ci/full for new goldens #1526's contour_tiler image and test changes. These images are that run's own frames, so against them its macOS lanes would fail onlycontour_tileramong the goldens, pluscvcgl_imgui_context_menu(both master's, both fixed in macOS CI: contour_tiler's macOS golden, Cmd+Z in the context-menu test, ci/full for new goldens #1526); not yet confirmed by a macOS run with the images in place.Under llvmpipe, a few of the slice views' nearest-sampled texels that sit exactly on a tie land on the other side. The view is now rasterized at its texture's origin rather than at its place in the window. Under an NVIDIA GPU the slice views are identical to before.
One more difference, in no golden: wide lines (
line_width> 1) inside a view rasterize a little differently at their anti-aliased edges (viewer_looks' wireframe view, up to 73 in a channel on a few hundred pixels), now that the view draws at its texture's origin.Cost
Measured with
cvcgl_ari_frame_bench(new in this PR): the document runs through AriRuntime + ImGuiBackend offscreen at 1280×800, each frame timed until the GPU has finished it (WaitForCompletion); 60 warm-up frames, then 3 rounds of 300. The old build is master (e1890d0) with the same bench source. The two builds were run alternately, twice through the set, on Windows / MSVC Release / RTX 4070. Medians in ms per frame, pass 1 / pass 2:Every document is cheaper. Most of the gain is the re-sync fix above, which the old window path would have gained too. The texture's own cost is small:
Render(), viewer_grid with view shadows off: 0.40 ms in the texture, 0.39 ms in the window before.My first version re-synced the mirror's props, the old way, just before each view drew, and that cost about 1.2 ms per view per frame (viewer_grid 15 → 20 ms). That is what led to the re-sync fix.
arigl snapshotcan't be used for this: it paces its frames to--fps(20 a second by default).arigl-web (WebGL2)
The arigl-web CI job now runs on changes to how a view draws, and passed on this PR, including its orthoslicer, volume_grid and volume_grid_contours cases. I also served this run's
arigl-webartifact locally and opened it in a browser (WebGL2):view_stacking: the windows stack over the views as designed. Cover's window hides part of Under's view, Over's view draws over Behind's window, and the clipped view stops at its window's edge with a scroll bar.orthoslicer: the slice view draws in its window and redraws when its axis is switched.volume_grid_contours: both views draw, and the document's own clicks in the slice view land (its status reads "closed a curve of drawn on z = 16").The FBOs mirror the window's own render framebuffer (VTK's choice of multisampled textures or renderbuffers, depth bits, stencil). A multisampled renderbuffer resolves to the single-sampled RGBA8 texture by a blit of the same rect, as WebGL2 allows. If the gamma-resolve shader cannot compile (GLSL ES 3.00 has no sampler2DMS), it falls back to the blit once and doesn't retry.
Coordination
scene_views.cpp. Its three lines inView::draw's volume branch don't overlap my edits; whichever merges first, the other rebases. ItsVolRenNode::viewPropassumptions all hold (notes are in the shell sessions' shared folder).scene_views.cpp; I'll rebase if they land first.ARIADNE.md§5.18: "How it draws", "Refresh rate", the scenes' anchor, and the limits list are updated. The view under the UI and the opaque first frame are no longer limits. The roadmap's render-to-texture tier (§9.9.13) notes that rendering a view into a texture is built.Not to be merged without Joe's OK.