The illusion of movement

the Story of the sense of sight, perception frames and refresh rate, motion blur of a moving object and the television screens.
(see also translation of an article by the same author "the Illusion of speed" — approx. TRANS.)

the

Introduction


You may have heard the term frames per second (FPS) and 60 FPS is a really good reference point for any animations. But most console games are at 30 FPS, and movies are usually recorded at 24 FPS, so why should we aim for 60 FPS?

the

... Frames per second?


the

the Early days of filmmaking



Shooting Hollywood film 1950 "Julius Caesar" with Charlton Heston

When the filmmakers started to make movies, many discoveries were made not by the scientific method, and through trial and error. The first cameras and projectors were controlled manually, and the film was very expensive — so expensive that when shooting I tried to use the smallest possible frame rate just to save film. This threshold was typically between 16 and 24 FPS.

When the physical film put the audio (the audio track) and play it simultaneously with the video, manually controlled playback became a problem. It turned out that people normally perceive a variable frame rate for video but not for sound (when changing both tempo and pitch), so the filmmakers had to choose a constant speed for both. Chose 24 FPS, and now, after almost a hundred years, it remains a standard in cinema. (In television the frame rate had to modify slightly because of how CRT TVs are synchronized with the frequency of the mains).

the

Frames and eyes


But if 24 FPS is barely acceptable for a movie, what is the optimal frame rate? This is a tricky question, because the optimum frame rate.


motion Perception is the process of inferring the speed and direction of elements in a scene based on visual, vestibular and proprioceptive sensations. Although the process seems simple to most observers, it has proved challenging from a computational point of view, and extremely difficult to explain from the point of view of neural processing. — Wikipedia

The eye is not a camera. He does not perceive the movement as a series of frames. He sees a continuous flow of information, not a set of individual pictures. Why, then, do frames work?

Two important phenomenon to explain why we see movement when looking at fast changing picture: the inertia of visual perception and Phi-phenomenon (stroboscopic illusion of continuous movement — approx. lane).

Most filmmakers think that the only reason is the inertia of visual perception, but it is not; although confirmed but not proved from the scientific point of view, the inertia of visual perception is a phenomenon whereby a residual image is probably saved about 40 milliseconds on the retina. This explains why we do not see the dark flicker in movie theaters or (usually) on the CRT.


Phi-phenomenon in action. Noticed movement in the picture, although it does not move?

On the other hand, many believe it is the Phi-phenomenon the true reason that we see the movement for separate images. This is an optical illusion of perceiving continuous motion between separate objects if they are shown quickly one after the other. But even Phi-phenomenon questioned, and scientists did not come to a consensus.
Our brain is very good at helping to forge a movement — not perfect, but good enough. A series of still frames that simulate movement creates different perceptual artifacts in the brain, depending on the frame rate. Thus, the frame rate will never be optimal, but we can approach the ideal.

the

Standard framrate, from bad to perfect


To better understand the absolute scale of the quality of the framerate, I suggest to see the review table. But remember that the eye is a complex system and it does not recognize frames, so it's not an exact science, just observations of different people over time.

the the the the the the the the
frame rate human Perception
10-12 FPS Absolute minimum to demonstrate movement. Smaller values already recognized by the eye as separate images.
< 16 FPS Creates a visible hitch, many such frame rate causes headaches.
24 FPS Minimum tolerable frame rate to perceive motion, cost-effective
30 FPS Much better than 24 FPS, but not realistic. It is the standard for NTSC video, due to the frequency of the alternating current
48 FPS Good, but not sufficient for true realism (although Thomas Edison thought otherwise). See also this article.
60 FPS sweet spot; most people won't understand to further improve the quality above 60 FPS.
∞ FPS To the present time science could not prove or surveillance to detect the theoretical limit.
note: Despite the fact that 60 FPS is considered good framrates for smooth animation, this is not enough for a great picture. Contrast and sharpness still can be improved beyond this value. To explore the extent to which our eye is sensitive to brightness change, and has conducted a number of scientific studies. They showed that subjects are able to recognize white frame among thousands of frames of black. If you want to dig deeper, here several resources, use.

the

Demo: how does the 24 FPS versus 60 FPS?


60vs24fps.mp4
I Thank my friend Mark tensing for creating this fantastic comparison.

the

HFR: the rewiring of the brain with the help of "the Hobbit"


"The hobbit" was a popular movie, filmed on a double framerate 48 FPS, which is called HFR (high frame rate). Unfortunately, not everyone liked the new look. This had several reasons, the main one — the so-called "the effect of the soap Opera".

