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

Bug OpenXR: Non-VR cameras stop rendering when headset is disabled (Oculus)

Discussion in 'VR' started by Iron-Warrior, Sep 4, 2021.

  1. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    We are making an asymmetrical VR/PC game, where a separate camera (with Target Eye set to None (Main Display) renders the PC player's point of view. We recently updated to OpenXR and with the Oculus runtime, when the headset is inactive (no user present), the PC camera rendering is disabled as well as the VR. This only occurs with the Oculus runtime; SteamVR does not disable PC camera rendering when the user is not present. Ideally we want the cameras to continue rendering as their job is to display the PC player's point of view regardless of whether the VR player is present in the headset.

    Thanks for any help.
     
  2. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    Okay, found an issue for this on the tracker. Wrote my thoughts:

    Could we please consider having a workaround for this?
     
  3. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    May not be what you are trying to do, but you could control the initialization and shutdown of XR manually which allows you to make a mixed PC/XR app.
     
  4. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    Yeah that's the nuclear option I was considering, to allow users to manually toggle VR on/off. I found a workaround here that allows me to continue using the Oculus runtime when it is available, but ideally this would be something that could just be toggled to be permitted. I poked around the OpenXR loader source but I'm guessing the actual disabling of the Unity camera rendering is handled in the native DLL.
     
  5. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    399
  6. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    Yeah, I do have runInBackground set, which does work correctly when using the Oculus runtime (and sometimes works with SteamVR in OpenXR)...not sure if you or @the_real_apoxol would know, but I'm assuming something in the native OpenXR DLL by Unity tech would be setting this, right? Since I'm not sure otherwise how OpenXR would affect how Unity's regular rendering runs.
     
  7. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    399
    The openxr integration will tell unity if the app is "in focus" or not, and then depending on the status of the run in background flag, unity will either allow the app to continue running or pause it.

    Looking into it though, it looks like we may be setting this focus flag on the wrong openxr state. We'll investigate ..
     
    Iron-Warrior likes this.
  8. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    Hey, just checking to see if anything came of this, or if a change should be expected in a future release.
     
  9. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    101
    Hey, just let you know that we have a fix now and currently is waiting for release. I will update it again with the Unity Editor version when the fix is out.
    Thanks.
     
  10. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    Awesome, thanks Tanya!
     
  11. GamesbyJP

    GamesbyJP

    Joined:
    May 20, 2018
    Posts:
    62
    Any news on this release yet?
     
  12. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    101
    Hey, good news fix was out.
    Fix included in those editor version: 2022.1.0a16 ,2021.2.2f1, 2020.3.23.
     
  13. GamesbyJP

    GamesbyJP

    Joined:
    May 20, 2018
    Posts:
    62
    Thank you!
     
  14. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    485
    I am using 2021.3.22f1, yet this issue still persists. Any luck on resolving this?
     
  15. AndreasWang

    AndreasWang

    Joined:
    Jul 31, 2019
    Posts:
    21
    There was a regression related to this that got fixed in version 1.9.0 recently. Might be worth giving it a shot if you haven't already :)
     
  16. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    485
    Is it the same issue like - when I remove my headset and keep it idle somewhere, it no longer renders the scene? No matter if I even add a simple cube to the scene, it no longer renders. Is this the same bug that is fixed?
     
  17. AndreasWang

    AndreasWang

    Joined:
    Jul 31, 2019
    Posts:
    21
    I did bug report the following and it got marked as a duplicate of the linked issue at least:
    The issue that I experienced on my end was that the whole frame loop stalled whenever the headset went idle, so you'd just be stuck seeing whatever the last frame was before it went idle. The performance of the whole application would also tank at the same time
     
  18. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    485
    Last edited: Sep 19, 2023
  19. jia_it

    jia_it

    Joined:
    Aug 17, 2020
    Posts:
    3
    Any idea when 1.9.0 of OpenXR will be released, or is there a pre-release version available?
     
  20. AndreasWang

    AndreasWang

    Joined:
    Jul 31, 2019
    Posts:
    21
    Looks like I mistakenly assumed it already was out, but it seems like 1.8.2 still is the latest version. It's been a little while since that one released (2023-07-18), so hopefully 1.9.0 will be out soon
     
    jia_it likes this.