Announcement

Collapse
No announcement yet.

UE 4 and Oculus Rift Framerate Optimization

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UE 4 and Oculus Rift Framerate Optimization

    I have been testing Unreal Engine 4 demos with Oculus Rift in the past few weeks. What I was most surprised/disappointed with is the low framerate I get despite my fairly beefy setup - running on dual Radeon HD 7990 in crossfire mode. It has improved a bit with version 4.1, but it's still very low. The only demo that runs smoothly (60FPS) on the Rift is the Mobile demo and that apartment demo that was made for VR anyway. Everything else is slower than this. With Reflections demo I get max 42 FPS. Elemental demo is the worst - 12FPS in the intro when we get to the external scene. Does anyone know what settings/hardware was Oculus using with their HD Rift Demo when they were showing Elemental demo? If my framerate is so lousy on DK1, then how on earth did they pull off 60FPS on HD rift? Using different drivers?

    I would be very grateful for any advice regarding the framerate optimization when running the UE4 level on the Rift. Here are my main questions:

    1 - What is the most optimal way to run a UE4 level? Runing it from UE4 editor and then closing the editor in the background, or running it as a standalone?

    2- Is CrossFire/SLI properly supported when running a level? I've heard Editor itself doesn't support it, but surely running the level should, right? I have crossfire turned on and my CPU usage monitoring says only the first GPU is being used to the max, none of the other 3 cores ever gets this high. When I run Crysis 3 for example the GPU core usage seems to be much more efficient. Maybe there's a setting that I missed to enable/optimize multi GPU threading.

    3- which .ini files contains the antialiasing and other settings that improve performance? (defaultengine.ini?) If you can name those settings and maybe give some examples that work best for you for VR that would be brilliant. I'm also a bit confused as to where are the quality settings for the demo scenes? Are they in the demo folders themselves (couldn't find them) or are these settings read from the UE installation folder? Also what are the biggest culprits for the framerate drop in VR? Post processes, reflections..?

    4- Is current oculus VR driver for UE4 pretty optimized as it is or can we expect significant framerate improvements in the future? I thought investing in 4 GPU system would have me sorted for a year or two so I would really like to know if problem lies in hardware or software optimization. HD Rift DK2 is just over 2 months away and given the current results I'm a bit worried if things will run smoothly. Do I need to invest in a new system again? If so what would be the best graphics card at the moment to run UE4 levels on? Titan? 780 Ti? 295X? Quadro?

    It would be great if people would contribute to this thread with their best optimization practices/settings for VR. I'm sure I'm not the only one struggling. If there is already a thread somewhere that answers any of my questions please post the link.

    Thank you!

    #2
    Hi @Alesh,

    I do not have answers to all your questions, but I had the same concerns regarding performances with the Oculus Rift DK1.

    Here is what I can tell you:
    1. First of all, be sure to use the rift as recommand (by Oculus VR) as an extended monitor (not in clone mode, as it breaks things like vsync).
    2. Disable the "Aero" Windows desktop composition engine. Right-click on your desktop, click "Personalize" and then select one of the "Basic" or "Classic" themes instead of an "Aero" theme. I did not bother to measure impact about this; does anyone did?
    3. Then, launch the game in standalone mode, without opening the Editor. Right click in you project ".uproject" file and hit "Launch game". This helps a lot!
    4. By then, you would run the game in default graphic config, that is "Epic mode"! This is a big problem here! You should tweak scalability parameters from Epic to High, at least. Read this official post to learn about its effect on Editor mode then read my explanation on how to make this dynamic into your standalone game using blueprints

    Hope all this will helps you achieve far greater framerates (as it did for me)! Last part is a bit clunky, but Epic will surely improve this.

    Cheers,
    SRombauts
    [Gamedev programmer at Darewise (Paris) - We are hiring]
    UE4 Git LFS 2.x Source Control Plugin 2.14-beta for UE4.23 - (v1 integrated by default since UE4.7)
    UE4 Plastic SCM Source Control Plugin 1.4.6 for UE4.23 - (integrated by default in Beta status since UE4.24)

    Comment


      #3
      Originally posted by SRombauts View Post
      Hi @Alesh,

      I do not have answers to all your questions, but I had the same concerns regarding performances with the Oculus Rift DK1.

      Here is what I can tell you:
      1. First of all, be sure to use the rift as recommand (by Oculus VR) as an extended monitor (not in clone mode, as it breaks things like vsync).
      2. Disable the "Aero" Windows desktop composition engine. Right-click on your desktop, click "Personalize" and then select one of the "Basic" or "Classic" themes instead of an "Aero" theme. I did not bother to measure impact about this; does anyone did?
      3. Then, launch the game in standalone mode, without opening the Editor. Right click in you project ".uproject" file and hit "Launch game". This helps a lot!
      4. By then, you would run the game in default graphic config, that is "Epic mode"! This is a big problem here! You should tweak scalability parameters from Epic to High, at least. Read this official post to learn about its effect on Editor mode then read my explanation on how to make this dynamic into your standalone game using blueprints

      Hope all this will helps you achieve far greater framerates (as it did for me)! Last part is a bit clunky, but Epic will surely improve this.

      Cheers,
      SRombauts
      Thanks a bunch! Plenty of tips I wasn't aware of when running on Rift. I was pretty sure the default quality was set very high, so it's good to have an idea how to tweak those settings to get the best performance. It would be very useful to have all these VR optimization practices in one place instead of chasing them around forums. Maybe we could make something like a wiki page just for that. I'll definitely post this on Oculus forums as well when I get back from my holidays and do some more testing..

      Comment


        #4
        Regarding cloning multiple monitors, I personally had the best performance with cloning enabled, and my game running in fullscreen mode, instead of running with my desktop extended and the game running in a "fullscreen" window.

        But to make vsync work (so that the Rift doesn't inherit the vsync timing of your primary monitor), at least with an Nvidia card, you can set the Rift as your clone source in the Nvidia Control Panel (#3 is my Rift in the screenshot below). This way the Rift's refresh timing will be used for vsync and you won't see any tearing on your headset, although if you primary monitor timing is even slightly different (probably the case) you will still see tearing on the primary monitor. Of course this shouldn't be a problem since only other people in the room will see your primary monitor while your Rift is on your head



        I also had noticeably better performance with the final "shipping" build versus Play In Editor (PIE). I have not tested @SRombauts suggestion of right-clicking and running the .uproject outside the editor, but that's a good idea (the editor really taxes the CPU, even when running in the background).

        Also, it's worth adjusting your project's Smooth Frame Rate settings (the higher the better), though I'm not sure how UE4 goes about hitting those higher targets:



        I also have a special unbounded Post Process Volume that's automatically enabled when the Rift is detected, with motion blur disabled (should improve latency) and AA set to FXAA (instead of TXAA) to avoid texture issues.

        FYI, I'm running on a 3770k with a GTX670, but with my admittedly minimal project running at 1280x800 on the Rift DK1, I'm able to hit a solid 60fps on "Epic" settings, even with full scene dynamic shadows, light propogation volumes, and shadow distance and resolution cranked up beyond the standard Epic levels:



        Good luck! I can't wait to see what people make for the Rift

        SINGMETOSLEEP / PARASOMNIA / DARKDRIFT / ETERNAL APEX / PRETTY ABRASIVE MUSIC / TWITTER @ACATALEPT

        Comment


          #5
          Nice advices, I should try and measure, then we should certainly make a Wiki page about all that.
          [Gamedev programmer at Darewise (Paris) - We are hiring]
          UE4 Git LFS 2.x Source Control Plugin 2.14-beta for UE4.23 - (v1 integrated by default since UE4.7)
          UE4 Plastic SCM Source Control Plugin 1.4.6 for UE4.23 - (integrated by default in Beta status since UE4.24)

          Comment


            #6
            Alesh,

            eVRydayVR posted a great article on Reddit about improving the framerate in UE4: http://www.reddit.com/r/oculus/comme...uality_in_ue4/

            There may also be a few other things which could degrade the experience for you:

            CrossFire/SLI is unfortunately known to cause microstuttering, which is apparently much more noticeable in the Rift. I have not tried it myself, but there are several posts related to this on the Oculus forums. Just google "Oculus Rift SLI".

            There is a great Oculus Rift page in the UE4 wiki. There is a section about texture blurring and vibrating caused by temporalAA. Disabling this seems to have improved the visual quality and feel for many people, I don't know what the impact on FPS is. https://wiki.unrealengine.com/Oculus_Rift

            Unfortunately, I broke my DK1 and I never had the chance to do much in UE4. With DK2 right around the corner, I can't justify buying a used DK1 (at a premium!). Now that I'm moving to UE4, optimization is a primary concern for me. Please share your results if you are able to try any of these optimizations. Also, it would be great if we could all contribute to the wiki with this sort of content.

            I believe UE4 could incorporate the tweaks from the first link to optimize the engine better by default (or by providing easy access to controlling these settings). The engine is improving continually, and I hope that optimizing for VR is one of Epic's priorities. I would consider these tweak's to be "low hanging fruit", as far as the relative effort involved in optimizing an engine. If optimizations are in the pipeline, it would be great to know where we can expect improvements.

            I, too, would like to have a better way to quantify where the greatest performance impacts are coming from. This is naturally part of any game development, and involves a significant amount of testing, but guidelines and tools that assist with this are always appreciated. For example, I had planned on using screenspace reflections, and then came to learn that they are not supported in stereoscopic rendering mode. It would be great to have an understanding of specific limitations that pertain to UE4 prior to trying and failing. I added this limitation to the wiki. I don't think we will be able to lean on Epic to do this entirely, so please share what you learn.
            Last edited by nitaiflick; 05-01-2014, 06:45 PM.

            Comment


              #7
              These are all great optimization tips! Wow, there are so many. I'm now quite confident 60FPS on the Rift is achievable with some tweaking. Will go through all of them next week and report the improvements and what works best in my experience. I'm sure Epic will incorporate these "Best practices" settings in the future updates if we start talking about it.
              From what I've read so far it seems that the biggest issue is multi GPU usage optimization of either Rift drivers or UE4 engine (or both). I really feel frustrated about not being able to use all my horsepower to the max. It seems a bit silly to splash out $700 for a beefy single GPU card just to get around something that is essentially a driver/software fix.

              Comment


                #8
                Tried the method from eVRydayVR of adjusting the DistortionScale value and i must say that i'm quite impressed. This does not increase performance directly but it can give you MUCH better image quality for free (and subsequently enables you to lower the ScreenPercentage to get better performance if you need to).

                I also like the fact that using this method there's no rendering power wasted on pixels that you can't see, so you are really making the most out of your HW. I'm wearing the Rift with the B lenses and with almost max eye-relief settings so i know i'm probably inside the group of users that will benefit the most from this trick.. using "hmdwarp s=1.2" without noticing any black borders.

                Unfortunately it seems like the DistortionScale value cannot be set in the Engine.ini, but i guess this should be fairly easy to fix..


                So what would be the best way to expose all of this to final users? I think an option could be: each time your game starts, the game/engine reads the values from the oculus config UTIL (eye relief and lens type) and makes an informed call on what should be a safe hmdwarp value for those settings (so black borders are not visible). Here it's important to stress that this estimation should always lean towards higher FOV, since even with the same lenses and eye-relief values different users can experience different FOVs depending on their face structure or how tight they wear the HMD.

                Then in Advanced Game/Video options you could let the users modify this estimated value if they want to:

                DistortionScale Slider: "FOV/screeen usage" <----------(1.2)--> "Image quality"

                DistortionScale Tickbox: "Optimize HMD FOV vs Image Quality on start"


                Having said that, probably with DK2/CV1's screens and optics there will be less screen pixels wasted in general, so maybe all this it won't be as relevant as with DK1..
                Last edited by PatimPatam; 05-08-2014, 09:24 AM.

                Comment


                  #9
                  Originally posted by PatimPatam View Post
                  Tried the method from eVRydayVR of adjusting the DistortionScale value and i must say that i'm quite impressed. This does not increase performance directly but it can give you MUCH better image quality for free (and subsequently enables you to lower the ScreenPercentage to get better performance if you need to).

                  I also like the fact that using this method there's no rendering power wasted on pixels that you can't see, so you are really making the most out of your HW. I'm wearing the Rift with the B lenses and with almost max eye-relief settings so i know i'm probably inside the group of users that will benefit the most from this trick.. using "hmdwarp s=1.2" without noticing any black borders.

                  Unfortunately it seems like the DistortionScale value cannot be set in the Engine.ini, but i guess this should be fairly easy to fix..


                  So what would be the best way to expose all of this to final users? I think an option could be: each time your game starts, the game/engine reads the values from the oculus config UTIL (eye relief and lens type) and makes an informed call on what should be a safe hmdwarp value for those settings (so black borders are not visible). Here it's important to stress that this estimation should always lean towards higher FOV, since even with the same lenses and eye-relief values different users can experience different FOVs depending on their face structure or how tight they wear the HMD.

                  Then in Advanced Game/Video options you could let the users modify this estimated value if they want to:

                  DistortionScale Slider: "FOV/screeen usage" <----------(1.2)--> "Image quality"

                  DistortionScale Tickbox: "Optimize HMD FOV vs Image Quality on start"


                  Having said that, probably with DK2/CV1's screens and optics there will be less screen pixels wasted in general, so maybe all this it won't be as relevant as with DK1..

                  Thanks for the great feedback! I like your idea about reading the profile to come up with a good estimation of the settings. I've also been wondering how much this will benefit the better optimized headsets. Hopefully as we approach a release product, settings like this won't need to be exposed to an end user.

                  On another note, UE4 released their roadmap, which is above and beyond what I had hoped for in my previous post. On it they included that timewarp is planned to be implemented this month, which should also improve performance. Epic continues to exceed my expectations

                  Comment


                    #10
                    Originally posted by acatalept View Post
                    Regarding cloning multiple monitors, I personally had the best performance with cloning enabled, and my game running in fullscreen mode, instead of running with my desktop extended and the game running in a "fullscreen" window.

                    But to make vsync work (so that the Rift doesn't inherit the vsync timing of your primary monitor), at least with an Nvidia card, you can set the Rift as your clone source in the Nvidia Control Panel (#3 is my Rift in the screenshot below). This way the Rift's refresh timing will be used for vsync and you won't see any tearing on your headset, although if you primary monitor timing is even slightly different (probably the case) you will still see tearing on the primary monitor. Of course this shouldn't be a problem since only other people in the room will see your primary monitor while your Rift is on your head



                    I also had noticeably better performance with the final "shipping" build versus Play In Editor (PIE). I have not tested @SRombauts suggestion of right-clicking and running the .uproject outside the editor, but that's a good idea (the editor really taxes the CPU, even when running in the background).

                    Also, it's worth adjusting your project's Smooth Frame Rate settings (the higher the better), though I'm not sure how UE4 goes about hitting those higher targets:



                    I also have a special unbounded Post Process Volume that's automatically enabled when the Rift is detected, with motion blur disabled (should improve latency) and AA set to FXAA (instead of TXAA) to avoid texture issues.

                    FYI, I'm running on a 3770k with a GTX670, but with my admittedly minimal project running at 1280x800 on the Rift DK1, I'm able to hit a solid 60fps on "Epic" settings, even with full scene dynamic shadows, light propogation volumes, and shadow distance and resolution cranked up beyond the standard Epic levels:



                    Good luck! I can't wait to see what people make for the Rift
                    This is brilliant advice! I was looking for a way to optimise UE4 for the Oculus and you've helped a lot with this. How have you made it automatically detect the settings when the rift is plugged in? Have you used a blueprint? If so could you share please? x

                    Comment

                    Working...
                    X