]> git.xonotic.org Git - xonotic/netradiant.git/blob - docs/manual/quake3/Terrain_Manual/pages/terrain_related_worldspawn_features.html
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / docs / manual / quake3 / Terrain_Manual / pages / terrain_related_worldspawn_features.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>Terrain</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><font SIZE="5">\r
13 <p align="center">Terrain-related WorldSpawn Features</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>A number of worldspawn key/value pairs were created to deal with issues\r
19 arising out of terrain creation.</p>\r
20 </font><b><i><font SIZE="4">\r
21 <p>Cold Breath and Hot Dust</p>\r
22 </font></i></b>\r
23 <p><font FACE="Times New Roman" color="#FFFFFF">\r
24 The following two features need not be directly related to terrain, although\r
25 they first appear in the Q3:TA maps. Each key/value pair needs to be the\r
26 worldspawn for that particular feature to work.</font></p>\r
27 <b>\r
28 <p><font FACE="Times New Roman" color="#FFFFFF">\r
29 Key/value pairs:</font></p>\r
30 <p><font FACE="Times New Roman" color="#FFFFFF">\r
31 Key:</font></b> <font FACE="Times New Roman" color="#FFFFFF">\r
32  enableBreath</font></p>\r
33 <b>\r
34 <p><font FACE="Times New Roman" color="#FFFFFF">\r
35 Value:</font></b> <font FACE="Times New Roman" color="#FFFFFF">\r
36  1</font></p>\r
37 <p><font FACE="Times New Roman" color="#FFFFFF">\r
38 When written into the worldspawn, this enables the appearance of \93frosty\r
39 breath\94 in the air in front of players. The frosty break does not appear in a\r
40 player\92s first person view, but will be seen in front of other players and in\r
41 3<sup>rd person view.</font></p>\r
42 <b>\r
43 <p><font FACE="Times New Roman" color="#FFFFFF">\r
44 Key/value pair:</font></p>\r
45 <p><font FACE="Times New Roman" color="#FFFFFF">\r
46 Key:</font></b> <font FACE="Times New Roman" color="#FFFFFF">\r
47  enableDust</font></p>\r
48 <b>\r
49 <p><font FACE="Times New Roman" color="#FFFFFF">\r
50 Value:</font></b> <font FACE="Times New Roman" color="#FFFFFF">\r
51  1</font></p>\r
52 <p><font color="#FFFFFF">\r
53 When written into the worldspawn, this enables the appearance of dust puffs\r
54 at the player\92s feet when he lands on or run on a \93dusty\94 surface. Adding\r
55 the surface parameter \93surfaceparm dust\94 to the shader for that surface\r
56 creates a dusty surface. The common/terrain2 texture already contains the\r
57 enableDust parameter.</font></p>\r
58 </sup><sup><b><i><font SIZE="4">\r
59 <p>Texture Remapping: Shaders for vertex light mode in Q3A</p>\r
60 </font></i></b>\r
61 <p><font color="#FFFFFF">\r
62 One thing we quickly discovered when mapping the metatexture onto the terrain\r
63 world was that it didn\92t work if a player chose to run in the game\92s vertex\r
64 lighting only mode. That mode compresses shaders into a single pass. Usually,\r
65 the engine makes a reasonable choice for which pass is mapped, but with the\r
66 metashaders, that wasn\92t the case. The solution: allow the mapper to choose a\r
67 substitute texture that only is used in the game\92s vertex lighting mode.\r
68 </font></p>\r
69 <p><font color="#FFFFFF">\r
70 For each shader that will be remapped a key/value pair must be entered in the\r
71 map\92s worldspawn.\r
72 </font></p>\r
73 <b>\r
74 <p><font color="#FFFFFF">\r
75 Key</font></b><font color="#FFFFFF">: vertexremapshader</font></p>\r
76 <b>\r
77 <p><font color="#FFFFFF">\r
78 Value:\r
79 </font></b> <font color="#FFFFFF">\r
80  normal_shader;vertexlighting_shader\r
81 </font></p>\r
82 <p><font color="#FFFFFF">\r
83 The normal_shader is the shader normally used on the terrain. The\r
84 vertexlighting_shader is the shader to be used when people run the map in Q3 in\r
85 vertex lit mode. The normal_shader and the vertexlighting_shader are seperated\r
86 by a semi-colon ;\r
87 </font></p>\r
88 <p><font color="#FFFFFF">\r
89 As many shaders can be remapped as needed by using the key. However, if more\r
90 than one shader is remapped in a map, each one must have a unique identifier \85\r
91 either a number or a letter after the Key word, as shown by \93vertexremapshaderX\94,\r
92 where X is a number or any character set. Examples, vertexremapshader01,\r
93 vertexremapshader02, vertexremapshaderA, vertexremapshaderB,\r
94 vertexremapshadermpterra2_1, etc.\r
95 </font></p>\r
96 <p><font color="#FFFFFF">\r
97 In mpterra2, the key/value pair for one of the replaced shaders looked like\r
98 this:\r
99 </font></p>\r
100 <b>\r
101 <p><font color="#FFFFFF">\r
102 Key:\r
103 </font></b> <font FACE="Times New Roman" color="#FFFFFF">\r
104  vertexremapshader1\r
105 </font></p>\r
106 <b>\r
107 <p><font color="#FFFFFF">\r
108 Value:\r
109 </font></b> <font FACE="Times New Roman" color="#FFFFFF">\r
110  textures/terrain/mpterra2_0to1;textures/terrain/vxmpterra2\r
111 </font></p>\r
112 <p><font color="#FFFFFF">\r
113 Each of the three root shaders and the two blend shaders had to replaced in\r
114 this manner.\r
115 </font></p>\r
116 <p><font color="#FFFFFF">\r
117 The following is a sample of the shader used to replace ALL the terrain\r
118 shaders in mpterra2:\r
119 </font></p>\r
120         <font FACE="Courier New">\r
121 <p>// *************************************************</p>\r
122 <p>// *</p>\r
123 <p>// * Vertex Lighting Replacement Shaders</p>\r
124 <p>// *</p>\r
125 <p>// *************************************************</p>\r
126 <p>textures/terrain/vxmpterra2</p>\r
127 <p>{</p>\r
128 <p>surfaceparm nolightmap</p>\r
129 <p>q3map_novertexshadows</p>\r
130 <p>q3map_forcesunlight</p>\r
131 <p>{</p>\r
132 <p>map textures/stone/pjrock10b_2.tga</p>\r
133 <p>rgbGen vertex</p>\r
134 <p>tcmod scale 0.125 0.125</p>\r
135 <p>}</p>\r
136 <p>}</p>\r
137 </font>\r
138 <sup><font FACE="Times New Roman">\r
139 <b><i><font SIZE="4">\r
140 <p>GridSize</p>\r
141 </font></i></b>\r
142 </font>\r
143 </sup>\r
144 \r
145 </sup>\r
146 \r
147 </font>\r
148 <p><font color="#FFFFFF" size="4"><sup><sup>\r
149 The Light Grid Size (as noted earlier) is the map that the Q3A engine uses to\r
150 light entities. It\92s what gives the illusion of players moving in and out of\r
151 shadowed areas on the game levels. We decided, that for large terrain maps, it\r
152 should not be as detailed (and therefore nowhere near as large) as we had done\r
153 for smaller, interior maps. After experimenting with placing controls for the\r
154 grid size on the bsp command line, we finally settled on putting the command\r
155 information in the map\92s world spawn. In that way, the grid size could be\r
156 easily tailored to the individual map.</sup></sup></font></p>\r
157 <font FACE="Times New Roman">\r
158 <sup><font SIZE="5">\r
159 <sup>\r
160 <b>\r
161 <p><font FACE="Times New Roman" color="#FFFFFF">\r
162 Key/value pair:\r
163 </font></p>\r
164 <p><font FACE="Times New Roman" color="#FFFFFF">\r
165 Key:\r
166 </font></b> <font FACE="Times New Roman" color="#FFFFFF">\r
167  gridsize\r
168 </font></p>\r
169 <b>\r
170 <p><font FACE="Times New Roman" color="#FFFFFF">\r
171 Value:\r
172 </font></b> <font FACE="Times New Roman" color="#FFFFFF">\r
173  X Y Z\r
174 </font></p>\r
175 </sup>\r
176 \r
177 </font>\r
178 </sup>\r
179 \r
180 </font>\r
181 <p><sup><sup><font color="#FFFFFF" size="3">\r
182 Note that the values are the dimensions of those coordinates. It\92s best to\r
183 keep them to power of 2 values. The default value for the gridsize (if left\r
184 unchanged) is 64 64 128. Setting higher x y and z values reduces the size of the\r
185 light grid data in both the .bsp file and in the Q3A game, but it also creates\r
186 less accurate dynamic model lighting.</font></sup></sup></p>\r
187 <b>\r
188 <p><sup><sup><font color="#FFFFFF" size="3">\r
189 Errors</font></sup></sup></p>\r
190 </b>\r
191 <p><sup><sup><font color="#FFFFFF" size="3">\r
192 Definitely set the x y and z values higher if you get:</font></sup></sup></p>\r
193 <p><sup><sup><font color="#FFFFFF" size="3">\r
194 ************ ERROR ************</font></sup></sup></p>\r
195 <p><font color="#FFFFFF" size="4"><sup><sup>\r
196 MAX_MAP_LIGHTGRID</sup></sup></font></p>\r
197 <p><font color="#FFFFFF" size="4"><sup><sup>\r
198 when compiling your map with q3map.</sup></sup></font></p>\r
199 \r
200 <p align="center"><font face="Times New Roman" size="4"><sup><a href="lighting_the_terrain.html">Back</a> - <a href="table_of_contents.html">Table\r
201 of Contents</a> - <a href="adding_buildings_to_terrain.html">Adding Buildings</a></sup></font></p>\r
202 \r
203 <font SIZE="5">\r
204 <font FACE="Times New Roman">\r
205 <sup>\r
206 \r
207 <p align="center">&nbsp;</p>\r
208 \r
209 </sup>\r
210 \r
211 </font></font></td>\r
212     </tr>\r
213   </table>\r
214 </div>\r
215 </b>\r
216 <p>&nbsp;</p>\r
217 <p>&nbsp;</p>\r
218 <p align="center">-23-</p>\r
219 \r
220 </body>\r
221 \r
222 </html>\r