Jump to content
  • Advertisement
Sign in to follow this  

OpenGL stuttering movement of objects in front of a static background

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

hi guys, first of it all, thank you very much for all the information here in this forum. this really kicks me :) i was just wondering if anyone here dropped into the same problem as i have observed here quite often. let me describe you with what i was struggling the whole night. when rendering an object which is moving slowly accross the screen (a car on a street, for example) it looks like the car is not moving smoothly at all. it is more like it moves constantly forward, but it stutters. I tried everything to find this problem. It is neither wrong interpolation, nor a problem with my actual system performance or something else. my framerate is constantly at 500 FPS. I have measured the frame times, they are almost alike. The object is passing the screen (static background) horizontally. My observation is like some frames are skipped (or rendered doubled). I was just curious if this is an OGRE problem or something like that. So i did a generic renderer, and i had the same problem there. I tested it on some friends computer (with decent GTX260, GF8800 or ATI 4870,4890, etc) -> same result. I tried openGL and directX. -> same result. So what am i doing wrong? my render loop goes like this: 1. calculate objects 2. render 15 objects (objects consist of 40-50 render batches per object) 3. swap framebuffer 4. goto 1) i also worked on another reproducer which renders only very few batches per frame, and this seemed to run quite smooth. So is it some kind of buffering problem? i thought that swapping the buffer might finish all buffers? guys, i really appreciate your help. thank you very much in advance. greetings,

Share this post

Link to post
Share on other sites
This probably isn't it, but does your camera follow the object by chance? If so, make sure you're updating the position of the camera last.

Share this post

Link to post
Share on other sites

i'm using QPF for measuring the time between the actual frames. this time is used to update the movement of my objects. i did both:

a) generate equally spread packets at 20hz and interpolate between them
b) base the movement on a function above time

same result.

i did also a frame capturing of each frame, and when i compare those images, one image is doubled sometimes. (though i'm not sure if it is probably just a matter of capturing :(

in my case, the camera has to be static. i know, that if you're updating your viewport and have your camera moving (like in racing games and such) you won't notice it. it's just there when observing everything.

i also tried to clamp my view at 30Hz (software) - same result. If i enable VSynch... same result aswell.

so, any idea on where this would come from? it's not constant performance jerking, just a 'hop' here and there.

Share this post

Link to post
Share on other sites
Ok, i did some more investigation. It is:

a) not depending of the number of batches i am going to render (3-4 batches are fine, 100 batches are producing those glitches)

b) my framerate with 100 batches is still above 100 FPS (GTX 260)

c) the cpu is almost idle, it is only due with interpolating between 2 position

d) it is not the timer (QPF) - i have produced 60Hz preprocessed frames and played them - same result

So my assumption goes into another direction:

i am doing a simple render loop:
1 interpolate,
2 transform,
3 bind textures,
4 call tons of VBO batches
5 call wglSwapBuffers

no glFlush/glFinish involved. So i am just curious if this is the right way to go. In my case, i don't have any heavy CPU load, this means the CPU is almost idle and just pushing as many batches as it can.

Is it possible that i am running into a synch/desynch problem here? Like i am drawing one frame, then switching front/backbuffers, render the next frame, and so on. But somehow my buffers aren't finished yet, so the driver starts to throw frames away. Just a random idea...

What do you guys think? Thank you very much. i'm kinda stuck here.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!