Search Unity

Enable Foveated Rendering in Unity without Oculus Integration for Oculus Quest/Go

Discussion in 'VR' started by ROBYER1, Aug 16, 2019.

  1. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    From my understanding, to enable foveated rendering on the Quest/Go, you must use "OVRManager.fixedFoveatedRenderingLevel = OVRManager.FixedFoveatedRenderingLevel.High" or similar to enable foveated rendering in a Unity Project. This also requires having at least one OVRManager on a gameobject in the scene.
    I would like to know if it is possible to enable the foveated rendering without the need for the OVRManager in the scene or having Oculus Utilities/Integration imported into the Unity Project at all?

    Like is there anything we can add to the android manifest or call something from the Oculus(Android) integration from the package manager in Unity?

    We want to simply use the Oculus (android) and Oculus (Desktop) packages from the package manager in our application but not include too much of the Oculus Integration asset from the Unity Asset store as it contains lots of code that conflicts with other plugins we are using.
     
    hippocoder and VRAI_Chris like this.
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Bumple.
     
    ROBYER1 likes this.
  3. daves

    daves

    Unity Technologies

    Joined:
    Oct 18, 2018
    Posts:
    24
    Currently, no, but it's in our plans. We're working with Oculus to expose the necessary data from their OVR plugin upstream so that we can apply it to our render targets, which is required to enable the reduced-rate rendering that FFR uses.
     
    DevDunk, V-J, ROBYER1 and 1 other person like this.
  4. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Just seen this, I am glad to hear it is in the plans
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Will it be available without having to install external stuff? was thinking of just having it in options or within XR namespace.
     
  6. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Interestingly enough, this Oculus Connect talk mentions how Vulkan allows for cross-platform Fixed Foveated Rendering (FFR) due to the extension no longer being Qualcomm only. This means that once Vulkan is working for Quest/Go, we may well see FFR cross-platform between Vulkan on Windows platform headsets as well as Mobile VR.


     
    DevDunk likes this.
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah that's right but then it goes into SRP territory and that seems to be the realm of wizards.
     
    ROBYER1 likes this.
  8. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    hippocoder likes this.
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    So can we use Vulkan now or? I mean the communication is a bit less than nothing atm from various parties.
     
  10. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    It seems that the v1.1.3 listing mentioning FFR hookups for Vulkan on Quest has been removed since I posted about it on the forums.. very spooky. I think we will have to wait a bit longer. I can't get a build to run with Vulkan on Quest on 2020.1.0.14a
     
  11. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
  12. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    funvr_9 and a436t4ataf like this.
  13. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    Hi
    Which headset are you using? I guess you need some eye tracking to know which part should be rendered in higher quality, and which don´t.
     
  14. RetroFlight

    RetroFlight

    Joined:
    Nov 16, 2019
    Posts:
    41
    No, it renders the middle of the screens higher than the outer edges.
     
  15. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    I think that would give a terrible experience. I mean, you move your eyes all the time to look around instead of moving the whole head.
     
  16. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    I think it is good, to have both options. Because for 2x VR cases. One for low-cost / hardware VRs and one with the high-level / hardware VRs. On my quest i expirienced this FFR with only inside the middle. So i recognized a very high jump between regula pixels and the outside lower resolution. It was a lil bit strange, but after a few min. you adopt to it and you forget about it. Best way is, to have two options for FFR: 1x static, 1x dynamic for eye-tracking devices.
     
  17. RetroFlight

    RetroFlight

    Joined:
    Nov 16, 2019
    Posts:
    41
    I hear you but it helps in the meantime with performance. Id like to use it eventually for say, so have a huge instancing of a lot of particles. Turn on FFR for a few dozen frames while they load and you likely wouldnt notice as a player but it could help keep the frames up.

    I used it in games and never noticed it until it was pointed out, then I noticed it all the time.
     
  18. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137
    I got Vulkan running on my Quest in Unity 2019.3.9f1 and was looking for the FFR but still do not see. I read above that this is in 2020 version which I am going to try next. I shall report back.
     
  19. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Do not try Vulkan in 2020 yet the XR Graphics team are still working on it.
     
  20. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137
    I made a copy of my project and tried 2020 last night with Vulkan before I saw your message. I see what you mean. Only the left eye rendered (at least on multiview as I did not try multipass) and the resolution was very low despite being on Ultra settings. Also, no FFR option to be found anywhere. Do you have any idea of when this will all be implemented? Thanks for the reply.
     
    ROBYER1 likes this.
  21. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Ffr is implemented in the Oculus XR Plugin for XR Management. You can see it in the Manual for that plugin on the package website if you search Oculus XR Plugin Unity you will see it
     
    Immersive-Matthew likes this.
  22. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137
    Thanks @ROBYER1. I think my issue may be that I am using the URP and not the standard as per the details in the manual. It states:

    "FFR works best when rendering directly into the eye textures using the forward rendering mode. Deferred rendering mode, which is characterized by rendering into an intermediate render texture, is not recommended for use with FFR. This situation arises often when using the default Universal Rendering Pipeline, which included a blit operation by default at the end of the frame."

    Does this mean I need to go back to the old standard "Unity’s Built-in Render Pipeline" as I thought URP was the new built in standard going forward. Or do I just need to turn of blit in the URP? As I thank back to the previous standard renderer before I moved to URP, I do not recall seeing FFR as an option. Is this a setting I need to write code to turn on at specified level or is this a option to select in the Unity UI somewhere? Thanks for your help.
     
  23. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Nope, use URP if you can! Check your inbox on the Oculus forum I replied to your message there.
     
  24. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    So is FFR working now? Is it 2020 only? Or any URP build?

    (I'm not using URP until it's supported in AssetStore, but I'd happily install a new editor to try out the FFR separately)
     
  25. FuzzyOnion

    FuzzyOnion

    Joined:
    Aug 22, 2014
    Posts:
    35
    +1 Also curious if FFR is possible with URP.
     
  26. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    URP + FFR has worked together for many months now, why don't you try it?
     
  27. FuzzyOnion

    FuzzyOnion

    Joined:
    Aug 22, 2014
    Posts:
    35
    I'm hoping to. I guess I've been failing at my googling (mostly your posts come up encouraging its development). As far as I understand, there's no way to enable it without using the Oculus Integration package. I was hoping that there was support in Unity's new XR System. I'm not sure what it's like to mix the two.
     
  28. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Best place to check is my forum posts ;) and of course also the scripting API for the platform plugin you are using, if you search 'FFR' in the XR Oculus Scripting api in the link below you will
    find it is here:
    https://docs.unity3d.com/Packages/com.unity.xr.oculus@1.9/api/Unity.XR.Oculus.Utils.html?q=ffr

    and here:
    https://forum.unity.com/threads/2019-3-release-xr-updates.821637/#post-5441730

    Just with the Oculus XR Plugin (from package manager) - use
    SetFoveationLevel(Int32)
    Code (CSharp):
    1. Unity.XR.Oculus.Utils.SetFoveationLevel(level)
     
    ArchVizPRO and NeatWolf like this.
  29. FuzzyOnion

    FuzzyOnion

    Joined:
    Aug 22, 2014
    Posts:
    35
    Yes! Thank you! I really appreciate your reply. I'll try to do a better job of following the updates to the Unity docs. Thanks again!

    Cheers,
     
  30. LooperXS

    LooperXS

    Joined:
    Jan 8, 2021
    Posts:
    2
    Sorry for the dumb question, but where should I put that in order for it to work?
     
  31. Danielsantalla

    Danielsantalla

    Joined:
    Jan 7, 2015
    Posts:
    75
    Bump on that last question!
     
  32. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Into a script in awake/start or call it with a function when you want to change it? It is just one line of code you call I am confused what is still confusing about it!
     
  33. Danielsantalla

    Danielsantalla

    Joined:
    Jan 7, 2015
    Posts:
    75
    I actually did just that but it doesn't seem to be turned on in my builds. Even setting it to the highest value doesn't seem to do anything to my rendering :/
     
  34. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Oh that's odd - are you on Oculus Quest 2? The effect is a lot less noticeable on Quest 2 vs the Quest 1

    Make sure you aren't using any fancy effects like post processing that cause an extra blit when rendering - try stripping back or make a separate test project just with a world space canvas and a cube or something visual where you can see the effect - if it works there or in a new scene you will be able to compare and see if you are doing anything in your project that causes the extra graphics blit that breaks FFR.

    FFR isn't always the route to performance, and if FFR doesn't work then you have that extra blit happening which can kill performance

    Use the Android logcat logs in Unity to see what your build is telling you when you set it!

    Check the log for errors, also try setting dynamic FFR from the docs here:
    https://docs.unity3d.com/Packages/com.unity.xr.oculus@1.9/api/Unity.XR.Oculus.Utils.html?q=ffr
     
  35. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    I would recommend any time something doesn't work in your project, try it in a separate unity project or a copy of yours with all assets removed for a quick test - then go from there and compare with your project to see why it worked in one not the other
     
  36. Leoss

    Leoss

    Joined:
    Apr 18, 2013
    Posts:
    9
    Did anyone manage to make it work on Quest 2 and URP? I tried it and saw no graphical or performance change.
     
  37. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137
    Yes it works with both Quests and URP with OpenGL and Vulkan. You can really see it on around the edges if you set it to 4. You can also see what level the FFR is in the OVR Metrics tool. You should see a performance increase. Nothing amazing, but for sure measurable in OVR Metrics.
     
  38. JungJik

    JungJik

    Joined:
    Jun 23, 2020
    Posts:
    5
    Hi,
    I found this mode in unity document. but I couldn't find how and where I can set the FoveatedRenderingMode value to. 2023 alpha version.

    thanks for any help.
     
    Last edited: Jan 10, 2023
    seeyam likes this.