Brain most people are trained to perceive 24 full frames per second as a quality movie, and 50-60 fields (interlaced television) remind us, the airwaves and destroy "film effect". A similar effect is created if you activate the motion interpolation on your TV for 24p material (progressive scan). Many do not like it (despite the fact that modern algorithms are fairly good at rendering smooth motion without artifacts, which is the main reason why the critics reject this feature).

Although HFR significantly improves image (makes motion not as faltering and struggling with blurred moving objects), it is not easy to find the answer as to improve its perception. This requires retraining of the brain. Some viewers do not notice any problems after ten minutes of watching "the Hobbit", but others absolutely can't stand HFR.
the

Camera and CGI: the history of the motion blur


But if 24 FPS is called barely tolerated Maratom, why you never complained about the discontinuity of the video, leaving the cinema? It turns out that the camera has a built — in feature- or bug, if you will — which is lacking in the CGI (including CSS animations!): is motion blur, i.e. the blur of a moving object.

Once you have seen motion blur in video games and in software it becomes painfully obvious.

Motion blur, as defined in Wikipedia, is

... the visible congestion of fast moving objects in still image or sequence of images such as a movie or animation. It occurs when the recorded image is changed during the recording of one frame is either due to rapid movement or during long-term exposure.

In this case, a picture is worth a thousand words.


motion blur


motion blur

Images from Evans & Sutherland Computer Corporation, salt lake city, Utah. Used with permission. All rights reserved.

Motion blur uses a trick, portraying a lot of movement in a single frame, sacrificing detail. That's the reason the movie at 24 FPS looks relatively acceptable, compared with video games at 24 FPS.

But initially, there motion blur? According to the description of E&S, which was first used 60 FPS for his mega-dome screens:

When you shoot film at 24 FPS, the camera sees and records only a part of the movement in front of the lens and the shutter closed after each exposure to rewind the tape to the next frame. This means that the shutter closed for the same time open. With the rapid movement and action in front of the camera frame rate is not high enough to keep up with them, and the images are blurred in every frame (due to exposure time).

Here is the graph, simply explaining the process.


Image Hugo Elias. Used with permission.

Classic cameras use seal (rotating segmented disk — approx. TRANS.) to capture motion blur. Rotating disc, you open the shutter for a controlled period of time under a certain angle and depending on this angle, change the exposure time. If the exposure is small, then the film will record less motion, that is motion blur will be weaker; and if the exposure is large, it enrolls more traffic and the effect will appear stronger.


the Shutter in action. Via Wikipedia

If motion blur is such a useful thing, why filmmakers tend to get rid of it? Well, adding motion blur, you lose the detail; and getting rid of it — lose the fluidity of movement. So when Directors want to shoot the scene with lots of detail, like an explosion with lots of flying particles or complex scenes with action, they often choose a small shutter, which reduces motion-blur and creates a crisp effect puppet animation.


Visualization capture Motion Blur. Via Wikipedia

So why not just add?

Motion blur greatly improves the animation in games and on web sites even on low framrate. Unfortunately, its implementation is too costly. To create the perfect motion blur, you'd need to remove four times more frames of the object in motion and then perform temporal filtering or smoothing (here's a great explanation from Hugo Elias). If a release acceptable material at 24 FPS you need to render at 96 FPS, instead you can just raise the framerate, so this is often not an option for content which is rendered in real time. Exceptions are video games, where the pre-known trajectory of the object, so that it is possible to calculate approximate motion blur, and systems for declarative animations such as CSS Animations and of course CGI movies like Pixar.
the

60 Hz != 60 FPS: refresh rate and why is it important


note: Hertz (Hz) is usually used when talking about the refresh rate, while the rate of frames per second (fps) is an established term for stop motion animation. In order not to confuse them, we use Hz for the refresh rate and FPS for the framerate.

If you are wondering why your laptop is so ugly looks like the Blu-Ray disc playback, often the reason is that the frame rate is unevenly divided into refresh rate (in contrast, the DVD will be converted before transmission). Yes, the refresh rate and framerate are not one and the same. According to Wikipedia, "[..] the refresh rate includes the repeated drawing of identical frames, while frame rate measures how often a video source will output a full frame of new data to display." So that the frame rate corresponds to the number of individual frames on the screen, and the refresh rate correspond to the number of times the image on screen is refreshed or redrawn.

Ideally, the refresh rate and frame rate is fully synchronized, but in certain situations there are reasons to use a refresh rate three times higher framerate, depending on the projection system.

the

a New problem each display


