OpenTK based game stutters intermittently

I am currently developing a game using OpenTK for rendering; C #,. Net 4.0, OpenGL 2.

Performing maximized (not full screen, but taking up all available screen space) with a resolution of 1280x1024, I see about 400 FPS on average. At 1680x1050, I see about 315 FPS on average. Despite this high frame rate, I experience intermittent stuttering.

In principle, for about 3 full seconds, the rendering will stutter noticeably, then it is perfectly smooth for about 0.5 to 1 second. This cycle repeats forever.

There is no frame rate reduction on my FPS counter according to stuttering. I calculate the frame rate by counting frames until I reach the desired refresh rate, and then I calculate the frame rate using the number of ticks per second, the number of ticks at the refresh rate and the number of frames that were counted. With this method, I see the update only once every two seconds, but I have never seen a drop in frame rate much lower, wherever I expected it to be.

The problem is greatly exacerbated if I drag the game window onto the second screen.

Running the application in the Release assembly did not solve the problem.

I performance profiled application using ANTS redgate. This indicated good problems that I have since fixed.

Any suggestions here?

+3
1

.

, ( GC.CollectionCount() 0, 1 2 ). , ( , ).

, gen-1 gen-2 .

: (.. Run() Run (60), (60, 60)) vsync. .

, , . ( , 60 59,9 ).

+3

Source: https://habr.com/ru/post/1781920/


All Articles