Skip to content

cvcGL: add a frozen (one-time) mirror option to addMirrorViewport - #404

Merged
transfix merged 1 commit into
masterfrom
feat/cvcgl-frozen-mirror
Sep 23, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/cvcgl-frozen-mirror

Conversation

@transfix

Copy link
Copy Markdown
Owner

What

addMirrorViewport re-copies its source renderer's props and lights every frame (syncMirrorProps: RemoveAllViewProps/RemoveAllLights + re-add). That is correct for a live minimap, but it means a mirror always tracks props added to the source later and can never keep its own light rig — a caller can't pin a fixed snapshot or a custom look.

Add bool liveSync = true to addMirrorViewport. With liveSync=false the mirror is primed once, at add time, then skipped by render()'s per-frame re-sync (gated by a new Viewport::mirrorLive()). Because the primed props are the same shared vtkProp pointers, geometry/visibility edits to props it already holds still flow through; it simply doesn't gain props added afterwards, and its lights are left untouched. The default is unchanged (live).

Why

This is the missing piece for a picture-in-picture minimap that must stay pixel-stable: a whole-map snapshot that (a) excludes content discovered later (e.g. belief_walls populated during a fog-on run) and (b) carries its own flat headlight instead of the source's stage-lighting rig. It's the prerequisite for porting nav_city_swarm's hand-rolled minimap onto the library path without changing what the user sees.

Test

cvcgl_viewport gains a frozen-mirror case: after freezing, a node added to the source does not reach the frozen mirror (while the default live mirror does), and the frozen mirror's own light survives a render. Full cvcgl viewport suite green locally:

cvcgl_smoke ............. Passed
cvcgl_viewport .......... Passed   (incl. new frozen-mirror assertions)
cvcgl_viewport_input .... Passed

API

Additive only: one defaulted parameter on addMirrorViewport, one new Viewport::mirrorLive() getter (+ a manager-only setMirrorLive). No behavior change for existing callers.

A mirror viewport re-copies its source renderer's props AND lights every
frame (syncMirrorProps: RemoveAllViewProps/RemoveAllLights + re-add). That is
right for a live minimap, but it also means a mirror always tracks props added
to the source later and can never keep its own light rig — a caller cannot pin
a fixed snapshot or a custom (e.g. flat) look.

Add `bool liveSync = true` to addMirrorViewport. With liveSync=false the mirror
is primed ONCE, at add time, then skipped by render()'s per-frame re-sync
(Viewport::mirrorLive() gates it). Because the primed props are the SAME shared
vtkProp pointers, geometry/visibility edits to props it already holds still flow
through; it simply does not gain props added afterwards, and its lights are left
untouched. Default is unchanged (live).

This is what a picture-in-picture minimap that must stay pixel-stable needs: a
whole-map snapshot that excludes content discovered later and carries its own
headlight instead of the source's stage rig.

cvcgl_viewport gains a frozen-mirror case: after freezing, a node added to the
source does NOT reach the frozen mirror (while the default live mirror does),
and the frozen mirror's own light survives a render. Full cvcgl viewport suite
green locally.
@transfix
transfix merged commit 1019cc4 into master Sep 23, 2026
13 checks passed
@transfix
transfix deleted the feat/cvcgl-frozen-mirror branch October 29, 2026 20:52
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