Vous êtes sur la page 1sur 10

What the hell is hardware T&L?

By Erik Sebellin on May 30, 2002 TweetShare Print The most important component of any gaming rig is the video card. You can have t he most jacked-up system possible, with a muscle-bound CPU and more RAM than NAS A, but if you're stuck with an obsolete card, your games are going to run like c rud. That said, simply upgrading your video card isn't always an option, especially w ith some cards costing upwards of S$200. Since you know that a particular game i s supposed to run on your system (after all, it meets the minimum requirements), you may choose to venture into the graphics options. There, technical terms lik e bump mapping, volumetric fog, and trilinear filtering are bandied about with w ild abandon, but if you don't know what they mean--or how they affect the games you play--you could find yourself spending hours tweaking the settings with less than satisfying results. That's why we've created this handy guide that into easy-to-understand language. We tried to unter in the depths of game setup options, and sed in a short guide that covers the basics of ut of your existing 3D card. breaks down all those fancy terms include every term you might enco as an added bonus, we've even tos getting the maximum performance o

Hopefully, this opus will rescue you from the ranks of the obsolete by helping y ou squeeze every last drop of functionality out of your once-cutting-edge card. And at the very least, it will help you understand the gist of the terms describ ed within, without mowing you down with an incomprehensible barrage of technical terminology. AGP and PCI

Accelerated Graphics Port (AGP) and Peripheral Component Interface (PCI) are two types of slots found on just about every current or recent motherboard. The dif ferences lie in their capabilities. AGP was designed strictly for video cards. I t gives equipped systems faster access to a video card's graphics capabilities a nd a speedy pipe to the system memory to score extra textures. The PCI port, how ever, is built with general use in mind. Although video cards are still made to work with PCI, you'll generally find sound cards, SCSI cards, and even modems co nnected to a PCI slot. Among the two, AGP is far better for graphics. If you're in the market for a new video card and your motherboard supports AGP in any respect, your best bet is a n AGP video card. The slightly higher cost is offset by the greatly increased sp eed. The various flavors of AGP include 1x, 2x, 4x, and the upcoming 8x; the number i s an indication of how quickly texture data can be transferred from the system b us to the motherboard. Most 4x implementations include sidebands, which allow re quests for data to be sent at the same time as previous requests are being fulfi lled. Most current hardware supports 4x. AGP is of primary importance to gamers whose video cards have less than 32MB of memory. Games run best when all or most texture data is stored in local memory-that is, memory right on the video card. The more memory a video card has, the m ore likely it is that this is going to be possible. Video cards with smaller amo unts of memory will make more judicious use of the AGP bus. Antialiasing

Antialiasing, often called FSAA (full-scene antialiasing), is a technique used b y video cards and some software to reduce the jagged look of low and medium reso lution graphics. If you look closely at a diagonal line in a game such as Quake II, you'll notice that it isn't entirely straight--it actually seems to resemble stair steps. Antialiasing blends the edges of these lines, the end result being a smoother, straighter look. Most of the new video cards, including the 3dfx Vo odoo5 series, ATI's Radeon cards, and Nvidia's GeForce2 series, offer FSAA. Note , though, that to use it, you have to enable it through the cards' drivers, not through the game's interface.

Using FSAA allows you to run a game at a lower resolution (such as 640 by 480 pi xels or 800 by 600) while giving it the sharp look of higher resolutions. Using it, however, adds a performance hit. API

An Application Programming Interface (API) is a collection of subroutines that p rograms can use to perform certain tasks. Before APIs, developers had to customi ze their products so they would work well on the wide variety of hardware config urations available. With APIs, developers can focus on a single version of their game and not worry about the little things. The three APIs you'll encounter are DirectX, Glide, and OpenGL. DirectX is from Microsoft, Glide is from 3dfx, and OpenGL is originally from Silicon Graphics. E ach API has its strengths and weaknesses for developers. For example, OpenGL is a cross-platform API, allowing it to run on PCs with various operating systems, Macintosh computers, and even Silicon Graphics' own machines. Glide is made to w ork exclusively with 3dfx video cards. Direct3D, from Microsoft, is part of the ubiquitous DirectX suite and is meant to support a wide range of products for PC s running Windows. Though most games will give you a choice as to which one you would like to use, your best bet is to go with your strength--your video card's strength, that is. Check Gamecenter for benchmarks of your video card to find out which API your vi deo card handles best and, if the game you wish to play supports it, select that one. Bump Mapping

