Sub-rect-aware Kooima: physically-correct 3D inside the surround canvas (#131)#135
Merged
Conversation
…as (#131) When a 2D-surround canvas sub-rect is active, the runtime weaves the 3D into that sub-rect (a smaller physical area of the panel) — but hooked_xrLocateViews was still computing the Kooima frustum + convergence against the FULL window. The result: depth/parallax sized for the window, then downscaled into the sub-rect, so the woven 3D was geometrically too strong (not physically accurate at the displayed size). Compute Kooima against the "effective output region": the canvas sub-rect when one is set (s_canvas_rect_*, window-client-relative + window screen origin), else the full window. Both the screen physical size (→ FOV, m2v) and the eye/center offset (→ convergence centered on where the content actually is) now track the sub-rect. No sub-rect → identical to before, so non-surround apps are unchanged. Diagnostic log now reports the effective region + a [canvas] marker. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 1, 2026
dfattal
added a commit
that referenced
this pull request
Jun 2, 2026
…131) Fullscreen 2D-surround region-editor support, plus a clean, deterministic startup for the transparent overlay. Overlay geometry (native, Win32): - New opt-in displayxr_set_fullscreen_overlay_pref: when set before session create, the transparent overlay is born covering nearly the whole monitor (monitor rect MINUS 1px on right+bottom) instead of Unity's small windowed client rect. The 1px keeps the window DWM-composited; an EXACT-monitor window trips Windows fullscreen-optimization / independent-flip (DWM-alpha bypass), which was the source of the startup white flashes + hang. It still covers the taskbar so content (e.g. the tiger's feet) renders over it. Born at final size so it is never resized (a resize recreates the presentation swapchain = a flash); the transparent-enable snap and set_overlay_fullscreen are no-ops when already near-fullscreen. - New displayxr_set_overlay_cursor: app-driven overlay cursor shape via WM_SETCURSOR (arrow / resize / move) for the region editor. Sub-rect-aware interaction (C#): - displayxr_get_canvas_rect_px binding + GetStereoViewport so the cyclopean raycast in DisplayXRTransparentOverlay maps the cursor through the canvas sub-rect (matching the sub-rect Kooima projection from #135), fixing LMB-rotate when a canvas sub-rect is active. Zero change with no sub-rect. - DisplayXRTransparentOverlay.RequestFullscreenOverlay wrapper for the pref. Diagnostics: - Coarse [+ms] relative timestamps on every native log line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
When a 2D-surround canvas sub-rect is active, the runtime weaves the 3D into
that sub-rect (a smaller physical area of the panel) — but hooked_xrLocateViews
was still computing the Kooima frustum + convergence against the FULL window.
The result: depth/parallax sized for the window, then downscaled into the
sub-rect, so the woven 3D was geometrically too strong (not physically accurate
at the displayed size).
Compute Kooima against the "effective output region": the canvas sub-rect when
one is set (s_canvas_rect_*, window-client-relative + window screen origin),
else the full window. Both the screen physical size (→ FOV, m2v) and the
eye/center offset (→ convergence centered on where the content actually is) now
track the sub-rect. No sub-rect → identical to before, so non-surround apps are
unchanged. Diagnostic log now reports the effective region + a [canvas] marker.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com