hh79 / gzdoomvr

Classic Doom/Heretic/Hexen games in stereo 3D and VR; modified version of gzdoom.
GNU General Public License v3.0
125 stars 10 forks source link

Slowdown and dropped frames in menu #54

Open Blizarre opened 3 years ago

Blizarre commented 3 years ago

Hi, GzDoom is awesome but I have a small issue in the menus: When I am in the middle of a game, I can see on the steamVR perforamcne overlay that the rendering time is very short, (4 ms/frame), which is good enough to reach 90fps. But as soon as there is a menu (startup menu, in game menu, or even the only startup splash screen), each frame takes 13/16ms and I start to get motion sickness.

I had that issue in your official build 4.5.0. I quickly ran some profiling with visual studio on openvr_controller, and I noticed that during the slow-downs, gzdoomvr\src\common\rendering\gl\gl_framebuffer.cpp:OpenGLFrameBuffer::Swap() was using 63% of the CPU time, while it was negligeable otherwise.

In the menu, most of the time is spent in OpenGLFrameBUffer::Update:

bad

Outside of the menu, everything seems alright:

good

Oculus quest 2, using AirLink. SteamVR, Nvidia 1060 6GB (driver 461.40), windows 10, OpenGL (Vulkan only gives me a black screen in VR) I don't understand what could cause this?

Blizarre commented 3 years ago

Surprisingly it is not correlated with the complexity of the menu: I had this issue in vanilla Doom, doom2, doom2 + brutal, doom2 + brutal + vr guns + hd textures....

But somehow, the end of level screen (with the score and the secrets found) and the map are perfectly fine

hh79 commented 3 years ago

Yes, it is known issue. I don't know if I am able to speed it up but I plan to move displaying menus to separate plane as it is in QuestZDoom. It will be a huge flat 2d screen so it should help reduce motion sick issues. https://youtu.be/fLIouKzT4Lg?t=26