Bump mapping is a trick that attempts to give a texture roughness or smoothness. For example, imagine a wireframe three-dimensional rectangle. On this rectangle a developer applies the texture of a brick wall. Right now, you've got a rectan gle covered in bricks. What you don't have, however, is the roughness and uneven ness that real brick surfaces have. To give a brick wall a more realistic look, a developer may create a bump map, w hich is essentially a flat picture, similar to a texture, with the roughness tha t brick walls have. The bump map would then be placed onto the brick wall textur e. The color of the wall doesn't change, but it suddenly gains a new, more three -dimensional look and feel. There are three different kinds of bump mapping methods. Environment-mapped bump mapping (EMBM) is a technique used on reflective surfaces like chrome or water. Although other bump maps can be applied to these surfaces, only EMBM can be use

d to help simulate more realistic movement of waves, for example. The second kind of bump mapping is called Dot Product 3 (DP3). DP3 bump maps hav e calculations embedded in them calling for your computer to calculate shading b ased on nearby light sources. Although it provides a better look, it lacks the f lexibility of EMBM. The third and final method of bump mapping is called embossing. It works like th e example of the brick wall provided above: it adds a second texture to enhance realism. Embossing is the simplest and least realistic method of bump mapping. Colored Lighting

Colored lighting is just what it sounds like: colored light. Years ago, when com puters were much slower and 3D accelerators were on the drawing board, games wer e only able to produce generic white light. These white lights (from sources lik e flashlights, for example, or explosions) would either cause the objects around them to be bathed in white light or do absolutely nothing at all. With colored lighting, a red light bulb is capable of coloring whatever is in a room with it. For example, if a person were to walk into the room, his or her fa ce and clothing would assume a reddish color. A blue shirt, under with the red l ight of the room, would look purple. Color Depth Color depth, also called bit depth, is the term for the amount of color that's r endered in a scene. Typical color depths you'll find are 8-bit, 16-bit, 24-bit a nd 32-bit. The higher the depth, the more colors you'll have available to you. T he drain on system resources, however, increases quite a bit when you move, say, from 16-bit to 32-bit, as your video card has to work harder to create more and more colors to place on the screen.

Why does it work harder? Well, computers can only think in binary code, which co nsists of just two numbers, one and zero, also known as "on" and "off." A single binary digit is a bit. Computers place patterns of bits into available memory a nd use them for calculations. Properties of pixels (those little dots that make up a picture) on a computer display are stored as bits, and the number of colors each pixel can have is determined by the number of bits used to "describe" the pixel. Take an 8-bit pixel, for example. That pixel can appear in one of 256 colors. In order to get 256 colors, the computer must calculate the number of possible val ues of each bit (which, of course, is two) to the power of eight, because there are eight bits; two to the eighth power is 256. The computer will set aside a ch unk of memory in order to store 256 combinations of binary code, each combinatio n representing a particular color.

Each one of those 256 colors will end up taking up a total of three bytes for ev ery pixel displayed. Since eight bits are the same as one byte, where do the two extra bytes come from? Well, red, green, and blue are always mixed to create a large assortment of colors. The data for the red, green, and blue colors is cont ained within those two extra bytes of memory. As a result, if you are running at a screen resolution of 640 by 480 (which cont

ains a total of 307,200 pixels), then 8 bits of color will end up requiring 921, 600 kilobytes, or almost one megabyte, of RAM. The higher in color bits you go ( which is the color depth), the more RAM is required. The amount of math, both on your part and on the computer's part, increases accordingly. Therefore, setting a game for 32-bit color requires a lot more processing power and memory than 16-bit color. Those are the bit depths most current games offer; you won't see games that use 8-bit color very often anymore, and you won't enco unter 24-bit color in a game very frequently. Dynamic Lighting

Dynamic lighting is the ability of a game to change the way an environment looks based on light sources. For example, picture a pitch-black room with a soldier in it. The soldier points a rifle at a nearby target and fires. The resulting fl ash of light from the weapon will briefly illuminate the soldier and anything ne arby, such as walls or objects. Though it may seem like a fairly minor effect, dynamic lighting is a tool used b y developers to help players truly get into a game. Firing a rocket down a hallw ay, for example, will illuminate sections of the hallway as the rocket passes th rough. Those lighted sections will then resume their natural state when the lumi nescent rocket is gone.

