Skip to main content
chelseahardy076
Inspiring
June 30, 2022
Solved

OpenXR and Gamma Color Mode in Unity

  • June 30, 2022
  • 9 replies
  • 9351 views

We have a VR app we'd like to bring to Oculus platforms, and it's made in Unity using the gamma colorspace. We're finding that the OVRGradleGeneration build step reports the following:

 

"Oculus Utilities Plugin with OpenXR only supports linear lighting. Please set 'Rendering/Color Space' to 'Linear' in Player Settings"

 

It's not practical for us to convert our app to linear color space at this time. Is there a timeline for gamma color space support in Unity with OpenXR? Is it intended to only ever support linear color space? Any potential workaround for this? We are using OpenXR on other platforms, so we're not enthusiastic about moving to non-OpenXR options on Oculus. 

    Best answer by chelseahardy076

    Well, we ended up putting in the work to upgrade to Unity 2021. We're using the Vulkan renderer, which works in Gamma color space. Still on Oculus XR plugin version 1.11.2, from the package manager inside Unity. So it all works, and the Unity upgrade was pretty easy for our project this time.

    9 replies

    chelseahardy076
    Inspiring
    June 30, 2022

    I forgot to mention. We're using Unity 2020.3.31f1 and the recommended Oculus XR plugin from the package manager, which is Version 1.11.2. It's hard to make sense of this, but I think that corresponds with "v33" on the Oculus site. 

    chelseahardy076
    chelseahardy076AuthorAnswer
    Inspiring
    July 13, 2022

    Well, we ended up putting in the work to upgrade to Unity 2021. We're using the Vulkan renderer, which works in Gamma color space. Still on Oculus XR plugin version 1.11.2, from the package manager inside Unity. So it all works, and the Unity upgrade was pretty easy for our project this time.

    Participant
    April 12, 2023

    Hey, have you gotten any farther with this?  I'm trying to see if there is a sneaky way to use Gamma color space with the latest OpenXR backends.  I'm still using com.unity.xr.oculus 1.11.2 to keep it working.  Very frustrating for us as Linear space imposes a not-insignificant frame rate hit.

    chelseahardy076
    Inspiring
    April 12, 2023

    Hey Zorak,

    Our current setup is working pretty well for us. We're on Unity 2012.3.17f1, using Oculus XR Plugin 3.2.2 from the Unity Asset Store. (Full plugin list here, if that helps: 

    )

    We are using Gamma space on all our platforms now, and it's working nicely. MSAA also works on all platforms- there were some combinations of MSAA where it doesn't work. We're using Vulkan on Quest, and that was a nice boost. 

    I don't recall when we moved from "Oculus XR plugin version 1.11.2" to what now seems to be 3.2.2. We've got a mid-sized project, and I remember both the unity upgrade and the oculus xr plugin upgrade being easier than expected. 

     

    Hope that helps!

    Honored Contributor
    June 27, 2023

    I'm trying to do the same thing, but it won't let me build. I'm still getting "Oculus Utilities Plugin with OpenXR only supports linear lighting. Please set 'Rendering/Color Space' to 'Linear' in Player Settings" even though I'm using Vulkan. Did you manually remove the check in in OVRGradleGeneration.cs or something?

    Participant
    April 12, 2023

    Interesting.  So, if I use OpenGL and if I upgrade to 3.2.2 it won't let me build because of the color space issue.  Are you suggesting that I can get around this by switching to Vulkan?  And you've seen a little performance improvement with Vulkan, huh?  About to try it!

    chelseahardy076
    Inspiring
    April 12, 2023

    Yes, definitely move to Vulkan if possible. We're stuck on OpenGL on Pico because the headset doesn't support it... and on older versions of Unity we ran into bugs with Vulkan. Or unsupported features. It will depend on your render pipeline choice as well, unfortunately. The landscape changes quickly since it seems like there can be separate issues in different versions of each VR platform's plugin, each unity version, each unity render pipeline version, etc. My memory is a bit fuzzy, but there were render-backend specific issues with MSAA, other antialiasing options, and also full screen effects in VR. 

    Participant
    April 12, 2023

    Yeah, last time I tried Vulkan, it was not ready for prime-time so I shelved it until now.

    Just ran a few test builds - all with Gamma color space:

    • Vulkan + plugin 3.2.2 + legacy backend: improved performance, but dark graphics - like a color space mismatch
    • Vulkan + plugin 3.2.2 + OpenXR backend: good graphics, slower performance, CPU pegged at level 4,  much improved z-buffer resolution (we have a very "deep" scene.)

    Not sure what to make of this all yet!