Chapter 8: Introduction to Textures


3D computer games are intensely visual. In this chapter we begin to explore the creative process behind the textures that give 3D objects their pizzazz.

Using Textures

Textures are probably the unsung heroes of 3D gaming. It is difficult to overstate the importance of textures. One of the most important uses of textures in a game is in creating and sustaining the ambience, or the look and feel of a game.

Textures also can be used to create apparent properties of objects, properties that the object shape doesn't have—it just looks like it does. For example, blocky shapes with jutting corners can appear to be smoothed by the careful application of an appropriate texture using a process called texture mapping.

Another way textures can be used is to create the illusion of substructure and detail. Figure 8.1 shows a castle with towers and walls that appear to be made of blocks of stone. The stone blocks are merely components of the textures applied to the tower and wall objects. There are no stone blocks actually modeled in that scene. The same goes for the appearance of the wooden boards in the steps and other structures. The texture gives not only the appearance of wood but the structure of individually nailed planks and boards. This is a powerful tool, using textures to define substructures and detail.

click to expand
Figure 8.1: Structure definition through using textures.

This ability to create the illusion of structure can be refined and used in other ways. Figure 8.2 shows a mountainside scene with bare granite rock and icefalls. Again, textures were created and applied with this appearance in mind. This technique greatly reduces the need to create 3D models for the myriad of tiny objects, nooks, and crannies you're going to encounter on an isolated and barren mountain crag.

click to expand
Figure 8.2: Rock and icefalls appearance on a mountainside.

Textures appear in many guises in a game. In Figure 8.3 two different textures are used to define the water near the shoreline. A foamy texture is used for the areas that splash against rock and sand, and a more wavelike texture is used for the deep water. In this application the water block is a dynamic object that has moving waves. It ebbs and flows and splashes against the shore. The water textures are distorted and twisted in real time to match the motion of the waves.

click to expand
Figure 8.3: Shoreline foam and deepwater textures.

Another area in a game where textures are used to enhance the ambience of a game is when they are used to define the appearance of the sky. Figure 8.4 shows cloud textures being used in a skybox. The skybox is basically the inside of a big six-sided box that surrounds your scene. By applying specially distorted and treated textures to the skybox, we can create the appearance of an all-enveloping 360-degree sky above the horizon.

click to expand
Figure 8.4: Clouds in a skybox using textures.

We can use textures to enhance the appearance of other objects in a scene. For example, in Figure 8.5 we see a number of coniferous trees on a hillside. By designing the ground texture that occupies the terrain location of the trees appropriately, we can achieve the forest look we want without needing to completely cover every inch of ground with the tree objects. This is helpful because the fewer objects we need to use for such a purpose—basically decoration—the more objects that will be available for us to use in other ways.

click to expand
Figure 8.5: Terrain accents.

One of the most amazing uses of textures is when defining technological items. Take the Tommy gun in Figure 8.6, for instance. There are only about a dozen objects in that model, and most of them are cubes, with a couple of cylinders tossed in, as well as two or three irregular shapes. Yet by using an appropriately designed texture, we can convey much greater detail. The weapon is easily identifiable as a Thompson Submachine Gun, circa 1944.

click to expand
Figure 8.6: Weapon detail using textures.

Following the theme of technological detail, Figure 8.7 is another example. This model of a Bell 47 Helicopter (think M*A*S*H) shows two trick uses of textures in one model. The engine detail and the instrument panel dials were created using textures we've already seen. Now take a look at the tail boom and the cockpit canopy. The tail boom looks like it is made of several dozen intersecting and overlapping metal bars; after all, you can see right through it to the buildings and ground in the background. But it is actually a single elongated and pinched box or cube with a single texture applied! The texture utilizes the alpha channel to convey the transparency information to the Torque renderer. Cool, huh? Then there is the canopy. It is semitransparent or mildly translucent. You can obviously see right through it, as you should when looking through Perspex, but you can still make out the sense of a solid glasslike surface.

click to expand
Figure 8.7: Vehicle detail and structure.

Of course, technological features are not the only things that can be enhanced through textures. In Figure 8.8 the brawler about to enter the tavern is attired in the latest stylish leather brawling jacket. He is obviously somewhere around 40 years of age, judging by his classic male-pattern baldness, and the bat is a Tubettiville slugger. Okay, okay, the bat is a stretch, but if it were turned over 180 degrees, you would be able to see the Tubettiville logo, and then you could tell! Also note the use of the texture specifying the tavern name, named in honor of a famous Delta Force 2 player, Insomniac.

click to expand
Figure 8.8: Player clothing, skin, and other details.

Look at the moon in Figure 8.9. Look again, closer. Does it look familiar? It should, because the moon texture in that picture is an actual photograph of the full moon, taken outside my house with a digital camera and then used to generate the moon texture. The rest of the scene is generated using the Torque Engine with appropriate nighttime lighting parameters set.

click to expand
Figure 8.9: Distant objects.

I think by now you have a pretty good idea why I say that textures are the unsung heroes of 3D gaming. They really make a huge difference by conveying not only the obvious visual information, but also the subtle clues and feelings that can turn a good game into a great experience.




3D Game Programming All in One
3D Game Programming All in One (Course Technology PTR Game Development Series)
ISBN: 159200136X
EAN: 2147483647
Year: 2006
Pages: 197

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net