0
\$\begingroup\$

I'm having quite some trouble with camera stutter in my LWJGL2 game. The stutter only occurs when moving the camera. When it stands still, the scene is rendered smoothly. I could verify that by animating the trees in the wind, and they don't stutter.

Also, I can confirm that the stutter was not introduced by the screen recording software, however I suspect that the recording made the stutter even worse.

My game uses delta-time multiplied with the velocities that are changed using the keyboard or directly by code.

Things I've already tried without success:

  • Turn VSync on
  • Remove all unrelated code
  • Try with 30fps cap and 60fps cap

It's also not related to my graphics drivers since a different LWJGL2 project based on the same engine runs smoothly.

I'm also running some background threads to handle networking and am reusing Vec3 and Mat4 instances when calculating projection and translation matrices.

Any ideas on what could cause the stutter?

\$\endgroup\$
0
\$\begingroup\$

Nevermind, after searching for hours I found the error. I was periodically calling a cpu-intense method that refreshed the minimap. After moving the execution of this method into an own thread, the stutter disappeared. It's also worth mentioning that the stutter was appeared periodically so it makes perfect sense now why this happened.

\$\endgroup\$

You must log in to answer this question.