![]() ![]() Q: Will the human brain notice if a frame is dropped at 60fps? So 59fps for one second and then back to 60fps the next? Or does the dropped frame have other implications?Ī: “Unfortunately the animation still stuttered away like an old tractor plowing through a barren potato field during dry season.” source: Facebook pop: using Grand Central Dispatch) and =only keep user input and drawing code on the main thread=. What happens then if there is some other computational heavy process on the main thread while heavy animation is going on? Wont the frame-rate go down and even start to be really slow?Ī: If you cannot achieve a good frame-rate that way, since your main thread is busy elsewhere, it is recommend to rather move everything else (pretty much your whole application logic) to other threads (e.g. Q: CVDisplayLink must draw on the main thread to be visible. The CVDisplayLink is like a high priority optimized timer. Also a timer doesn’t fire at precise intervals, =if you miss a screen refresh only by 0.01 ms, then the whole image will be delayed by a full screen refresh= (causing animation lag and reducing the number of rendered images displayed a second). It makes no sense to render more images than your monitor can physically display or your sub-system can actually process. Q: Why use CVDisplayLink over NSTimer to do frame-animation:Ī: Because CVDisplayLink will make sure that rendering is in sync with your screen refresh rate and the graphical sub-system. =CVDisplayLink gives us a much better time-resolution than NSTimer= to measure percentage complete use: percentComplete = elapsedTime / animationDuration Q & A You can also use timeStamp and duration to skip frames if the frame-rate drops etc. You can set it to call a method on every tick, but instead of setting a time interval, the time interval is determined by the screen’s refresh rate. CVDisplayLink works very much like an NSTimer. Older frame animation technology at 24fps vimeo Description:ĬVDisplayLink is the holy grail of rich animation & interaction in OSX and IOS. =It’s highly useful when you want to combine animation with user interactions=, something that is not easily handled by transitions or stock animations.ĬVDisplayLink 60fps rich animation + interactivity demo: vimeo probably at 30fps? and original video in 60fps and the code for this here and here CVDisplayLink is a timer object that allows your application to synchronize its drawing to the refresh rate of the display. ![]()
0 Comments
Leave a Reply. |