2023.1 - HDRP - Switching between openxr and desktop camera breaks in standalone win build

, ,

I have reported the issue already through Bug report, but I wanted to share here as well.

We are using 2023.1 + HDRP + OpenXR + Single Pass Instanced Render mode.
There are two cameras in the scene, but afaik same results can be seen with single camera as well.

Basically everything works as expected in Editor and Development build. But when built in “release” mode it breaks. After XR initialization the desktop camera stops rendering and shadows look different.

I have tested this with Mixed reality and Steam OpenXR runtimes/headsets. (Reverb and HTC Vive Focus3)

I have created and attatched a sample project to demonstrate the issue.
it contains:

  • sample scene (Assets/Scenes/Startup.unity)
  • simple script to toggle between xr and desktop (Assets/Scripts/XRToggleScript.cs)

How to reproduce using attatched sample

BROKEN scenario

  • open Assets/Scenes/Startup.unity
  • create a windows standalone build (make sure development build is unchecked)
  • include Scenes/Startup scene
  • run the resulting application
  • move around using WSAD
  • pay attention to the color of shadows (dark gray)
  • connect VR headset (tested with HP Reverb and HTC Focus3)
  • hit MKey on your keyboard to switch between desktop and xr
  • put on your VR headset
  • now look around and pay attention to shadows color (brown)
  • hit MKey again to switch back to ‘desktop mode’
  • now the desktop camera does not work anymore (desktop camera is not rendering)

Working scenario A (Editor play)

  • open Assets/Scenes/Startup.unity
  • hit ‘Play’
  • move around using WSAD
  • pay attention to the color of shadows (dark gray)
  • connect VR headset (tested with HP Reverb and HTC Focus3)
  • hit MKey on your keyboard to switch between desktop and xr
  • put on your VR headset
  • now look around and pay attention to shadows color (dark gray)
  • hit MKey again to switch back to ‘desktop mode’
  • desktop WSAD controls work fine and camera is rendering

Working scenario B (Development build)

  • open Assets/Scenes/Startup.unity
  • create a windows standalone development build
  • run the resulting application
  • move around using WSAD
  • pay attention to the color of shadows (dark gray)
  • connect VR headset (tested with HP Reverb and HTC Focus3)
  • hit MKey on your keyboard to switch between desktop and xr
  • put on your VR headset
  • now look around and pay attention to shadows color (dark gray)
  • hit MKey again to switch back to ‘desktop mode’
  • desktop WSAD controls work fine and camera is rendering

9400790–1315862–3D.HDRP.OpenXR.Repro.zip (2.65 MB)

Tested with 2023.1.14f1 and then again with 2023.1.16f1 with same results.

So today I have received a reply to the bug report. They said they didn’t have a reverb nor focus, so they could not test this issue. And the issue was “Closed as Not Qualified”.

I have never said that it’s a headset dependent issue and afaik it really is not.

So I had to test my repro app again and this time with Quest2same results.

Frustrating… also pretty critical issue if you ask me.

Just tested with 2023.1.18f1 and the issue is still present.

Today the issue was reopen and reproduced by Unity. Apparently the issue is no longer present in HDRP 17.0.1

So right now a workaround could be update to unity 2023.3 which is in aplha.

I have great news.

The issue is no longer present in Unity 2023.1.20f1

1 Like