Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question OpenXR Boundaries

Discussion in 'VR' started by ImpossibleRobert, Oct 3, 2021.

  1. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    511
    I switched to OpenXR and was initially extremely positively surprised. Everything seems to work out of the box. EXCEPT. The boundaries through TryGetBoundaryPoints. That is a big mess. Every provider and combination seems to provide different but also always incorrect results. When switching back to legacy non-OpenXR and OVR Manager everything is fine again (OpenXR 1.2.8, Unity 2021.1.23, Rift, Quest, Vive).

    Some providers return a rectangle, some the full boundary with hundreds of points. Sometimes there is simply nothing returned. And if there is a rectangle, it has nothing to do with the real boundary and is way too big and unaligned.

    What I am looking for is a reliable way to get the biggest rectangle available in the play space, like xrGetReferenceSpaceBoundsRect of the OpenXR spec describes. How can I get access to this data in a reliable way?
     
  2. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    I have made a note to look into exposing this information and investigating TryGetBoundaryPoints in OpenXR, however that may take a bit of time on our end. If you dont want to wait you could write your own OpenXR Feature that returns the value of `xrGetReferenceSpaceBoundsRect ` yourself too.

    This isnt a simple task but may be a work around for now if you can get it working. The intercept sample included with OpenXR may help you as well.

    https://docs.unity3d.com/Packages/com.unity.xr.openxr@1.2/manual/features.html
     
    rwetzold likes this.
  3. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    101
    We investigated TryGetBoundaryPoints in OpenXR. Here are some notes:
    1. in OpenXR, we actually return bound rect values - width & height obtained from xrGetReferenceSpaceBoundsRect via TryGetBoundaryPoints if you have guardian/ boundary setup in headset and boundary data is supported by runtime. We formatted it into a List<Vector3> of size 4, representing the 4 points of play space rectangle. (some platforms require to have a roomscale guardian setup)

    2. There is a known issue when using Quest with Link, the result is not correct. We already reached out to Oculus about this issue, but we don't have an ETA when it will be fixed.

    One more thing to clarify, for legacy non-openXR Oculus provider, TryGetBoundaryPoints will return a list of detailed boundary points (may including hundreds of points).

    Please let me know if you have any other questions.
     
  4. VirtualDestructor

    VirtualDestructor

    Joined:
    May 3, 2014
    Posts:
    40
    I just ran into this issue in Unity 2021.3.4. I try to use Unity's API's for everything, but TryGetBoundaryPoints() does not work with Oculus when using the OpenXR backend. It would be great if I could do this using Unity's API.
     
  5. ceitel

    ceitel

    Joined:
    Jan 3, 2017
    Posts:
    34
    Also having this issue with Oculus over link in Unity 2021.3.25. Would prefer built-in OpenXR over using Oculus SDK as this has been a pain to program around when we want to be HMD agnostic. Any updates appreciated! Also noteworthy: Oculus (when using OpenXR) is not calling OnBoundaryChanged() on recenter events.
     
  6. rosssssss

    rosssssss

    Joined:
    Jan 27, 2017
    Posts:
    70
    Hello re this - we really need more detailed boundary information than that. For example if the user is in a roughly L-Shaped room - then the boundary rectangle it returns could well be in the other leg of the L-shaped room - i.e. around the corner from where they are actually standing and actually intending to do the VR experience.- which means we have no way at all of getting useful boundary info -
    Would it be possible to also expose the full boundary geometry?