Originally posted by Ansla
View Post
Announcement
Collapse
No announcement yet.
Wayland/Weston 0.95 Land In Ubuntu 12.10
Collapse
X
-
-
Originally posted by Ansla View PostCan you elaborate a bit on this? From what I know vsync should work the following way: once frame x is sent to the monitor rendering starts for frame x + 1 with whatever information is available at that time and not render anything else until the next vsync event. Now, at 60 fps the interval between frames is ~16ms. If rendering the next frame took just 4ms and somewhere between ms 4 and 12 new info comes from another player should a properly coded engine render a new frame that takes into account this new info?
a game like this may have a main loop that looks something like this:
Code:while(not done) readInput() stepGameLogic() drawCommands() vsyncAndSwapBuffers()
while frame_n calls the first 3 functions, frame_{n-1} is being rendered on the gpu, and frame_{n-2} is being scanned out on the display. frame_n then sends a swapbuffers command which should put it to sleep until the vblank fires. so with a game like this, when you press a button you should see a completed frame on the screen showing the games reaction within 3-4 frames worth of time later (for 60hz: 3.X/60 secs), depending on when you pressed the button - ie best case right before readInput, worst right after. (just in case you're wondering why it's 3-4 frames later and not 2-3, it's because a given frame only starts the scanout 2 frames worth of time later, it takes 1 additional frame for it to be completely displayed)
also emulators can benefit from 120hz rendering, both to reduce lag and for simulating the effects of a crt on a non-crt displays.
i also want to add that i'm worried about how wayland/weston will handle games/emulators that rely on vsync for timing, like the above example does. i mean, fullscreen applications shouldn't be a problem as it should just unredirect them, but i've yet to see a compositor that's able to work well when running these kinds of applications in a window (compiz and windows aero cannot, can't speak for macosx..)
Comment
Comment