Kila and Grae are now truly complete. They have been fully textured, giving them color to bring them to life in the game world. Throughout this chapter we have discussed how to create textures as well as how to reduce the file size of texture pages. With the models now finished, you're ready for Chapter 10, where you will explore levels of detail.
Chapter 10. Levels of Detail (LODs)
NOW THAT OUR characters are complete, including textures, and have been signed off by our managers, we can proceed to generate the level of detail (LOD) models needed to preserve processing power.
As we have already discussed (mainly in Chapter 5, "Model Optimization"), saving processor power and memory is very important when creating computer games. Here in Chapter 10 we will demonstrate how to gradually reduce a character to its lowest resolution, efficiently optimizing the model to get the various levels of detail needed in the game.
Why Do We Need LODs?
When a character is far off in the distance, essentially taking up few pixels on the screen, there is no need for the character to have 4000 polygons when 100 or less will do.
This is where LODs come into play. What you do is take your main model and create four versions, or five, or however many are needed, each one stepping down in its polygon count. As the character moves away from the camera, a different version of the model is loaded in its place. The farther away from the camera, the lower the version, until the character can no longer be seen.
If we use Kila as an example, her main model of 4094 polygons would more than likely be used for close-up shots, or maybe just in cut scenes. The next LOD for Kila, then, would be the main one used in game, since we could remove around 1000 polygons and still retain all the detail needed. The LOD after that would comprise 1000 polygons; then we'd drop down to around 500; and the last one would be about 100 or 200. As you can see, we step down gradually at first, before dropping dramatically as distance from the character increases. We can do this because there will be decreasing need for detail as the character moves farther away.
The graphics programmer usually sets the number of LODs and the number of polygons in each LOD. The trick is to have as few LODs as possible. One rule of thumb in the industry is "The sum polycount of all LODs shouldn't exceed the main game model."
You can see Kila with her levels of detail in Figure 10.1. Although there are fewer polygons in the versions that are farther away, you cannot tell.
Figure 10.1. Kila with levels of detail
Check out the games you play. Look carefully, and you will see characters or objects "pop" as they move away from the camera. This is the game engine swapping the current model for a lower LOD.
Setting the Binding Pose
Before we proceed to create LODs for both our characters, we need to alter their pose. We began with both Kila and Grae in the basic T pose, which made it easier to work with them, but we will need to alter the pose in preparation for the characters to be bound to a skeleton (which we'll do in the next chapter).
It's advisable to alter the pose now (you could even start off designing your models with the arms posed like this, to save time). Otherwise, once the level of detail models have been created, you would need to edit five models instead of just one.
The main areas that will need altering on Kila are the arm and finger positions.
The arm should be at the average position between the most-used extreme positions. If a character only ever walks with its arms down by its sides, it doesn't make any sense to raise the arms up to shoulder level when you bind it. This would just increase distortion to the shoulder area when the skeleton deforms the mesh.
Kila will be performing generally ordinary actions, so the arms should be set at about a 45 degree angle.
Before we adjust them, we need to make the arms separate objects so that they're easier to manipulate.
Detach the Arms
Not only do we need for the arms to be detached from the torso, but also to be separated along their UV borders so that we keep the UV's intact.
Open up the file called Kila_Texture.mb.
The arms are now free for you to work on. (Notice your bonus: The hands are now separated, too, ready for LOD work later.) Next we will look into the best approach for rotating the arms.
Rotate the Arms
We want to rotate both the arms the same amount and from the same pivot on either side. We could adjust the pivot as shown earlier in the book, snapping it to a vertex close to where our shoulder pivot would be. This wouldn't be very accurate, though, because the arm would rotate around the wrong axis. What we want is for the axis to follow the orientation of the arm.
For this purpose we will use a locator, which is a very simple dummy object that takes the shape of a cross. Locators have many uses: They can pinpoint positions in space; they can be used as a main controller; or, as in this case, they can be used to drive the rotation of a series of objects.
We will position a locator where the shoulder pivot is, and parent the arm and hand to it. When the locator is rotated, the arm will rotate correctly.
The arms are now orientated correctly, meaning we can now reattach them to the torso. Make sure you deactivate Snap Rotate on the Rotate tool before you proceed.
Reattach the Arms
Now the two arms are in position, and we can stitch them back onto the torso. First, we need to combine the three pieces of geometry into a single model.
Now that the shoulders are repositioned and smoothed out, let's reposition the fingers.
Like the arms, the fingers should be between their most extreme positions. Currently they are flat, which is close to one extreme. We need to go in and bend them slightly so that they look more relaxed.
Adjusting the hands is a good idea, but it's not strictly necessary, so feel free to skip this section if you like.
To save time, we can delete the right hand and work only on the left. We can do this because both hands have more or less the same UV mapping. Then we can duplicate the edited hand to replace the right hand.
Figure 10.11 shows Kila in her new pose.
Figure 10.11. Kila in her new pose
Grae, too, needs to be posed, so load Grae_Texture.mb. Adjust his arms and fingers just as you have done Kila's. Save him as Grae_Pose.mb when he's finished.
When your models are posed and ready, you can begin generating the levels of detail.