Possible causes of cyclic FPS drops?

后端 未结 1 1721
一个人的身影
一个人的身影 2021-02-14 13:59

I was writing a new code base in opengl and have encountered a weird bug very early on. It is a distinct fluctuation in framerate that is repetitive and predictable.

I k

1条回答
  •  甜味超标
    2021-02-14 14:35

    When we were building a game engine at my last job we also had curious problems like that from time to time.

    Causes I remember:

    • Lua garbage collection. Where were using Lua as scripting language for the engine and the GC would make it appear as if there was problem with the rendering! Though it was not obviously. Check for any other threads or even processes that might become greedy in your application/machine.

    • OpenGL driver issues: disabling or enabling "Threaded Optimization" in the NVIDIA driver had funny effects on performance like this sometimes. ATI drivers more often simply had bugs which required an upgrade.

    • Problems with the Windows event loop. Like using GetMessage instead of PeekMessage.

    Another thing: If you are really not rendering much and have several thousand FPS: even the slightest increase in rendering time will have "huge" effects on your FPS. So what you are seeing might be very normal operating system/driver tasks that are irrelevant when working with "normal" game FPS like 60 to 120 and not much noticeable later.

    0 讨论(0)
提交回复
热议问题