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.

Bug Can't Enable FFR w/ URP - Oculus Quest 2

Discussion in 'VR' started by Zaflores, Mar 13, 2023.

  1. Zaflores

    Zaflores

    Joined:
    Sep 23, 2017
    Posts:
    10
    Hello!

    Unity Version 2021.3.4f1.
    URP version 12.1.7

    I am working on a VR game for the Oculus Quest 2 using URP and we are having trouble enabling FFR for our title as we're currently GPU bound and would like to have FFR working so we're able to accurately profile our game using all the features we can.

    I'm aware there are a number of things that can break FFR, but I don't believe we're doing any of them. No post processing, disabled depth texture/opaque texture in URP settings object, etc.

    Is there a best way to figure out what's disabling FFR in our project? I'm launching a scene that isn't currently running at 72 FPS and using the command adb shell setprop debug.oculus.foveation.level 4 to try and force FFR on but it makes no difference.

    Any advice on how I can debug this?

    Zach
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,428
    I think you are missing some info
     
  3. Zaflores

    Zaflores

    Joined:
    Sep 23, 2017
    Posts:
    10
    Hi! Sorry The post has been updated with all the correct information, Made a typo and submitted the issue while trying to fix it.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,428
    Make sure you use the oculus xr plugin and oculus integration and call ffr via code instead of adb commands. Are you using OVRMetrics to check FFR level?

    Also, definitely update unity to the latest LTS for a good performance bump as well :)
     
    Zaflores likes this.
  5. Zaflores

    Zaflores

    Joined:
    Sep 23, 2017
    Posts:
    10
    Yes!

    I am using the Oculus XR Plugin and not OpenXR, and I am attempting to enable FFR via code.

    My code for enabling FFR looks like this:
    Code (CSharp):
    1.  
    2. public class EnableFoveated : MonoBehaviour
    3. {
    4.     private void Awake()
    5.     {
    6.         InputFocusAquired();
    7.         OVRManager.InputFocusAcquired += InputFocusAquired;
    8.     }
    9.  
    10.     void InputFocusAquired()
    11.     {
    12.         OVRManager.foveatedRenderingLevel = OVRManager.FoveatedRenderingLevel.HighTop;
    13.         OVRManager.useDynamicFoveatedRendering = true;
    14.     }
    15. }
    I added the FFR level to my OVR graph and it looks like this script isn't correctly setting the foveation level however the ADB command does trigger the foveation level to increase to the specified amount (however I'm seeing no difference in visual quality despite trying to set FFR to the max level, and no changes in FPS graph in OVR metrics tool)
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,428
    Does the code even run?
     
  7. Zaflores

    Zaflores

    Joined:
    Sep 23, 2017
    Posts:
    10
    Yes!

    I was actually able to fix the foveation not being set by changing the code to the following:

    Code (CSharp):
    1.         OVRManager.foveatedRenderingLevel = OVRManager.FoveatedRenderingLevel.Low;
    2.         OVRManager.foveatedRenderingLevel = OVRManager.FoveatedRenderingLevel.HighTop;
    3.         OVRManager.useDynamicFoveatedRendering = true;
    I saw somewhere it was a bug that a cached value was being used and that by changing the value twice you could set it to the appropriate level. The foveation level is now reflected in the OVRMetricsTool however I am not seeing any sort of visual difference still. I have yet to verify this with a GPU capture in RenderDoc (which will be my next step) but with the level set to HighTop there should be some pretty obvious visual difference with foveation on, I believe
     
  8. Zaflores

    Zaflores

    Joined:
    Sep 23, 2017
    Posts:
    10
    Apparently FFR only works with Vulkan!

    Switched the graphics API to auto graphics API and things are running a lot better.
    Maybe this could be added into the oculus package as a warning, because I was stuck on this for quite a while. Hope this is useful to someone!

    Zach
     
  9. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,428
    If it's said nowhere make a bug report
     
  10. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    266
    FFR with OpenGL stopped working since URP 10.10.1.

    I'm working on a OpenGL project using URP 12.1.8, and FFR is not visible at all regardless of the level, despite the Overlay Tool shows the correct FFR number. Changing DynamicFFR or Intermediate Texture options does not help.
     
  11. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,428
    File a bug report, otherwise it won't be fixed
     
    Zaflores likes this.
  12. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    266
  13. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,428
    Disable dynamic ffr and set it to high. If it doesn't work it's different than the bug report, as the solution there was that it was on dynamic reading the reply