“Next Gen car – part 4 ” by Valentin Nadolu
IV. Texture baking
1. The Normal Map:
In games, the normal map is used to add details to low-poly geometry. The information can be extracted from a high-resolution mesh and then applied to the ingame model to improve its aspect. The major advantage of this technique is that it can vastly improve the look of a low-res asset without having a big impact on rendering performance.Here is how it all works.As mentioned in the low-res portion of this tutorial, lightning of an object in a realtime 3d environment is done by using normals, which are a vertex attribute. The major disadvantage of this technique is that the shading quality is proportional with the number of polygons.Building a next gen object is almost synonym with using normal maps. Instead of relying of mathematical procedures to determine the way light is reflected off a surface, the „per pixel” lightning method uses a normal map to define the normal’s direction in every point of its geometry. The major advantage is that the normals can be calculated from a high-res version of the asset. Each pixel in the normal map will define the normal of that point in 3d space as follows: the three color channels R (red), G (green) and B (blue) will determine the X (red), Y (green) and Z (blue) values of the normal. There are two types of normal maps used in games:a. Object (World) Space Normal Map. Can be easily identified by the fact that it looks like a rainbow. Each color channel defines the absolute coordinates of the normal in world space. This type of map is used for static, non-deformable objects and it is usually avoided as it is hard to change in Photoshop after it is generated.b. Tangent Space Normal Map. Can be easily recognized by being predominantly blue. Each pixel defines the deviation of the normal from the value calculated with the „per vertex: method by using a local coordinate system (X, Y, Z will instead be U, V, N). This is the most used type of normal maps in games as it is easy to edit in Photoshop and it can be applied to deformable meshes.
Scene preparation:
A good idea is to save a new scene before starting to prepare the scene for baking. This will ensure that all the settings used for baking are saved separately in this new scene and are easy to go back to in case of anything needing a rebake. All the meshes should be recombined by following these rules:1. The low-res geometry will be separated in such a way that every object has only one material. For example, the door geometry will be separate from the door window, even if in the final scene they will probably be merged together. Naming these meshes should be done by using a simple to follow naming convention like this: body_low, glass_low, interior_low.2. As mentioned before, intersections must be avoided by separating objects because they can cause artifacts in the baked textures. For example, if the interior has intersections, I will separate it into different objects that will intersect each other but will not contain intersections themselves. Naming should be something like interior_low 1, interior_low 2.3. The high-res geometry will be recombined in a similar way to the low-res geometry. Each previously created low-res geometry should have a corresponding high-res counterpart named something like: body_high, glass_high, interior_high, etc.
These naming rules will help speed up baking by making each high-res/low-res pair easier to select.Don’t forget to apply Smooth on the high-res meshes before baking!Texture baking in Maya can be done by using the Transfer Maps utility found under Lightning/Shading->Transfer Maps…The „target meshes” section is for the low-res meshes and the „source meshes” section is for the high-res versions. The settings in the next image are a good starting point for baking. The settings that usually need tweaking are „Search envelope” and „Max search depth:”For each pair of meshes, a normal map will be generated. If there is more than one normal map for one particular material, these baked normal maps can be recombined in Photoshop by using the Overlay blend mode.The combined textures can be loaded on the bump channel of a Phong material. The „Use as” drop box in the bump2d node has to be set to „Tangent Space Normals” for the normal map to correctly be displayed when high quality rendering is enabled (Renderer->High Quality Rendering in the viewport menu)
Pages: 1 2
Latest Comments