Projectors
Many people think that while working the projectors play the tape in front of the light source. But in this case we would observe a continuous blurred image. Instead, for separating frames from each other is used here shutter, as in the case with cameras. After displaying a frame, the shutter closes and the light does not pass until then, until the shutter will not open for the next frame and the process is repeated.


Shutter of the film projector in action. Of the Wikipedia.

However, this is not a complete description. Of course, as a result of such processes, you will see the same thing, but the flickering of the screen due to the fact that the screen is dark 50% of the time will drive you crazy. These blackout between shots will ruin the illusion. To compensate for the projectors actually close the shutter two or three times on each frame.

Of course, this seems counterintuitive — why add a extra button, it seems to us, that they became less? The goal is to reduce the blackout period, which has a disproportionate effect on the visual system. Threshold merge flicker (closely related to the inertia of visual perception) describes the effect of these blackouts. Approximately ~45 Hz dimming periods must be less than ~60% of show time frame, that's why effective the double shutter in the movies. More than 60 Hz, the periods of blackout can be more than 90% of the display time of the frame (needed for displays like CRT). The whole concept in General is a bit more complicated, but in practice here's how to avoid flicker:

the
    the
  • to Use a different type of display, where there is no blackout between frames, that is, it continuously displays the image on the screen.
  • the
  • to Apply constant, unchanging phase of the blackouts with a duration less than 16 MS

Shimmering CRT

Monitors and CRT televisions work by guiding the electrons on a fluorescent screen, which contains the phosphors with low afterglow time. How little time afterglow? So small that you will never see the full picture! Instead, the process of electronic scanning of the phosphor ignites and loses its brightness is less than 50 microseconds is 0.05 millisecondi! For comparison, full frame on your smartphone is demonstrated in the course of 16.67 MS.

Update the screen shot with the shutter speed 1/3000 seconds. Of the Wikipedia.

So the only reason why the CRT works in General — it is the inertia of visual perception. Because of the long dark intervals between illuminations CRT often appear to be flickering, especially in the PAL system, which operates at 50 Hz, in contrast to the NTSC operates at 60 Hz, which already takes effect, the threshold of flicker fusion.

To further complicate the matter, the eye perceives no flicker the same at every point on the screen. In fact, peripheral vision, though, and passes into the brain more blurred image, is more sensitive to brightness and has a much shorter response time. Probably it was very useful in ancient times for detecting wild animals leaping from the side in order to eat you, but it's frustrating when watching movies on a CRT from a close distance or at an odd angle.

Blurred LCD displays

Liquid crystal displays (LCD), which are classified as the device selection and storage, is actually pretty amazing, because they have no blackouts between frames. The current image is continuously shown on it until the new image.

Let me repeat that: the LCD displays there is no flicker caused by the screen updating, regardless of the frequency of updates.

But now you're thinking: "Wait, I recently took the TV, and each manufacturer touting the hell higher the refresh rate of the screen!" And although most of it is pure marketing, but LCD displays with a higher refresh rate to solve the problem — just not the one that you think.

Visual motion blur

Manufacturers of LCD displays all raise the frequency of updates because the or the visual display motion blur. So, not only the camera can record motion blur, but your eyes can too! Before I explain how it happens, here are two mind-blowing demos that will help you to feel the effect (click on the image).



first experiment focus your gaze on a stationary flying alien at the top, and you will clearly see the white line. And if you focus on a moving alien, the white lines magically disappear. With the Blur Busters website:

"due to the movement of your eyes vertical lines at each update of the frame are blurred in a thick line, filling the black void. Displays with small pokespecial (such as a CRT or LightBoost) remove such motion blur, so this test looks different on those displays."

In fact, the effect of tracking eye different objects can never be fully prevented, and often he is such a big problem in film production and that there are special people whose only job is to predict which will track the viewer's eye in the frame, and to ensure that nothing else can't stop him.

In second experiment the guys from Blur Busters is trying to recreate the effect of the LCD screen compared to the screen with a small pokespecial, just inserting black frames between frames of the display — amazing, but it works.

As shown earlier, motion blur can be a blessing-or a curse — it sacrifices sharpness for smoothness, and add your eyes blur always desirable. So why is motion blur — so a big problem for LCD displays compared to CRT where such questions arise? Here is an explanation of what happens if the short term frame (obtained in a short time) is on the screen longer than expected.


The following quote from a great article by Dave Marsh on MSDN about temporal resampling. It is surprisingly accurate and relevant to the article 15 years ago:

