I’m currently developing in **UE4 4.11 **and I’m having trouble rendering with the commercial HTC Vive.
For testing purposes, I shipped a build that is the ‘First Person Shooter’ Template. (of course with VR compatibility)
I tested this build on several platforms.
PC - 300 FPS (I set a Max of 300)
Rift - 75 FPS
Vive - 45 FPS
It is worth noting that I have tried exporting scenes with scaled scene intensity for GPU/CPU rendering and the FPS on the Vive DID NOT CHANGE.
I also did ensure that all intensive post-processing effects were lowered/turned off. (e.g FXAA AA, lens flares off, motion blur off)
Upon further testing I also found out that the FPS is locked to 45 when even executing a basic scene in Unity.
Is there anyway to unlock the FPS of the Vive?
P.s the specs of my PC are as follows: CPU: i7-4790k @ 4.00GHz
GPU: 8GB GeForce GTX 970
I have some bad news for you. You NEED to hit 90 frames per second on the Vive. This is the hardware refresh rate for the displays and it is fixed at 90 FPS. This means you need to be rendering your frames about once every 11ms. Anything more than that is unacceptable. If the engine detects that you are BELOW the 90 frames per second, such as 85FPS, it will not render the scene at 90FPS, instead, it will render each frame twice, and let the renderer catch up. You’ll notice that half of 90 is 45. This is what’s happening to your game.
What you should be doing is running the GPU performance visualizer every time your scene is not hitting at least 90 FPS. You can do this at any time by hitting “RCtrl + RShift + comma”. You’ll get a pop up window which shows you a bar segmented into different colors, with each bar being a slice of time. You can click on each bar to see what it is and how much time is being consumed to render that frame. I’ve been doing this quite a bit in the last few days, so I can give you a few pointers on what causes performance hits.
Shadows! Particularly dynamic shadows. Currently, getting good lighting in VR is all about trickery, fakery and black magic.
Paralax Occlusion Mapping materials
Light sources which are not static, cast shadows, etc.
Post process settings (AA, SSOA, Reflections)
Scene Capture Components
Particle emitters, particularly the ones with lots of translucent materials
Okay, so you capture the performance of a scene. How do you figure out how much each part of the scene costs your GPU?
I use the scientific method coupled with the process of elimination. Here are my general steps:
Observe a performance problem (FPS drops below 90 FPS for an extended period of time and consistently)
Form a hypothesis on what could be causing the problem. 95% of the time, it’s going to be wrong.
Collect data. Use the performance visualizer to see where your spending most of your time in the render loop. Is it lights? Shadows? Base Pass? Particles? Post Process?
Establish your hypothesis and write it down in notepad++. “I think my scene is slow because the torch is casting dynamic shadows”.
Establish a consistent and repeatable test! Place your camera at a particular spot in the scene and begin the game. DO NOT move the camera in your game. Observe your FPS and try to get a range (~80-82 FPS)
Remove your hypothesized source of performance draw.
Play the game again and do not move the camera. Observe your FPS and establish the new range (~82-84 FPS).
If you keep toggling the visibility of that object and can consistently see a change in FPS, you can get an idea on the FPS cost of that object. “My torch costs me about 2 FPS per torch, so if I have 5 torches in my scene, I’m looking at a 10 FPS cost.”
Repeat for every element in your scene
Also, keep in mind that you can also run into performance problems on the CPU side as well! This usually comes down to poorly chosen algorithms, or doing too much processing all at once. You can repeat the above process to isolate and identify the source of CPU lag.
Thanks for the list of ways to minimize FPS cost and your scientific method application.
I was more concerned to the fact that I tested the Vive on an extremely basic scene, and yet still ‘didn’t hit the 90 FPS’ mark.
This was all tested on an extremely basic pre-built UE4 project template, yet I’m unable to hit that 90 FPS mark.
Within my other overly complex scene I have extraneous amounts going on, on screen. Yet both shipped builds run at 45 FPS. No more, no less.
Now I’ll presume you know just how basic and non-complex the ‘First Person Shooter’ Template is, so I’ll spare you the brief. But don’t you think it’s quite odd?
Are you sure the frame rate is being reported correctly? It would seem to me that 45fps is an unusually specific framerate that just happens to be half of the native 90fps that Vive requires - and you’re getting that reported in both Unity and Unreal. Techniques like instanced stereo rendering may be causing the framerate to be reported at half the actual, and that actual frame rate may be being capped at the display frequency of the Vive.
Like Ambeshee was clue’d in on, yes. Unusually specific and for a reason
This is a known issue, you most likely have “Enable Reprojection” enabled in the steam settings. DISABLE this setting (i think it is enabled by default). I’ve encountered the issue aswell, it seems to almost be random at times to what your rendering (not even a heavy taxing scene can cause it to go to 45 fps). UE4 “locks” to 45 FPS. The issue is logged as UE-30406
Hey there, KRushin! Thanks for the reply! Thank god it’s not just me.
Awesome to hear the bug has been logged too!
I did attempt turning that off in my debug process and the SteamVR software would send out blank (black) frames in place of missed frames. I presume this is normal behavior as re-projecting would check the render sequence multiple times to ensure frames aren’t missed.
P.S. I just tried shipped the project in 4.12 (I also noticed that they updated the SteamVR SDK integration within this update) and the tracking seems to be much more natural and less frame-dependent or simply more optimised.