]> git.xonotic.org Git - xonotic/netradiant.git/blob - docs/manual/quake3/Terrain_Manual/pages/height_maps.html
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / docs / manual / quake3 / Terrain_Manual / pages / height_maps.html
1 <html>\r
2 \r
3 <head>\r
4 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
5 <meta name="GENERATOR" content="Microsoft FrontPage 4.0">\r
6 <meta name="ProgId" content="FrontPage.Editor.Document">\r
7 <title>Height Maps</title>\r
8 </head>\r
9 \r
10 <body background="../pics/background.jpg" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">\r
11 \r
12 <b>\r
13 <p align="center"><font size="5">Height Maps</font></p>\r
14 <div align="right">\r
15   <table border="1" cellspacing="1" width="100%" bordercolor="#808080" bgcolor="#000000" cellpadding="10">\r
16     <tr>\r
17       <td width="100%"><font FACE="Times New Roman">\r
18 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The terrain maps in Quake III: Team Arena began as grayscale bitmap art files\r
19 imported into David Hyde\92\93<i>GenSurf</i>\94 tool, a Q3Radiant plug-in. As\r
20 mentioned before, the height map is a template that the utility uses to define\r
21 the vertex heights of the triangles forming the terrain surface. We used <i> Adobe\r
22 Photoshop</i> and <i> JASC\92s Paint Shop Pro</i> to create and adjust our height maps \85\r
23 but any art program that can output a .bmp format file can be used to create the\r
24 height map.</p>\r
25 </font><font FACE="Times New Roman" SIZE="2">\r
26 <p><img SRC="Image3.gif" WIDTH="264" HEIGHT="350" align="left"></p>\r
27 </font><font FACE="Times New Roman">\r
28 <p>figure 1.</p>\r
29 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; By way of example, the piece of artwork in figure 1 is a greatly scaled up\r
30 (4X) version of the height map used to create the initial terrain geometry for\r
31 mpterra2. The very dark, horizontal area near the center is the big \93lake\94\r
32 near the center of the map. The dark curves to the upper right and lower left\r
33 are the \93fjord\94 water areas. The dark areas in the upper left and lower\r
34 right are the locations of the bases. The white and very light gray areas\r
35 represent the peaks of hills and mountains.</p>\r
36 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The key to understanding how the height map works is that the shades of gray\r
37 in the art (call them \93color values\94) represent the height of mesh vertexes\r
38 (triangle corners) and not the triangle quads (squares created by two\r
39 triangles). When you work on a piece of art where each individual pixel\r
40 corresponds to a vertex, it is easy to imagine the pixels (usually large square\r
41 blocks) as squares of terrain. But that\92s not how it works.</p>\r
42 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Start by giving some thought to the eventual size and proportions of the\r
43 final terrain area in your map. How many rows and columns of triangles do you\r
44 want in the map? The finer you subdivide the map (making more rows and columns),\r
45 the more triangles will appear in any given view, but the terrain can be made\r
46 less blocky by including more.</p>\r
47 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GenSurf can generate a terrain mesh of up to 64 triangles on a side (of the X\r
48 and Y dimensions of the entire mesh). If you don\92t decimate the GenSurf output\r
49 (an option that optimizes and reduces the number of triangles used to create the\r
50 mesh \85 and we really recommend that you don\92t), it generates a mesh of\r
51 triangles in arranged in quads in neat rows and columns. By way of reference,\r
52 mpterra2 (the largest Team Arena map) is \93only\94 48x64 columns and rows of\r
53 triangles. Since Q3Radiant and q3map tend to like things that end up in neat\r
54 powers of 2 or units of 64 subdivisions, consider having your map extents (lower\r
55 left and upper right map corners) fall onto neat units, power of 2 units. In\r
56 mpterra2, the extents were set up to make the mesh triangles have sides of 256\r
57 units.</p>\r
58 </font><font FACE="Times New Roman" SIZE="2">\r
59 <p><img SRC="Image4.gif" WIDTH="103" HEIGHT="99" align="left"></p>\r
60 </font><font FACE="Times New Roman">\r
61 <p>Figure 2.</p>\r
62 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Figure 2 shows an example of a top view of a terrain mesh that is 8 x 8 rows\r
63 and colums of triangles (on a side).</p>\r
64 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Just as you would plan out a game map, give thought to the layout and flow of\r
65 your terrain map. Will it be all-open in one view? Can you use natural terrain\r
66 features to block vis? How complicated will your buildings (if any) be? Do you\r
67 want to include trees, water, weather effects or other items that could add to\r
68 the visual cost of your map?</p>\r
69 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Begin the creation of your height map by making a new grayscale file. If your\r
70 program doesn\92t allow you to easily modify a .bmp format file, work in another\r
71 format and then convert it when you save. You can make the dimensions of your\r
72 height map art whatever you want. The extents you set in GenSurf for the map\r
73 dimensions are what determine the final size of the terrain piece. Some may find\r
74 it easier to work with a large file initially, using their favorite painting\r
75 tools to lay in the shades of gray.</p>\r
76 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; However, when you get down to making final and precise changes in your height\r
77 map you should (and this is STRONGLY recommended), change the size of the art\r
78 file such that the pixel dimensions of the map are 1 pixel larger than the\r
79 number of divisions (rows and columns) in the terrain mesh you want to create.\r
80 If you are making a 64 x 64 division map, then you want to create a 65 x 65\r
81 pixel height map.</p>\r
82 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If there is not a one-to-one match between the number of vertexes in the mesh\r
83 (one more than the number of divisions) and the number of pixels in the height\r
84 map, then GenSurf interpolates the number values (0 to 255 range) of the pixels\r
85 to get an averaged value instead of an exact value for the height of the vertex\r
86 at that point.</p>\r
87 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When you save out the height map art file, you must save it in 8-bit .BMP\r
88 format. Currently, this is the only the file format that GenSurf recognizes.</p>\r
89 <b>\r
90 <p>Tips and things to consider for making Height Maps</p>\r
91 <blockquote>\r
92   <blockquote>\r
93   </b></font><font FACE="Symbol">\r
94 <p>· </font><font FACE="Times New Roman">Read through the section on blocking\r
95 vis later in the document. Plan your vis blocking terrain structures in advance\r
96 instead of having to start over when you discover that too much of your world is\r
97 in view.</p>\r
98 </font><font FACE="Symbol">\r
99 <p>· </font><font FACE="Times New Roman">Consider what type of geometry will\r
100 form the edges of your map. The terrain maps in Q3:TA resolve the issue by\r
101 creating canyon-like settings \85 valleys bordered by high canyon or mountain\r
102 walls.</p>\r
103 </font><font FACE="Symbol">\r
104 <p>· </font><font FACE="Times New Roman">Start by filling your map with a\r
105 neutral gray (value 127 or 128). Paint the high areas lighter and the low areas\r
106 darker.</p>\r
107 </font><font FACE="Symbol">\r
108 <p>· </font><font FACE="Times New Roman">Keep your terrain shapes simple when\r
109 you start. You can add greater complexity as your map develops.</p>\r
110 </font><font FACE="Symbol">\r
111 <p>· </font><font FACE="Times New Roman">You will probably want to keep the \93playable\94\r
112 area of your map within a fairly close or \93narrow\94 range of gray values\r
113 close to the middle range of values. This allows you to use very dark shades of\r
114 gray to create deep chasms and very light shades of gray to create high\r
115 mountains, canyon walls or visual barriers.</p>\r
116 </font><font FACE="Symbol">\r
117 <p>· </font><font FACE="Times New Roman">Extreme jumps between the gray values\r
118 in adjacent areas means steep slopes.</p>\r
119 </font><font FACE="Symbol">\r
120 <p>· </font><font FACE="Times New Roman">Avoid making vertical or near vertical\r
121 terrain surfaces \85 unless you don\92t mind the resulting textured surface\r
122 looking like barcode. Q3Map planar projects the textures onto the terrain entity\92s\r
123 surface (Normal brushes are box mapped). The pixels will stretch and stretch to\r
124 fill the space. The farther the surface is from horizontal, the greater the\r
125 stretching.</p>\r
126 </font><font FACE="Symbol">\r
127 <p>· </font><font FACE="Times New Roman">Use the roughness feature of GenSurf\r
128 to add a little, um \85 roughness to your map \85 so flat areas aren\92t\r
129 completely flat. If you are using a 1 to 1 scale height map, adding \93noise\94\r
130 to the file will also accomplish this.</p>\r
131 </font><font FACE="Symbol">\r
132 <p>· </font><font FACE="Times New Roman">If you want an area, such as a path,\r
133 to be flat, you need to make the gray value affecting two adjacent vertexes the\r
134 same value.</p>\r
135 </font><font FACE="Symbol">\r
136 <p>· </font><font FACE="Times New Roman">You can create gentle slopes by\r
137 changing the gray values between adjacent areas by very small amounts.</p>\r
138 </font><font FACE="Symbol">\r
139 <p>· </font><font FACE="Times New Roman">Slopes greater than 45 degrees are\r
140 close to becoming unplayable barriers.</p>\r
141 <p>&nbsp;</p>\r
142 </blockquote>\r
143 </blockquote>\r
144 <p>If you are building a symmetrical team style map, only create one side of the\r
145 terrain. Create a new piece of art that has the dimensions of the final piece.\r
146 Paste the map half into the new file and move it into position. If the map will\r
147 have an even number of vertexes, paste the map again and then rotate or mirror\r
148 (as you choose) the selection and move it into position. If the number of\r
149 vertexes is odd, after you paste the first half of the map, select all but the\r
150 row or column of pixels along which the two halves of the map will face and copy\r
151 it. Paste it, rotate or mirror it, then position it. Now, select and copy half\r
152 the row or column of pixels you didn\92t copy in the last operation. Paste it,\r
153 transform it as you did in the last operation, and then position it so that it\r
154 is in the same row or column, but on the opposite side of the piece you copied.</p>\r
155 <p>When you make significant changes to a height map, consider saving it as\r
156 version rather than over-writing the older file. Always nice to have a back up\r
157 when you realize that you\92ve messed up more than you\92ve fixed.</p>\r
158 </font>\r
159 \r
160 <p align="center"><a href="creating_the_terrain.html">Back</a> - <a href="table_of_contents.html">Table\r
161 of Contents</a> - <a href="other_possible_height_map_tools.html">Other Height\r
162 Map Tools</a></p>\r
163 \r
164         <p>&nbsp;</td>\r
165     </tr>\r
166   </table>\r
167 </div>\r
168 </b>\r
169 <p align="center">&nbsp;</p>\r
170 <p align="center">-8-</p>\r
171 \r
172 </body>\r
173 \r
174 </html>\r