While addressing the pixel, it is loaded with a certain value and remains with this value of the light output until the next addressing. From the point of view of drawing of the image is wrong. A specific instance of the original scene is only valid in a specific moment. After this moment the objects in the scene must be moved to other places. It is incorrect to hold images of objects in a stationary position until the next sample. Otherwise, it appears that as if the object suddenly jumps to a completely different place.

And its output:

Your opinion will attempt to smoothly follow movements of the object of interest, and the display would keep him stationary for the entire frame. The result will inevitably be a blurred image of a moving object.

Here's how! It turns out that we need to do is to light the image on the retina, and then let the eye along with the brain to interpolate the movement.

the

Additional notes: so to what extent our brain interpolates, in fact?


No one knows for sure, but definitely there are many situations where the brain helps to create the final image of what it shows. Take for example this test for blind spot as it turns out, there is a blind spot in the place where the optic nerve joins the retina. The idea is that the spot should be black, but in fact the brain fills it with interpolated image with the surrounding space.

the

Stills and screen refresh are not mixed and do not match!


As mentioned earlier, there are problems if the framerate and screen refresh rate are not synchronized, that is, when the refresh rate is not evenly divisible by the framerate.

the

Problem: screen tearing


What happens when your game or application start to draw a new frame on the screen, and the display is in the middle of the update cycle? It literally breaks the frame in half:


Here's what happens behind the scenes. Your CPU/GPU performs certain calculations for composing the frame, and then transmits it to the buffer that should wait that the monitor will trigger the update through the driver stack. The monitor then reads this frame and starts to display (here you need double buffering to always a single image was given and one was compiled). The gap occurs when the buffer that currently is displayed on the screen from top to bottom is replaced by the next a frame that gives the graphics card. The result is that the upper part of your screen is obtained from one frame, and the lower part from the other.

Note: to be precise, screen tearing can occur even if the refresh rate and framerate are the same! They must be the same phase, and frequency.


screen tearing in action. Of the Wikipedia

This is clearly not what we need. Fortunately, there is a solution!

the

Solution: Vsync


Screen tearing can be eliminated by using Vsync, short for "vertical sync". This is a hardware or software feature, which ensures that the gap will not happen — that your software may render a new frame only when the previous is finished updating the screen. Vsync changes the frequency of deletions of frames from the buffer of the above-mentioned process, so that the image never changed in the middle of the screen.
Therefore, if a new frame is not ready for rendering on the next update of the screen, the screen just take the previous frame and re-redrawn, it will render it. Unfortunately, this leads to the next problem.

the

New problem: jitter


Although our staff is no longer torn, playback is still not smooth. This time the reason for the problem that is so serious that every industry gives her their names: jader, jitter, scatter, the junk or hitching, jitter and coupling. Let's look at the term "jitter".

Jitter occurs when the animation vosproizvoditsya at a different frame rate compared to the one where it was rented out (or intended to play). this Often means that the jitter appears when the playback frequency is unstable or variable, rather than fixed (as most content is recorded at a fixed frequency). Unfortunately, this is what happens when you try to display, for example, the content 24 FPS on the screen is updated 60 times per second. From time to time, because 60 is not divisible by 24 with no remainder, you have one frame to show twice (unless you use more advanced conversion) that spoils the smooth effects, such as panning the camera.

In games and on web sites with lots of animation is even more noticeable. Many people can not play the animation at a constant divisible without a remainder framrate. Instead, the frame rate of them varies greatly according to different reasons, such as independent from each other and the work of separate graphic layers, processing user input and so on. It may come as a shock, but the animation with a maximum frame rate of 30 FPS looks much, much better than the same animation with a frequency which varies from 40 to 50 FPS.

You don't have to believe a word you say; see with your own eyes. Here is a spectacular demonstration of microglitter (microstutter).

the

jitter


the

When you convert: "telecine"


"Telecine" — conversion method the image on the film into a video signal. Expensive professional converters like those used on television, osushestvit this operation largely through a process called managing motion vectors (motion vector steering). He is able to create a very compelling new footage to fill in the gaps. At the same time, still widely used the other two methods.

Acceleration

When you convert 24 FPS to PAL signal at 25 FPS (for example, TV or video in the UK) the normal practice is to simply speed up the original video at 1/25 of a second. So if you ever wondered why "Ghostbusters" in Europe for a couple of minutes shorter, then here is the answer. Although the method works surprisingly well for video, it terribly affects the sound. You may ask, how much worse could crash on 1/25 audio with no additional change in pitch? Almost a semitone worse.

