in black and white
Main menu
Share a book About us Home
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics

Quake 4 mods for dummies - Guilfoyle E.

Guilfoyle E. Quake 4 mods for dummies - Wiley publishing , 2006. - 411 p.
ISBN-13: 978-0-470-03746-1
Download (direct link): quake4modsfordumm2006.pdf
Previous << 1 .. 86 87 88 89 90 91 < 92 > 93 94 95 96 97 98 .. 129 >> Next

278 Part IV: Going Beyond the Basics
Figure 15-30:
Your lowest mip-map level should be set to 1x1.
With the settings in place and your four images selected, press the Compress button to perform the conversion. When you do, a window appears, providing you with the conversion status of each image. When the conversion is complete, your window will look like Figure 15-31. You can close this program and confirm that there are now four new files ending in .dds within your textures\chapter15 folder.
Figure 15-31:
While The Compress-onator works on your images, a window displays the progress.
Sometimes The Compressonator will get stuck and not perform the operation you request. If you have any trouble with the program, close it and reopen it. That usually fixes any issues.
That’s it. Your images are ready, and you can now instruct the game on how to use them. You may now close your image programs and proceed.
Making Everything Work Together
Now that you have all the pieces of the texture puzzle, it’s time to assemble them. In a text file that looks just like a script, you need to tell the game where to find each of these images and how to assemble them. This bit of script in your text file is called a shader.
Chapter 15: Creating Custom Textures 279
Building a shader
To create a shader for this new texture, follow these steps:
1. Open NotePad.
2. In the text editor, type the following line of text:
textures/chapter15/brick {
This line tells the game that you are defining a new texture called chap-ter15/brick. Just like when you applied the texture common/caulk in your map, you would apply this new texture chapter15/brick after this file has been completed.
3. (Optional) To instruct the game that you want your material to behave like brick, add this line to your text files:
This second line defines the surface type of material you are creating. This addition isn’t required, but it will affect how objects interact with your texture. For example, if you were making a metal texture, you would want to tell the game that the surface material is made of metal. This way, when someone shoots at the texture, the bullets would bounce off with sparks just like on metal. On the other hand, if this were a sand texture for the ground, you would want it to sound like sand when someone was walking on it rather than metal or wood. You wouldn’t want bullets looking like they bounce off it.
A list of possible surface types that can be assigned to a material is as
cardboard plastic
flesh ricochet
glass stone
liquid wood
4. The next line you need to type is
qer_editorimage textures/chapter15/brick_ed.tga
This line instructs the mapping editor where to find the image for the texture preview tab. When you loaded your textures in the editor, there were thumbnail images of each of the textures that made it easy to browse and select a texture of choice for your application. This is the image that you will see as a thumbnail.
5. Continue with these next two lines of code:
diffusemap textures/chapter15/brick_d.tga specularmap textures/chapter15/brick_s.tga
280 Part IV: Going Beyond the Basics________________________________________________________
Here you tell the game where to find the colorful diffuse map image and the specular map that controls the shininess of the texture. So far, these lines of scripting are quite straightforward.
6. Type in the following line to your text file:
bumpmap addnormals ( textures/chapter15/brick_local.tga, heightmap ( textures/chapter15/brick_h.tga, 1 ) )
With this line, you define is the bumpiness of your image. This line is a little more complicated because you want to not only define how your image will deform the brush face with your normal map, but you also want to define the smaller bumps created with lighting tricks via the height map.
This one line actually contains information for both of your bumpy images. The two images together are your bump map. First the normal map is defined, and then the height map. The height map, however, has an additional instruction at the end.
The number 1 entered at the end of your height map tells the game how much influence this image will have on the bumping of your texture. Generally, you will enter only 1. However, in some cases, when you want the bumping to be more extreme, you might consider increasing this number slightly. I haven’t found a maximum number to enter here, but I highest number I have seen used by other modders is 5. You really shouldn’t need to go any higher than that.
7. To close your script, add the closing curly bracket.
The result, when fully assembled in your text file, will read like this:
textures/chapter15/brick { stone
qer_editorimage textures/chapter15/brick_ed.tga diffusemap textures/chapter15/brick_d.tga specularmap textures/chapter15/brick_s.tga bumpmap addnormals (
textures/chapter15/brick_local.tga, heightmap ( textures/chapter15/brick h.tga, 1 ) )
With your shader file written, you need to save it someplace that the game can find and read it.
Previous << 1 .. 86 87 88 89 90 91 < 92 > 93 94 95 96 97 98 .. 129 >> Next