Skip to content

Sub-rect-aware Kooima: physically-correct 3D inside the surround canvas (#131)#135

Merged
dfattal merged 1 commit into
mainfrom
fix/subrect-kooima-131
May 31, 2026
Merged

Sub-rect-aware Kooima: physically-correct 3D inside the surround canvas (#131)#135
dfattal merged 1 commit into
mainfrom
fix/subrect-kooima-131

Conversation

@dfattal
Copy link
Copy Markdown
Collaborator

@dfattal dfattal commented May 31, 2026

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

…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>
@dfattal dfattal merged commit 6ab76c6 into main May 31, 2026
4 checks passed
@dfattal dfattal deleted the fix/subrect-kooima-131 branch May 31, 2026 06:52
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>
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