Game Engine Analysis 4
Original author: Jake Simpson Translator: to the sea Email: GameWorldChina@myway.com
Part 4 models and animations, detail level
Role modeling and animation
Your role model looks on the screen, how to easily create them, texture, and animation to eliminate untrusted utensils for modern games to complete. The role model system has gradually complex, including a higher polygon quantity model, and makes the model to move on the screen.
Now you need a skeleton model system, have a skeleton and mesh detail level, a single vertex skeleton assessment, skeleton animation ignore, and the angle of stay in the game is ignored. And these don't even begin to involve some good things you can do, like animation mix, skeleton reverse kinematics (IK), and single skeleton restrictions, as well as textures of the camera. This list is also able to continue. But really, after using professional journals, what are we really talking about here? let us see.
Let us define a grid-based system and a skeletal animation system begins. In a grid-based system, for each animated frame, you want to define each point in the model grid in the world. For example, you have a model containing 200 polygons, 300 top points (note, usually not 3 pairs of relationships between vertices and polygons, because a large polygon is often shared - using strips And fan shape, you can significantly reduce the number of vertices). If the animation has 10 frames, then you need to have 300 vertical positions in memory. There are a total of 300 x 10 = 3000 vertices, each with X, Y, Z and color / alpha information consisting of x, y, z and color / alpha information. How fast you can see this increased. Both Quake I, II and III use this system that does have the ability to dynamically deformed grids, such as swinging the skirt, or let the hair flutter.
In contrast, in the skeletal animation system, the grid is a skeleton composed of skeletons (the skeleton is the object of your movement). The grid vertices are related to the skeleton itself, so they are relative to the skeletons in the model, rather than the grid representing each vertex in the world. Therefore, if you move the skeleton, the position of the polygonal vertex is also changed accordingly. This means that you only have to move the bone movement, typically about 50 skeletons - it greatly saves memory.
Skeletal animation attached benefits
Another advantage of skeletal animation is to "valuate" each vertex, respectively, according to some skeletons that affect the vertex. For example, the backbone of the arms move, shoulders, neck and even the torso can affect the grid. When you move the torso, the grid moves like a role. The overall effect is a more smooth and trusted animation that can be achieved in 3D characters and requires less memory. Everyone won.
Of course, the disadvantage here is that if you want to make organic things and very good, such as hair, or shawl, in order to make it look nature, you have finally launched the quantity of amazing skeletons, which will raise some processing time.
Some of the other things that can bring you based on the skeletal system is 'Ignore' specific hierarchical skeleton - Said, "I don't care about the animation to do things for this skeleton, I want it to point to the world. A specific point. " it's great. You can make the model look at the events in the world, or keep their feet remain horizontally on their stood. All this is very subtle, but it can help bring the true feelings of the scene.
In the skeletal system, you can even specify "I need to put this special animation for the legs of the model, and a different gun or shooting animation play on the model torso, and the guy (role) screaming different animation effects in the model Head play ". Very wonderful. GHOUL2 (in Soldier Of Fortune II: Double Helix and Jedi Knight i: Outcast) has all these good things, and is particularly designed to allow programmers to use all of these ignorers. This is difficult to believe in animations like you. This rescue is not believed like you. Raven has a character walking animation and an animation that is standing, and merges these two animations in it simultaneously, rather than needing an animation representative role. Walk and fire. More skeletons in the closet
The effects previously described can be done by having a hierarchy bone system. What does it mean? It means that each skeleton is actually position relative to its father, rather than each skeleton is directly located in the space. This means that if you move your father's skeleton, then all its children's skeletons are followed by moving, and there is no need for any additional efforts on the code. This is allowed to change animation at any skeleton level, and the things that are passed down through the rest of the bones.
Creating a bone system without a hierarchy is possible - but then you can't ignore a skeleton and expect it to work. What you see is just a skeleton on your body began a new animation unless you realize a system that is deliver information ', other skeletons under the skeleton maintain the original animation. First, starting with a hierarchy system, you automatically get these effects.
Many today's animation systems begin to appear new features, such as animation mixing, transition from a movie movie to another movie, instead of immediate transition from an animation to another. For example, you have a role in walking, then he stopped. You are not only suddenly transforming the animation, letting his legs and feet are in the invalid position, but mix half a second, so that the foot seems to move to a new animation. It is not possible to evaluate this effect - mixing is a subtle thing, but if it is used correctly, it is really different.
Reverse kinematics
Reverse Kinematics (IK) is a professional term that is discarded by many people, and there is not much concept for its true meaning. IK is a relatively relatively new system in the game today. Using IK, programmers can move one hand, or leg, the remaining joints of the model are automatically repositioned, so the model is correctly defined. And there is a new position of the model of the model, and the model is correctly oriented. For example, you will say, "Good, hand, picking up the cup on the table" and pointing out the position of the cup in the world. Hand will move there, and the body behind it will adjust itself so that the arms move, the body is properly curved, and so on.
There are also things opposite to IK, called forward motion, essentially opposite to the order of IK work. Imagine a hand, hand attached to the arm, the arm attached to the body. Now imagine that you have hit your body again. Usually, the arm is tick-like, and the hand of the arm is vibrated with the hand. IK can move the body and let the remaining limbs move in a real way. Basically, it requires an animator to set a large amount of information for each work - a range of motion that can pass through the joint, if the skeleton in front of a piece of skeleton moves, then this skeleton will move how much percentage, and so on.
Like it now, although it is very good, it is a big handling problem. Don't have a different animation combination. It is worth noting that the real IK solution requires a hierarchical bone system instead of a model space system - otherwise they have time consuming too much to calculate each skeleton properly.
LOD Geometry
Finally, we should quickly discuss the detail level (LOD) system associated with the zoom model geometric complexity (the LOD relative to the MIP mapping) is discussed). Assuming that most of the multi-PC game supports the huge range of processor speeds, and any given visual scene of you may render (one role on the screen is still 12?), You usually need some system to process Such cases, for example, when the system is close to the limit at the same time, 12 roles are drawn simultaneously, each role has 3,000 polygons, and maintains a realistic frame rate. LOD is designed to assist in such scenarios. The most basic case, which dynamically chase the ability to change the number of roles you draw on the screen dynamically changed at any given time. In the face of realism, when a role is far away, maybe only ten screen pixels height, you really don't need 3000 polygons to render this role - maybe 300 is enough, and you have difficult to distinguish the difference. Some LOD systems will need to create multiple versions of the model, and they will rely on the approximate to the model from the observer to change the LOD level on the screen, and how many polygons are being simultaneously displayed. More complex systems will actually dynamically reduce the number of polygons on the screen, at any given time, any given role, dynamically-Messiah and SacriFice include this style of technology, although not in the CPU Inexpensive. You must be confident that compared to the first thing to simply rendering the entire thing, your LOD system does not have more time to calculate how many polygons (or not rendered) are rendered. All the way will work, because today we try to draw the number of polygons to draw on the screen, this is a very necessary thing. Note that DX9 will support the adaptive geometric zoom (Tesellation) of hardware execution.
Attack is, get a smooth, performance and movement of the model, and look realistic models on the screen. A smooth movie is often a combination of artificial build animations and motion capture animations. Sometimes you just handle a given animation - when you do some animation you can't do in real life, you tend to do this - for example, you really can't Bending, or like the Lui Kang in Mortal Kombat 4, in the traveling bicycle kicks, usually the exercise is out of the way! Usually sports capture animation - actually video capture live actors run through what you want to be on the screen The animation you see - is a way to get realistic things. The real thing can make a normal game look great, and you can cover many things. For example, NFL Blitz, the model on the screen is about 200 polygons. They look horrified in still standing, once these models run, they have a fast and smooth animation, and many ugliness of the model they have disappeared. Eyes are easy to see is 'realistic' animation rather than model itself. A nice model designer can cover most model defects.
I hope these insights bring to your model and animation. In the fifth part, we will go further into the 3D world, discuss something about physical, sports and effect systems.