There are different ways of implementing dynamic lighting. The first is called a light map. A light map works like a texture, or even a bump map, except it is a ctivated only when a light source is necessary. Using the rocket example, if the rocket were to pass parallel to a brick wall, light cast from its flame would l ight up the wall. A light map is added to the wall by the game to show this. The light map doesn't change the colors or physical look of the brick; it just make s it suddenly look much brighter. The light map is then taken away once the rock et has moved on. The second type of dynamic lighting is vertex lighting. With vertex lighting, th e light from the rocket that lands on a nearby wall is calculated based on the p osition, intensity, and size of the light source. Of the two, light mapping is m uch more precise and will allow for the best quality. Vertex lighting requires l ess processing power, though it doesn't look quite as nice. Environment Mapping

Environment mapping is a technique used to alter a particular texture based on t he environment around it. This has been put to good use in driving simulations w here large or close objects (such as trees, the sky, or even other cars) are ref lected onto a vehicle, providing it with a chrome-like appearance. Environment m apping essentially gives textures a highly reflective appearance, making mirrors and shiny objects realistic. Frame-Rate Locking

When a computer gets bogged down in complex tasks, the frame rate in any game wi ll suffer. To compensate for this, some games provide an option called "frame-ra

te locking" or "frame skipping." Usually, the option will ask you to enter a num ber representing the minimum frame rate you will tolerate. When your frame rate drops to this number, the computer may reduce the detail of the scene or skip a bunch of calculations and think ahead. As a result, if you've just fired a rocket down a hallway, and your computer dec ides it needs to skip some frames, your rocket will suddenly reappear much farth er away than where you last saw it, as the intervening frames have been chopped away. Or, if you're running along in an enclosed area at a smooth frame rate and you burst into a huge, open area, the computer may reduce the texture quality o f faraway objects--or not draw them at all--to keep the frame rate steady. In general, 30 frames per second is the lowest you'll want to go to preserve smo oth, fluid animation, and 20fps is the lowest you should go in terms of playabil ity. The human eye will stop seeing fluid motion--instead seeing a slide-show ef fect of still shots--at about 8 frames per second. Hardware T&L

Hardware transform and lighting is found on the latest-generation video cards an d supported by only a few games at this point--though that will almost certainly change. Hardware T&L, as it is called, is a great step towards helping develope rs put more detail into objects without bogging down CPUs. To understand hardwar e T&L, you have to know a bit about the process of rendering 3D graphics. The moving images you see in a game are actually made up of rapidly displayed st ill frames. The more still frames your computer is able to display in a given le ngth of time (the most commonly referenced unit of time is one second), the smoo ther the scene appears to move. That's why a high frame rate, which is the numbe r of frames drawn in one second, is so desirable. It takes a series of steps for your computer to lay out and draw (or render) eac h still frame. In most cases, the steps are transform, lighting, triangle setup, and rendering. Obviously, T&L represents the first two steps. A 3D application, such as a game, keeps tabs on everything that's going on in a game, including camera movements, the relative motion of other objects, changes in level of detail, physics engine calculations, and other factors. This data is sent through the API and on to the graphics pipeline, where transform, lighting , triangle setup, and rendering take place. The transform step takes all of that viewpoint data and determines exactly what objects will be rendered in a single frame. Usually, every object--including tho se obscured from the final rendered scene by closer objects--is transformed. Lig hting effects, based on the 3D engine's lighting capabilities, is then applied t o the transformed scene. Then the triangles, which are the polygons that make up the 3D objects of the scene, are set up by a floating point engine, and the sub sequent data is used in the final step in the process, the rendering of the scen e. The rendering engine decides the best color for each pixel that makes up the scene (based on myriad factors including the base color of each textured or mult itextured pixel, lighting data, transparency and translucency, fog, and so on. Traditionally, the transform and lighting are taken care of by the main system p rocessor, and only the final steps are offloaded to the video card's processor. Nvidia's GeForce 256 chipset was the first major graphics chipset to contain its own transform and lighting engine, which is why Nvidia dubbed it a GPU (graphic s processing unit, a term which other companies have accepted and are even using to describe their own 3D processors). Hardware T&L, therefore, is the ability o f a graphics processor to do transform and lighting calculations, thus offloadin

