What is a Normal Map
On 3D forums, people periodically have questions about the use of normal maps, so we decided to write a small informational article on this topic.
In simple words, the normal is the direction the vertex "looks" to. Expressed in XYZ coordinates for each vertex. Expressed in XYZ coordinates for each vertex. With the help of normals, anti-aliasing groups or hard/soft edges are formed, which, in turn, define the character of the "surface" of the polygons.
Editing normals allows you to expand the possibilities of 3D modeling. For example, a flat surface can be made visually curly, or vice versa. Planes identical in geometry, but having different normals at the vertices.
You can also make the volumetric shape visually flat, align normals in one direction.
However, this technique is limited by the number of vertices, and to create a detailed surface, you will need no fewer vertices than on a full-fledged hike.
This problem is solved by a normal map, which contains normal coordinates in each pixel, encoded in RGB channels as XYZ coordinates. Such a map is already limited by the number of pixels, and this is more than a million at a resolution of 1024x1024, which is many times the number of vertices and allows you to add more detailed details to the surface.
Thus, Normal Map tremendously expands the possibilities for a detailed elaboration of relatively "light" models. However, the question arises of how to get this texture.
The surest and correct way is to "bake" from a more detailed model. The baking process encodes the normals from the high-poly model into RGB coordinates, taking into account the normals of the low-poly itself, the so-called "compensation".
There is a lot of information about the normals bake and this rather voluminous topic draws on a separate article, therefore we will restrict ourselves to the main points.
For proper baking, you need a good UV map. The basic rule is simple, all hards (or faces between anti-aliasing groups) must have a cut on UV, otherwise, the seam will be visible.
You can bake on a model with one smoothing group and ignore the seams in the right places. But then the normal map will have creepy gradients (compensation of the low-poly normals), which will give us an error in the future. The smaller the gradients on the normal, the easier it is to work with it. When preparing a low-poly, you need to set up anti-aliasing groups, make cuts of the hydrocarbon along the required edges, and only then continue cutting as needed.
The finished normal map cannot be corrected like a regular texture. Any manipulations with brightness, saturation, contrast, etc. will violate the same RGB coordinates, and the normal map will be displayed incorrectly. Painting is possible, but the experience is required.
When loading a normal map, it is necessary to take into account gamma correction (sRGB). It is not used for these types of maps.
The normal map has two formats: OpenGL and DirectX, which differ in the direction of the green channel. Therefore, be sure to consider what format your render engine is using. All modern engines have a flip green channel option without using third-party editors.