Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Any possibility to use (fixed) foveated rendering with OpenXR?

Discussion in 'VR' started by SylvainChague, Aug 30, 2022.

  1. SylvainChague

    SylvainChague

    Joined:
    Nov 20, 2012
    Posts:
    8
    Hello,

    I've been looking for a way to add fixed foveated rendering to a VR project setup with OpenXR. Ideally, I would like to avoid having to import the vendor specific plugins in my project.

    Looking at the release notes for 2021.3.4f1, I noticed the following: Added gaze foveated rendering (GFR) on Vulkan. That seems great, but I unfortunately could not find any documentation on this... any pointer or suggestion?
     
    Hobodi likes this.
  2. AndreasWang

    AndreasWang

    Joined:
    Jul 31, 2019
    Posts:
    23
    if you have a Meta Quest 2, the OpenXR plugin version 1.5.1 recently released with support for a few OpenXR extensions related to fixed foveated rendering that should work on that HMD: https://docs.unity3d.com/Packages/com.unity.xr.openxr@1.5/changelog/CHANGELOG.html.

    You might need to implement a native plugin that can intercept OpenXR calls to xrCreateSwapchain (https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrCreateSwapchain.html) in order to use the XR_FB_swapchain_update_state extension. Documentation for the FFR extensions can be found in the OpenXR spec: https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html while the OpenXR Plugin should come with a sample for how you can implement OpenXR function interception.

    You can also directly call OpenXR functions from C#. An example of how this can be done can be found in this thread: https://forum.unity.com/threads/ope...escriptive-device-names.1051493/#post-8316300
     
    w450468524 likes this.
  3. amplez

    amplez

    Joined:
    Aug 19, 2018
    Posts:
    5
    Anyone implemented this?
     
  4. SylvainChague

    SylvainChague

    Joined:
    Nov 20, 2012
    Posts:
    8
    As OpenXR is becoming the go-to solution for XR development, an official implementation would be very interesting.
     
    DevDunk likes this.
  5. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    If a runtime implements Meta's set of extensions, and also a Unity OpenXR Feature requests the same set of extensions, the OpenXR plugin will properly utilize them.

    XR_FB_foveation XR_FB_foveation_configuration XR_FB_swapchain_update_state XR_FB_foveation_vulkan


    Meta's third party package does this, but you can do it on your own. There are a few native calls that can configure things (FBSetFoveationLevel, FBGetFoveationLevel, FBGetFoveationDynamic), you can figure out the signatures from meta's package.

    When there's a cross-vendor foveation extension that we see adoption of, we'll implement that properly. For now, we have the meta version implemented in this way where a third party package can enable it.
     
  6. GamerTobbe

    GamerTobbe

    Joined:
    Apr 4, 2019
    Posts:
    23
    thanks for the info, we got the FFR working now with this post. We still trying to figure out how to change the refresh rate with different signatures, you don't have a hint about it?
     
    DevDunk likes this.
  7. prawn-star

    prawn-star

    Joined:
    Nov 21, 2012
    Posts:
    76
    I'm a bit confused. What is Meta's third part package? Is it Meta Quest Support enabled from OpenXR feature groups.
    And how do you call these functions? (FBSetFoveationLevel, FBGetFoveationLevel, FBGetFoveationDynamic))
    I switched from Oculus to OpenXR when adding hand tracking and cannot set the FFR level now using Unity.XR.Oculus.Utils
     
    pierre92nicot likes this.