Search Unity

Fixed foveated rendering on Oculus Quest not working

Discussion in 'AR/VR (XR) Discussion' started by Bslashingu, May 29, 2019.

  1. Bslashingu

    Bslashingu

    Joined:
    Sep 17, 2012
    Posts:
    28
    I have not had any luck getting OVRManager.tiledMultiResLevel working on Quest. With an older Oculus SDK I got the error "Tiled-based Multi-resolution feature is not supported" but now nothing shows up and seemingly there is no resolution change around the edge of the screen. It's as if there's no effect. This is on 2019.1.4f1
     
  2. Hyperactive

    Hyperactive

    Joined:
    Aug 13, 2013
    Posts:
    2
    Seems like it does enable in the script, but I agree nothing changes on screen. I printed the value of OVRManager.tiledMultiResLevel onto a text mesh in my game to check it's value. It does return that it's enabled, but definitely no pixel change.
    Maybe they haven't officially released this on Quest? Though it's clear it exists as can see it on published games like Vader Immortal.
    Odd!
     
  3. Hyperactive

    Hyperactive

    Joined:
    Aug 13, 2013
    Posts:
    2
  4. NicolaZangrando

    NicolaZangrando

    Joined:
    Feb 11, 2019
    Posts:
    2
    Hi! Did you manage to make it work?
     
  5. digitaljohn

    digitaljohn

    Joined:
    Aug 14, 2012
    Posts:
    8
    Same issue here.

    Using Unity 2018.4.1f1
     
  6. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    311
    FWIW no probs for me to have it to work using the latest Oculus mobile SDK, Unity 2019.1.2f1, standard render pipeline. Obviously this won't work on the Rift, only on Quest. Also, it didn't worked in LWRP.
     
  7. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    160
    Trying with Unity 2019.1.4, Oculus SDK 1.36, using LWRP.
    Changing FFR settings won't do anything, also the Render Scale option in the LWRP settings doesn't affect the final resolution (both with FFR enabled and disabled). Might definitely be a problem with LWRP then...
    EDIT: switched back to Standard Pipeline, and FFR works fine now.

    As a side question, how much does the LWRP help with Quest compared to Standard Pipeline?
     
    Last edited: Jun 11, 2019
  8. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    311
    @DanjelRicci I didn't took much time experimenting with, at first tries results were bad (I mean worst than standard RP).
    But once again i didn't investigated it further.
     
  9. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    160
    @Gruguir “good” to know then. I was reading more or less the same feedback in other non-VR related threads...

    On a side note: I’m not trying complex scenes actually but it’s been really hard for me to understand what makes the game stutter and what not, because it stutters regardless if there’s a cube or some characters (thread here). I ended up here when trying to enable FFR to save on performance.
     
  10. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    168
    @DanjelRicci for us performance improvements are huge with LWRP. 10 fps to 50fps with a scene with two lights with shadows. Performance is about the same for simple unlit scenes though.

    Has anyone from this thread reported a bug to Unity with it? If yes, please post the case number here.

    @LeonhardP @phil_lira any information about this? Is the FFR implementation something on Unity's end or on Oculus' end?

    Edit: reported as (Case 1162746) [LWRP] Quest FFR (Fixed Foveated Rendering) not working on LWRP
     
    Last edited: Jun 14, 2019
  11. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    168
    @phil_lira and everyone here, I just spent half a day just debugging FFR on LWRP and found a fix.
    My assumption was that FFR only works if graphics are directly put on screen without inbetween resolving into a temporary render texture, and turns out this is true.
    I added in a couple dozen debug logs into the LWRP itself to track it down, found that "requiresIntermediateColorTex" was always true and that the only reason for it is that Display.main.requiresBlitToBackbuffer was always returning true for the Quest. Knowing that the Built-in pipeline renders directly to the backbuffer I assumed that this is incorrect and just overwrote it with "false".
    Now FFR works, and since I didn't do any other change to the LWRP I think everything else should still be working as well.

    For anyone who needs this as desperately as I did: change "Display.main.requiresBlitToBackbuffer" in "RequiresIntermediateColorTexture" in ForwardRenderer.cs in the LWRP package to "false". Done. Double that performance.
     
    DanjelRicci likes this.
  12. StudioEvil

    StudioEvil

    Joined:
    Aug 28, 2013
    Posts:
    51
    @fherbst tried that but the RequiresIntermediateColorTexture returned true anyway. Didn't have time to investigate so i put a glorious "return false" on that method AND IT WORKS LIKE A CHARME :D
    Frame rate is now fixed at 72 (before it was oscillating between 70 and 52).
    Thank you very much! :)
    Hope that a fix will arrive from Unity or Oculus.
     
    justdizzy, fherbst and DanjelRicci like this.
  13. justdizzy

    justdizzy

    Joined:
    Mar 8, 2016
    Posts:
    48
    I was also getting "isTargetTexture2DArray" and "renderingData.killAlphaInFinalBlit" as true, so I went with the nuclear "return false;" option. One thing to note is that I believe this workaround will disable the ability to cast the content to a mobile device or Chromecast, though I can't verify this.
     
  14. Dark-Table

    Dark-Table

    Joined:
    Nov 25, 2008
    Posts:
    236
    @fherbst I tried out your fix and it looks like it enables FFR, but breaks MSAA. Fiddlesticks.
     
  15. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    168
    I double-checked that again and it doesn't seem to break MSAA for me (or it doesn't work in either mode). Weird.
     
  16. justdizzy

    justdizzy

    Joined:
    Mar 8, 2016
    Posts:
    48
    I made a quality switcher that can cycle from MSAA off to MSAA 8x, and when using the "return false" work-around, I see no difference in aliasing, but when using the unchanged file, I can see it shift, so it breaks MSAA for me.
     
  17. NicolaZangrando

    NicolaZangrando

    Joined:
    Feb 11, 2019
    Posts:
    2
    Hi,
    I've resolved by switching off the option "Force Into RT" in the camera component, it appears if you switch to Debug mode:

    fovproblem.png
     
    fherbst likes this.
  18. Dark-Table

    Dark-Table

    Joined:
    Nov 25, 2008
    Posts:
    236
    @NicolaZangrando What does this setting fix? I'm using the OVRCameraRig and this setting is off by default on all the cameras in the scene and I still have either broken FFR or broken MSAA.

    The simplest way to test this is use a shell command to turn on FFR across all apps:
    Code (CSharp):
    1. adb shell setprop debug.oculus.foveation.level 4
    You'll be able to see that FFR is running even in Oculus Home.
    ffrtest.png
    In Oculus Home you can see FFR on the window beams, but you can also see the rest of the scene is using MSAA (no jaggies).

    Then go to your LWRP app and see if FFR and/or MSAA are running.
    Without FFR Hack:
    lwrp_no_ffrtest.png
    With FFR Hack:
    lwrp_ffrtest.png

    Even though the plank near the center of the screen is outside of the area affected by FFR you can see the aliasing on it when the hack is applied.

    Has anyone from Unity commented on this issue yet?
     
  19. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    168
    No, my bug report from June 13 ((Case 1162746) [LWRP] Quest FFR (Fixed Foveated Rendering) not working on LWRP) is still unanswered. Over different channels (success team) I got the vague reply that it's "discussed internally", but that's 2 weeks ago now.
    @phil_lira any news?