An interesting technology for personnel rendering games.

Is there a constant frame rate in games or is it dynamic? If constant, then what; if dynamic, then what does it depend on?

I read in Wikipedia that, for example, for silent films they used a constant frame rate of 16 FPS. Is it dynamic in games?

What do FPS meters actually measure? It seems more like the number of FPS that a video card can give, and not the frame rate in the game.

  • 2
    In different games, it is different . - D-side
  • I do not understand to what question this answer belongs. I have 6 of them here. Do you mean it can be constant, and maybe dynamic? Then can you give examples? - Ivan Antonov
  • 2
    But because it is not necessary to ask more than one question in one question :) - D-side

1 answer 1

Why is there an inconsistent frame rate (FPS) in games?

Because at each moment in time, the load on frame rendering is not constant - the number of objects on the screen changes, the range and visibility volume changes, the speed with which the CPU prepares and “orders” new frames also differs from many factors. This is a generally unpredictable process (especially since a player can look at the wall, then from a height on almost the whole area).

In games, the constant frame rate or is it dynamic? If constant, then what; if dynamic, then what does it depend on?

Differently. Usually dynamic, but bounded above by the refresh rate of the screen (60-75 Hz, often more). The limitation is called V-Sync (vertical sync). The refresh rate depends on the speed with which the video card has time to render the graphics, on the display frequency. More than the display frequency, it is fundamentally impossible to show, but on frame 1, several frames can be combined on the display (top to bottom, as they come from the video card). Now there are adaptive frequency displays that adapt to the video card.

I read in Wikipedia that, for example, for silent films they used a constant frame rate of 16 FPS. Is it dynamic in games?

Usually dynamic - the more frames per second, the smoother it looks.

What do FPS meters actually measure? It seems more like the number of FPS that a video card can give, and not the frame rate in the game.

FPS is usually the number of frames per second, which gives the video card (different games can count this number a little differently). It is considered as time divided by a slightly averaged interval between ready frames (for example, 1000ms / 16ms = 62fps). What do you mean by the frame rate in the game is unclear.


I want to understand how scenes are built in games to make a similar frame rendering for canvas.

The scene in the game is built in general (forgive me for such a simplification) of the triangles that the GPU can draw in unrealistically crazy quantities, painted according to the rules (texturing, pixel effects, etc.) with a doubly unreal speed. All this is rendered into a triangle-by-triangle buffer, a pixel-by-pixel buffer. As soon as the picture is ready, it is given to the display and the next picture begins to be drawn.

For canvas (without using a video card?), A buffer is also usually made where the frame is drawn (by means of CPU), and as soon as the frame is finished, it is given to the canvas for display on the screen, and in the meantime the next frame is drawn. This can be done both sequentially and by timer if you want to get a static FPS.

PS On Javascript everything is a bit more complicated. Another layer is added with the browser and OS and their arrangement of the picture for display on the screen, here I am not very much in the subject.

  • I want to understand how scenes are built in games to make a similar frame drawing for canvas. - Ivan Antonov
  • We can discuss in the local chat, if the site rules and reputation allow ( chat.stackexchange.com/rooms/64099/rendering ) or Skype - kromster80 - Kromster
  • About the OS and the browser here do not worry. I plan on making a canvas on canvas. But since this is a normal drawing canvas, you will have to process it differently, with every move you redraw the entire scene, as in games. If you do not redraw, then one object, being drawn over the stage, erases it as it moves. And then I came up with a comparison with other games, the monitor, too, does not distinguish objects, it has only pixels. That's what codepen.io/antonowano/pen/MvQZYZ wanted to do - Ivan Antonov
  • Dark green - back scene, light green - front, red - hero. Nothing is erased because the scene is redrawn every time. - Ivan Antonov
  • one
    Yes. Almost always everything is redrawn. Sometimes only some things can be cached (like a minimap). Because complex games are dynamic and each frame is unique there. And in simple games, such savings simply do not pay off, but only complicate the development. - Kromster