g the task from the system processor and leaving it free to take care of other p rocesses. Hardware T&L is still a new, developing technology. Currently, a few games (Sold ier of Fortune and MDK2, for example) use T&L, but in many cases it's still fast er to let the system processor do it. This is likely to change as hardware T&L e ngines become more sophisticated and as game developers program their titles to take hardware T&L into account, thus getting the most out of the technology. Level of Detail This term can mean a lot of things. Most commonly, you will see level of detail (or LOD) associated with terms like texture, skin, terrain, lighting, or just gr aphics. Usually, level of detail refers to the texture resolution used in render ing said objects. Generally, textures range in resolution from 10 pixels by 10 p ixels (10 by 10) to 1,024 by 1,024 or more pixels. The more pixels available, th e better a texture looks overall--and the more processing power it takes to rend er it. Lowering the level of detail of an object, therefore, will cause a game to use l ower-quality versions of a particular texture. In most cases, this results in a big boost in speed at the expense of graphical quality. If you're afraid of making your game look pitifully bad for the sake of speed, t ry lowering the level of detail on things that tend to be less important--skin d etail, for example. Tweaking the level of detail to find a good balance of speed and quality will take a bit of experimentation, but the benefits are worth it. MIP Mapping

Multi-image pyramid (MIP) mapping is a clever technique used by developers to sa ve on memory and ensure a much more enjoyable game. It has to do with balancing the size of textures with the amount of resources your computer needs to be able to run a game efficiently. When a texture is created, developers will create several versions of it at diff erent resolutions. Those resolutions can range from 2 by 2 pixels to 1,024 by 1, 024 pixels and up. The higher the resolution, the more memory it will take up. Let's take a first person shooter like Half-Life as an example. If you are looki ng at a wall that is very far away, the textures applied to that wall are reduce d, through MIP-mapping, to 2 by 2. If it were 256 by 256, it would be taking up a large amount of memory rendering detail that, because it's so far away, you co uldn't even make out. As you move closer to the wall, the game will replace that 2-by-2 texture with a 4 by 4, 8 by 8, 16 by 16 (or whatever other textures the developers created), and so on until it reaches you with the maximum provided re solution. Motion Blur

Think for a moment about a movie. Movies run at a minimum of 24 frames per secon d. They run at the perfect speed to allow the human eye to see motion as smooth and flowing--any slower, and movement would appear jerky. Speeds higher than 30f ps wouldn't make too much of a difference. Now, if you were to look at one of th ose movie frames, you would see that anything moving quickly would actually be b lurred. A speed of 24fps allows the human eye to blend the blurred images into o ne continuous motion. On a computer, things work differently. If you were to look frame by frame at a

fast-moving object in a game, there would be no blurring, because objects on a c omputer are drawn, removed from the screen, and drawn again in a new position. T here is no intervening movement. This results in a less than fluid and lifelike animation and necessitates frame rates higher than 30fps. Motion blur, though it 's not yet being embraced by developers, has the potential to create more realis tic, cinematic animation. 3dfx's T-buffer, which is part of the Voodoo5 architec ture, supports motion blur in hardware. Multitexturing This technique allows a game to apply multiple textures onto a single polygon in one pass. Older video cards will only support single or dual texturing, allowin g for only one or two textures to be added to a single surface. For example, imagine that brick wall from the bump mapping example, only without any bump maps applied. Currently, only the brick texture is present on that wal l. Now imagine that brick wall with a spotlight shined on it, a poster hung on i t, some graffiti painted nearby, and a bunch of black bullet holes. The bullet h oles, graffiti, spotlight, and poster textures are rendered on top of the brick texture. From there, you can place bullet hole textures on top of the poster, or perhaps even add a texture representing paint to try to cover up both graffiti and bulle t holes. The thing to keep in mind with multitexturing, however, is that the mor e layers of textures that are added to a surface, the more demand is placed on a video processor. In most cases, developers have instructions in place that will strip unimportant textures in case the computer is running low on resources. Fo r example, if the spray paint and poster were not important, the scene would be rendered with just the brick and bullet holes. Projected Textures

