Introduction
In this article I am going to be discussing a lot of different topics, but it’s important to know that this article will not be a good first look at 3D modeling. If you have never touched 3D before in your life this isn’t the article for you. I also won’t be discussing how to use any one specific tool, or what file formats different game engines require you to use.
The primary purpose of this article is to give someone who has some foundation in 3D an idea of what they should learn or focus on if they want to transition into games.
3D in Games
These screenshots are of models from Starcraft 2 and UDK with their wireframes turned on so you can see how complex they are:
Games are a very unique medium to work with, both in general and as an art form, because unlike almost every other form of expression, games are interactive. This means that no matter how much planning you do, and no matter how much time you spend trying, you will never be able to predict every possible thing a player can do at any given moment. Because of this, games run on game engines which take in the actions of the player and output the results, and specifically they use Real-Time Rendering to create the 3D graphics you see when you play.
Real-Time Rendering is when a computer system generates the images or outcomes of an action for the viewer/player as they occur. Movies, TV Shows and still images are all rendered beforehand so that the viewer will have the exact images or experiences the creator wanted. Because these mediums are not rendered in real-time, the creator is free to make the piece as complex as they want.
Take for example the movie Toy Story 3. Toy Story 3 is a beautiful looking movie and the artists who worked on the film put a lot of time and energy into making the models and textures in that movie incredibly detailed and complex. While this made for a great looking movie, it also came at a cost: rendering time. I read in an interview about the movie that the least complex scenes in Toy Story 3 took a minimum of 8 hours to render each frame – and (in case you’re not into animation) there are 23-30 frames in each second of a video. Can you imagine playing Starcraft 2 or Call of Duty and having to wait eight hours to see the result of your mouse click, or the impact of your bullet? No one would ever play games if that was what it took, so keeping down render times for your game is important.
While it’s true that as technology becomes more and more advanced the line between high-end games and movies becomes thinner, there are still major markets such as tablets, smart phones, and hand-held consoles which have substantial restrictions on what they can handle.
When making 3D art for games it is important to understand what the restrictions are, and how to work within them to create high-quality, usable art assets. On top of that, even though the restrictions might not be as tight as they used to be, understanding what the restrictions are, and how they work, can help you work within game engines more effectively, and can allow you to create much more versatile assets.
Modeling: Polycounts and Optimization
The first stage any 3D art asset goes through, after all of the concept art has been finalized, is the modeling stage. The modeling process in games is very similar to the modeling process in other mediums, but when modeling for games the most important thing to consider is the polycount of your model, and keeping all of your polygons in Quads or Triangles.
First let’s look at polycounts. The polycount of your model is the total number of triangular polygons it takes to draw your model in 3D space. The higher the polycount is for your model, the longer it takes for the system to render it – and as I mentioned earlier, render times are very important.
Technically, render time can be affected by a lot of different factors and it’s not always the case that if you have low-poly models you will also have low render times. However, if your game engine is optimized well, the art assets would be the next main reason for slowdown.
Silhouettes
The first method I want to look at for keeping down your polycount is focusing on your model’s silhouette.
Keeping an eye on the silhouette of your model can be very important in preventing it from getting too complex. When making 3D models for games I like to always consider the importance of a detail in helping the player identify or understand an object, before I start adding it to a model. For example, let’s look at these images of a camera.
If we look at the silhouette of the camera it is easy to see which details are important, the shape of the light which comes out just over the back of the lens, the length and size of the lens relative to the camera, and the way the viewfinder just out of the back. These details are important because they allow the viewer to immediately see what the object is, or how it is built, and because they are not what I call “interior details”: things such as the texture of the grip, or items that are not flush with the camera but which also don’t contribute a discernible shape to the silhouette.
Looking at the original image you can see there are a bunch of little details which seem obvious and important, but would have little impact on the model or the player’s ability to identify it. This includes the ridges that go around the lens and allow the user to adjust the focus, the buttons and switches all over the camera, and the notch on the side which allows the user to open the SD card slot and USB port. These details are unimportant for the modeling stage because they don’t add anything substantial to the model, and don’t make it any easier for the viewer to understand what they are looking at.
When making models for any production it’s important to notice which features need to be on the model and which should just be on the texture, but in games you have to make sure that there is no “wasted space” on the model, and that every polygon you use is worth it.
Unseen Polygons
Another helpful way to keep your polycount down is to remove unseen polygons from your model. There are some scenarios where it will be impossible for the player to see certain parts or sides of a model, because of the way it is being used in the game. Since the player will never see these parts of an object, it would literally be a waste to use polygons on them.
A concrete example of this is guns in an FPS. In most FPS games the engine uses a higher detail model of a gun for the first-person view than it does for when the player is watching enemies with the same gun from a distance. It does this because the first-person model will be in front of the player for extended periods of time and thus needs to look as high-quality as possible. To make this work even more effectively, modelers will often remove the parts of the gun which are too obscured or low down on the screen for the player to ever see, since it allows them to make the rest of the gun look that much better.
If you look at the above images of the Link Gun from UDK you’ll see the the third-person model (left) has parts the first-person model (right) doesn’t. Since the player would never see these parts from the angle the gun is held and animated in first-person, they were removed from the final version.
While removing unseen parts and pieces can be helpful in staying under your polygon limit, you should also be careful when doing so as it can cause issues later. For example, if your game was heavily physics based, and the player could pick up and move any objects they wanted, then you would have no way of knowing which faces, if any, should be removed, since it would be easy for the player to put the object in a position you aren’t expecting.
Similarly if you have an object like a tree or a barrel which will be used in a lot of different places, it’s often best to leave them primarily intact since they too can end up being at a lot of different positions and angles depending on how your level is built.
As long as you use common sense, and don’t go crazy trying to cut down your polycount in this way, you should be okay.
Triangles and Quads
The other main thing I wanted to discuss about modeling is keeping your polygons in Triangles and Quads.
When your model is brought into the game engine you are using, or exported from the 3D application it was made in, every single polygon in your model will be triangulated (turned into two or more triangles) for easier calculations when rendering. The system does this by creating new edges to connect existing vertices on your model.
Triangulating a polygon is a simple process, but the more sides the polygon has, the more ways it can be triangulated. This is important because depending on how a polygon is triangulated, it may end up becoming more complex than it needs to be. If your model is already triangulated, the system won’t have to do anything, and you will have more control over how your final model looks.
If your model is made entirely of Quads this also wont be a major issue since Quads can only triangulated in two unique ways.
Once your polygons start having more than 4 sides things get complicated quickly. Look at this Pentagon (Pent), for example. Technically there are only two ways to use edges to triangulate it:
The problem is that every vertex on the Polygon is a completely separate object. This means that the first method of triangulation actually represents five unique methods of triangulation, and thus a Pent can be triangulated in six different ways.
This problem only worsens as the edges increase, and eventually it can be a huge issue for the model and the rendering system. The bottom line here is you need to keep an eye on your polygons and make sure that your final model is built entirely out of Quads and Tris. This isn’t specific to games – it’s generally a bad idea to have polygons which are not Quads and Tris no matter what you are working on – but I still felt it should be brought up here since it can be even more important in real-time systems.
LOD Models
Finally, before I move on from discussing modeling, I want to mention LOD (Level of Detail) Models. LOD Models are when you provide multiple models for the same object which are of varying levels of complexity and display different models depending on the object’s distance from that camera – this way, the farther the model is from the camera, the lower its polycount will be, and the less it will take for the system to render it.
Having different models for different distances allows you to draw more on screen at once, and it makes processing easier for the system since it doesn’t have to render high-detail models for things that are only barely able to be seen.
Below is an image of the Manta’s LOD Models from Unreal Tournament 3 (UDK). For your convenience I’ve outlined some of the spots where the difference in the complexity of each model is rather obvious. If you look closely you’ll see that some shapes on the model have been greatly simplified, and others seem to have been removed entirely.
Texture Types and Uses
Once your model is finished it’s time to move onto texturing. Texturing is an important aspect of the art pipeline no matter what you’re working on, and games are no exception. Like modeling, texturing for games has a lot of overlap with texturing in other mediums, but there are some things which are very common in games and are helpful to know about. In this section I’m going to discuss the most common texture types in games, the use of tiling textures, and the use of decals.
In games there are many different texture types used, but some get much more attention than the others. The texture types that are most important to know about are Diffuse Maps, Normal Maps, Specular Maps, and Alpha Maps. Knowing what each texture type or map is, and how it can be used, is important, but they are also relatively universal across all 3D art so I’m not going to spend much time discussing them; I’ll simply give a short explanation of each, with an example.
Diffuse Map
A Diffuse Map is just the flat colors for your object. A diffuse map is really just a picture wrapped around your model without any special effects applied. There are few scenarios where you would have a model without a diffuse map.
Normal Map
A Normal Map is a type of texture that is blue, pink, and green, and is used to give the illusion of greater detail on your model. If is similar to a bump map but much more powerful.
If you go back to the example of the camera model from before, the normal map would be used to give the illusion that the ridges going around the lens are actually there on the model and are not just a texture. Normal maps are used on most objects as well, since they give the illusion that the objects in your scene have many more fine details than they actually do.
Specular Map
A specular map is used to add specularity, or “shininess”, to an object. A specular map is usually black and white or greyscale. Specular maps are not always used, but whenever you have an object that is highly shiny or reflective in some areas, but not in others, you would definitely use a specular map since it allows for a strong level of variation in specular intensity across a single model.
Alpha Map
An alpha or transparency map is used to make parts of an object more transparent. Like specular maps they are usually black and white or greyscale. Alpha maps are also not always used but are relatively common.
The two most common scenarios you would find alpha maps would be if you had a window model, where one would be used to make the glass transparent or semi-transparent, or if you had a plant with a large number of leaves so you could make the leaf models themselves much simpler.
Tiling
Games also make regular use of tiling textures, or textures which can be repeated infinitely in one or more directions without an issue. This is because things like the ground and large walls are often hard to texture by hand and it would be incredibly time consuming if every wall in every level of every game had to be textured individually. To solve this issue, tiling textures are used so that only one texture needs to be made for all the walls of a given type.
No comments:
Post a Comment