Jump to content
  • Advertisement
Sign in to follow this  
DarkNebula

OpenGL OpenGL smooth animation

This topic is 4863 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

Well, I'm doing some map scrolling for my map editor, and I have it moving every millisecond at 1 on a 800x600 matrix and sometimes, not all the time, the scrolling looks choppy. I wondering what's causing this. This FPS is over 800, so I don't think it's that. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Check the maximum delay between two frames. I suppose that 800 fps is averaged over some time. If some frames take a lot more time than others you get a choppy effect.

Share this post


Link to post
Share on other sites
I'd say do a time based movement. This way, no matter what the frames are, the pic should move the same. So say, how far should the pic move per whole second. Then multiply the seconds per last frame/game loop by that distance to get the distance to move this round. So if the pic should move 1 unit per second, then if the time passed this frame is 100milliseconds, 0.1second, than multiply 0.1*the 1 from above and you get 0.1, which is what it should move this frame.This way, if it flickers, you know the frame rate is bad. If the rate is good, the movement should be smooth, even if it chops for a second, the object will move as far as if it didn't chop.

Share this post


Link to post
Share on other sites
Switch to time-based movement. At 800fps, any small hiccup in your system (a banner add animating in a web browser window), will cause you to skip a few frames. It doesn't take much inconsistency in framerate to be very noticable, even at high framerates.

Prefer time-based movement, and prefer a consistant but slower framerate. I highly suggest turning on VBL sync, as you're consuming an unnecessary portion of the available system resources. There are other programs that would like to use that CPU/GPU/battery.

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!