Repository navigation
cvcGL: add a frozen (one-time) mirror option to addMirrorViewport - #404
Merged
Merged
Conversation
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.
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.
What
addMirrorViewportre-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 = truetoaddMirrorViewport. WithliveSync=falsethe mirror is primed once, at add time, then skipped byrender()'s per-frame re-sync (gated by a newViewport::mirrorLive()). Because the primed props are the same sharedvtkProppointers, 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_wallspopulated 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 portingnav_city_swarm's hand-rolled minimap onto the library path without changing what the user sees.Test
cvcgl_viewportgains 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:API
Additive only: one defaulted parameter on
addMirrorViewport, one newViewport::mirrorLive()getter (+ a manager-onlysetMirrorLive). No behavior change for existing callers.