Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions samples/desktop-avatar/Assets/TransparentAutoSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DisplayXRContentBounds>();
if (bounds == null) bounds = host.AddComponent<DisplayXRContentBounds>();
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)
{
Expand Down
2 changes: 1 addition & 1 deletion samples/desktop-avatar/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 10 additions & 0 deletions samples/desktop-avatar/Packages/packages-lock.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down