Repository navigation
viewport: refresh_hz, a throttled inset shows its last pixels between draws - #1247
Merged
Merged
Conversation
… draws A viewport widget, or any inset Viewport, drew its scene again in every frame; a mirror of the main view draws every node a second time. Viewport::setRefreshHz(hz) draws it at most hz times a second and shows its last picture in between, and the Ariadne viewport widget takes it as refresh_hz:. - Viewport keeps its last draw: its EndEvent blits the rect into a window-sized colour texture, and a vtkRendererDelegate draws that texture as a quad in the renders between (multisampled windows included), clearing the rect's depth as the renderer would. - ViewportManager::render() asks each viewport whether it draws this frame; one showing its last pixels skips its mirror re-sync too. - It draws at once on a new rect or window size, on being shown again and on invalidate(); a translucent viewport draws every frame whatever the rate. The widget also invalidates when what it shows changes and while the pointer drags, wheels or picks in it, and for three frames after. - docs/ARIADNE.md: refresh_hz and a "Refresh rate" paragraph. - Tests: cvcgl_viewport_refresh (new); cvcgl_ariadne_pick runs its pick view at refresh_hz: 2.
transfix
enabled auto-merge (squash)
November 15, 2026 02:10
transfix
added a commit
that referenced
this pull request
Nov 15, 2026
- app_runtime.cpp: the constructor hands the scene its repeat: count function (#1230), then takes the verb table's lock as before. - e2ee_intrinsics.cpp (#1191): the e2ee-* provider registers its async functions on the calling program's host (*ictx.host, else the app's), as every provider on this branch does (B30), so an isolated document's e2ee-backup and e2ee-restore park on its own group. - STATE_EXEC_THREADED.md: the e2ee provider in the provider table and the file list.
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.
A
viewportwidget (or any insetViewport) draws its scene again in every frame. A mirror of the main view draws every node a second time, with its own camera, so a map beside a busy scene can cost as much as the scene itself.refresh_hz:draws it at most N times a second and shows its last picture in between.What it adds
Viewport::setRefreshHz(hz)(Viewport.h), withrefreshHz(),invalidate()anddraws(). 0, the default, draws the viewport in everyViewportManager::render(), as before.vtkRendererDelegatedraws that texture as a quad, texel for pixel, in place of the scene. It clears the rect's depth, as the renderer would. A quad and not a blit, because GLES and WebGL 2 cannot blit into a multisampled framebuffer.ViewportManager::render()asks each viewport whether it draws this frame. One showing its last pixels skips its mirror re-sync, the per-prop filter pass, as well as its draw.setVisible, or the layout state), andinvalidate().setBackground(..., opaque = false)draws every frame whatever the rate, since its last pixels would freeze what is under it.refresh_hz:on the Ariadneviewportwidget (scene_views.cpp). The view also draws at once:show,hide,chrome,camera,shadows,overrideor starting camera change;Picks were already a geometry ray cast (
vtkCellPicker), so they test the scene as it is, not the last picture.Docs: ARIADNE.md, the
refresh_hzrow and a "Refresh rate" paragraph under the viewport widget.Tests (local, Linux, offscreen)
cvcgl_viewport_refresh(new, 40 checks): a mirror inset over a red base, run once with no multisampling and once with 4 samples.invalidate(), a move, the time passing and being shown again draws it.cvcgl_ariadne_pick: its pick view now hasrefresh_hz: 2, so every existing pick check runs on a throttled view.cvcgl_viewport,cvcgl_viewport_input,cvcgl_ariadne_views,cvcgl_scene_renderer_facade, and the rest of thecvcgl_ariadne_*,cvcgl_viewport*andcvcgl_scene_renderer*tests (10 in all, with the two above).Measured
A local benchmark (not committed): 400 actors, a mirror inset in the top-right corner, a 1280x720 offscreen window, 200 renders a run:
setRefreshHz(5)At this frame rate, 5 Hz is about one render in four; the rest show the kept picture.
The texture costs one RGBA8 buffer the size of the window per throttled viewport.