Search code examples
c++virtual-realityunreal-engine4oculusunreal-blueprint

Unreal VR Build is running only at 60 fps why? But Runs at 80+FPS in editor(engine)


I'm developing a VR game using the Unreal Engine. My target device is Oculus Rift and Rift S. According to the Oculus documentation, the VR application should run at 80-90FPS. But my application(build) is running at only 60fps. But the same project in the unreal editor (engine) is running at 80+ FPS. One thing I found is that when I removed my monitor connection, the Frame rate hits 80+ (Build). Why is this happening? I thought this might be due to some bad polycount mesh, heavy postprocessing or complex material. So this time I exported/packed the sample VR Templated by Unreal Engine instead of testing my game. OMG! This build is also running at 59.1 FPS (a very basic unreal's default VR Template). I think there is something in the Unreal Engine side that caps the fps for the builds.

System Spec:

  • Geforce GTX 1060 3GB | 16 GB RAM DDR3 | i7 9th gen 3.7Ghz Processor
  • Oculus Rift Headset Unreal Engine 4.23 Oculus Lost Frame tool and
  • VRCValidator were used to test the FPS. I also tried with some other 3rd party fps measuring tools.

Thanks in Advance!


Solution

  • Finally after reading a bunch of Oculus VR and Unreal docs, forums, and Reddit discussions, I found the solution for this. We need to explicitly run few console commands.

    In the level blueprint's begin play event add a few second/microsecond delay and execute the following commands one by one.

    • add a very small dealy node first (0.1 to 1 second is enough)
    • vr.bEnableHMD 1
    • vr.bEnableStereo or goto edito -> project settings - > enable "Start in VR"
    • t.maxFPS 200 (you can give any value greater than 100 here)
    • r.ScreenPercentage 75 (lower the value better the performance and lower the quality too)
    • r.SceneRenderTargetResizeMethod 2 (for builds we need to set the render resize method)
    • and most importantly goto project settings-> under frame rate settings -> uncheck smooth frame rate then set minimum desired frame rate to 80+.

    enter image description here