Hi JS, On Fri, Apr 24, 2009 at 2:37 PM, Jean-Sébastien Guay <[email protected]> wrote: > As a related point, in Vortex we have a frame lock which will sleep a given > number of milliseconds at the end of the post-update phase before starting > the next frame. The amount of time it sleeps is dictated by a given frame > rate, i.e. if the time taken by the pre-update, update, post-update phases > was less than say 1/60th of a second then it sleeps for the remaining time. > This can be disabled at any time, and the physics work whether it's on or > not, it's just to give a consistent user experience whether vsync is on or > off. From what you've said you want to do something similar.
The frame scheme I'm working on right now only affect Viewer::run(), and you'll be able to switch it on/off as well. So if you don't use Viewer::run() then you won't get this facility, and even if you do use run then you'll be able to control the whether or not it does cap the frame rate. > So then, we'd have three frame-rate control mechanisms: vsync, OSG's > mechanism and Vortex's mechanism. So you see why I'd want a way to disable > the one in OSG easily (since we have more control over the one in Vortex to > make sure it does exactly what we want). > > Also, I've always been suspicious of this kind of scheme when related to > vsync. What if both vsync and the frame-rate control scheme in OSG are > turned on, but the frames finish rendering in between vsync cycles. Won't > that introduce tearing? We'd have to synchronize the end of OSG frame > rendering with the vsync so that the swap occurs at the right time, wouldn't > we? (this is a question I have about our own scheme too, I haven't had the > chance to look into how it's done that much) If vsync is on then the OSG side frame capping won't affect this, it won't cause tearing. The OSG frame rate capping might cause you to loose a frame occasionally though as the microSleep timing code is not perfectly accurate. The frame rate capping can be turned off so if you have vysnc on this may well be what you'd want to do. I'm still playing with the implementation + API. More info once I have something concrete to share. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

