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 Gamma color mode on Oculus with OpenXR.

Discussion in 'VR' started by AndyKorth, Jul 5, 2022.

  1. AndyKorth

    AndyKorth

    Joined:
    Oct 19, 2009
    Posts:
    40
    Hello everyone,

    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:

    Code (CSharp):
    1. "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.

    We're using Unity 2020.3.31f1 and the recommended Oculus XR plugin from the package manager, which is Version 1.11.2.

    I understand starting in Oculus XR Package version 2.0.0-preview.1 gamma color space is no longer supported with GLES and OpenXR, that seems to imply it should work in versions prior to that, correct? (source: https://docs.unity3d.com/Packages/com.unity.xr.oculus@2.0/changelog/CHANGELOG.html )

    Thanks in advance,
    Andy
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,393
    In the oculus tab at the bottom you need to use the legacy oculus input handling instead of openxr. Then it might work with openGL.
    Have you tried looking at the visuals with linear color space? Usually it doesn't degrade the visuals
     
  3. AndyKorth

    AndyKorth

    Joined:
    Oct 19, 2009
    Posts:
    40
    Ah, we've got openXR support on our other VR platforms, so I'm really hesitant to add support for the legacy oculus input handling. That would be our third VR SDK, and we're really hoping to use OpenXR as much as possible, since it's working well for our app. It's definitely a possibility, but it's probably my least favorite option.

    Yeah, the visuals are fairly messed up in linear color space. I think a lot will need to be redone, especially our custom lightmapping solution.

    Lots of stuff like this when using linear on things that weren't made for it: http://kortham.homeip.net/files/Unity_2022-06-30_11-13-55.png

    http://kortham.homeip.net/files/vlc_2022-06-30_10-42-06.png
     
  4. kazak_tm

    kazak_tm

    Joined:
    Sep 7, 2021
    Posts:
    12
    It didn't work for me. I'm trying to build Oculus XR and Gamma. We can't use Linear because it breaks our panoramas. Which version of oculus xr should I use with Unity 2021.3.13f to use Oculus and Gamma without Vulkan?

    upload_2022-11-23_18-6-5.png
     
  5. ash_at_unity3d

    ash_at_unity3d

    Unity Technologies

    Joined:
    Jan 9, 2020
    Posts:
    41
    @AndyKorth From the OpenXR spec here, OpenXR always expects colors to be linear: https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrColor4f.html
    @kazak_tm out of curiousity, why are you not targeting Vulkan?
     
  6. kazak_tm

    kazak_tm

    Joined:
    Sep 7, 2021
    Posts:
    12
    In our application, when playing a video from the url (in the unity video player), the build crashes. There are no errors in unity. I thought it was because of Vulkan. But no. This is a unity 2021.3.xx bug. It does not crash in versions 2019 and 2020. Unity does not crash in the editor. Only the build.
    Now I'm using vulkan.
    Do you know why the video crashes? It breaks only when playing the url a second time. The first time it plays, I close it. The second time I reproduce it - crash. When the video file is downloaded, everything is fine.
     
  7. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,393
    If it works in 2020 please make a bug report for it
     
  8. kazak_tm

    kazak_tm

    Joined:
    Sep 7, 2021
    Posts:
    12
    Now the bug is only in unity 2021.3.13f1.
    Everything works great in 2020.
     
  9. ash_at_unity3d

    ash_at_unity3d

    Unity Technologies

    Joined:
    Jan 9, 2020
    Posts:
    41
    As @DevDunk mentions, @kazak_tm - you should file a bug. I'm not aware of any crashes with 2021.3 with video playback.
     
    DevDunk likes this.
  10. kazak_tm

    kazak_tm

    Joined:
    Sep 7, 2021
    Posts:
    12
    Can you help? How do I file a bug report for oculus quest 2? Or give a link where to file a bug?
     
  11. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,393
    In your project (or even better, a smaller reproduction project), press Help -> Report a Bug
     
    kazak_tm likes this.