Projected textures help create a much more realistic environment in a game. If y ou can imagine light coming through a stained-glass window with the window's ima ge being displayed on the floor or other objects nearby, then you've got a good idea of what projected textures look like. They can also be in motion, as you mi ght see, for example, on someone standing in front of a movie projector or with the shimmering sunlight from the surface of a lake shining on rocks and sand at the bottom. Real-Time Shading Real-time shading is a technique used to portray shadows accurately from a light source that is in motion. For example, if a small light were revolving around a dark room, shadows would be stretching and shrinking constantly. The Gathering of Developers game Nocturne was known more for its real-time shadows than its ga meplay. There are two types of shading involved in creating shadows as well as enhancing graphics, making objects look more three-dimensional: per-polygon shading and p er-pixel shading. In per-polygon shading, light is calculated at each vertice of a polygon and the n displayed on the surface of that object. In per-pixel shading, the light for e ach individual pixel making up the object is taken into account, and the shaded result is applied to the surface. Per-pixel shading is very processor-intensive, since there's more work to do, but results in a much nicer, much smoother image . Resolution Resolution represents the number of pixels, and therefore the amount of detail, you have on your screen at any one time. Common resolutions are 640 by 480, 800

by 600, 1,024 by 768, 1,280 by 1,024, and 1,600 by 1,200. The numbers indicate r ows and columns of pixels: 640 by 480 means that there are 640 pixels horizontal ly across your screen and 480 vertically, from top to bottom. Since higher resolutions allow more detail on the screen, games will both look b etter and run more slowly. If you need a quick boost in speed, lowering your res olution will take a load off your CPU's back. If you are more interested in bett er graphical quality, raising the resolution will improve graphical detail. Shading

Shading helps define an object and give it greater depth, allowing for a more re alistic look. The more common types of shading are Gouraud shading and Phong sha ding. Gouraud shading calculates the light at both ends of an object and applies a gradient between the two. In Phong shading, the light necessary for each pixe l is calculated. Phong shading is the better of the two, but is slower. Gouraud shading is your best choice for speed. Software Rendering

Software rendering is the good old-fashioned way of creating a 3D image on your screen. The modern method, hardware rendering, is faster and more efficient and allows for a startling increase in quality. Up until the advent of 3D accelerato rs, all games used software rendering. With software rendering, all the work of putting graphics onto your screen is ha ndled by your CPU--which also happens to be working on processing sound and tran slating the messages coming from your mouse, keyboard, or joystick. It is almost always better to choose hardware rendering. Texture Filtering

Texture filtering is a technique used to smooth the overall look of a texture; w ithout filtering, each pixel within a texture would stand out clearly, and low-r esolution textures might look blocky. Higher resolution textures that don't unde rgo filtering often appear to be speckled, and they tend to sparkle as an animat ed scene changes.

Bi- and trilinear filtering each work to create smooth transitions between diffe rent colored pixels in a texture. In bilinear filtering, this is done by taking four pixels of a texture, finding an average color, and then replacing them with the new average. Trilinear filtering works the same way, except it also samples the pixels of the nearest two MIP maps to determine a three-dimensional average : this not only smooths the look of the texture, but it also smooths the transit ion from MIP to MIP. Though the graphical quality resulting from trilinear filte ring is obviously far superior to that of bilinear filtering, the amount of proc essor power needed to run it is much higher. Textures

If you've seen a wireframe model, you've seen the building blocks of the objects

in a 3D-accelerated game. A shipping crate, for example, would essentially be a big cube. Textures are two-dimensional (flat) pictures that are added to those wireframe models to make them look as they were intended to look. For example, imagine a large rectangle. Next, imagine that brick wall again. If you were to snap a photo of that brick wall and place it on that rectangle, you would now have a brick wall--or, really, a wireframe rectangle with a brick text ure on it. In some cases, you'll be presented with an option for choosing a texture pixel r esolution, or a texture compression scheme. Texture pixel resolution options ten d to look like "256x256" or "32x32." Keep in mind, however, that when altering t his option a lower resolution will provide an increase in game performance, but the graphical quality will decrease correspondingly. Texture compression schemes such as DXTC (formerly S3TC) and FXT1 are used by ma ny games. Each of these is a method of compressing a texture, much as GIF and JP EG are methods of compressing an image. The smaller the texture, the more textur es a game can stuff into your video card's memory. Good use of texture compressi on can enable games to display higher resolutions than would otherwise be possib le. Volumetric Fogging and Lighting