Let's take a real example of a major failure. When Warner released in Germany extended Blu-Ray collection of Lord of the rings, they used to German dubbing already adjusted the PAL version of the audio track that has been pre-accelerated at 1/25 with a subsequent lowering of the tone correction changes. But since Blu-Ray is at 24 FPS, they had to perform the inverse transform videos so that they are again slowed. Of course, from the beginning of a bad idea it was to perform this double conversion, due to losses, but even worse, after slowing down the video to match the frame rate of the Blu-Ray they forgot to change back the tone on the sound track, so all the actors in the film suddenly began to sound serdaristan talking a semitone below. Yes, this is a true story and Yes, she really insulted the fans, there were a lot of tears, a lot of bad copies and a lot of lost money after the big feedback of the drives.
The moral of the story: change the speed — not the best idea.

Pulldown

To convert the footage to NTSC, American TV standard, will not work with a simple acceleration because converting 24 FPS to 29.97 FPS corresponds to the acceleration 24,875%. Unless you really don't like the chipmunks, it will not be the best option.

Instead, it uses a process called 3:2 pulldown (among others), which became the most popular conversion method. In this process, taking 4 of the original frame and convert them into 10 interlaced fields or 5 full frames. Here is an illustration that describes the process.


3:2 Pulldown in action. From Wikipedia.

On an interlaced display (i.e. CRT) videopal in the middle are displayed in tandem, each in interlaced form, so they consist of every other row of pixels. Original frame A is divided into two half, both of which are displayed on the screen. The next frame B is also broken, but the odd Videophone appears twice, so this frame is distributed among three polyedrum. And, in sum, we get 10 distributed videopoem half images of the 4 original full frames.

This works well enough when displaying on an interlaced screen (such as a CRT TV) from about 60 videoporama per second (almost half pictures), because polyedra never shown together. But the signal looks horrible on displays that do not support polyedra and should be together 30 full frames, as in the rightmost column in the illustration above. The reason for the failure is that each of the third and fourth frames kaleytsa from two different frames of the original, which leads to what I call "Frankenfruit". It especially looks awful on fast movement, when there are significant differences between the frames.

So pulldown looks elegant, but it's not a universal solution. Then what? Is there a perfect option? As it turns out, he is still there, and the solution is deceptively simple!

the

When displaying: G-Sync, Freesync, and limit the maximum frame rate


Instead of fighting with a fixed refresh rate, of course, much better to use a variable refresh rate, which is always synchronized with framrates. This is exactly what is technology Nvidia G-Sync and AMD Freesync. G-Sync module built into monitors, it allows them to be synchronized with the results of the GPU instead of forcing the GPU to sync with the monitor and Freesync achieves the same goal without the module. It really is a revolutionary technology that eliminates the need for "telecine" and all the content is variable framrates like games and web animations, looks a lot smoother.

Unfortunately, G-Sync and Freesync is a relatively new technology and is not yet widely spread, so if you as a web developer doing animation for web sites or applications and can't afford to use the full 60 FPS, it is best to limit the maximum frame rate to without a trace was divided by the refresh rate — in almost all cases the best limit is 30 FPS.

the

Conclusion and next steps


So how to achieve a decent balance with all the desired effects, minimal motion blur, minimal flicker, constant frame rate, a good display of movement and good compatibility with all displays — without much encumbrance GPU and display? Yes, very large framerate can reduce motion blur, but at great cost. The answer is clear and after reading this article, you should know him: 60 FPS.
Now that you are smarter, make every effort to run all animated content at 60 frames per second.

a) If you are a web developer


Go to jankfree.org, where the developers Chrome gather the best resources on how to do all of your applications and animations perfectly smooth. If you have time for only one article, choose great article Paul Lewis The Runtime Performance Checklist.

the

b) If you are an Android developer


Check out our "Best practices for performance" in the official Android Training section where we have compiled for you a list of the most important factors, bottlenecks and tricks of optimization.

the

c) If you work in the film industry


Record the whole content at 60 FPS or better at 120 FPS, so you can reduce it to 60 FPS, 30 FPS and 24 FPS if necessary (unfortunately, adding support for 50 FPS and 25 FPS (PAL) will have to raise the frame rate to 600 FPS). Play all content at 60 FPS and don't apologize for the "soap Opera effect". This revolution will take time, but it will happen.

the

d) For all other


Demand 60 FPS for any moving pictures on the screen, and if anyone asks why, send him to this article.
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

ODBC Firebird, Postgresql, executing queries in Powershell

Installation LivestreetCMS on MODX Revolution package 10 clicks

The Ministry of communications wants to ban phones without GLONASS