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) { 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,