I apologize for such a long break between the first and second part, but there were both objective and subjective reasons. So, the second part, about computer games and 3D. And, yes, the article is intended for those who have no idea at all about this issue.
3D graphics in computer games When I bought my first computer for money earned in the summer in high school — I learned how to download games from a cassette ZX Spectrum — I was immediately interested in the question: how is this all programmed? The answer to this question I received from the book on programming games for the ZX Spectrum. When I had a PC-compatible computer, I already imagined how games are made. But quite a bit of time passed and games appeared that were unlike any other - games with 3D characters. One of the brightest representatives of such games was Tomb Raider. And every year the number of such games grew. I always wondered: how are they created? But I did not find a clear answer (the Internet was then exotic). If I had come across a similar article at that time, I would get answers to some questions. I hope that the text below will help give an idea of how the environment and characters appear in 3D games.
But first, a little about landfills. In the last article Popularly about 3D graphics, part 1 polygons were mentioned. But, judging by the comments, the purpose of the article was not entirely achieved. Therefore, I want to dwell a bit on tessellation and smoothing. Imagine that you have a piece of paper. This will be the polygon. Divide it in half horizontally and vertically. We get 4 parts. This is tessellation. Why do we need it in 3D graphics? The thing is that the polygon is the base unit of the surface (in polygonal modeling) and they can be modeled except the plane. Recall that in order to make a paper airplane it is necessary to bend a sheet of paper several times. So with polygons - breaking the original polygons into parts, placing them at the right angles to each other and smoothing, you can get these or other forms. Smoothing, as already mentioned in the last part, is splitting polygons with changing angles between polygons. This means that if we have a square, which, as we know, has right angles of 90 degrees, then after smoothing these angles will be about 135 degrees. How the smoothing operation transforms the model's blank can be seen in the video below.
In this case, two smoothing iterations are applied. You can see how the number of polygons increases and the model takes on smooth shapes.
But back to the games. ')
At the dawn of personal computers, graphics (there were text-based, yes, yes, text-based games) games were two-dimensional in every sense: the characters were drawn in a projection and could only move along the X and Y axes. To imitate, for example, walking, the legs were drawn in a different period of time, and these frames were simply launched in a circle. A classic example of a two-dimensional game is Tetris. The following video footage from the two-dimensional game Nebulus for the extremely popular in the 80s (and in the CIS and in the 90s) of the last century, the platform ZX Spectrum.
But computers grew and lately most games are three-dimensional. What gives us the three-dimensional? (By the way, the final picture for ordinary monitors is still pseudo-three-dimensional, but by placing objects in perspective and being able to move in three dimensions, the illusion of three-dimensionality appears). Three-dimensional gives us more freedom and realism. Take a look at these chess, one of which is two-dimensional, and the second - three-dimensional. Which ones look more realistic? How does a three-dimensional character appear in the game? To begin with, a modeler makes a high-poly model of a necessary object or character in one of the three-dimensional modeling programs (for example, 3ds Max or Maya, revision is possible in ZBrush or Mudbox). Then a sweep is built - a representation of a drawing of a three-dimensional object on a plane. On a scan, the artist draws textures, that is, roughly speaking, colors the model, then materials are configured that include the drawn textures. Materials allow you to give textures realistic. The model is ready. But the game requires a low poly model. It is obtained from a high-poly or copied at a certain stage of high-poly modeling. Why do you need a high poly model? It gives you the opportunity to get a more realistic picture, to simulate small details, shadows, which will then be present in the game in the form of a texture. Much of what we perceive in games as small objects (depressions, corrosion, cracks, bolts, and much, much more) is actually drawn with shadows in mind, which, when not very detailed, is perceived as a three-dimensional object. Auxiliary textures are obtained from the high-poly model. As a rule, in addition to the color and pattern texture, the relief texture (bump) and reflections (specular) are used, as well as the normal map. Overlaying the texture of the picture (diffuse) they make the model more realistic. All this allows reducing hardware requirements to the level accessible to modern iron. Then the low-poly model and textures are exported to the so-called game engine which allows, as a rule, to simulate a certain world. The game engine is responsible for the gameplay itself: the interaction of the hero with the outside world, the visualization of the image in real time, for the artificial intelligence of computer characters. 3D game engines are different: both paid and free, free for non-commercial use, complex and difficult to master, for different platforms, etc. If you decide to experiment with exporting your own models to the game engine, the main thing is to be able to convert the model in the format of your 3D editor to the format of the game engine and the latter works on your platform. Not to be unfounded, in the video below I will briefly show how the model is inserted into the game engine. For example, I took CryEngine 3. Why him? Because the widely known shooter Crysis 3 runs on it, besides, the engine itself is available for free download and free for non-commercial use. Documentation is available for CryEngine 3 in both English and Russian, there is an extension for 3ds Max.