From 1f657d03eef180030530720c278a7efa80f4792f Mon Sep 17 00:00:00 2001 From: dfattal Date: Sun, 6 Sep 2026 19:51:46 +0200 Subject: [PATCH 1/2] feat(desktop-avatar): report content bounds for the rear depth budget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plugin now consumes the runtime's advisory rear depth budget (XR_DXR_depth_budget, displayxr-unity#318): a transparent overlay may show what is behind its display plane when the desktop right behind the content carries no horizontal depth cue. The runtime decides that from a background measurement — and without a content region to aim at it judges the WHOLE window, so an empty Notepad's own menu and status bars are enough structure to keep the clip shut while the tiger stands in the opposite corner. Attach DisplayXRContentBounds to the first silhouette target, pinned to exactly the renderer list the click-through mask is cut from, so the region the runtime measures is the geometry the user actually sees. Nothing else changes: ClipAtDisplayPlane still owns foregroundOnlyClip, and against a runtime without the extension the clip stays on the plane. Verified on the panel (runtime v2.16.13): the runtime logs `roi=16,4,38,34 (app content bounds)`, and the state tracks the background — ClippedBusyBackground (cue=1.00) over a busy desktop, Open (cue=0.00) over a plain one, with the rear volume resolving to 214.191 world units at farOffsetVH=107.1. The visual eyeball is still owed. NOTE: the committed plugin pin is still #upm/v2.14.0, which predates the component — this branch does not build until the pin is bumped to the release carrying displayxr-unity#318. That bump is the next commit here. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_019JgFFrsR9dpT2anKy5AtYs --- .../Assets/TransparentAutoSetup.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/samples/desktop-avatar/Assets/TransparentAutoSetup.cs b/samples/desktop-avatar/Assets/TransparentAutoSetup.cs index 1bf409d..028017e 100644 --- a/samples/desktop-avatar/Assets/TransparentAutoSetup.cs +++ b/samples/desktop-avatar/Assets/TransparentAutoSetup.cs @@ -93,6 +93,27 @@ private static void Install() Renderer[] hit = hitList.Count > 0 ? hitList.ToArray() : null; + // Rear depth budget (XR_DXR_depth_budget v2): tell the runtime WHERE the + // content is, so it decides whether the avatar may show its back from the + // desktop BEHIND THE AVATAR rather than from the whole window. Without this + // an empty Notepad's own menu and status bars are enough horizontal structure + // to keep the clip shut while the tiger is in the opposite corner. + // + // The renderer list is pinned to exactly the silhouette targets above, so the + // measured region is the same geometry the click-through mask is cut from. + // One component only — native tracks a single region — so it goes on the + // first target root and covers the rest through the explicit list. + if (targetRoots.Count > 0 && hit != null) + { + var host = targetRoots[0]; + var bounds = host.GetComponent(); + if (bounds == null) bounds = host.AddComponent(); + bounds.renderers = hit; + Debug.Log($"[TransparentAutoSetup] Content bounds reported from '{host.name}' " + + $"({hit.Length} renderer(s)) — the rear depth budget is judged from " + + "the desktop behind the content."); + } + int installed = 0; foreach (var cam in Camera.allCameras) { From 098ddd0521ad755d5200fea2567a3b7403431193 Mon Sep 17 00:00:00 2001 From: dfattal Date: Mon, 7 Sep 2026 00:10:24 +0200 Subject: [PATCH 2/2] chore(desktop-avatar): pin the plugin to v2.19.0 (rear depth budget + content mask) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restores a released pin — the branch was carrying the local `file:` dev override while the plug-in was being built, which the repo rule says must never be committed. v2.19.0 carries the background-aware foreground clip. Against runtime v2.16.14+ the runtime judges the tiger's SILHOUETTE rather than a rectangle around it; the mask producer is entirely plug-in side (the transparent overlay already reads that silhouette back for SetWindowRgn), so the only app-side contribution is the content region added in the previous commit. Verified by building this sample against the RELEASED package, not the worktree: UPM resolved `com.displayxr.unity@08ec4412cebb` (the upm/v2.19.0 tag commit) and the built player's displayxr_unity.dll is Authenticode Valid, signed by Leia, Inc. — so the signed DLL reaches a consumer through the git-URL channel, which is the half of the release that has silently shipped unsigned before. Panel behaviour verified on this sample: busy content inside the content box but off the silhouette leaves the clip OPEN, the same stimulus on the body closes it, and the pre-mask bounds path closes on both. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_019JgFFrsR9dpT2anKy5AtYs --- samples/desktop-avatar/Packages/manifest.json | 2 +- samples/desktop-avatar/Packages/packages-lock.json | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/samples/desktop-avatar/Packages/manifest.json b/samples/desktop-avatar/Packages/manifest.json index c5d4267..94cf48d 100644 --- a/samples/desktop-avatar/Packages/manifest.json +++ b/samples/desktop-avatar/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.14.0", + "com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.19.0", "com.unity.multiplayer.center": "1.0.1", "com.unity.render-pipelines.universal": "17.0.4", "com.unity.ugui": "2.0.0", diff --git a/samples/desktop-avatar/Packages/packages-lock.json b/samples/desktop-avatar/Packages/packages-lock.json index 7da3ac0..c1a2673 100644 --- a/samples/desktop-avatar/Packages/packages-lock.json +++ b/samples/desktop-avatar/Packages/packages-lock.json @@ -1,5 +1,15 @@ { "dependencies": { + "com.displayxr.unity": { + "version": "https://github.com/DisplayXR/displayxr-unity.git#upm/v2.19.0", + "depth": 0, + "source": "git", + "dependencies": { + "com.unity.xr.management": "4.4.0", + "com.unity.inputsystem": "1.4.4" + }, + "hash": "08ec4412cebbbc08397a6aaf543ba4a7dd802d99" + }, "com.unity.burst": { "version": "1.8.28", "depth": 2,