   jogl framerate issue and concept of a world update
  Hi,i currently ran into 2 problems. Hopefully someone can give me some hints.1. I use jogl to render a 3d scene. Jogl supports automatic buffer swaping after rendering, which is a mess. With VSYNC enabled i got 54 to 62 frames per second. With the disabled flag they go up to 700 frames. The measured time is ~0.01 milliseconds per frame (mspf). Taking control over the buffer swaping (using drawable.display(); drawable.swapBuffers(); instead of drawable.repaint();) creates me a fixed framerate at 60 frames per second. Thats quite good. But the timings are jumping from 0.0 to 16.6 or even 33.2 mspf. This shows me, that the swap buffers method do not swap the buffers at command but when ever it wants. Displaying a graph of the mspf gives me about 10 frames with 0.0 mspf followed by 10 frames with higher values. This problem only seems to appear on windows xp. The timings on windows vista are okay.2. I currently handling my world update in the same thread as i do the rendering. This results in jerky behaviour with jumping animations. So i use the calculated mspf to scale the time passed in the animated world. This works for slow systems which only reach for example 30 fps. This results in 32.2 mspf which means that every frame display 2 passed time slices. A problem occurs if good systems only render 30 frames but can reach even higher framerates. ATI grahics cards do this. For a full animated scene i got 4 to 7 mspf but only a framerate of 30. Using glFlush or glFinish doesnt change a thing.I thought about splitting the animation/world update and the rendering thread, but this will result in two major problems:a) As long as i do not lock / synchronize the objecttree the rendered world might by inconsitent. A part of the world might belong to the past and the other part to the current time. But locking the objecttree is equal to update and render in the same thread...b) If the graphics hardware is buffering images (this is what i guess when i see mspf-rates jumping) time slices could be skipped. The graphics hardware thinks "ah, ok, now i have no more images buffered, lets draw... 10" which results in 10 images, displayed in 1/6 of a second, which show a frozen scene -> again resulting in jerky animations...Some hints anyone?Greetz,Achilloes.[Edited by - Achilleos on September 30, 2008 2:59:00 AM]