Volumetric fog is a technique with many applications. Something that is volumetr ic is capable of taking up three-dimensional space. Most often, volumetric fog i s used to obscure the maximum viewable distance in a game. This technique has tw o benefits: it can provide a more realistic, or spooky, atmosphere in a game, or it can obscure textures in the distance, meaning your computer won't be forced to draw them in until you get closer, thus saving on processor power. Volumetric fog can also be confined to specific places. For example, a nearby graveyard co uld be full of fog but a surrounding town can be relatively free of the effect. Volumetric fog is also used to display steam rising from water, smoke from a cig arette, or plain old fog. Another common method of creating fog is environment fog, in which it is assumed that the entire area the player is occupying is full of fog. The problem with e nvironment fogging, however, is that it can at times seem unrealistic, since it affects absolutely everything in the game. If you enter a building with a very l arge and open interior, for example, the environment fog could obscure the far w all. This effect isn't too believable. If you've ever seen Turok, you know what we're talking about.

You may encounter an option commonly found in racing simulations called View Dis tance or, sometimes, Scenery Pop-Up. If you turn this all the way down, you'll n otice that buildings will just suddenly appear as though out of nowhere while yo u race. This is done to help minimize the amount of objects on your screen at on ce so your CPU doesn't run into trouble. Start your tweaking with the highest se tting and work your way down. Whenever scenery popping up causes your CPU to sto p and think, turn the option down a notch. Volumetric lighting allows light to appear as though it were passing through som ething like smoke, fog, or even dust. Without volumetric lighting, light would s imply be completely visible or obscured. Tweaking Your Games Before you begin tweaking, you will have to gather some information. First, chec k the box in which your game was packaged. Somewhere on that box is a section de

tailing the minimum system requirements for running your software. Minimum requi rements can usually be considered wishful thinking, but you can use them to dete rmine about how much tweaking you'll have to do to achieve a playable frame rate . The higher your system is above the minimum requirements, the less graphical q uality you'll have to sacrifice. Conversely, if your system matches, or just bar ely beats, the requirements, you could be in for some major tweaking. Basic Tweaking Methodology Now that you have a sense of how much tweaking you'll have to do, you can load u p your game and get started. Enter the graphics configuration screen of the soft ware and have a look at all the terms you'll find there. If you need to find out what they mean, refer to the definitions in this feature. Often, games will default to a certain configuration. Since you're reading this, odds are that the configuration isn't working too well for you. First, find out what might be causing your game to run sluggishly. Does the game get slow only when you fire a weapon? Look for the Dynamic Lightin g option and turn it off. Dynamic lighting typically comes into play when a weap on is fired or when a source of light is somehow activated. Does the game run smoothly until you turn a corner? Look for the Texture Quality option. Typically, a game will load all the textures needed for the scene you f ind yourself in. If you enter an area requiring new textures, the game will have to send those to your video card, causing choppiness in gameplay. Lowering the overall quality of the texture will reduce the amount of necessary data and cut down on stalls. Does the game run poorly overall? If so, your computer may be trying to do too m uch. Give it a break by lowering a few options. If possible, begin by lowering t he Color Depth option to its minimum. Even though 16-bit color may not look as g ood as 32-bit color, the performance increase you get will make it worthwhile. If the game is still sluggish, consider lowering or even turning off filtering. Trilinear filtering helps make games look their best, but it asks a lot from a m achine. Dropping down to bilinear filtering, or, if the game offers the option, turning off filtering altogether, will result in a big performance gain at the c ost of image quality. Finally, consider lowering your pixel resolution. Resolution is a major factor i n determining how a game will look, and the higher the resolution the better the result will be. One word of warning about resolution: lowering the resolution t o anything below 640 by 480 pixels will result in your game looking pretty bad. Overall, resolution will have one of the biggest effects on how your game looks and plays. Try to leave it at a minimum of 800 by 600 and play around with other options first. Many games offer other graphical options as well. Have a look at your graphic co nfiguration screen. Use the definitions in this guide to help you decipher the l ingo and figure out exactly how to make your games look as good as they can whil e moving at a playable frame rate.