GodotVR / godot_openvr

GDNative based Open VR module
MIT License
227 stars 34 forks source link

FPS stuck on 45 FPS #24

Open BastiaanOlij opened 6 years ago

BastiaanOlij commented 6 years ago

I'm just recording this to see if others experience this as well. I now have a working FPS counter in 3D (I'll add it to the demo project soon) and noticed that while the FPS starts out strong at between 75 - 90 fps it suddenly drops and gets fixed at 45fps. Rendering on the HMD however looks solid.

This makes me wonder if this is OpenVR or Oculus stepping in, possibly something like the timewarp or something. I suspect the VR SDK recognising I'm not reaching a solid 90 fps and decides to do its screen interpolation thing. i.e. we render every even frame and the SDK interpolates every odd frame. Our FPS would be 45 for this to result in 90fps on the HMD.

I don't know if this is an Oculus or OpenVR thing, it may be unique behaviour on the rift. It will be very interesting to see what others experience once I release the Sponza VR demo.

ChristophHaag commented 6 years ago

SteamVR has some pretty good graph for that which also shows when the "reprojection" interpolation is enabled. https://developer.valvesoftware.com/wiki/SteamVR/Frame_Timing

BastiaanOlij commented 6 years ago

Cheers! I'm gonne see what that tells me :)

BastiaanOlij commented 6 years ago

OK, that didn't make much difference but seeing I'm using a Rift and not a Vive it could be oculus being the one in control here. Anyway, this is for another day. I want to get my demo and my video up by the end of this weekend :)

Olm-e commented 6 years ago

hello, I was/am experiencing the same kind of problem, with frame rate degrading fastly at start of a godot scenery, more visible on one with screenspace reflection effect on objects, and some kind of bizarre ghosting effect with it... (w/ disabled all reprojection in vrmonitor and 1:1 supersampling rendering) this is using godot alpha, openvr and godot_openvr from early december (it was working in that state, needed to develop/show/test not debug) so I have to update to latest codes and test new demo to see if this has changed. - but thought it was worthing to report confirmation on linux with vive and nvidia driver at the time -

BastiaanOlij commented 6 years ago

@Olm-e there are several performance enhancements made in Godot since alpha so its worth trying out with the latest release candidate (though you'll probably end up fixing a bunch of code as there are changes in both Godot and the openvr module). Seeing where we're at with release candidate 1 I think its relatively safe to grab the latest master or RC1 and start polishing up your project. Do not Akien did say there are a few regression issues with RC1 (I think they are fixed in master) so might want to read up on those to see if they effect you.

While I'm sure I'm restating the obvious but seeing how often this pops up it can't be said enough, make absolutely sure the editor is displaying code, not the 3D viewport, when testing your game, or the editor will keep the GPU busy and drop your framerate in half.

If you're using GIProbes make sure to turn the high def voxel cone off in your settings, that is a killer for VR (already brings Sponza on desktop down to the 45fps region on my laptop). Consider looking into the new lightmapper.

Other then that, several of the new features in Godot are very GPU intensive and it does impact VR hard though I'm still very pleasantly surprised at how well the Sponza demo runs on my GTX 1060/i7 kobi lake laptop.

In the end, its hard to point at a culprit without knowing more about your scene and what you're doing. VR requires you to be sparser with effects, Godot is no exception here. You can see this in many other VR games that simplify lighting effects. Just a compromise when needing to run high resolution high fps.

Olm-e commented 5 years ago

So I'm continuing this here as it looks like more appropriate issue :

On Linux (can't test otherwise) I realised that using any sort of projected shadows (from spots or omnilights) would creep the FPS very badly. this extreme drop in FPS is bizarely contravariant to the number of vertices displayed (meaning the more vrtx the more fps, the less on screen, the less image displayed ... :Z) the same content displayed with and without shadows: 7>25 fps / 90+ fps

when the framerate drop, there is also an anoying ghost effect, apparently made by "the compositor" from openvr, that apparently try to compensate for the movement but quite badly then... displaying 2 images is not enhancing the view in any case (being it compensated or not but not both) at 90fps it's barely noticable but with some probable zones of less good framerate in any game, this effect must be looked at with shadows (8 lamps) godotvrshadow without shadows (9+ lamps) godotvrnoshadow