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