Repository navigation
Conversation
…map) The true DBG minimap, generalised: a viewport that shows a scene ANOTHER viewport already draws, from its own camera, without re-attaching the scene (which SceneGraph::setRenderer would do — blanking the source view, the trap the previous commit made loud). ViewportManager::addMirrorViewport(name, sourceViewport, region, layer) adds a Viewport flagged mirror, pointing at the source viewport's renderer. It does NOT attach the scene a second time and is not tracked in attachedScenes; instead render() copies the source renderer's props into the mirror's renderer each frame (shared by reference — one geometry drawn twice), so the mirror always shows the live scene from its own viewpoint. A node added or re-meshed in the source scene appears in the mirror the next frame with no extra work. Viewport gains isMirror()'s companion mirrorSource() (the source renderer, or nullptr) and a manager-only setMirrorSource(). cvcgl_viewport extended: a mirror of the primary over the same mainScene draws the shared geometry (its rect shows the scene, not just its background), a large quad added to the source scene shows up in the mirror rect (live prop sync, camera untouched), and mirroring an unknown source throws. Full cvcgl suite (28 tests) green locally. Stacked on the ViewportManager core PR.
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.
cvcGL: mirror viewports — alternate cameras over a shared scene (minimap)
Stacked on #384 (base branch
feat/cvcgl-viewport-core). Review/merge #384first; this adds the second half of the PiP story.
Why
#384 gave us N viewports over separate scenes and made a second
setRendererover one scene a loud error. The other half the demos want is theminimap: a second view of the same scene from a different camera —
which
addSceneViewportnow (correctly) refuses.What
ViewportManager::addMirrorViewport(name, sourceViewport, region, layer=2)— a viewport flagged mirror, pointed at the source viewport's renderer. It
does not attach the scene again (so the source keeps its actors) and is
not tracked in
attachedScenes. Eachrender()copies the source renderer'sprops into the mirror's renderer (shared by reference — one geometry drawn
twice), so the mirror always shows the live scene from its own camera; a
node added or re-meshed in the source scene appears in the mirror next frame
with no extra bookkeeping.
Viewport::mirrorSource()(the source renderer, ornullptr) alongsideisMirror(), plus a manager-onlysetMirrorSource().Tests
cvcgl_viewportextended (offscreen, headless): a mirror of the primary overthe same
mainScenebackground —
luma > 0.18);rect with the mirror camera left untouched (per-frame prop sync);
Full
cvcglsuite (28 tests) green locally on Windows/MSVC.Not yet (still the follow-ups from #384)
Input router (
FindPokedRenderer), state layout,SceneRenderer→facade,promoting the nav-city minimap demo onto this path, and the SWIG bindings +
Python
ChaseCamerashim. Lights for a mirror currently fall back to aheadlight following the mirror camera (explicit
StageLightingrigs are not yetmirrored) — fine for a minimap, noted for the demo pass.