|Build a NextGen Game Car: Part II [Low-res model]|
Software: Autodesk Maya
Author: Valentin Nadolu (AMC Studio)
Author Website: http://www.amc.ro
Setting up the normals in Maya:
Written by Valentin Nadolu.
At first sight, the processing power of a next gen console might seem enough to render huge amounts of polygons and allow the high-res model just created to be rendered in full detail in real-time. The problem is that a vehicle is just a part of the scene rendered by the game engine. 20.000 polygons might seem low, but if you consider that some racing games can have many cars on screen at the same time, that adds up to a lot of polygons being rendered. That is why games require different models with different detail levels to be created for each vehicle.
The first mesh used is usually called "ingame" and it is the model players see in the actual game. This one has around 10.000 polygons for racing games and much less than that for games that contain more complex scenes, like Grand Theft Auto type of games. This model is optimized to be viewed from a medium distance so certain parts of the car have little to no detail to save on polygons. The underside is usually flat, there are no suspension parts unless the car is an open-wheeler and the interior has less geometry detail than the exterior. The geometry I will build for this tutorial's subject car is pretty simple as shape goes so I will set the polycount limit to about 7000 polygons, including wheels and interior.
For the low-resolution model, the modeling rules are stricter that in the case of the low-res model because the optimization of the mesh plays a more important role. Realtime rendering is done using triangles, the only geometrical shape that a video card can "understand". All other more complex 3D shapes are converted to triangles when rendered or exported to a game's rendering engine. This automatic conversion can cause problem if the source polygon has more than 4 sides, because it might tessellate in an incorrect/inefficient mode. This is why only quads are to be used. There are areas where quads probably won't do, so triangles can be used to fill in these areas.
As mentioned at the beginning of this tutorial, saving a different scene with basic high-res mode of the exterior is used as a base for the low-res model. Still, it seems I forgot to save a good intermediary mesh for the wheel so I will have to build it by using the full detailed mesh. This might also be the case in some situations, when the artist is required to build a low-res model using an already finished high-resolution mesh.
First thing is to eliminate all the close parallel cuts in the geometry that were used to strengthen the high-res model. A simple way to do this is to use Edit Mesh->Merge Vertices on the entire wheel mesh. The Distance value can be tweaked to make sure that only the very close vertices are merged.
Next step is to reduce the unnecessary polygons by deleting the edges that do not influence the shape too much.
The high-res wheel didn't have an interior, but the low-res still requires one that will be visible in the game. As the car has a very small ground clearance, the back of the wheel will be barely visible, so just basic geometry there is enough.
The way the object is illuminated is defined by normals, which are a vectorial attribute assigned to each vertex. This vector defines the direction in which the light is reflected off that vertex. To make it easier to setup vertex normals without having to define them one by one, Maya uses an attribute applied to each edge called Hard Edge(Normals->Harden Edge) or Soft Edge (Normals->Soften Edge). In short, if one edge is "hard", the geometry will look like it is broken on that edge. Contrary, if the edge is "soft", the mesh will have a continuous aspect on that edge. This is done by splitting one vertex into a couple of vertices with different normals for each one to create the "broken" appearance of the geometry. The lightning for a soft-edged area is calculated by averaging the values of the normals of adjacent vertices.
Modeling for games will almost always mean that the normals have to be adjusted for the model to look its best. The problem comes when there is a normal map involved, normal map that requires as few hard edges as possible. I will talk more about this necessity in the 4th chapter.
First thing to do before setting up the normals is using the Normals->Unlock Normals option to unlock the normals and allow for proper editing.
The starting point is the mesh with all of its edges set to soft. This is done because there will be less hard edges than soft edges, so it makes sense to set them all as soft and then just change a few to hard as necessary.
As you can see, the wheel doesn't look that good with all the edges set to soft. The strange shadows visible on the mesh will have an adverse effect on the quality of final lightning with normal maps. Here are some simple rules that I use when setting up normals:
a. All border edges count as hard edges. (not a rule, but a fact to be remembered â˜º)
b. For curved continuous surfaces, set the edges as soft (2 and 3 in the image)
c. For angles that have a concave shape, use hard edge (4)
d. For angles that are close to 90 degrees use either soft edge if the edge is facing the camera (5) or hard edge if it is not visible(6)
The last rule is good for objects that do not rotate in the scene. As always, these rules can be broken as long as the final result is good.
Using the above rules, here is how the wheel looks. The continuous edges are hard and the dotted line ones are soft. This view mode can be activated by shift right-clicking on the object and selecting Soften/Harden Edge->Toggle Soft Edge Display.
I recommend setting up the normals before optimizing the geometry. This way you can take shading into account when the polygon reduction is done. As the hard/soft edge setting in reversible, it is easier to change edges from hard to soft or vice-versa than to reduce the entire mesh with all the edges set to hard only to realize that once the normals are set, some areas require extra polygons.
Next, some images that show the way the normals are set on the car's body:
If the high-res geometry had intersections, it is preferable that the ingame version has none. Partially occluded polygons will most likely lead to artifacts in the game’s engine. Topology has to be redone in certain areas, and fully occluded faces can be deleted to avoid rendering artifacts.
Now comes the polygon reduction part. In the following images are basic descriptions of the most common polygon reduction methods and some areas where they can be applied.
1. Select Edge Ring and Collapse
2. Select Edge Loop and Delete Edge
The borders of the low-res model are very important. They have to match the high-res geometry very closely so that baking the textures will not result in "blank spots" on the normal maps because of improper overlap. The white wireframe object in the next image is the high-res model without smooth. The green wireframe object is the low-res. As you can see, the two shapes might not be identical, but the borders are very close to each other.
Moving on to the wheel wells, the quickest way to make them is to select the border of the wheel well and to extrude it in.
After filling in the wheel wells, the rest of the underside can be constructed using as few polygons as possible.
Speeding up things a bit, here are some of the other parts reduced to low-res:
The final low-res model will look like this. Note that each different color represents a different material that will ultimately have a different texture. The final polycount is 7116, just a bit over the initial estimate.
The next chapter of this tutorial contains details about the UV creation process.
All links for this tutorial:
1. Build a NextGen Game Car: Part I [High-res Modeling]
2. Build a NextGen Game Car: Part II [Low-res model]
3. Build a NextGen Game Car: Part III [UV Layout]
4. Build a NextGen Game Car: Part IV [Texture Baking]
5. Build a NextGen Game Car: Part V [Texturing]