]> git.xonotic.org Git - xonotic/netradiant.git/blob - docs/manual/quake3/Compile_Manual/q3map.html
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / docs / manual / quake3 / Compile_Manual / q3map.html
1 <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">\r
2 <html>\r
3 <head>                    \r
4   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">                \r
5   <title>Q3Map Manual</title>\r
6   <style TYPE="text/css">\r
7   <!--\r
8     a:link    { color: #9999FF ; text-decoration: none ; }\r
9     a:visited { color: #6666AA ; text-decoration: none ; }\r
10     a:hover   { color: #6666FF ; text-decoration: none ; }\r
11     h3        { color: #FFFFFF ; }\r
12     b         { color: #CCCCCC ; }\r
13     i         { color: #888888 ; font-size: 10pt ; }\r
14   //-->\r
15   </style>\r
16 </head>\r
17 \r
18 <body bgcolor="#000000" text="#BBBBBB">\r
19 \r
20 <p align="center">Q3map Manual</p>\r
21 </font>\r
22 <div align="right">\r
23   <table border="1" cellspacing="1" width="100%" bordercolor="#808080" bgcolor="#000000" cellpadding="10">\r
24     <tr>\r
25       <td width="100%">\r
26 <p><font size="3">q3map command line switches:</font></p>\r
27 <pre>\r
28 q3map\r
29 -----\r
30 \r
31 -threads &lt;number&gt;\r
32         Number of threads used to compile the map. For the fastest compile\r
33         times the number of threads is set to the number of system processors.\r
34 -glview\r
35         Write a .gl file of the bsp tree for debugging.\r
36 -v\r
37         Output verbose information.\r
38 -draw\r
39         Enable realtime debug drawing output.\r
40 -nowater\r
41         Water, slime and lava brushes are not compiled and won't show up when running the map in Quake.\r
42 -noopt\r
43         unused.\r
44 -nofill\r
45         unused.\r
46 -nodetail\r
47         Detail brushes are not compiled and won't show up when running the map in Quake.\r
48 -fulldetail\r
49         Detail brushes will be treated as normal brushes.\r
50 -onlyents\r
51         Only change the entities in a .bsp using a .ent file.\r
52 -onlytextures\r
53         Only change the textures in a .bsp file.\r
54 -micro\r
55         unused.\r
56 -nofog\r
57         Visible surfaces that cross fog boundaries will not be split along the bound.\r
58         This can cause visually incorrect fog in the map.\r
59 -nosubdivide\r
60         Visible surfaces are not subdivided as required by shader tesselation.\r
61         The shader parameter "tesssize" sets the tesselation of a surface.\r
62 -leaktest\r
63         Only test the map for leaks. If a leak is found the compilation is stopped.\r
64 -verboseentities\r
65         Output verbose information about entity sub-models.\r
66 -nocurves\r
67         Curves are not compiled and won't show up when running the map in Quake.\r
68 -notjunc\r
69         T-junctions are not fixed. This can cause tiny slits where a surface meets halfway another surface.\r
70 -expand\r
71         Expands all the brush planes and saves a new map out to allow visual inspection of the clipping bevels\r
72 -tmpout\r
73         Output files to a folder called "tmp".\r
74 -fakemap\r
75         Write out a fakemap.map This map will contain a worldspawn entity with all the world brushes.\r
76 -samplesize &lt;N&gt;\r
77         Set the lightmap pixel size to NxN units. Default 16x16.\r
78 -custinfoparms\r
79         Will enable custom surface flags (see below)\r
80 \r
81 q3map -vis\r
82 ----------\r
83 \r
84 -threads &lt;number&gt;\r
85         Number of threads used to compile the map. For the fastest compile\r
86         times the number of threads is set to the number of system processors.\r
87 -fast\r
88         Only calculate a very loose visiblity list. It doesn't take much time to\r
89         calculate but a lot more polygons will be drawn by the Q3 engine than necesary.\r
90 -merge\r
91         Merge bsp leaves before calculating the visibility list. This will speed up\r
92         the vis calculations but mostly more polygons will be drawn by the Q3 engine\r
93         than necesary.\r
94 -nopassage\r
95         Disable the passage visibility algorithm. The passage vis is faster and a bit more\r
96         tight than the old algorithm.\r
97 -level\r
98         unused.\r
99 -v\r
100         Output verbose information.\r
101 -nosort\r
102         Don't sort the portals on complexity. Sorting mostly speeds up visibility calculations\r
103         because more complex portals can use information from less complex portals.\r
104 -saveprt\r
105         Don't delete the .prt file after creating the visibility list.\r
106 -tmpin &lt;path&gt;\r
107         Input files will be read from a folder called "tmp".\r
108 -tmpout &lt;path&gt;\r
109         Output files will be written to a folder called "tmp".\r
110 \r
111 \r
112 q3map -light\r
113 ------------\r
114 \r
115 -threads &lt;number&gt;\r
116         Number of threads used to compile the map. For the fastest compile\r
117         times the number of threads is set to the number of system processors.\r
118 -bounce &lt;N&gt; [NEW]\r
119         Enable radiosity calculation. Rediffuses the light emitted onto surfaces N\r
120         times. Will write out the BSP after every pass, so it can be cancelled.\r
121         Light reflected is the lightmap/vertex * texture color, subsampled to a certain\r
122         granularity across every lit surface. Use q3map_lightimage in a shader\r
123         to override the reflected color.\r
124 -bouncegrid [NEW]\r
125         Radiosity affects lightgrid (entity lighting).\r
126 -fast [NEW]\r
127         Enables light envelopes for area lights, speeding light up by 50x or more on\r
128         some maps. Has the side effect of dimmer maps with large numbers of dim surface\r
129         lights.\r
130 -fastgrid [NEW]\r
131         Same as fast, but only for lightgrid calculation.\r
132 -fastbounce [NEW]\r
133         Enables fast for radiosity passes only.\r
134 -cheap [NEW]\r
135         Stop calculating light at a sample when it exceeds (255, 255, 255). This may\r
136         produce odd artifacts on maps with lots of saturated colored lighting. Also,\r
137         do not use -cheap with radiosity if you wish to preserve all light emitted.\r
138 -cheapgrid [NEW]\r
139         Same as cheap, but only for lightgrid calculation.\r
140 -area &lt;scale&gt;\r
141         This scales the light intensity of area lights.\r
142 -point &lt;scale&gt;\r
143         This scales the light intensity of point lights.\r
144 -notrace\r
145         No light tracing is performed. As a result no shadows will be casted.\r
146 -patchshadows\r
147         Enable patches casting shadows.\r
148 -novertex\r
149         Don't calculate vertex lighting.\r
150 -nogrid\r
151         Don't calculate light grid for dynamic model lighting.\r
152 -smooth [NEW]\r
153         Smart version of -extra. Only subsamples lightmap pixels that are shadowed.\r
154         Produces results comparable to -extra in roughly 1/3 the time. Can also be\r
155         used with -extra or -extrawide for 16- or 48-tap sampling respectively\r
156         (smoother shadows).\r
157 -extra\r
158         Take four samples per lightmap pixel and store the average light value of these\r
159         four samples for the actual lightmap pixel.\r
160         This super sampling is used for anti-aliasing.\r
161 -extrawide\r
162         Just like -extra four samples per lightmap pixel are calculated. However the\r
163         average of 12 samples is stored per lightmap pixel.\r
164 -samplesize &lt;N&gt;\r
165         Set the lightmap pixel size to NxN units. Default 16x16.\r
166 -border\r
167         Create a debugging border around the lightmap.\r
168 -v\r
169         Output verbose information.\r
170 -nosurf\r
171         Disables surface tracing (detail brushes and patches) for shadow calculation.\r
172 -dump\r
173         Dumps prefab files when used with radiosity for each bounce.\r
174 \r
175 \r
176 q3map -vlight\r
177 -------------\r
178 \r
179 -threads &lt;number&gt;\r
180         Number of threads used to compile the map. For the fastest compile\r
181         times the number of threads is set to the number of system processors.\r
182 -area &lt;scale&gt;\r
183         This scales the light intensity of area lights.\r
184 -point &lt;scale&gt;\r
185         This scales the light intensity of point lights.\r
186 -novertex\r
187         Don't calculate vertex lighting.\r
188 -nogrid\r
189         Don't calculate light grid for dynamic model lighting.\r
190 -nostitching\r
191         No polygon stitching before lighting.\r
192 -noalphashading\r
193         Don't use alpha shading at all.\r
194 -nocolorshading\r
195         Don't use colored alpha shading. The alpha channel will be used as if it were binary.\r
196         The light goes through or not and does not change color.\r
197 -tracelight\r
198         Use the "-light" light algorithm for all surface unless a surface\r
199         uses a shader with the shader option "q3map_vlight".\r
200 -samplesize &lt;N&gt;\r
201         Set the lightmap pixel size to NxN units. Default 16x16.\r
202 -v\r
203         Output verbose information.\r
204 </pre>\r
205 \r
206 \r
207 \r
208 <p><font size="3">The q3map options are a subset of the shader instructions that require\r
209 recompiling of the map.</font></p>\r
210 \r
211 <p><font size="3">q3map_bounce &lt;fraction&gt;</font></p>\r
212 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>]\r
213 Specify a number between 0 and 1.0 (or higher) to scale the amount of light reflected in radiosity passes.\r
214 Default: 1.0</font></p>\r
215 \r
216 <p><font size="3">q3map_nofast</font></p>\r
217 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>]\r
218 Surfaces that emit light with this shader parameter will disable -fast optimisation. Useful for\r
219 large areas of dim sky where you want all the dim light to reach all surfaces.</font></p>\r
220 \r
221 <p><font size="3">q3map_tracelight</font></p>\r
222 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>] Surfaces using a shader with this option will always be lit with the\r
223 original &quot;-light&quot; light algorithm. Patches will not cast shadows on\r
224 this surface unless the shader option q3map_patchshadows is used.</font></p>\r
225 <p><font size="3">q3map_patchshadows</font></p>\r
226 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>] When this option is used in conjunction with the original (-light)\r
227 lighting algorithm, surfaces with textures modified by this option will will\r
228 show shadows cast by curve patches (under normal circumstances, curve patches do\r
229 not cast shadows).</font></p>\r
230 <p><font size="3">q3map_vertexshadows</font></p>\r
231 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>] By default, no shadows are cast on vertex-only lit surfaces (see\r
232 surfaceparm pointlight). Also when running Quake III Arena in vertex&nbsp; lighting\r
233 mode, no shadows are cast upon any surfaces (shadows are part of the light map).\r
234 When using this shader option shadows *will* be cast on the surface when vertex\r
235 lit. However sharp shadow edges won't be seen on the surface because light\r
236 values are only calculated at the vertexes.</font></p>\r
237 <p><font size="3">q3map_novertexshadows</font></p>\r
238 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>] Shaders used for misc_models and terrain can now use\r
239 q3map_novertexshadows to disable shadows to be cast at the vertex lit surfaces.\r
240 Shadows being cast at small misc_model objects often makes sense. However\r
241 shadows on large vertex lit terrain surfaces often look bad. By default no\r
242 shadows are cast at forced vertex list surfaces ( shaders with &quot;pointlight&quot;\r
243 ).</font></p>\r
244 <p><font color="#FFFFFF" size="3">q3map_forcesunlight</font></p>\r
245 <p><font color="#FFFFFF" size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [</font><font color="#FFFF00" size="3">NEW</font><font color="#FFFFFF" size="3">] No sunlight is cast at vertex lit md3 models and terrain by default.\r
246 Using this option sunlight (overbright bits created by q3map_sun option) will be\r
247 cast on these surfaces.</font></p>\r
248 <p><font size="3">q3map_vertexscale &lt;scale&gt;</font></p>\r
249 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>] The light value at the vertexes of a surface using a shader with this\r
250 option is multiplied by the scale value. This is a way to lighten or darken a\r
251 vertex light only surface in comparison to other, light-map lit surfaces around\r
252 it.</font></p>\r
253 <p><font size="3">q3map_notjunc</font></p>\r
254 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>] Surfaces modified by a shader with this option are not used for\r
255 tjunction fixing.</font></p>\r
256 <p><font size="3">q3map_vlight</font></p>\r
257 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>] Surfaces modified by a shader with this option will always be lit with\r
258 the &quot;-vlight&quot; algorithm when q3map is used with the options &quot;-vlight\r
259 -tracelight&quot;.</font></p>\r
260 <p><font size="3">q3map_lightmapsamplesize &lt;S&gt;</font></p>\r
261 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<font color="#FFFF00">NEW</font>] Surfaces using a shader with this shader option will use lightmaps with\r
262 pixel size SxS. This option can be used to produce high resolution shadows on\r
263 certain surfaces or can be used to reduce the size of lightmap data where high\r
264 resolution shadows are not required.</font></p>\r
265 <p><font size="3">q3map_lightimage &lt;image&gt;</font></p>\r
266 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Image to use for the light color of a surface light instead of the image(s)\r
267 used by the shader. Color is averaged from the texture. Texture must be the same\r
268 size as the base image map.</font></p>\r
269 <p><font size="3">q3map_surfacelight &lt;value&gt;</font></p>\r
270 <p><font size="3">Sets the amount of light this surface emits.</font></p>\r
271 <p><font size="3">q3map_lightsubdivide &lt;value&gt;</font></p>\r
272 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A surface light is subdivided into a bunch of point lights for the actual\r
273 lighting of the world. This parameter controls the space between those point\r
274 lights. Default value is 120.</font></p>\r
275 <p><font size="3">q3map_backsplash &lt;percent&gt; &lt;distance&gt;</font></p>\r
276 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A surface light is also lit by itself using back splash point lights with a\r
277 lower intensity. The &lt;percent&gt; parameter specifies the intensity\r
278 percentage they use from the q3map_surfacelight &lt;value&gt; parameter. The\r
279 &lt;distance&gt; parameter controls the distance of these back splash lights\r
280 from the surface. You can set the &lt;percent&gt; to zero or a negative value to\r
281 disable the back splash lights.</font></p>\r
282 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q3map_globaltexture</font></p>\r
283 <p><font size="3">When this option is set the texture is not aligned to the world.</font></p>\r
284 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q3map_backshader &lt;shader&gt;</font></p>\r
285 <p><font size="3">&lt;shader&gt; is the path/name of the shader or texture to be used at the\r
286 back side of the surface.</font></p>\r
287 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q3map_flare &lt;shader&gt;</font></p>\r
288 <p><font size="3">Creates a flare using the specified &lt;shader&gt; at the center of the\r
289 surface using a shader with this option.</font></p>\r
290 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; light &lt;value&gt;</font></p>\r
291 <p><font size="3">Old style flare specification always using the shader &quot;flareshader&quot;.\r
292 The &lt;value&gt; parameter is unused.</font></p>\r
293 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q3map_sun &lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt;\r
294 &lt;degrees&gt; &lt;elevation&gt;</font></p>\r
295 <p><font size="3">Color will be normalized, so it doesn't matter what range you use. The\r
296 intensity falls off with angle but not distance. A value of 100 is a fairly\r
297 bright sun.</font></p>\r
298 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; degree of 0 = from the east, 90 = north, etc.</font></p>\r
299 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elevation of 0 = sunrise/set, 90 = noon</font></p>\r
300 <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; surfaceparm pointlight</font></p>\r
301 <p><font size="3">Surfaces using a shader with this parameter will always be vertex lit</font></p>\r
302 <p><font size="3">This option can be used to reduce the lightmap data. Often used on surfaces</font></p>\r
303 <p><font size="3">that don't need any shadows.</font></p>\r
304 \r
305 \r
306 <p><font size="3">Surfaceparm dust</font></p>\r
307 <p><font size="3">If a player lands (jumps onto) on a surfaces using a shader with this\r
308 parameter, a put of dust will appear at the player\92s feet. Note that the\r
309 worldspawn entity of that map must have an enableDust key set to a value of 1.\r
310 Note: This surfaceflag has been replaced by "surfaceparm woodsteps" in\r
311 Return to Castle Wolfenstien.</font></p>\r
312 \r
313 <font FACE="Arial" SIZE="5"><b><font SIZE="4">\r
314 <p>Custom surfaceparms</p>\r
315 </font></b><font SIZE="2">\r
316 <p>With the new q3map tool you can add custom surface parameters for mods\r
317 without the need to recompile the q3map tool. These custom surfaceparms are\r
318 stored in a file called \91custinfoparms.txt\92 in the folder scripts/. An\r
319 example of this file with the new surfaceparm treacle and surfaceparm grass is\r
320 shown below.</p>\r
321 <p>// Custom Infoparms File<br>\r
322 // Custom Contentsflags<br>\r
323 {<br>\r
324 treacle 0x4000<br>\r
325 }<br>\r
326 // Custom Surfaceflags<br>\r
327 {<br>\r
328 grass 0x80000<br>\r
329 }</p>\r
330 <p>&nbsp;</p>\r
331 <b>\r
332 <p>NOTE:</b> For linux users, when using the -custinfoparms parameter q3map\r
333 first looks in your homedir, and only if it doesn't find a custinfoparms.txt\r
334 there, it uses the one stored in the</p>\r
335 <p>quake3 install dir (usually /usr/local/games).</p>\r
336 <p>&nbsp;</p>\r
337 </font><b>\r
338 <p>Content Flags</p>\r
339 </b><font SIZE="2">\r
340 <p>Contents flags are flags similar to CONTENTS_FOG in the original Q3A. These\r
341 flags define the contents of volumes inside the game (for instance lava, fog,\r
342 water, etc.).</p>\r
343 <p>If you look in the source file game/surfaceflags.h, it has defines for all\r
344 contents flags. The define is split into a name and a hexadecimal value, for\r
345 instance CONTENTS_PLAYERCLIP 0x10000. These hexadecimal values are powers of 2\r
346 and can be ored together (binary) to form a bit mask. Up to 32 contents flags\r
347 can be ored together this way.</p>\r
348 <b>\r
349 <p>Example</b>: creating a volume with treacle.</p>\r
350 <p>The following outlines how a custom contents flag can be added and used in a\r
351 mod. First open the \91custinfoparms.txt\92 file and add \91treacle 0x4000\92\r
352 to the Custom Contentsflags section as shown in the example file above (0x4000\r
353 is one of the unused values available for custom use). Next write a shader\r
354 script which uses \91surfaceparm treacle\92. Apply this new shader to all sides\r
355 of a brush in a test map. When you compile the map, add the -custinfoparms\r
356 parameter to the command line following q3map.</p>\r
357 <p>Next, add CONTENTS_TREACLE 0x4000 to the source file game/surfaceflags.h in\r
358 your mod. Now you can call the point contents function. If the point is inside\r
359 the brush with the shader using the \91surfaceparm treacle\92 then the point\r
360 contents call will return a bit mask with CONTENTS_TREACLE set. This can for\r
361 instance be used to slow down player movement when a player is inside such a\r
362 brush.</p>\r
363 <p>&nbsp;</p>\r
364 </font><b>\r
365 <p>Surface Flags</p>\r
366 </b><font SIZE="2">\r
367 <p>The surface flags are texture properties that often affect entities in\r
368 contact with surfaces using such flags. The \91surfaceparm metalsteps\92\r
369 parameter from Q3A is a good example.</p>\r
370 <p>If you look in the source file game/surfaceflags.h, it has defines for all\r
371 surface flags. The define is split into a name and a hexadecimal value, for\r
372 instance SURF_NODAMAGE 0x1. These hexadecimal values are powers of 2 and can be\r
373 ored together (binary) to form a bit mask. Up to 32 surface flags can be ored\r
374 together this way.</p>\r
375 <b>\r
376 <p>Example</b>: Making \91footsteps on grass\92 sounds</p>\r
377 <p>The following outlines how a custom surface flag can be added and used in a\r
378 mod. First open up the \91custinfoparms.txt\92 file and add 'grass 0x80000' to\r
379 the Custom Surfaceflags section as shown in the example file above (0x80000 is\r
380 the first available unused value in surfaceflags.h for surface flags). Next\r
381 write a shader script which uses a grass image and has 'surfaceparm grass\92.\r
382 Create a test map with the grass shader covering the ground surface. When you\r
383 compile the map, add the -custinfoparms parameter to the command line following\r
384 q3map.</p>\r
385 <p>Next, add SURF_GRASS 0x80000 to the source file game/surfaceflags.h in your\r
386 mod. Now you'll be able to execute a trace and the trace information will be\r
387 returned in the trace_t structure. If the trace hits a surface with the grass\r
388 surfaceparm then the SURF_GRASS flag will be set in trace_t-&gt;surfaceFlags.\r
389 Such a trace can be used to trigger playing a sound of a person stepping on\r
390 grass. For a reference example, see the existing metal steps in the game code.</p>\r
391 <p>&nbsp;</p>\r
392 </font>\r
393 <p>&nbsp;</p>\r
394 \r
395 </font>\r
396 \r
397 <font FACE="Arial" SIZE="5">\r
398 \r
399       <p>&nbsp;</font></td>\r
400   </tr>\r
401 </table>\r
402 </div>\r
403 </b>\r
404 <p>&nbsp;</p>\r
405 <p>&nbsp;</p>\r
406 <p align="center">-27-</p>\r
407 \r
408 </body>\r
409 \r
410 </html>\r