I was prompted by a video on the official YouTube channel Stopgame.ru pro, supposedly, quote, “Free camera in MGS 5. How is the playing game work?". I am not going to go through all the blunders of this video, it is quite written about them in the comments, and I want to dwell on one technical moment that, I think, will be interesting to Stopgame readers.ru. It is about what this video is called as BackFace Culling (for 2 min 38 seconds).
What do we see on the screen? Translucent helicopter. If you turn to Google for an explanation what kind of beast is this: Backface Culling? we will get an answer that this is a method of hiding landfills to increase speed. Let me quote the video:
“… the developers applied the BackFace Culling method, t.e. The engine does not display those landfills that are not located immediately in front of the camera. In other words, there are no training grounds outside this point of view … "
But the author, apparently, is not very familiar with the technical details of the construction of polygonal objects for 3D in general and games in particular. It is mentioned that the authors of the game used the BackFace Culling method, although this is not correct, since it is built into the game engine and is not consciously used, this is the internal mechanics of the engine. But in order to get around this feature, you already need to act consciously. This is the first. Second: BackFace Culling is not related to “… for the game there are no training grounds outside this view point …”, this is already from the field of rays trace and z-culling’a (t.e. a method based on the overlap of the object by others). Backface Culling refers only to the circulated side of the landfill. But everything in order is slightly lower.
In the meantime. If we were talking about cars with ICE, then the above quote sounded approximately like this:
“The developers have applied the combustion method, t.e. The pistons move. In other words, tires allow the wheels to spin."
The retreat is over.
Now I will allow myself to wander a little in the wilds of the theory about polygons and virtual chambers so that, I hope, most became clear what the essence is actually there?
Modern three -dimensional games are built from three -dimensional objects (plus lighting, textures, sound accompaniment, etc.p., But now it’s not about that). Three -dimensional objects, in turn, are built from “bricks” – landfills (planes), usually triangular, t.e. They have three peaks and a plane between them. Why triangular? Because through three points you can draw only one plane. This simplifies calculations and eliminates many artifacts (no, not those that Lara Croft are usually looking for, but from unwanted effects in the reward image). Although there are landfills and quadrangular, five, and t.D., but the game engines use it exactly triangular.
The landfill is just a mathematical https://nonukcasinosites.co.uk/review/wagerland-casino/ model of what is actually not. And this model implies that the landfill has no thickness. At all. In reality, even a sheet of paper has a completely measurable thickness, but it does not have it, since everything is mathematically possible, well, or almost everything. Therefore, the landfill can be compared with a triangular sheet of paper with a zero thick. Well, if such a sheet has no thickness, then it does not have a surface, it is transparent. And transparent models are somehow not applicable in a video game, if not there are no reasonable reasons. Therefore, they came up with painting this non -existent plane with color in order to make the landfill visible. And then they learned to put the texture on the landfill – t.e. pre -drawn picture or photo.
Therefore, mathematically the landfill separately, the texture is separate. It is like flies and cutlets – there must be a separate. And the video card first builds a mathematical model of invisible landfills, then puts textures, then lighting and other special effects.
Next. The landfill has such a property as a normal or vector, perpendicular plane of the landfill. I will not go into details, but it is needed for imposing textures and a blast of light. Moreover, so to speak, by default, normal has only one side of our transparent sheet of paper with a zero thickness. The texture is superimposed on this side. And the second side … transparent, more precisely, mathematically does not exist.
If in almost any program of three -dimensional modeling, such as 3DS Max’s, create a polygonal cube, put a texture on it, and then expand the normal at the landfills of one of the parties, then this side will become invisible.
I think with landfills and textures more or less clear. Now about the camera.
In reality, the light is reflected from objects and falls on the retina or into the camera lens and creates an image. But in 3D, especially games, it would be very expensive, because at a certain point in time we see only a limited space in the direction of the gaze. Therefore, 3Ds come differently: the virtual chamber itself emits rays and the environment is calculated only from the training grounds that these same rays came to, which many, many times accelerates the miscalculation of the final scene. This is the property of the game engine and it is the same that for the camera, fixed by the authors of the game in a certain place, which for the cells of the camera. From the point of view of displaying the surrounding space, these two cameras work according to the same principle, just for the first to notvode without interfering in the normal work of the game, and for the second it is available. Well, for some reason the author of the video decided that this is some special camera that allows you to look into the inner world of the game, but this is not entirely true, or rather, not at all like that. This is just a way to climb for textures. The same effect can be achieved if in a certain place of a particular game, which is called “falling into textures” due to oversight of the developers.
So, I think, now we know enough to draw a conclusion about what we see in the case of a helicopter? And we are visible to the standard situation for a closed room, from which the player is not going to release: only the internal walls of the helicopter are simulated. Normals in these landfills are turned inside. If you look outside, it is expected, the texture does not exist, the poet is a helicopter seems translucent. The same is true for the premises in which the player is not allowed, only in this case the normal are facing out, and the room is transparent from the inside.
What do they do in cases where the player is allowed into the room? Everything is very simple: in such buildings, the walls have two polygons of the circulated normals in opposite directions. And in this case, the helicopter model does not have external landfills, because this is absolutely not necessary. This is the vain work of those who model, impose an UV-extract, textures. This is an extra waste of RAM. In the end, this is an extra waste of processor time on Z-Culling, because it also needs some, albeit small, resources for its miscalculation. And if there is nothing mathematically, like textures on the back of the landfill, then resources are not spent on this at all.
I hope now it became clear to everyone: why the helicopter looks translucent?
And how in the game they create a sheet of paper opaque on both sides or something thin? In this case, there is no need for six training grounds per sheet, so a special double -sided material is used. He, as it were, adds another normal to Pligon, although I’m not sure that this is a correct comparison. And the leaf looks the same on both sides.
I hope this note was useful, and if you, dear reader, have a desire to learn more about the 3D world in video games, then write about it in the comments and with sufficient interest I will think about a more extensive and cognitive article.
Small postscript.
I think the note will be incomplete if you do not talk about conflicts.
As we recall, the ruler is transparent and generally does not exist. How then you can’t let the game character go through the walls? Three -dimensional models are applied invisible to the player with a “power frame” – a conflict model (collision). This is a three -dimensional mathematical structure, which exists, as it were, separately from polygons and textures, it is only responsible for imitation, let’s say, a solid surface. Visually, it looks like a set of simple figures of "tied" to a three -dimensional polygonal model. Well, or like a frame grid, it all depends on the display method in a particular program. It is according to this mathematical model from simple geometric figures that the game engine calculates what the ball should bounce and through that the game character should not pass.
The collision model can be generated automatically on the basis of a polygonal model of a three -dimensional object, but, for the sake of optimization, as a rule, the collision is created separately by hand. This is what such bugs in games as “failing through textures” or “invisible wall” are explained. In the first case, the conflict is less than the polygonal model, in the second – more, if simplified.
And the mod on the free camera simply bypasses this mechanism of conflicts, which allows you to travel "for textures".
