Jump to content
  • Advertisement
Sign in to follow this  
Sharlock93

Frame skips and Object jumps problem.

This topic is 757 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

The timing code you have in your example is trivial and hard to get wrong. But you might want to look at what glfwGetTime returns, verify that the time between frames is actually non-zero each time, etc.

Share this post


Link to post
Share on other sites

The timing code you have in your example is trivial and hard to get wrong. But you might want to look at what glfwGetTime returns, verify that the time between frames is actually non-zero each time, etc.

Yeah, this fucks with my head, I have even removed all the timing calculations, just straight up set dt to 1.0/60.0 and turn Vsync on, I honestly don't know what is happening.

Share this post


Link to post
Share on other sites

Have you tried taking out time-dependent distance calculations entirely? If nothing else is happening then moving a fixed amount each frame should be very smooth, even if slightly variable. If it's not, it sounds like something is periodically interrupting your PC, such as a bad wireless driver or similar.

Share this post


Link to post
Share on other sites

Have you tried taking out time-dependent distance calculations entirely? If nothing else is happening then moving a fixed amount each frame should be very smooth, even if slightly variable. If it's not, it sounds like something is periodically interrupting your PC, such as a bad wireless driver or similar.

I posted the same question to reddit, and someone mentioned i should test the examples that come with glfw, after testing them, it looks like those examples also had the same problem, after looking into it, like Lactose the problem happened every one second, I have a program called f.lux that is used for night time and changes the color of your screen, after disabling that, the examples of glfw ran smoothly, which is very very weird.

 

Here are two videos I made of the examples:

with f.lux:

 

 

without f.lux:

 

Share this post


Link to post
Share on other sites

Have you tried using QueryPerformanceCounter() as timer?

 

That is what glfw would use most likely, but I don't know, I'm still gonna test to see if not using f.lux would fix my problem first, I'm try to clean up my code a bit.

Share this post


Link to post
Share on other sites

So after removing f.lux, everything is smooth as a baby's butt, I wonder why would f.lux cause this? the staggering and the jump happens every second, like on each "second" boundary, maybe I should report this to the f.lux people.

Share this post


Link to post
Share on other sites

I ran in to this problem when my frame rate was too high using a fixed time step with no interpolation - long story short you can end up having two updates in a single frame and this happens over and over causing the jitter - I believe its referenced in the above article mentioned. Don't have time to look over your code at this second but

 

A quick fix is to turn on vsync by calling glfwSwapInterval(1) - you might give it a shot. The other f.lux thing might be turning vsync on and off - I'm not sure though

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!