2 ===================================================================
\r
3 --- game_ef.h (revision 158)
\r
4 +++ game_ef.h (working copy)
\r
6 qfalse, /* wolf lighting model? */
7 128, /* lightmap width/height */
8 1.0f, /* lightmap gamma */
9 + 1.0f, /* lightmap exposure */
10 1.0f, /* lightmap compensate */
11 + 1.0f, /* lightgrid scale */
12 + 1.0f, /* lightgrid ambient scale */
13 + qfalse, /* disable shader lightstyles hack */
14 + qfalse, /* keep light entities on bsp */
15 + 8, /* default patchMeta subdivisions tolerance */
16 + qfalse, /* patch casting enabled */
17 + qfalse, /* compile deluxemaps */
18 + 0, /* deluxemaps default mode */
19 "IBSP", /* bsp file prefix */
20 46, /* bsp file version */
21 qfalse, /* cod-style lump len/ofs order */
23 ===================================================================
\r
24 --- game_etut.h (revision 158)
\r
25 +++ game_etut.h (working copy)
\r
26 @@ -148,7 +148,16 @@
\r
27 qfalse, /* wolf lighting model? */
28 128, /* lightmap width/height */
29 2.2f, /* lightmap gamma */
30 + 1.0f, /* lightmap exposure */
31 1.0f, /* lightmap compensate */
32 + 1.0f, /* lightgrid scale */
33 + 1.0f, /* lightgrid ambient scale */
34 + qfalse, /* disable shader lightstyles hack */
35 + qfalse, /* keep light entities on bsp */
36 + 8, /* default patchMeta subdivisions tolerance */
37 + qfalse, /* patch casting enabled */
38 + qfalse, /* compile deluxemaps */
39 + 0, /* deluxemaps default mode */
40 "IBSP", /* bsp file prefix */
41 47, /* bsp file version */
42 qfalse, /* cod-style lump len/ofs order */
44 ===================================================================
\r
45 --- game_ja.h (revision 158)
\r
46 +++ game_ja.h (working copy)
\r
48 qfalse, /* wolf lighting model? */
49 128, /* lightmap width/height */
50 1.0f, /* lightmap gamma */
51 + 1.0f, /* lightmap exposure */
52 1.0f, /* lightmap compensate */
53 + 1.0f, /* lightgrid scale */
54 + 1.0f, /* lightgrid ambient scale */
55 + qfalse, /* disable shader lightstyles hack */
56 + qfalse, /* keep light entities on bsp */
57 + 8, /* default patchMeta subdivisions tolerance */
58 + qfalse, /* patch casting enabled */
59 + qfalse, /* compile deluxemaps */
60 + 0, /* deluxemaps default mode */
61 "RBSP", /* bsp file prefix */
62 1, /* bsp file version */
63 qfalse, /* cod-style lump len/ofs order */
65 ===================================================================
\r
66 --- game_jk2.h (revision 158)
\r
67 +++ game_jk2.h (working copy)
\r
69 qfalse, /* wolf lighting model? */
70 128, /* lightmap width/height */
71 1.0f, /* lightmap gamma */
72 + 1.0f, /* lightmap exposure */
73 1.0f, /* lightmap compensate */
74 + 1.0f, /* lightgrid scale */
75 + 1.0f, /* lightgrid ambient scale */
76 + qfalse, /* disable shader lightstyles hack */
77 + qfalse, /* keep light entities on bsp */
78 + 8, /* default patchMeta subdivisions tolerance */
79 + qfalse, /* patch casting enabled */
80 + qfalse, /* compile deluxemaps */
81 + 0, /* deluxemaps default mode */
82 "RBSP", /* bsp file prefix */
83 1, /* bsp file version */
84 qfalse, /* cod-style lump len/ofs order */
85 Index: game_qfusion.h
\r
86 ===================================================================
\r
87 --- game_qfusion.h (revision 158)
\r
88 +++ game_qfusion.h (working copy)
\r
90 -/* -------------------------------------------------------------------------------
92 -This code is based on source provided under the terms of the Id Software
93 -LIMITED USE SOFTWARE LICENSE AGREEMENT, a copy of which is included with the
94 -GtkRadiant sources (see LICENSE_ID). If you did not receive a copy of
95 -LICENSE_ID, please contact Id Software immediately at info@idsoftware.com.
97 -All changes and additions to the original source which have been developed by
98 -other contributors (see CONTRIBUTORS) are provided under the terms of the
99 -license the contributors choose (see LICENSE), to the extent permitted by the
100 -LICENSE_ID. If you did not receive a copy of the contributor license,
101 -please contact the GtkRadiant maintainers at info@gtkradiant.com immediately.
103 -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
104 -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
105 -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
106 -DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
107 -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
108 -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
109 -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
110 -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
111 -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
112 -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
114 -----------------------------------------------------------------------------------
116 -This code has been altered significantly from its original form, to support
117 -several games based on the Quake III Arena engine, in the form of "Q3Map2."
119 -------------------------------------------------------------------------------- */
124 -#ifndef GAME_QFUSION_H
125 -#define GAME_QFUSION_H
129 -/* -------------------------------------------------------------------------------
131 -content and surface flags
133 -------------------------------------------------------------------------------- */
136 -#define F_CONT_SOLID 1 /* an eye is never valid in a solid */
137 -#define F_CONT_LAVA 8
138 -#define F_CONT_SLIME 16
139 -#define F_CONT_WATER 32
140 -#define F_CONT_FOG 64
142 -#define F_CONT_AREAPORTAL 0x8000
144 -#define F_CONT_PLAYERCLIP 0x10000
145 -#define F_CONT_MONSTERCLIP 0x20000
146 -#define F_CONT_TELEPORTER 0x40000
147 -#define F_CONT_JUMPPAD 0x80000
148 -#define F_CONT_CLUSTERPORTAL 0x100000
149 -#define F_CONT_DONOTENTER 0x200000
150 -#define F_CONT_BOTCLIP 0x400000
152 -#define F_CONT_ORIGIN 0x1000000 /* removed before bsping an entity */
154 -#define F_CONT_BODY 0x2000000 /* should never be on a brush, only in game */
155 -#define F_CONT_CORPSE 0x4000000
156 -#define F_CONT_DETAIL 0x8000000 /* brushes not used for the bsp */
157 -#define F_CONT_STRUCTURAL 0x10000000 /* brushes used for the bsp */
158 -#define F_CONT_TRANSLUCENT 0x20000000 /* don't consume surface fragments inside */
159 -#define F_CONT_TRIGGER 0x40000000
160 -#define F_CONT_NODROP 0x80000000 /* don't leave bodies or items (death fog, lava) */
162 -#define F_SURF_NODAMAGE 0x1 /* never give falling damage */
163 -#define F_SURF_SLICK 0x2 /* effects game physics */
164 -#define F_SURF_SKY 0x4 /* lighting from environment map */
165 -#define F_SURF_LADDER 0x8
166 -#define F_SURF_NOIMPACT 0x10 /* don't make missile explosions */
167 -#define F_SURF_NOMARKS 0x20 /* don't leave missile marks */
168 -#define F_SURF_FLESH 0x40 /* make flesh sounds and effects */
169 -#define F_SURF_NODRAW 0x80 /* don't generate a drawsurface at all */
170 -#define F_SURF_HINT 0x100 /* make a primary bsp splitter */
171 -#define F_SURF_SKIP 0x200 /* completely ignore, allowing non-closed brushes */
172 -#define F_SURF_NOLIGHTMAP 0x400 /* surface doesn't need a lightmap */
173 -#define F_SURF_POINTLIGHT 0x800 /* generate lighting info at vertexes */
174 -#define F_SURF_METALSTEPS 0x1000 /* clanking footsteps */
175 -#define F_SURF_NOSTEPS 0x2000 /* no footstep sounds */
176 -#define F_SURF_NONSOLID 0x4000 /* don't collide against curves with this set */
177 -#define F_SURF_LIGHTFILTER 0x8000 /* act as a light filter during q3map -light */
178 -#define F_SURF_ALPHASHADOW 0x10000 /* do per-pixel light shadow casting in q3map */
179 -#define F_SURF_NODLIGHT 0x20000 /* don't dlight even if solid (solid lava, skies) */
180 -#define F_SURF_DUST 0x40000 /* leave a dust trail when walking on this surface */
183 -#define F_SURF_VERTEXLIT (F_SURF_POINTLIGHT | F_SURF_NOLIGHTMAP)
187 -/* -------------------------------------------------------------------------------
191 -------------------------------------------------------------------------------- */
194 - "qfusion", /* -game x */
195 - "baseq3", /* default base game data dir */
196 - ".q3a", /* unix home sub-dir */
197 - "quake", /* magic path word */
198 - "scripts", /* shader directory */
199 - 2048, /* max lightmapped surface verts */
200 - 2048, /* max surface verts */
201 - 12288, /* max surface indexes */
202 - qtrue, /* flares */
203 - "flareshader", /* default flare shader */
204 - qfalse, /* wolf lighting model? */
205 - 512, /* lightmap width/height */
206 - 1.0f, /* lightmap gamma */
207 - 1.0f, /* lightmap compensate */
208 - "FBSP", /* bsp file prefix */
209 - 1, /* bsp file version */
210 - qfalse, /* cod-style lump len/ofs order */
211 - LoadRBSPFile, /* bsp load function */
212 - WriteRBSPFile, /* bsp write function */
215 - /* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
218 - { "default", F_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
222 - { "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
223 - { "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
224 - { "skip", 0, 0, 0, 0, C_SKIP, 0 },
228 - { "origin", F_CONT_ORIGIN, F_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
229 - { "areaportal", F_CONT_AREAPORTAL, F_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
230 - { "trans", F_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
231 - { "detail", F_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
232 - { "structural", F_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
233 - { "hint", 0, 0, F_SURF_HINT, 0, C_HINT, 0 },
234 - { "nodraw", 0, 0, F_SURF_NODRAW, 0, C_NODRAW, 0 },
236 - { "alphashadow", 0, 0, F_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
237 - { "lightfilter", 0, 0, F_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
238 - { "nolightmap", 0, 0, F_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
239 - { "pointlight", 0, 0, F_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
243 - { "nonsolid", 0, F_CONT_SOLID, F_SURF_NONSOLID, 0, 0, C_SOLID },
245 - { "trigger", F_CONT_TRIGGER, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
247 - { "water", F_CONT_WATER, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
248 - { "slime", F_CONT_SLIME, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
249 - { "lava", F_CONT_LAVA, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
251 - { "playerclip", F_CONT_PLAYERCLIP, F_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
252 - { "monsterclip", F_CONT_MONSTERCLIP, F_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
253 - { "nodrop", F_CONT_NODROP, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
255 - { "clusterportal", F_CONT_CLUSTERPORTAL, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
256 - { "donotenter", F_CONT_DONOTENTER, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
257 - { "botclip", F_CONT_BOTCLIP, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
259 - { "fog", F_CONT_FOG, F_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
260 - { "sky", 0, 0, F_SURF_SKY, 0, C_SKY, 0 },
262 - { "slick", 0, 0, F_SURF_SLICK, 0, 0, 0 },
264 - { "noimpact", 0, 0, F_SURF_NOIMPACT, 0, 0, 0 },
265 - { "nomarks", 0, 0, F_SURF_NOMARKS, 0, C_NOMARKS, 0 },
266 - { "ladder", 0, 0, F_SURF_LADDER, 0, 0, 0 },
267 - { "nodamage", 0, 0, F_SURF_NODAMAGE, 0, 0, 0 },
268 - { "metalsteps", 0, 0, F_SURF_METALSTEPS, 0, 0, 0 },
269 - { "flesh", 0, 0, F_SURF_FLESH, 0, 0, 0 },
270 - { "nosteps", 0, 0, F_SURF_NOSTEPS, 0, 0, 0 },
271 - { "nodlight", 0, 0, F_SURF_NODLIGHT, 0, 0, 0 },
272 - { "dust", 0, 0, F_SURF_DUST, 0, 0, 0 },
276 - { NULL, 0, 0, 0, 0, 0, 0 }
285 +/* -------------------------------------------------------------------------------
\r
287 +This code is based on source provided under the terms of the Id Software
\r
288 +LIMITED USE SOFTWARE LICENSE AGREEMENT, a copy of which is included with the
\r
289 +GtkRadiant sources (see LICENSE_ID). If you did not receive a copy of
\r
290 +LICENSE_ID, please contact Id Software immediately at info@idsoftware.com.
\r
292 +All changes and additions to the original source which have been developed by
\r
293 +other contributors (see CONTRIBUTORS) are provided under the terms of the
\r
294 +license the contributors choose (see LICENSE), to the extent permitted by the
\r
295 +LICENSE_ID. If you did not receive a copy of the contributor license,
\r
296 +please contact the GtkRadiant maintainers at info@gtkradiant.com immediately.
\r
298 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
\r
299 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\r
300 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
\r
301 +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
\r
302 +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
\r
303 +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
\r
304 +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
\r
305 +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
\r
306 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
\r
307 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
309 +----------------------------------------------------------------------------------
\r
311 +This code has been altered significantly from its original form, to support
\r
312 +several games based on the Quake III Arena engine, in the form of "Q3Map2."
\r
314 +------------------------------------------------------------------------------- */
\r
319 +#ifndef GAME_QFUSION_H
\r
320 +#define GAME_QFUSION_H
\r
324 +/* -------------------------------------------------------------------------------
\r
326 +content and surface flags
\r
328 +------------------------------------------------------------------------------- */
\r
331 +#define F_CONT_SOLID 1 /* an eye is never valid in a solid */
\r
332 +#define F_CONT_LAVA 8
\r
333 +#define F_CONT_SLIME 16
\r
334 +#define F_CONT_WATER 32
\r
335 +#define F_CONT_FOG 64
\r
337 +#define F_CONT_AREAPORTAL 0x8000
\r
339 +#define F_CONT_PLAYERCLIP 0x10000
\r
340 +#define F_CONT_MONSTERCLIP 0x20000
\r
341 +#define F_CONT_TELEPORTER 0x40000
\r
342 +#define F_CONT_JUMPPAD 0x80000
\r
343 +#define F_CONT_CLUSTERPORTAL 0x100000
\r
344 +#define F_CONT_DONOTENTER 0x200000
\r
345 +#define F_CONT_BOTCLIP 0x400000
\r
347 +#define F_CONT_ORIGIN 0x1000000 /* removed before bsping an entity */
\r
349 +#define F_CONT_BODY 0x2000000 /* should never be on a brush, only in game */
\r
350 +#define F_CONT_CORPSE 0x4000000
\r
351 +#define F_CONT_DETAIL 0x8000000 /* brushes not used for the bsp */
\r
352 +#define F_CONT_STRUCTURAL 0x10000000 /* brushes used for the bsp */
\r
353 +#define F_CONT_TRANSLUCENT 0x20000000 /* don't consume surface fragments inside */
\r
354 +#define F_CONT_TRIGGER 0x40000000
\r
355 +#define F_CONT_NODROP 0x80000000 /* don't leave bodies or items (death fog, lava) */
\r
357 +#define F_SURF_NODAMAGE 0x1 /* never give falling damage */
\r
358 +#define F_SURF_SLICK 0x2 /* effects game physics */
\r
359 +#define F_SURF_SKY 0x4 /* lighting from environment map */
\r
360 +#define F_SURF_LADDER 0x8
\r
361 +#define F_SURF_NOIMPACT 0x10 /* don't make missile explosions */
\r
362 +#define F_SURF_NOMARKS 0x20 /* don't leave missile marks */
\r
363 +#define F_SURF_FLESH 0x40 /* make flesh sounds and effects */
\r
364 +#define F_SURF_NODRAW 0x80 /* don't generate a drawsurface at all */
\r
365 +#define F_SURF_HINT 0x100 /* make a primary bsp splitter */
\r
366 +#define F_SURF_SKIP 0x200 /* completely ignore, allowing non-closed brushes */
\r
367 +#define F_SURF_NOLIGHTMAP 0x400 /* surface doesn't need a lightmap */
\r
368 +#define F_SURF_POINTLIGHT 0x800 /* generate lighting info at vertexes */
\r
369 +#define F_SURF_METALSTEPS 0x1000 /* clanking footsteps */
\r
370 +#define F_SURF_NOSTEPS 0x2000 /* no footstep sounds */
\r
371 +#define F_SURF_NONSOLID 0x4000 /* don't collide against curves with this set */
\r
372 +#define F_SURF_LIGHTFILTER 0x8000 /* act as a light filter during q3map -light */
\r
373 +#define F_SURF_ALPHASHADOW 0x10000 /* do per-pixel light shadow casting in q3map */
\r
374 +#define F_SURF_NODLIGHT 0x20000 /* don't dlight even if solid (solid lava, skies) */
\r
375 +#define F_SURF_DUST 0x40000 /* leave a dust trail when walking on this surface */
\r
378 +#define F_SURF_VERTEXLIT (F_SURF_POINTLIGHT | F_SURF_NOLIGHTMAP)
\r
382 +/* -------------------------------------------------------------------------------
\r
386 +------------------------------------------------------------------------------- */
\r
389 + "qfusion", /* -game x */
\r
390 + "baseq3", /* default base game data dir */
\r
391 + ".q3a", /* unix home sub-dir */
\r
392 + "quake", /* magic path word */
\r
393 + "scripts", /* shader directory */
\r
394 + 2048, /* max lightmapped surface verts */
\r
395 + 2048, /* max surface verts */
\r
396 + 12288, /* max surface indexes */
\r
397 + qtrue, /* flares */
\r
398 + "flareshader", /* default flare shader */
\r
399 + qfalse, /* wolf lighting model? */
\r
400 + 512, /* lightmap width/height */
\r
401 + 1.0f, /* lightmap gamma */
\r
402 + 1.0f, /* lightmap exposure */
\r
403 + 1.0f, /* lightmap compensate */
\r
404 + 1.0f, /* lightgrid scale */
\r
405 + 1.0f, /* lightgrid ambient scale */
\r
406 + qfalse, /* disable shader lightstyles hack */
\r
407 + qfalse, /* keep light entities on bsp */
\r
408 + 8, /* default patchMeta subdivisions tolerance */
\r
409 + qfalse, /* patch casting enabled */
\r
410 + qfalse, /* compile deluxemaps */
\r
411 + 0, /* deluxemaps default mode */
\r
412 + "FBSP", /* bsp file prefix */
\r
413 + 1, /* bsp file version */
\r
414 + qfalse, /* cod-style lump len/ofs order */
\r
415 + LoadRBSPFile, /* bsp load function */
\r
416 + WriteRBSPFile, /* bsp write function */
\r
419 + /* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
\r
422 + { "default", F_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
\r
426 + { "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
\r
427 + { "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
\r
428 + { "skip", 0, 0, 0, 0, C_SKIP, 0 },
\r
432 + { "origin", F_CONT_ORIGIN, F_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
\r
433 + { "areaportal", F_CONT_AREAPORTAL, F_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
\r
434 + { "trans", F_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
\r
435 + { "detail", F_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
\r
436 + { "structural", F_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
\r
437 + { "hint", 0, 0, F_SURF_HINT, 0, C_HINT, 0 },
\r
438 + { "nodraw", 0, 0, F_SURF_NODRAW, 0, C_NODRAW, 0 },
\r
440 + { "alphashadow", 0, 0, F_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
\r
441 + { "lightfilter", 0, 0, F_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
\r
442 + { "nolightmap", 0, 0, F_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
\r
443 + { "pointlight", 0, 0, F_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
\r
447 + { "nonsolid", 0, F_CONT_SOLID, F_SURF_NONSOLID, 0, 0, C_SOLID },
\r
449 + { "trigger", F_CONT_TRIGGER, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
451 + { "water", F_CONT_WATER, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
\r
452 + { "slime", F_CONT_SLIME, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
\r
453 + { "lava", F_CONT_LAVA, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
\r
455 + { "playerclip", F_CONT_PLAYERCLIP, F_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
\r
456 + { "monsterclip", F_CONT_MONSTERCLIP, F_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
\r
457 + { "nodrop", F_CONT_NODROP, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
459 + { "clusterportal", F_CONT_CLUSTERPORTAL, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
460 + { "donotenter", F_CONT_DONOTENTER, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
461 + { "botclip", F_CONT_BOTCLIP, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
463 + { "fog", F_CONT_FOG, F_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
\r
464 + { "sky", 0, 0, F_SURF_SKY, 0, C_SKY, 0 },
\r
466 + { "slick", 0, 0, F_SURF_SLICK, 0, 0, 0 },
\r
468 + { "noimpact", 0, 0, F_SURF_NOIMPACT, 0, 0, 0 },
\r
469 + { "nomarks", 0, 0, F_SURF_NOMARKS, 0, C_NOMARKS, 0 },
\r
470 + { "ladder", 0, 0, F_SURF_LADDER, 0, 0, 0 },
\r
471 + { "nodamage", 0, 0, F_SURF_NODAMAGE, 0, 0, 0 },
\r
472 + { "metalsteps", 0, 0, F_SURF_METALSTEPS, 0, 0, 0 },
\r
473 + { "flesh", 0, 0, F_SURF_FLESH, 0, 0, 0 },
\r
474 + { "nosteps", 0, 0, F_SURF_NOSTEPS, 0, 0, 0 },
\r
475 + { "nodlight", 0, 0, F_SURF_NODLIGHT, 0, 0, 0 },
\r
476 + { "dust", 0, 0, F_SURF_DUST, 0, 0, 0 },
\r
480 + { NULL, 0, 0, 0, 0, 0, 0 }
\r
489 Index: game_quake3.h
\r
490 ===================================================================
\r
491 --- game_quake3.h (revision 158)
\r
492 +++ game_quake3.h (working copy)
\r
493 @@ -112,7 +112,16 @@
\r
494 qfalse, /* wolf lighting model? */
495 128, /* lightmap width/height */
496 1.0f, /* lightmap gamma */
497 + 1.0f, /* lightmap exposure */
498 1.0f, /* lightmap compensate */
499 + 1.0f, /* lightgrid scale */
500 + 1.0f, /* lightgrid ambient scale */
501 + qfalse, /* disable shader lightstyles hack */
502 + qfalse, /* keep light entities on bsp */
503 + 8, /* default patchMeta subdivisions tolerance */
504 + qfalse, /* patch casting enabled */
505 + qfalse, /* compile deluxemaps */
506 + 0, /* deluxemaps default mode */
507 "IBSP", /* bsp file prefix */
508 46, /* bsp file version */
509 qfalse, /* cod-style lump len/ofs order */
511 ===================================================================
\r
512 --- game_sof2.h (revision 158)
\r
513 +++ game_sof2.h (working copy)
\r
514 @@ -139,7 +139,16 @@
\r
515 qfalse, /* wolf lighting model? */
516 128, /* lightmap width/height */
517 1.0f, /* lightmap gamma */
518 + 1.0f, /* lightmap exposure */
519 1.0f, /* lightmap compensate */
520 + 1.0f, /* lightgrid scale */
521 + 1.0f, /* lightgrid ambient scale */
522 + qfalse, /* disable shader lightstyles hack */
523 + qfalse, /* keep light entities on bsp */
524 + 8, /* default patchMeta subdivisions tolerance */
525 + qfalse, /* patch casting enabled */
526 + qfalse, /* compile deluxemaps */
527 + 0, /* deluxemaps default mode */
528 "RBSP", /* bsp file prefix */
529 1, /* bsp file version */
530 qfalse, /* cod-style lump len/ofs order */
531 Index: game_tenebrae.h
\r
532 ===================================================================
\r
533 --- game_tenebrae.h (revision 158)
\r
534 +++ game_tenebrae.h (working copy)
\r
535 @@ -112,7 +112,16 @@
\r
536 qfalse, /* wolf lighting model? */
537 512, /* lightmap width/height */
538 2.0f, /* lightmap gamma */
539 + 1.0f, /* lightmap exposure */
540 1.0f, /* lightmap compensate */
541 + 1.0f, /* lightgrid scale */
542 + 1.0f, /* lightgrid ambient scale */
543 + qtrue, /* disable shader lightstyles hack */
544 + qfalse, /* keep light entities on bsp */
545 + 8, /* default patchMeta subdivisions tolerance */
546 + qfalse, /* patch casting enabled */
547 + qtrue, /* compile deluxemaps */
548 + 0, /* deluxemaps default mode */
549 "IBSP", /* bsp file prefix */
550 46, /* bsp file version */
551 qfalse, /* cod-style lump len/ofs order */
552 Index: game_tremulous.h
\r
553 ===================================================================
\r
554 --- game_tremulous.h (revision 158)
\r
555 +++ game_tremulous.h (working copy)
\r
556 @@ -1,160 +1,169 @@
\r
557 -/* -------------------------------------------------------------------------------
559 -Copyright (C) 1999-2006 Id Software, Inc. and contributors.
560 -For a list of contributors, see the accompanying CONTRIBUTORS file.
562 -This file is part of GtkRadiant.
564 -GtkRadiant is free software; you can redistribute it and/or modify
565 -it under the terms of the GNU General Public License as published by
566 -the Free Software Foundation; either version 2 of the License, or
567 -(at your option) any later version.
569 -GtkRadiant is distributed in the hope that it will be useful,
570 -but WITHOUT ANY WARRANTY; without even the implied warranty of
571 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
572 -GNU General Public License for more details.
574 -You should have received a copy of the GNU General Public License
575 -along with GtkRadiant; if not, write to the Free Software
576 -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
578 -----------------------------------------------------------------------------------
580 -This code has been altered significantly from its original form, to support
581 -several games based on the Quake III Arena engine, in the form of "Q3Map2."
583 -------------------------------------------------------------------------------- */
585 -/* Tremulous support, by LinuxManMikeC */
589 -#ifndef GAME_TREMULOUS_H
590 -#define GAME_TREMULOUS_H
594 -/* -------------------------------------------------------------------------------
596 -content and surface flags - also uses defines from game_quake3.h
598 -------------------------------------------------------------------------------- */
599 -#define TREM_CONT_NOALIENBUILD 0x1000
600 -#define TREM_CONT_NOHUMANBUILD 0x2000
601 -#define TREM_CONT_NOBUILD 0x4000
603 -#define TREM_SURF_NOALIENBUILDSURFACE 0x80000
604 -#define TREM_SURF_NOHUMANBUILDSURFACE 0x100000
605 -#define TREM_SURF_NOBUILDSURFACE 0x200000
609 -/* -------------------------------------------------------------------------------
613 -------------------------------------------------------------------------------- */
616 - "tremulous", /* -game x */
617 - "base", /* default base game data dir */
618 - ".tremulous", /* unix home sub-dir */
619 - "tremulous", /* magic path word - think this is right for trem*/
620 - "scripts", /* shader directory */
621 - 64, /* max lightmapped surface verts */
622 - 999, /* max surface verts */
623 - 6000, /* max surface indexes */
624 - qfalse, /* flares */
625 - "flareshader", /* default flare shader */
626 - qfalse, /* wolf lighting model? */
627 - 128, /* lightmap width/height */
628 - 1.0f, /* lightmap gamma */
629 - 1.0f, /* lightmap compensate */
630 - "IBSP", /* bsp file prefix */
631 - 46, /* bsp file version */
632 - qfalse, /* cod-style lump len/ofs order */
633 - LoadIBSPFile, /* bsp load function */
634 - WriteIBSPFile, /* bsp write function */
637 - /* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
640 - { "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
644 - { "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
645 - { "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
646 - { "skip", 0, 0, 0, 0, C_SKIP, 0 },
650 - { "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
651 - { "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
652 - { "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
653 - { "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
654 - { "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
655 - { "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
656 - { "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
658 - { "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
659 - { "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
660 - { "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
661 - { "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
665 - { "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
667 - { "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
669 - { "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
670 - { "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
671 - { "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
673 - { "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
674 - { "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
675 - { "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
677 - { "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
678 - { "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
679 - { "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
681 - { "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
682 - { "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
684 - { "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
686 - { "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
687 - { "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
688 - { "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
689 - { "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
690 - { "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
691 - { "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
692 - { "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
693 - { "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
694 - { "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
698 - {"noalienbuild", TREM_CONT_NOALIENBUILD,0,0,0,0,0},
699 - {"nohumanbuild", TREM_CONT_NOHUMANBUILD,0,0,0,0,0},
700 - {"nobuild", TREM_CONT_NOBUILD,0,0,0,0,0},
702 - {"noalienbuildsurface", 0,0,TREM_SURF_NOALIENBUILDSURFACE,0,0,0},
703 - {"nohumanbuildsurface", 0,0,TREM_SURF_NOHUMANBUILDSURFACE,0,0,0},
704 - {"nobuildsurface", 0,0,TREM_SURF_NOBUILDSURFACE,0,0,0},
708 - { NULL, 0, 0, 0, 0, 0, 0 }
717 +/* -------------------------------------------------------------------------------
\r
719 +Copyright (C) 1999-2006 Id Software, Inc. and contributors.
\r
720 +For a list of contributors, see the accompanying CONTRIBUTORS file.
\r
722 +This file is part of GtkRadiant.
\r
724 +GtkRadiant is free software; you can redistribute it and/or modify
\r
725 +it under the terms of the GNU General Public License as published by
\r
726 +the Free Software Foundation; either version 2 of the License, or
\r
727 +(at your option) any later version.
\r
729 +GtkRadiant is distributed in the hope that it will be useful,
\r
730 +but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
731 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
732 +GNU General Public License for more details.
\r
734 +You should have received a copy of the GNU General Public License
\r
735 +along with GtkRadiant; if not, write to the Free Software
\r
736 +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
738 +----------------------------------------------------------------------------------
\r
740 +This code has been altered significantly from its original form, to support
\r
741 +several games based on the Quake III Arena engine, in the form of "Q3Map2."
\r
743 +------------------------------------------------------------------------------- */
\r
745 +/* Tremulous support, by LinuxManMikeC */
\r
749 +#ifndef GAME_TREMULOUS_H
\r
750 +#define GAME_TREMULOUS_H
\r
754 +/* -------------------------------------------------------------------------------
\r
756 +content and surface flags - also uses defines from game_quake3.h
\r
758 +------------------------------------------------------------------------------- */
\r
759 +#define TREM_CONT_NOALIENBUILD 0x1000
\r
760 +#define TREM_CONT_NOHUMANBUILD 0x2000
\r
761 +#define TREM_CONT_NOBUILD 0x4000
\r
763 +#define TREM_SURF_NOALIENBUILDSURFACE 0x80000
\r
764 +#define TREM_SURF_NOHUMANBUILDSURFACE 0x100000
\r
765 +#define TREM_SURF_NOBUILDSURFACE 0x200000
\r
769 +/* -------------------------------------------------------------------------------
\r
773 +------------------------------------------------------------------------------- */
\r
776 + "tremulous", /* -game x */
\r
777 + "base", /* default base game data dir */
\r
778 + ".tremulous", /* unix home sub-dir */
\r
779 + "tremulous", /* magic path word - think this is right for trem*/
\r
780 + "scripts", /* shader directory */
\r
781 + 64, /* max lightmapped surface verts */
\r
782 + 999, /* max surface verts */
\r
783 + 6000, /* max surface indexes */
\r
784 + qfalse, /* flares */
\r
785 + "flareshader", /* default flare shader */
\r
786 + qfalse, /* wolf lighting model? */
\r
787 + 128, /* lightmap width/height */
\r
788 + 1.0f, /* lightmap gamma */
\r
789 + 1.0f, /* lightmap exposure */
\r
790 + 1.0f, /* lightmap compensate */
\r
791 + 1.0f, /* lightgrid scale */
\r
792 + 1.0f, /* lightgrid ambient scale */
\r
793 + qfalse, /* disable shader lightstyles hack */
\r
794 + qfalse, /* keep light entities on bsp */
\r
795 + 8, /* default patchMeta subdivisions tolerance */
\r
796 + qfalse, /* patch casting enabled */
\r
797 + qfalse, /* compile deluxemaps */
\r
798 + 0, /* deluxemaps default mode */
\r
799 + "IBSP", /* bsp file prefix */
\r
800 + 46, /* bsp file version */
\r
801 + qfalse, /* cod-style lump len/ofs order */
\r
802 + LoadIBSPFile, /* bsp load function */
\r
803 + WriteIBSPFile, /* bsp write function */
\r
806 + /* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
\r
809 + { "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
\r
813 + { "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
\r
814 + { "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
\r
815 + { "skip", 0, 0, 0, 0, C_SKIP, 0 },
\r
819 + { "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
\r
820 + { "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
\r
821 + { "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
\r
822 + { "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
\r
823 + { "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
\r
824 + { "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
\r
825 + { "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
\r
827 + { "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
\r
828 + { "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
\r
829 + { "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
\r
830 + { "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
\r
834 + { "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
\r
836 + { "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
838 + { "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
\r
839 + { "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
\r
840 + { "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
\r
842 + { "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
\r
843 + { "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
\r
844 + { "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
846 + { "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
847 + { "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
848 + { "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
\r
850 + { "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
\r
851 + { "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
\r
853 + { "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
\r
855 + { "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
\r
856 + { "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
\r
857 + { "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
\r
858 + { "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
\r
859 + { "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
\r
860 + { "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
\r
861 + { "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
\r
862 + { "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
\r
863 + { "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
\r
867 + {"noalienbuild", TREM_CONT_NOALIENBUILD,0,0,0,0,0},
\r
868 + {"nohumanbuild", TREM_CONT_NOHUMANBUILD,0,0,0,0,0},
\r
869 + {"nobuild", TREM_CONT_NOBUILD,0,0,0,0,0},
\r
871 + {"noalienbuildsurface", 0,0,TREM_SURF_NOALIENBUILDSURFACE,0,0,0},
\r
872 + {"nohumanbuildsurface", 0,0,TREM_SURF_NOHUMANBUILDSURFACE,0,0,0},
\r
873 + {"nobuildsurface", 0,0,TREM_SURF_NOBUILDSURFACE,0,0,0},
\r
877 + { NULL, 0, 0, 0, 0, 0, 0 }
\r
887 ===================================================================
\r
888 --- game_wolf.h (revision 158)
\r
889 +++ game_wolf.h (working copy)
\r
890 @@ -129,7 +129,16 @@
\r
891 qtrue, /* wolf lighting model? */
892 128, /* lightmap width/height */
893 1.0f, /* lightmap gamma */
894 + 1.0f, /* lightmap exposure */
895 1.0f, /* lightmap compensate */
896 + 1.0f, /* lightgrid scale */
897 + 1.0f, /* lightgrid ambient scale */
898 + qfalse, /* disable shader lightstyles hack */
899 + qfalse, /* keep light entities on bsp */
900 + 8, /* default patchMeta subdivisions tolerance */
901 + qfalse, /* patch casting enabled */
902 + qfalse, /* compile deluxemaps */
903 + 0, /* deluxemaps default mode */
904 "IBSP", /* bsp file prefix */
905 47, /* bsp file version */
906 qfalse, /* cod-style lump len/ofs order */
907 Index: game_wolfet.h
\r
908 ===================================================================
\r
909 --- game_wolfet.h (revision 158)
\r
910 +++ game_wolfet.h (working copy)
\r
912 qtrue, /* wolf lighting model? */
913 128, /* lightmap width/height */
914 1.0f, /* lightmap gamma */
915 + 1.0f, /* lightmap exposure */
916 1.0f, /* lightmap compensate */
917 + 1.0f, /* lightgrid scale */
918 + 1.0f, /* lightgrid ambient scale */
919 + qfalse, /* disable shader lightstyles hack */
920 + qfalse, /* keep light entities on bsp */
921 + 8, /* default patchMeta subdivisions tolerance */
922 + qfalse, /* patch casting enabled */
923 + qfalse, /* compile deluxemaps */
924 + 0, /* deluxemaps default mode */
925 "IBSP", /* bsp file prefix */
926 47, /* bsp file version */
927 qfalse, /* cod-style lump len/ofs order */
929 ===================================================================
\r
930 --- light.c (revision 158)
\r
931 +++ light.c (working copy)
\r
932 @@ -313,7 +313,15 @@
\r
934 flags &= ~LIGHT_SURFACES;
938 + /* vortex: unnormalized? */
939 + if (spawnflags & 32)
940 + flags |= LIGHT_UNNORMALIZED;
942 + /* vortex: distance atten? */
943 + if (spawnflags & 64)
944 + flags |= LIGHT_ATTEN_DISTANCE;
946 /* store the flags */
947 light->flags = flags;
949 @@ -357,12 +365,13 @@
\r
952 /* ydnar: get deviance and samples */
953 + /* VorteX: now set start value for _samples when _deviance is found */
954 deviance = FloatForKey( e, "_deviance" );
955 if( deviance == 0.0f )
956 deviance = FloatForKey( e, "_deviation" );
957 if( deviance == 0.0f )
958 deviance = FloatForKey( e, "_jitter" );
959 - numSamples = IntForKey( e, "_samples" );
960 + numSamples = max(IntForKey( e, "_samples" ), deviance);
961 if( deviance < 0.0f || numSamples < 1 )
964 @@ -385,14 +394,16 @@
\r
965 if( _color && _color[ 0 ] )
967 sscanf( _color, "%f %f %f", &light->color[ 0 ], &light->color[ 1 ], &light->color[ 2 ] );
968 - ColorNormalize( light->color, light->color );
969 + if (!(light->flags & LIGHT_UNNORMALIZED))
971 + ColorNormalize( light->color, light->color );
975 light->color[ 0 ] = light->color[ 1 ] = light->color[ 2 ] = 1.0f;
978 intensity = intensity * pointScale;
979 light->photons = intensity;
981 light->type = EMIT_POINT;
983 /* set falloff threshold */
984 @@ -741,6 +752,7 @@
\r
987 VectorClear( trace->color );
988 + VectorClear( trace->colorNoShadow );
990 /* ydnar: early out */
991 if( !(light->flags & LIGHT_SURFACES) || light->envelope <= 0.0f )
992 @@ -766,7 +778,6 @@
\r
997 /* project sample point into light plane */
998 d = DotProduct( trace->origin, light->normal ) - light->dist;
1000 @@ -881,8 +892,7 @@
\r
1002 float distByNormal, radiusAtDist, sampleRadius;
1003 vec3_t pointAtDist, distToSample;
1007 /* do cone calculation */
1008 distByNormal = -DotProduct( trace->displacement, light->normal );
1009 if( distByNormal < 0.0f )
1010 @@ -922,6 +932,9 @@
\r
1011 add = light->photons * angle;
1015 + /* VorteX: set noShadow color */
1016 + VectorScale(light->color, add, trace->colorNoShadow);
1019 trace->testAll = qtrue;
1020 @@ -942,6 +955,9 @@
\r
1021 /* return to sender */
1025 + /* VorteX: set noShadow color */
1026 + VectorScale(light->color, add, trace->colorNoShadow);
1028 /* ydnar: changed to a variable number */
1029 if( add <= 0.0f || (add <= light->falloffTolerance && (light->flags & LIGHT_FAST_ACTUAL)) )
1030 @@ -1378,6 +1394,56 @@
\r
1034 + /////// Floodlighting for point //////////////////
1035 + //do our floodlight ambient occlusion loop, and add a single contribution based on the brightest dir
1041 + col[0]=col[1]=col[2]=floodlightIntensity;
1045 + trace.testOcclusion = qtrue;
1046 + trace.forceSunlight = qfalse;
1047 + trace.inhibitRadius = DEFAULT_INHIBIT_RADIUS;
1048 + trace.testAll = qtrue;
1052 + if (q==0) //upper hemisphere
1054 + trace.normal[0]=0;
1055 + trace.normal[1]=0;
1056 + trace.normal[2]=1;
1058 + else //lower hemisphere
1060 + trace.normal[0]=0;
1061 + trace.normal[1]=0;
1062 + trace.normal[2]=-1;
1065 + f = FloodLightForSample(&trace, floodlightDistance, floodlight_lowquality);
1067 + contributions[ numCon ].color[0]=col[0]*f;
1068 + contributions[ numCon ].color[1]=col[1]*f;
1069 + contributions[ numCon ].color[2]=col[2]*f;
1071 + contributions[ numCon ].dir[0]=dir[0];
1072 + contributions[ numCon ].dir[1]=dir[1];
1073 + contributions[ numCon ].dir[2]=dir[2];
1075 + contributions[ numCon ].style = 0;
1077 + /* push average direction around */
1078 + addSize = VectorLength( col );
1079 + VectorMA( gp->dir, addSize, dir, gp->dir );
1082 + /////////////////////
1084 /* normalize to get primary light direction */
1085 VectorNormalize( gp->dir, gp->dir );
1087 @@ -1420,6 +1486,9 @@
\r
1089 /* ambient light will be at 1/4 the value of directed light */
1090 /* (ydnar: nuke this in favor of more dramatic lighting?) */
1091 + /* (PM: how about actually making it work? d=1 when it got here for single lights/sun :P */
1093 + /* (Hobbes: always setting it to .25 is hardly any better) */
1094 d = 0.25f * (1.0f - d);
1095 VectorMA( gp->ambient[ j ], d, contributions[ i ].color, gp->ambient[ j ] );
1097 @@ -1437,8 +1506,10 @@
\r
1098 for( j = 0; j < 3; j++ )
1099 if( color[ j ] < minGridLight[ j ] )
1100 color[ j ] = minGridLight[ j ];
1101 - ColorToBytes( color, bgp->ambient[ i ], 1.0f );
1102 - ColorToBytes( gp->directed[ i ], bgp->directed[ i ], 1.0f );
1104 + /* vortex: apply gridscale and gridambientscale here */
1105 + ColorToBytes( color, bgp->ambient[ i ], gridScale*gridAmbientScale );
1106 + ColorToBytes( gp->directed[ i ], bgp->directed[ i ], gridScale );
1110 @@ -1654,14 +1725,12 @@
\r
1113 Sys_Printf( "--- DirtyRawLightmap ---\n" );
1118 RunThreadsOnIndividual( numRawLightmaps, qtrue, DirtyRawLightmap );
1122 + /* floodlight pass */
1123 + FloodlightRawLightmaps();
1125 /* ydnar: set up light envelopes */
1126 SetupEnvelopes( qfalse, fast );
1128 @@ -1774,12 +1843,64 @@
\r
1131 Sys_Printf( "--- Light ---\n" );
1133 + Sys_Printf( "--- ProcessGameSpecific ---\n" );
1135 /* set standard game flags */
1136 wolfLight = game->wolfLight;
1137 + if (wolfLight == qtrue)
1138 + Sys_Printf( " lightning model: wolf\n" );
1140 + Sys_Printf( " lightning model: quake3\n" );
1142 lmCustomSize = game->lightmapSize;
1143 + Sys_Printf( " lightmap size: %d x %d pixels\n", lmCustomSize, lmCustomSize );
1145 lightmapGamma = game->lightmapGamma;
1146 + Sys_Printf( " lightning gamma: %f\n", lightmapGamma );
1148 lightmapCompensate = game->lightmapCompensate;
1149 + Sys_Printf( " lightning compensation: %f\n", lightmapCompensate );
1151 + lightmapExposure = game->lightmapExposure;
1152 + Sys_Printf( " lightning exposure: %f\n", lightmapExposure );
1154 + gridScale = game->gridScale;
1155 + Sys_Printf( " lightgrid scale: %f\n", gridScale );
1157 + gridAmbientScale = game->gridAmbientScale;
1158 + Sys_Printf( " lightgrid ambient scale: %f\n", gridAmbientScale );
1160 + noStyles = game->noStyles;
1161 + if (noStyles == qtrue)
1162 + Sys_Printf( " shader lightstyles hack: disabled\n" );
1164 + Sys_Printf( " shader lightstyles hack: enabled\n" );
1166 + keepLights = game->keepLights;
1167 + if (keepLights == qtrue)
1168 + Sys_Printf( " keep lights: enabled\n" );
1170 + Sys_Printf( " keep lights: disabled\n" );
1172 + patchShadows = game->patchShadows;
1173 + if (patchShadows == qtrue)
1174 + Sys_Printf( " patch shadows: enabled\n" );
1176 + Sys_Printf( " patch shadows: disabled\n" );
1178 + deluxemap = game->deluxeMap;
1179 + deluxemode = game->deluxeMode;
1180 + if (deluxemap == qtrue)
1183 + Sys_Printf( " deluxemapping: enabled with tangentspace deluxemaps\n" );
1185 + Sys_Printf( " deluxemapping: enabled with modelspace deluxemaps\n" );
1188 + Sys_Printf( " deluxemapping: disabled\n" );
1190 + Sys_Printf( "--- ProcessCommandLine ---\n" );
1192 /* process commandline arguments */
1193 for( i = 1; i < (argc - 1); i++ )
1194 @@ -1827,6 +1948,22 @@
\r
1195 Sys_Printf( "All light scaled by %f\n", f );
1199 + else if( !strcmp( argv[ i ], "-gridscale" ) )
1201 + f = atof( argv[ i + 1 ] );
1202 + Sys_Printf( "Grid lightning scaled by %f\n", f );
1207 + else if( !strcmp( argv[ i ], "-gridambientscale" ) )
1209 + f = atof( argv[ i + 1 ] );
1210 + Sys_Printf( "Grid ambient lightning scaled by %f\n", f );
1211 + gridAmbientScale *= f;
1215 else if( !strcmp( argv[ i ], "-gamma" ) )
1217 @@ -1836,6 +1973,14 @@
\r
1221 + else if( !strcmp( argv[ i ], "-exposure" ) )
1223 + f = atof( argv[ i + 1 ] );
1224 + lightmapExposure = f;
1225 + Sys_Printf( "Lighting exposure set to %f\n", lightmapExposure );
1229 else if( !strcmp( argv[ i ], "-compensate" ) )
1231 f = atof( argv[ i + 1 ] );
1232 @@ -1889,12 +2034,6 @@
\r
1233 Sys_Printf( "Dark lightmap seams enabled\n" );
1242 else if( !strcmp( argv[ i ], "-shadeangle" ) )
1244 shadeAngleDegrees = atof( argv[ i + 1 ] );
1245 @@ -1927,13 +2066,28 @@
\r
1246 Sys_Printf( "Approximating lightmaps within a byte tolerance of %d\n", approximateTolerance );
1250 else if( !strcmp( argv[ i ], "-deluxe" ) || !strcmp( argv[ i ], "-deluxemap" ) )
1253 Sys_Printf( "Generating deluxemaps for average light direction\n" );
1256 + else if( !strcmp( argv[ i ], "-deluxemode" ))
1258 + deluxemode = atoi( argv[ i + 1 ] );
1259 + if (deluxemode == 0 || deluxemode > 1 || deluxemode < 0)
1261 + Sys_Printf( "Generating modelspace deluxemaps\n" );
1265 + Sys_Printf( "Generating tangentspace deluxemaps\n" );
1268 + else if( !strcmp( argv[ i ], "-nodeluxe" ) || !strcmp( argv[ i ], "-nodeluxemap" ) )
1270 + deluxemap = qfalse;
1271 + Sys_Printf( "Disabling generating of deluxemaps for average light direction\n" );
1273 else if( !strcmp( argv[ i ], "-external" ) )
1275 externalLightmaps = qtrue;
1276 @@ -2151,6 +2305,12 @@
\r
1278 Sys_Printf( "Default lightmap sample size set to %dx%d units\n", sampleSize, sampleSize );
1280 + else if( !strcmp( argv[ i ], "-samplescale" ) )
1282 + sampleScale = atoi( argv[ i + 1 ] );
1284 + Sys_Printf( "Lightmaps sample scale set to %d\n", sampleScale);
1286 else if( !strcmp( argv[ i ], "-novertex" ) )
1288 noVertexLighting = qtrue;
1289 @@ -2186,11 +2346,36 @@
\r
1291 Sys_Printf( "Disabling lightstyles\n" );
1293 + else if( !strcmp( argv[ i ], "-style" ) || !strcmp( argv[ i ], "-styles" ) )
1295 + noStyles = qfalse;
1296 + Sys_Printf( "Enabling lightstyles\n" );
1298 + else if( !strcmp( argv[ i ], "-keeplights" ))
1300 + keepLights = qtrue;
1301 + Sys_Printf( "Leaving light entities on map after compile\n" );
1303 else if( !strcmp( argv[ i ], "-cpma" ) )
1306 Sys_Printf( "Enabling Challenge Pro Mode Asstacular Vertex Lighting Mode (tm)\n" );
1308 + else if( !strcmp( argv[ i ], "-floodlight" ) )
1310 + floodlighty = qtrue;
1311 + Sys_Printf( "FloodLighting enabled\n" );
1313 + else if( !strcmp( argv[ i ], "-debugnormals" ) )
1315 + debugnormals = qtrue;
1316 + Sys_Printf( "DebugNormals enabled\n" );
1318 + else if( !strcmp( argv[ i ], "-lowquality" ) )
1320 + floodlight_lowquality = qtrue;
1321 + Sys_Printf( "Low Quality FloodLighting enabled\n" );
1324 /* r7: dirtmapping */
1325 else if( !strcmp( argv[ i ], "-dirty" ) )
1326 @@ -2212,6 +2397,7 @@
\r
1327 Sys_Printf( "Enabling randomized dirtmapping\n" );
1329 Sys_Printf( "Enabling ordered dir mapping\n" );
1332 else if( !strcmp( argv[ i ], "-dirtdepth" ) )
1334 @@ -2219,6 +2405,7 @@
\r
1335 if( dirtDepth <= 0.0f )
1337 Sys_Printf( "Dirtmapping depth set to %.1f\n", dirtDepth );
1340 else if( !strcmp( argv[ i ], "-dirtscale" ) )
1342 @@ -2226,6 +2413,7 @@
\r
1343 if( dirtScale <= 0.0f )
1345 Sys_Printf( "Dirtmapping scale set to %.1f\n", dirtScale );
1348 else if( !strcmp( argv[ i ], "-dirtgain" ) )
1350 @@ -2233,6 +2421,7 @@
\r
1351 if( dirtGain <= 0.0f )
1353 Sys_Printf( "Dirtmapping gain set to %.1f\n", dirtGain );
1357 /* unhandled args */
1358 @@ -2279,6 +2468,7 @@
\r
1359 /* ydnar: set up optimization */
1362 + SetupFloodLight();
1363 SetupSurfaceLightmaps();
1365 /* initialize the surface facet tracing */
1366 Index: light_bounce.c
\r
1367 ===================================================================
\r
1368 --- light_bounce.c (revision 158)
\r
1369 +++ light_bounce.c (working copy)
\r
1370 @@ -510,7 +510,7 @@
\r
1373 case MST_TRIANGLE_SOUP:
1374 - numTriangleDiffuseLights;
1375 + numTriangleDiffuseLights++;
1379 Index: light_trace.c
\r
1380 ===================================================================
\r
1381 --- light_trace.c (revision 158)
\r
1382 +++ light_trace.c (working copy)
\r
1384 #define GROW_TRACE_NODES 16384 //% 16384
1385 #define GROW_NODE_ITEMS 16 //% 256
1387 -#define MAX_TW_VERTS 12
1388 +#define MAX_TW_VERTS 24 // vortex: increased from 12 to 24 for ability co compile some insane maps with large curve count
1390 #define TRACE_ON_EPSILON 0.1f
1392 Index: light_ydnar.c
\r
1393 ===================================================================
\r
1394 --- light_ydnar.c (revision 158)
\r
1395 +++ light_ydnar.c (working copy)
\r
1403 /* ydnar: scaling necessary for simulating r_overbrightBits on external lightmaps */
1404 @@ -72,16 +73,51 @@
\r
1406 sample[ i ] = pow( sample[ i ] / 255.0f, gamma ) * 255.0f;
1409 + if (lightmapExposure == 1)
1411 + /* clamp with color normalization */
1412 + max = sample[ 0 ];
1413 + if( sample[ 1 ] > max )
1414 + max = sample[ 1 ];
1415 + if( sample[ 2 ] > max )
1416 + max = sample[ 2 ];
1417 + if( max > 255.0f )
1418 + VectorScale( sample, (255.0f / max), sample );
1422 + if (lightmapExposure==0)
1424 + lightmapExposure=1.0f;
1426 + inv=1.f/lightmapExposure;
1429 + max = sample[ 0 ];
1430 + if( sample[ 1 ] > max )
1431 + max = sample[ 1 ];
1432 + if( sample[ 2 ] > max )
1433 + max = sample[ 2 ];
1435 + dif = (1- exp(-max * inv) ) * 255;
1453 - /* clamp with color normalization */
1454 - max = sample[ 0 ];
1455 - if( sample[ 1 ] > max )
1456 - max = sample[ 1 ];
1457 - if( sample[ 2 ] > max )
1458 - max = sample[ 2 ];
1459 - if( max > 255.0f )
1460 - VectorScale( sample, (255.0f / max), sample );
1462 /* compensate for ingame overbrighting/bitshifting */
1463 VectorScale( sample, (1.0f / lightmapCompensate), sample );
1465 @@ -384,7 +420,7 @@
\r
1467 #define BOGUS_NUDGE -99999.0f
1469 -static int MapSingleLuxel( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv, vec4_t plane, float pass, vec3_t stv[ 3 ], vec3_t ttv[ 3 ] )
1470 +static int MapSingleLuxel( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv, vec4_t plane, float pass, vec3_t stv[ 3 ], vec3_t ttv[ 3 ], vec3_t worldverts[ 3 ] )
1472 int i, x, y, numClusters, *clusters, pointCluster, *cluster;
1473 float *luxel, *origin, *normal, d, lightmapSampleOffset;
1474 @@ -392,6 +428,12 @@
\r
1478 + vec3_t cverts[ 3 ];
1480 + vec4_t sideplane, hostplane;
1485 static float nudges[][ 2 ] =
1487 @@ -485,6 +527,51 @@
\r
1488 /* non axial lightmap projection (explicit xyz) */
1490 VectorCopy( dv->xyz, origin );
1492 + //////////////////////
1493 + //27's test to make sure samples stay within the triangle boundaries
1494 + //1) Test the sample origin to see if it lays on the wrong side of any edge (x/y)
1495 + //2) if it does, nudge it onto the correct side.
1497 + if (worldverts!=NULL)
1501 + VectorCopy(worldverts[j],cverts[j]);
1503 + PlaneFromPoints(hostplane,cverts[0],cverts[1],cverts[2]);
1509 + //build plane using 2 edges and a normal
1512 + VectorCopy(cverts[next],temp);
1513 + VectorAdd(temp,hostplane,temp);
1514 + PlaneFromPoints(sideplane,cverts[i],cverts[ next ], temp);
1516 + //planetest sample point
1517 + e=DotProduct(origin,sideplane);
1522 + //VectorClear(origin);
1523 + //Move the sample point back inside triangle bounds
1524 + origin[0]-=sideplane[0]*(e+1);
1525 + origin[1]-=sideplane[1]*(e+1);
1526 + origin[2]-=sideplane[2]*(e+1);
1528 + VectorClear(origin);
1535 + ////////////////////////
1537 /* planar surfaces have precalculated lightmap vectors for nudging */
1538 if( lm->plane != NULL )
1539 @@ -516,8 +603,13 @@
\r
1541 origin[ lm->axisNum ] += lightmapSampleOffset;
1543 + VectorCopy(origin,origintwo);
1544 + origintwo[0]+=vecs[2][0];
1545 + origintwo[1]+=vecs[2][1];
1546 + origintwo[2]+=vecs[2][2];
1549 - pointCluster = ClusterForPointExtFilter( origin, LUXEL_EPSILON, numClusters, clusters );
1550 + pointCluster = ClusterForPointExtFilter( origintwo, LUXEL_EPSILON, numClusters, clusters );
1552 /* another retarded hack, storing nudge count in luxel[ 1 ] */
1554 @@ -533,14 +625,14 @@
\r
1555 for( i = 0; i < 3; i++ )
1557 /* set nudged point*/
1558 - nudged[ i ] = origin[ i ] + (nudge[ 0 ] * vecs[ 0 ][ i ]) + (nudge[ 1 ] * vecs[ 1 ][ i ]);
1559 + nudged[ i ] = origintwo[ i ] + (nudge[ 0 ] * vecs[ 0 ][ i ]) + (nudge[ 1 ] * vecs[ 1 ][ i ]);
1563 /* get pvs cluster */
1564 pointCluster = ClusterForPointExtFilter( nudged, LUXEL_EPSILON, numClusters, clusters ); //% + 0.625 );
1565 - if( pointCluster >= 0 )
1566 - VectorCopy( nudged, origin );
1567 + //if( pointCluster >= 0 )
1568 + // VectorCopy( nudged, origin );
1572 @@ -550,8 +642,8 @@
\r
1574 VectorMA( dv->xyz, lightmapSampleOffset, dv->normal, nudged );
1575 pointCluster = ClusterForPointExtFilter( nudged, LUXEL_EPSILON, numClusters, clusters );
1576 - if( pointCluster >= 0 )
1577 - VectorCopy( nudged, origin );
1578 + //if( pointCluster >= 0 )
1579 + // VectorCopy( nudged, origin );
1583 @@ -597,7 +689,7 @@
\r
1584 than the distance between two luxels (thanks jc :)
1587 -static void MapTriangle_r( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv[ 3 ], vec4_t plane, vec3_t stv[ 3 ], vec3_t ttv[ 3 ] )
1588 +static void MapTriangle_r( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv[ 3 ], vec4_t plane, vec3_t stv[ 3 ], vec3_t ttv[ 3 ], vec3_t worldverts[ 3 ] )
1590 bspDrawVert_t mid, *dv2[ 3 ];
1592 @@ -645,7 +737,7 @@
\r
1594 /* split the longest edge and map it */
1595 LerpDrawVert( dv[ max ], dv[ (max + 1) % 3 ], &mid );
1596 - MapSingleLuxel( lm, info, &mid, plane, 1, stv, ttv );
1597 + MapSingleLuxel( lm, info, &mid, plane, 1, stv, ttv, worldverts );
1599 /* push the point up a little bit to account for fp creep (fixme: revisit this) */
1600 //% VectorMA( mid.xyz, 2.0f, mid.normal, mid.xyz );
1601 @@ -653,12 +745,12 @@
\r
1602 /* recurse to first triangle */
1603 VectorCopy( dv, dv2 );
1605 - MapTriangle_r( lm, info, dv2, plane, stv, ttv );
1606 + MapTriangle_r( lm, info, dv2, plane, stv, ttv, worldverts );
1608 /* recurse to second triangle */
1609 VectorCopy( dv, dv2 );
1610 dv2[ (max + 1) % 3 ] = ∣
1611 - MapTriangle_r( lm, info, dv2, plane, stv, ttv );
1612 + MapTriangle_r( lm, info, dv2, plane, stv, ttv, worldverts );
1616 @@ -674,8 +766,8 @@
\r
1619 vec3_t *stv, *ttv, stvStatic[ 3 ], ttvStatic[ 3 ];
1620 + vec3_t worldverts[ 3 ];
1623 /* get plane if possible */
1624 if( lm->plane != NULL )
1626 @@ -699,16 +791,20 @@
\r
1630 + VectorCopy( dv[ 0 ]->xyz, worldverts[ 0 ] );
1631 + VectorCopy( dv[ 1 ]->xyz, worldverts[ 1 ] );
1632 + VectorCopy( dv[ 2 ]->xyz, worldverts[ 2 ] );
1634 /* map the vertexes */
1635 - MapSingleLuxel( lm, info, dv[ 0 ], plane, 1, stv, ttv );
1636 - MapSingleLuxel( lm, info, dv[ 1 ], plane, 1, stv, ttv );
1637 - MapSingleLuxel( lm, info, dv[ 2 ], plane, 1, stv, ttv );
1638 + MapSingleLuxel( lm, info, dv[ 0 ], plane, 1, stv, ttv, worldverts );
1639 + MapSingleLuxel( lm, info, dv[ 1 ], plane, 1, stv, ttv, worldverts );
1640 + MapSingleLuxel( lm, info, dv[ 2 ], plane, 1, stv, ttv, worldverts );
1642 /* 2002-11-20: prefer axial triangle edges */
1645 /* subdivide the triangle */
1646 - MapTriangle_r( lm, info, dv, plane, stv, ttv );
1647 + MapTriangle_r( lm, info, dv, plane, stv, ttv, worldverts );
1651 @@ -730,7 +826,7 @@
\r
1652 dv2[ 2 ] = dv[ (i + 1) % 3 ];
1654 /* map the degenerate triangle */
1655 - MapTriangle_r( lm, info, dv2, plane, stv, ttv );
1656 + MapTriangle_r( lm, info, dv2, plane, stv, ttv, worldverts );
1660 @@ -792,8 +888,8 @@
\r
1661 LerpDrawVert( dv[ max + 2 ], dv[ (max + 3) % 4 ], &mid[ 1 ] );
1663 /* map the vertexes */
1664 - MapSingleLuxel( lm, info, &mid[ 0 ], plane, 1, stv, ttv );
1665 - MapSingleLuxel( lm, info, &mid[ 1 ], plane, 1, stv, ttv );
1666 + MapSingleLuxel( lm, info, &mid[ 0 ], plane, 1, stv, ttv, NULL );
1667 + MapSingleLuxel( lm, info, &mid[ 1 ], plane, 1, stv, ttv, NULL );
1671 @@ -848,7 +944,6 @@
\r
1673 vec3_t *stv, *ttv, stvStatic[ 4 ], ttvStatic[ 4 ];
1676 /* get plane if possible */
1677 if( lm->plane != NULL )
1679 @@ -878,18 +973,16 @@
\r
1682 /* map the vertexes */
1683 - MapSingleLuxel( lm, info, dv[ 0 ], plane, 1, stv, ttv );
1684 - MapSingleLuxel( lm, info, dv[ 1 ], plane, 1, stv, ttv );
1685 - MapSingleLuxel( lm, info, dv[ 2 ], plane, 1, stv, ttv );
1686 - MapSingleLuxel( lm, info, dv[ 3 ], plane, 1, stv, ttv );
1687 + MapSingleLuxel( lm, info, dv[ 0 ], plane, 1, stv, ttv, NULL );
1688 + MapSingleLuxel( lm, info, dv[ 1 ], plane, 1, stv, ttv, NULL );
1689 + MapSingleLuxel( lm, info, dv[ 2 ], plane, 1, stv, ttv, NULL );
1690 + MapSingleLuxel( lm, info, dv[ 3 ], plane, 1, stv, ttv, NULL );
1692 /* subdivide the quad */
1693 MapQuad_r( lm, info, dv, plane, stv, ttv );
1701 maps the locations, normals, and pvs clusters for a raw lightmap
1702 @@ -941,7 +1034,7 @@
\r
1703 num = lightSurfaces[ lm->firstLightSurface + n ];
1704 ds = &bspDrawSurfaces[ num ];
1705 info = &surfaceInfos[ num ];
1708 /* bail if no lightmap to calculate */
1709 if( info->lm != lm )
1711 @@ -1173,7 +1266,7 @@
\r
1714 /* map the fake vert */
1715 - MapSingleLuxel( lm, NULL, &fake, lm->plane, pass, NULL, NULL );
1716 + MapSingleLuxel( lm, NULL, &fake, lm->plane, pass, NULL, NULL, NULL );
1720 @@ -1596,7 +1689,6 @@
\r
1722 VectorSubtract( origin2, origin, originVecs[ 0 ] );
1723 //% VectorSubtract( normal2, normal, normalVecs[ 0 ] );
1725 /* calulate y vector */
1726 if( (y < (lm->sh - 1) && bx >= 0.0f) || (y == 0 && bx <= 0.0f) )
1728 @@ -1660,7 +1752,6 @@
\r
1729 float biasDirs[ 4 ][ 2 ] = { { -1.0f, -1.0f }, { 1.0f, -1.0f }, { -1.0f, 1.0f }, { 1.0f, 1.0f } };
1730 vec3_t color, total;
1734 if( lightLuxel[ 3 ] >= lightSamples )
1736 @@ -1693,7 +1784,6 @@
\r
1737 VectorCopy( normal[ b ], trace->normal );
1741 LightContributionToSample( trace );
1743 /* add to totals (fixme: make contrast function) */
1744 @@ -1768,7 +1858,6 @@
\r
1746 float stackLightLuxels[ STACK_LL_SIZE ];
1749 /* bail if this number exceeds the number of raw lightmaps */
1750 if( rawLightmapNum >= numRawLightmaps )
1752 @@ -1904,7 +1993,7 @@
\r
1755 VectorCopy( ambientColor, luxel );
1758 VectorScale( normal, 0.00390625f, deluxel );
1761 @@ -1963,28 +2052,39 @@
\r
1762 deluxel = SUPER_DELUXEL( x, y );
1763 origin = SUPER_ORIGIN( x, y );
1764 normal = SUPER_NORMAL( x, y );
1766 - /* set contribution count */
1767 - lightLuxel[ 3 ] = 1.0f;
1770 - trace.cluster = *cluster;
1771 - VectorCopy( origin, trace.origin );
1772 - VectorCopy( normal, trace.normal );
1774 - /* get light for this sample */
1775 - LightContributionToSample( &trace );
1776 - VectorCopy( trace.color, lightLuxel );
1778 - /* add to count */
1779 - if( trace.color[ 0 ] || trace.color[ 1 ] || trace.color[ 2 ] )
1781 + ////////// 27's temp hack for testing edge clipping ////
1782 + if( origin[0]==0 && origin[1]==0 && origin[2]==0 )
1784 + lightLuxel[ 1 ] = 255;
1785 + lightLuxel[ 3 ] = 1.0f;
1790 + /* set contribution count */
1791 + lightLuxel[ 3 ] = 1.0f;
1794 + trace.cluster = *cluster;
1795 + VectorCopy( origin, trace.origin );
1796 + VectorCopy( normal, trace.normal );
1798 + /* get light for this sample */
1799 + LightContributionToSample( &trace );
1800 + VectorCopy( trace.color, lightLuxel );
1802 + /* add to count */
1803 + if( trace.color[ 0 ] || trace.color[ 1 ] || trace.color[ 2 ] )
1807 /* add to light direction map (fixme: use luxel normal as starting point for deluxel?) */
1810 + /* vortex: use noShadow color */
1811 /* color to grayscale (photoshop rgb weighting) */
1812 - brightness = trace.color[ 0 ] * 0.3f + trace.color[ 1 ] * 0.59f + trace.color[ 2 ] * 0.11f;
1813 + brightness = trace.colorNoShadow[ 0 ] * 0.3f + trace.colorNoShadow[ 1 ] * 0.59f + trace.colorNoShadow[ 2 ] * 0.11f;
1814 brightness *= (1.0 / 255.0);
1815 VectorScale( trace.direction, brightness, trace.direction );
1816 VectorAdd( deluxel, trace.direction, deluxel );
1817 @@ -2222,6 +2322,38 @@
\r
1818 /* free light list */
1819 FreeTraceLights( &trace );
1821 + /* floodlight pass */
1822 + FloodlightIlluminateLightmap(lm);
1826 + for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ )
1829 + if( lm->superLuxels[ lightmapNum ] == NULL )
1832 + for( y = 0; y < lm->sh; y++ )
1834 + for( x = 0; x < lm->sw; x++ )
1837 + cluster = SUPER_CLUSTER( x, y );
1838 + //% if( *cluster < 0 )
1841 + /* get particulars */
1842 + luxel = SUPER_LUXEL( lightmapNum, x, y );
1843 + normal = SUPER_NORMAL ( x, y );
1845 + luxel[0]=(normal[0]*127)+127;
1846 + luxel[1]=(normal[1]*127)+127;
1847 + luxel[2]=(normal[2]*127)+127;
1853 /* -----------------------------------------------------------------
1855 ----------------------------------------------------------------- */
1856 @@ -2263,7 +2395,7 @@
\r
1857 /* -----------------------------------------------------------------
1859 ----------------------------------------------------------------- */
1862 /* walk lightmaps */
1863 for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ )
1865 @@ -3112,7 +3244,7 @@
\r
1866 int i, x, y, z, x1, y1, z1;
1867 light_t *light, *light2, **owner;
1869 - vec3_t origin, dir, mins, maxs, nullVector = { 0, 0, 0 };
1870 + vec3_t origin, dir, mins, maxs;
1871 float radius, intensity;
1872 light_t *buckets[ 256 ];
1874 @@ -3587,7 +3719,430 @@
\r
1875 CreateTraceLightsForBounds( mins, maxs, normal, info->numSurfaceClusters, &surfaceClusters[ info->firstSurfaceCluster ], LIGHT_SURFACES, trace );
1878 +/////////////////////////////////////////////////////////////
1880 +#define FLOODLIGHT_CONE_ANGLE 88 /* degrees */
1881 +#define FLOODLIGHT_NUM_ANGLE_STEPS 16
1882 +#define FLOODLIGHT_NUM_ELEVATION_STEPS 4
1883 +#define FLOODLIGHT_NUM_VECTORS (FLOODLIGHT_NUM_ANGLE_STEPS * FLOODLIGHT_NUM_ELEVATION_STEPS)
1885 +static vec3_t floodVectors[ FLOODLIGHT_NUM_VECTORS ];
1886 +static int numFloodVectors = 0;
1888 +void SetupFloodLight( void )
1891 + float angle, elevation, angleStep, elevationStep;
1892 + const char *value;
1893 + double v1,v2,v3,v4,v5;
1896 + Sys_FPrintf( SYS_VRB, "--- SetupFloodLight ---\n" );
1898 + /* calculate angular steps */
1899 + angleStep = DEG2RAD( 360.0f / FLOODLIGHT_NUM_ANGLE_STEPS );
1900 + elevationStep = DEG2RAD( FLOODLIGHT_CONE_ANGLE / FLOODLIGHT_NUM_ELEVATION_STEPS );
1902 + /* iterate angle */
1904 + for( i = 0, angle = 0.0f; i < FLOODLIGHT_NUM_ANGLE_STEPS; i++, angle += angleStep )
1906 + /* iterate elevation */
1907 + for( j = 0, elevation = elevationStep * 0.5f; j < FLOODLIGHT_NUM_ELEVATION_STEPS; j++, elevation += elevationStep )
1909 + floodVectors[ numFloodVectors ][ 0 ] = sin( elevation ) * cos( angle );
1910 + floodVectors[ numFloodVectors ][ 1 ] = sin( elevation ) * sin( angle );
1911 + floodVectors[ numFloodVectors ][ 2 ] = cos( elevation );
1912 + numFloodVectors++;
1916 + /* emit some statistics */
1917 + Sys_FPrintf( SYS_VRB, "%9d numFloodVectors\n", numFloodVectors );
1920 + value = ValueForKey( &entities[ 0 ], "_floodlight" );
1922 + if( value[ 0 ] != '\0' )
1925 + v4=floodlightDistance;
1926 + v5=floodlightIntensity;
1928 + sscanf( value, "%lf %lf %lf %lf %lf", &v1, &v2, &v3, &v4, &v5);
1930 + floodlightRGB[0]=v1;
1931 + floodlightRGB[1]=v2;
1932 + floodlightRGB[2]=v3;
1934 + if (VectorLength(floodlightRGB)==0)
1936 + VectorSet(floodlightRGB,240,240,255);
1939 + if (v4<1) v4=1024;
1942 + floodlightDistance = v4;
1943 + floodlightIntensity = v5;
1945 + floodlighty = qtrue;
1946 + Sys_Printf( "FloodLighting enabled via worldspawn _floodlight key.\n" );
1950 + VectorSet(floodlightRGB,240,240,255);
1951 + //floodlighty = qtrue;
1952 + //Sys_Printf( "FloodLighting enabled via worldspawn _floodlight key.\n" );
1954 + VectorNormalize(floodlightRGB,floodlightRGB);
1958 +FloodLightForSample()
1959 +calculates floodlight value for a given sample
1960 +once again, kudos to the dirtmapping coder
1963 +float FloodLightForSample( trace_t *trace , float floodLightDistance, qboolean floodLightLowQuality)
1967 + float contribution;
1969 + float gatherLight, outLight;
1970 + vec3_t normal, worldUp, myUp, myRt, direction, displacement;
1978 + if( trace == NULL || trace->cluster < 0 )
1983 + dd = floodLightDistance;
1984 + VectorCopy( trace->normal, normal );
1986 + /* check if the normal is aligned to the world-up */
1987 + if( normal[ 0 ] == 0.0f && normal[ 1 ] == 0.0f )
1989 + if( normal[ 2 ] == 1.0f )
1991 + VectorSet( myRt, 1.0f, 0.0f, 0.0f );
1992 + VectorSet( myUp, 0.0f, 1.0f, 0.0f );
1994 + else if( normal[ 2 ] == -1.0f )
1996 + VectorSet( myRt, -1.0f, 0.0f, 0.0f );
1997 + VectorSet( myUp, 0.0f, 1.0f, 0.0f );
2002 + VectorSet( worldUp, 0.0f, 0.0f, 1.0f );
2003 + CrossProduct( normal, worldUp, myRt );
2004 + VectorNormalize( myRt, myRt );
2005 + CrossProduct( myRt, normal, myUp );
2006 + VectorNormalize( myUp, myUp );
2009 + /* vortex: optimise floodLightLowQuality a bit */
2010 + if ( floodLightLowQuality == qtrue )
2012 + /* iterate through ordered vectors */
2013 + for( i = 0; i < numFloodVectors; i++ )
2014 + if (rand()%10 != 0 ) continue;
2018 + /* iterate through ordered vectors */
2019 + for( i = 0; i < numFloodVectors; i++ )
2023 + /* transform vector into tangent space */
2024 + direction[ 0 ] = myRt[ 0 ] * floodVectors[ i ][ 0 ] + myUp[ 0 ] * floodVectors[ i ][ 1 ] + normal[ 0 ] * floodVectors[ i ][ 2 ];
2025 + direction[ 1 ] = myRt[ 1 ] * floodVectors[ i ][ 0 ] + myUp[ 1 ] * floodVectors[ i ][ 1 ] + normal[ 1 ] * floodVectors[ i ][ 2 ];
2026 + direction[ 2 ] = myRt[ 2 ] * floodVectors[ i ][ 0 ] + myUp[ 2 ] * floodVectors[ i ][ 1 ] + normal[ 2 ] * floodVectors[ i ][ 2 ];
2028 + /* set endpoint */
2029 + VectorMA( trace->origin, dd, direction, trace->end );
2031 + //VectorMA( trace->origin, 1, direction, trace->origin );
2033 + SetupTrace( trace );
2035 + TraceLine( trace );
2038 + if (trace->compileFlags & C_SKY )
2040 + contribution=1.0f;
2042 + else if ( trace->opaque )
2044 + VectorSubtract( trace->hit, trace->origin, displacement );
2045 + d=VectorLength( displacement );
2047 + // d=trace->distance;
2048 + //if (d>256) gatherDirt+=1;
2049 + contribution=d/dd;
2050 + if (contribution>1) contribution=1.0f;
2052 + //gatherDirt += 1.0f - ooDepth * VectorLength( displacement );
2055 + gatherLight+=contribution;
2060 + if( gatherLight <= 0.0f )
2066 + gatherLight/=(sub);
2068 + outLight=gatherLight;
2069 + if( outLight > 1.0f )
2072 + /* return to sender */
2077 +FloodLightRawLightmap
2078 +lighttracer style ambient occlusion light hack.
2079 +Kudos to the dirtmapping author for most of this source.
2080 +VorteX: modified to floodlight up custom surfaces (q3map_floodLight)
2081 +VorteX: fixed problems with deluxemapping
2084 +// floodlight pass on a lightmap
2085 +void FloodLightRawLightmapPass( rawLightmap_t *lm , vec3_t lmFloodLightRGB, float lmFloodLightIntensity, float lmFloodLightDistance, qboolean lmFloodLightLowQuality, float floodlightDirectionScale)
2087 + int i, x, y, *cluster;
2088 + float *origin, *normal, *floodlight, floodLightAmount;
2089 + surfaceInfo_t *info;
2092 + // float samples, average, *floodlight2;
2094 + memset(&trace,0,sizeof(trace_t));
2097 + trace.testOcclusion = qtrue;
2098 + trace.forceSunlight = qfalse;
2099 + trace.twoSided = qtrue;
2100 + trace.recvShadows = lm->recvShadows;
2101 + trace.numSurfaces = lm->numLightSurfaces;
2102 + trace.surfaces = &lightSurfaces[ lm->firstLightSurface ];
2103 + trace.inhibitRadius = DEFAULT_INHIBIT_RADIUS;
2104 + trace.testAll = qfalse;
2105 + trace.distance = 1024;
2107 + /* twosided lighting (may or may not be a good idea for lightmapped stuff) */
2108 + //trace.twoSided = qfalse;
2109 + for( i = 0; i < trace.numSurfaces; i++ )
2112 + info = &surfaceInfos[ trace.surfaces[ i ] ];
2114 + /* check twosidedness */
2115 + if( info->si->twoSided )
2117 + trace.twoSided = qtrue;
2122 + /* gather floodlight */
2123 + for( y = 0; y < lm->sh; y++ )
2125 + for( x = 0; x < lm->sw; x++ )
2128 + cluster = SUPER_CLUSTER( x, y );
2129 + origin = SUPER_ORIGIN( x, y );
2130 + normal = SUPER_NORMAL( x, y );
2131 + floodlight = SUPER_FLOODLIGHT( x, y );
2133 + /* set default dirt */
2134 + *floodlight = 0.0f;
2136 + /* only look at mapped luxels */
2137 + if( *cluster < 0 )
2140 + /* copy to trace */
2141 + trace.cluster = *cluster;
2142 + VectorCopy( origin, trace.origin );
2143 + VectorCopy( normal, trace.normal );
2145 + /* get floodlight */
2146 + floodLightAmount = FloodLightForSample( &trace , lmFloodLightDistance, lmFloodLightLowQuality)*lmFloodLightIntensity;
2148 + /* add floodlight */
2149 + floodlight[0] += lmFloodLightRGB[0]*floodLightAmount;
2150 + floodlight[1] += lmFloodLightRGB[1]*floodLightAmount;
2151 + floodlight[2] += lmFloodLightRGB[2]*floodLightAmount;
2152 + floodlight[3] += floodlightDirectionScale;
2156 + /* testing no filtering */
2161 + /* filter "dirt" */
2162 + for( y = 0; y < lm->sh; y++ )
2164 + for( x = 0; x < lm->sw; x++ )
2167 + cluster = SUPER_CLUSTER( x, y );
2168 + floodlight = SUPER_FLOODLIGHT(x, y );
2170 + /* filter dirt by adjacency to unmapped luxels */
2171 + average = *floodlight;
2173 + for( sy = (y - 1); sy <= (y + 1); sy++ )
2175 + if( sy < 0 || sy >= lm->sh )
2178 + for( sx = (x - 1); sx <= (x + 1); sx++ )
2180 + if( sx < 0 || sx >= lm->sw || (sx == x && sy == y) )
2183 + /* get neighboring luxel */
2184 + cluster = SUPER_CLUSTER( sx, sy );
2185 + floodlight2 = SUPER_FLOODLIGHT( sx, sy );
2186 + if( *cluster < 0 || *floodlight2 <= 0.0f )
2190 + average += *floodlight2;
2195 + if( samples <= 0.0f )
2200 + if( samples <= 0.0f )
2204 + *floodlight = average / samples;
2210 +void FloodLightRawLightmap( int rawLightmapNum )
2212 + rawLightmap_t *lm;
2214 + /* bail if this number exceeds the number of raw lightmaps */
2215 + if( rawLightmapNum >= numRawLightmaps )
2217 + /* get lightmap */
2218 + lm = &rawLightmaps[ rawLightmapNum ];
2221 + if (floodlighty && floodlightIntensity)
2222 + FloodLightRawLightmapPass(lm, floodlightRGB, floodlightIntensity, floodlightDistance, floodlight_lowquality, 0);
2225 + if (lm->floodlightIntensity)
2227 + FloodLightRawLightmapPass(lm, lm->floodlightRGB, lm->floodlightIntensity, lm->floodlightDistance, qfalse, lm->floodlightDirectionScale);
2228 + numSurfacesFloodlighten += 1;
2232 +void FloodlightRawLightmaps()
2234 + Sys_Printf( "--- FloodlightRawLightmap ---\n" );
2235 + numSurfacesFloodlighten = 0;
2236 + RunThreadsOnIndividual( numRawLightmaps, qtrue, FloodLightRawLightmap );
2237 + Sys_Printf( "%9d custom lightmaps floodlighted\n", numSurfacesFloodlighten );
2241 +FloodLightIlluminate()
2242 +illuminate floodlight into lightmap luxels
2245 +void FloodlightIlluminateLightmap( rawLightmap_t *lm )
2247 + float *luxel, *floodlight, *deluxel, *normal;
2250 + vec3_t lightvector;
2251 + int x, y, lightmapNum;
2253 + /* walk lightmaps */
2254 + for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ )
2257 + if( lm->superLuxels[ lightmapNum ] == NULL )
2260 + /* apply floodlight to each luxel */
2261 + for( y = 0; y < lm->sh; y++ )
2263 + for( x = 0; x < lm->sw; x++ )
2265 + /* get floodlight */
2266 + floodlight = SUPER_FLOODLIGHT( x, y );
2267 + if (!floodlight[0] && !floodlight[1] && !floodlight[2])
2271 + cluster = SUPER_CLUSTER( x, y );
2273 + /* only process mapped luxels */
2274 + if( *cluster < 0 )
2277 + /* get particulars */
2278 + luxel = SUPER_LUXEL( lightmapNum, x, y );
2279 + deluxel = SUPER_DELUXEL( x, y );
2281 + /* add to lightmap */
2282 + luxel[0]+=floodlight[0];
2283 + luxel[1]+=floodlight[1];
2284 + luxel[2]+=floodlight[2];
2286 + if (luxel[3]==0) luxel[3]=1;
2288 + /* add to deluxemap */
2289 + if (deluxemap && floodlight[3] > 0)
2291 + normal = SUPER_NORMAL( x, y );
2292 + brightness = floodlight[ 0 ] * 0.3f + floodlight[ 1 ] * 0.59f + floodlight[ 2 ] * 0.11f;
2293 + brightness *= ( 1.0f / 255.0f ) * floodlight[3];
2294 + VectorScale( normal, brightness, lightvector );
2295 + VectorAdd( deluxel, lightvector, deluxel );
2305 Index: lightmaps_ydnar.c
\r
2306 ===================================================================
\r
2307 --- lightmaps_ydnar.c (revision 158)
\r
2308 +++ lightmaps_ydnar.c (working copy)
\r
2309 @@ -414,6 +414,12 @@
\r
2310 lm->superNormals = safe_malloc( size );
2311 memset( lm->superNormals, 0, size );
2313 + /* allocate floodlight map storage */
2314 + size = lm->sw * lm->sh * SUPER_FLOODLIGHT_SIZE * sizeof( float );
2315 + if( lm->superFloodLight == NULL )
2316 + lm->superFloodLight = safe_malloc( size );
2317 + memset( lm->superFloodLight, 0, size );
2319 /* allocate cluster map storage */
2320 size = lm->sw * lm->sh * sizeof( int );
2321 if( lm->superClusters == NULL )
2322 @@ -1087,17 +1093,25 @@
\r
2323 /* allocate a new raw lightmap */
2324 lm = &rawLightmaps[ numRawLightmaps ];
2329 lm->splotchFix = info->si->splotchFix;
2330 lm->firstLightSurface = numLightSurfaces;
2331 lm->numLightSurfaces = 0;
2332 - lm->sampleSize = info->sampleSize;
2333 - lm->actualSampleSize = info->sampleSize;
2334 + /* vortex: multiply lightmap sample size by -samplescale */
2335 + if (sampleScale > 0)
2336 + lm->sampleSize = info->sampleSize*sampleScale;
2338 + lm->sampleSize = info->sampleSize;
2339 + lm->actualSampleSize = lm->sampleSize;
2340 lm->entityNum = info->entityNum;
2341 lm->recvShadows = info->recvShadows;
2342 lm->brightness = info->si->lmBrightness;
2343 lm->filterRadius = info->si->lmFilterRadius;
2344 + VectorCopy(info->si->floodlightRGB, lm->floodlightRGB);
2345 + lm->floodlightDistance = info->si->floodlightDistance;
2346 + lm->floodlightIntensity = info->si->floodlightIntensity;
2347 + lm->floodlightDirectionScale = info->si->floodlightDirectionScale;
2348 VectorCopy( info->axis, lm->axis );
2349 lm->plane = info->plane;
2350 VectorCopy( info->mins, lm->mins );
2351 @@ -2254,7 +2268,6 @@
\r
2352 char *rgbGenValues[ 256 ];
2353 char *alphaGenValues[ 256 ];
2357 Sys_Printf( "--- StoreSurfaceLightmaps ---\n");
2359 @@ -2269,7 +2282,7 @@
\r
2360 ----------------------------------------------------------------- */
2363 - Sys_FPrintf( SYS_VRB, "Subsampling..." );
2364 + Sys_Printf( "Subsampling..." );
2366 /* walk the list of raw lightmaps */
2368 @@ -2437,11 +2450,11 @@
\r
2370 luxel = SUPER_LUXEL( lightmapNum, x, y );
2371 deluxel = SUPER_DELUXEL( x, y );
2374 /* copy light direction */
2375 if( deluxemap && lightmapNum == 0 )
2376 VectorCopy( deluxel, dirSample );
2379 /* is this a valid sample? */
2380 if( luxel[ 3 ] > 0.0f )
2382 @@ -2521,7 +2534,7 @@
\r
2383 /* store the sample in the bsp luxels */
2384 bspLuxel = BSP_LUXEL( lightmapNum, x, y );
2385 bspDeluxel = BSP_DELUXEL( x, y );
2388 VectorAdd( bspLuxel, sample, bspLuxel );
2389 if( deluxemap && lightmapNum == 0 )
2390 VectorAdd( bspDeluxel, dirSample, bspDeluxel );
2391 @@ -2562,7 +2575,7 @@
\r
2397 /* wrap bsp luxels if necessary */
2400 @@ -2604,15 +2617,144 @@
\r
2406 /* -----------------------------------------------------------------
2407 + convert modelspace deluxemaps to tangentspace
2408 + ----------------------------------------------------------------- */
2412 + if( deluxemap && deluxemode == 1)
2414 + vec3_t worldUp, myNormal, myTangent, myBinormal;
2417 + Sys_Printf( "converting..." );
2419 + for( i = 0; i < numRawLightmaps; i++ )
2421 + /* get lightmap */
2422 + lm = &rawLightmaps[ i ];
2424 + /* walk lightmap samples */
2425 + for( y = 0; y < lm->sh; y++ )
2427 + for( x = 0; x < lm->sw; x++ )
2429 + /* get normal and deluxel */
2430 + normal = SUPER_NORMAL(x, y);
2431 + cluster = SUPER_CLUSTER(x, y);
2432 + bspDeluxel = BSP_DELUXEL( x, y );
2433 + deluxel = SUPER_DELUXEL( x, y );
2436 + VectorSet( myNormal, normal[0], normal[1], normal[2] );
2438 + /* get tangent vectors */
2439 + if( myNormal[ 0 ] == 0.0f && myNormal[ 1 ] == 0.0f )
2441 + if( myNormal[ 2 ] == 1.0f )
2443 + VectorSet( myTangent, 1.0f, 0.0f, 0.0f );
2444 + VectorSet( myBinormal, 0.0f, 1.0f, 0.0f );
2446 + else if( myNormal[ 2 ] == -1.0f )
2448 + VectorSet( myTangent, -1.0f, 0.0f, 0.0f );
2449 + VectorSet( myBinormal, 0.0f, 1.0f, 0.0f );
2454 + VectorSet( worldUp, 0.0f, 0.0f, 1.0f );
2455 + CrossProduct( myNormal, worldUp, myTangent );
2456 + VectorNormalize( myTangent, myTangent );
2457 + CrossProduct( myTangent, myNormal, myBinormal );
2458 + VectorNormalize( myBinormal, myBinormal );
2461 + /* project onto plane */
2462 + dist = -DotProduct(myTangent, myNormal);
2463 + VectorMA(myTangent, dist, myNormal, myTangent);
2464 + dist = -DotProduct(myBinormal, myNormal);
2465 + VectorMA(myBinormal, dist, myNormal, myBinormal);
2468 + VectorNormalize( myTangent, myTangent );
2469 + VectorNormalize( myBinormal, myBinormal );
2471 + /* convert modelspace deluxel to tangentspace */
2472 + dirSample[0] = bspDeluxel[0];
2473 + dirSample[1] = bspDeluxel[1];
2474 + dirSample[2] = bspDeluxel[2];
2475 + VectorNormalize(dirSample, dirSample);
2477 + /* fix tangents to world matrix */
2478 + if (myNormal[0] > 0 || myNormal[1] < 0 || myNormal[2] < 0)
2479 + VectorNegate(myTangent, myTangent);
2481 + /* build tangentspace vectors */
2482 + bspDeluxel[0] = DotProduct(dirSample, myTangent);
2483 + bspDeluxel[1] = DotProduct(dirSample, myBinormal);
2484 + bspDeluxel[2] = DotProduct(dirSample, myNormal);
2491 + /* -----------------------------------------------------------------
2493 + ----------------------------------------------------------------- */
2495 +#ifdef sdfsdfwq312323
2497 + Sys_Printf( "blending..." );
2499 + for( i = 0; i < numRawLightmaps; i++ )
2502 + float myBrightness;
2504 + /* get lightmap */
2505 + lm = &rawLightmaps[ i ];
2507 + /* walk individual lightmaps */
2508 + for( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ )
2511 + if( lm->superLuxels[ lightmapNum ] == NULL )
2514 + /* walk lightmap samples */
2515 + for( y = 0; y < lm->sh; y++ )
2517 + for( x = 0; x < lm->sw; x++ )
2520 + bspLuxel = BSP_LUXEL( lightmapNum, x, y );
2523 + VectorNormalize(bspLuxel, myColor);
2524 + myBrightness = VectorLength(bspLuxel);
2525 + myBrightness *= (1 / 127.0f);
2526 + myBrightness = myBrightness*myBrightness;
2527 + myBrightness *= 127.0f;
2528 + VectorScale(myColor, myBrightness, bspLuxel);
2535 + /* -----------------------------------------------------------------
2536 collapse non-unique lightmaps
2537 ----------------------------------------------------------------- */
2539 if( noCollapse == qfalse && deluxemap == qfalse )
2542 - Sys_FPrintf( SYS_VRB, "collapsing..." );
2543 + Sys_Printf( "collapsing..." );
2545 /* set all twin refs to null */
2546 for( i = 0; i < numRawLightmaps; i++ )
2547 @@ -2674,13 +2816,13 @@
\r
2553 /* -----------------------------------------------------------------
2554 sort raw lightmaps by shader
2555 ----------------------------------------------------------------- */
2558 - Sys_FPrintf( SYS_VRB, "sorting..." );
2559 + Sys_Printf( "sorting..." );
2561 /* allocate a new sorted list */
2562 if( sortLightmaps == NULL )
2563 @@ -2696,7 +2838,7 @@
\r
2564 ----------------------------------------------------------------- */
2567 - Sys_FPrintf( SYS_VRB, "allocating..." );
2568 + Sys_Printf( "allocating..." );
2570 /* kill all existing output lightmaps */
2571 if( outLightmaps != NULL )
2572 @@ -2749,7 +2891,7 @@
\r
2573 ----------------------------------------------------------------- */
2576 - Sys_FPrintf( SYS_VRB, "storing..." );
2577 + Sys_Printf( "storing..." );
2579 /* count the bsp lightmaps and allocate space */
2580 if( bspLightBytes != NULL )
2581 @@ -2817,7 +2959,7 @@
\r
2584 if( numExtLightmaps > 0 )
2585 - Sys_FPrintf( SYS_VRB, "\n" );
2586 + Sys_Printf( SYS_VRB, "\n" );
2588 /* delete unused external lightmaps */
2589 for( i = numExtLightmaps; i; i++ )
2590 @@ -2836,7 +2978,7 @@
\r
2591 ----------------------------------------------------------------- */
2594 - Sys_FPrintf( SYS_VRB, "projecting..." );
2595 + Sys_Printf( "projecting..." );
2597 /* walk the list of surfaces */
2598 for( i = 0; i < numBSPDrawSurfaces; i++ )
2599 @@ -3108,7 +3250,7 @@
\r
2603 - Sys_FPrintf( SYS_VRB, "done.\n" );
2604 + Sys_Printf( "done.\n" );
2606 /* calc num stored */
2607 numStored = numBSPLightBytes / 3;
2609 ===================================================================
\r
2610 --- main.c (revision 158)
\r
2611 +++ main.c (working copy)
\r
2612 @@ -604,7 +604,7 @@
\r
2615 atexit( ExitQ3Map );
2618 /* read general options first */
2619 for( i = 1; i < argc; i++ )
2621 @@ -680,6 +680,10 @@
\r
2623 /* ydnar: new path initialization */
2624 InitPaths( &argc, argv );
2626 + /* set game options */
2627 + if (!patchSubdivisions)
2628 + patchSubdivisions = game->patchSubdivisions;
2630 /* check if we have enough options left to attempt something */
2633 ===================================================================
\r
2634 --- q3map2.h (revision 158)
\r
2635 +++ q3map2.h (working copy)
\r
2640 -#define Q3MAP_VERSION "2.5.17"
2641 -#define Q3MAP_MOTD "Last one turns the lights off"
2642 +#define Q3MAP_VERSION "2.5.17 base : FS_20g base : R5"
2643 +#define Q3MAP_MOTD "Sorry, it doesn't match my furniture."
2647 @@ -235,6 +235,7 @@
\r
2648 #define LIGHT_FAST_TEMP 512
2649 #define LIGHT_FAST_ACTUAL (LIGHT_FAST | LIGHT_FAST_TEMP)
2650 #define LIGHT_NEGATIVE 1024
2651 +#define LIGHT_UNNORMALIZED 2048 /* vortex: do not normalize _color */
2653 #define LIGHT_SUN_DEFAULT (LIGHT_ATTEN_ANGLE | LIGHT_GRID | LIGHT_SURFACES)
2654 #define LIGHT_AREA_DEFAULT (LIGHT_ATTEN_ANGLE | LIGHT_ATTEN_DISTANCE | LIGHT_GRID | LIGHT_SURFACES) /* q3a and wolf are the same */
2655 @@ -267,6 +268,7 @@
\r
2656 #define SUPER_NORMAL_SIZE 4
2657 #define SUPER_DELUXEL_SIZE 3
2658 #define BSP_DELUXEL_SIZE 3
2659 +#define SUPER_FLOODLIGHT_SIZE 4
2661 #define VERTEX_LUXEL( s, v ) (vertexLuxels[ s ] + ((v) * VERTEX_LUXEL_SIZE))
2662 #define RAD_VERTEX_LUXEL( s, v )(radVertexLuxels[ s ] + ((v) * VERTEX_LUXEL_SIZE))
2663 @@ -279,9 +281,8 @@
\r
2664 #define SUPER_ORIGIN( x, y ) (lm->superOrigins + ((((y) * lm->sw) + (x)) * SUPER_ORIGIN_SIZE))
2665 #define SUPER_NORMAL( x, y ) (lm->superNormals + ((((y) * lm->sw) + (x)) * SUPER_NORMAL_SIZE))
2666 #define SUPER_DIRT( x, y ) (lm->superNormals + ((((y) * lm->sw) + (x)) * SUPER_NORMAL_SIZE) + 3) /* stash dirtyness in normal[ 3 ] */
2667 +#define SUPER_FLOODLIGHT(x, y ) (lm->superFloodLight + ((((y) * lm->sw) + (x)) * SUPER_FLOODLIGHT_SIZE))
2671 /* -------------------------------------------------------------------------------
2674 @@ -543,7 +544,16 @@
\r
2675 qboolean wolfLight; /* when true, lights work like wolf q3map */
2676 int lightmapSize; /* bsp lightmap width/height */
2677 float lightmapGamma; /* default lightmap gamma */
2678 + float lightmapExposure; /* default lightmap exposure */
2679 float lightmapCompensate; /* default lightmap compensate value */
2680 + float gridScale; /* vortex: default lightgrid scale (affects both directional and ambient spectres) */
2681 + float gridAmbientScale; /* vortex: default lightgrid ambient spectre scale */
2682 + qboolean noStyles; /* use lightstyles hack or not */
2683 + qboolean keepLights; /* keep light entities on bsp */
2684 + int patchSubdivisions; /* default patch subdivisions tolerance */
2685 + qboolean patchShadows; /* patch casting enabled */
2686 + qboolean deluxeMap; /* compile deluxemaps */
2687 + int deluxeMode; /* deluxemap mode (0 - modelspace, 1 - tangentspace with renormalization, 2 - tangentspace without renormalization) */
2688 char *bspIdent; /* 4-letter bsp file prefix */
2689 int bspVersion; /* bsp version to use */
2690 qboolean lumpSwap; /* cod-style len/ofs order */
2691 @@ -662,6 +672,7 @@
\r
2692 char *backShader; /* for surfaces that generate different front and back passes */
2693 char *cloneShader; /* ydnar: for cloning of a surface */
2694 char *remapShader; /* ydnar: remap a shader in final stage */
2695 + char *deprecateShader; /* vortex: shader is deprecated and replaced by this on use */
2697 surfaceModel_t *surfaceModel; /* ydnar: for distribution of models */
2698 foliage_t *foliage; /* ydnar/splash damage: wolf et foliage */
2699 @@ -737,7 +748,13 @@
\r
2701 vec3_t color; /* normalized color */
2702 vec3_t averageColor;
2706 + /* vortex: per-surface floodlight */
2707 + float floodlightDirectionScale;
2708 + vec3_t floodlightRGB;
2709 + float floodlightIntensity;
2710 + float floodlightDistance;
2712 qb_t lmMergable; /* ydnar */
2713 int lmCustomWidth, lmCustomHeight; /* ydnar */
2714 @@ -1013,7 +1030,7 @@
\r
2716 int patchWidth, patchHeight;
2720 /* ydnar/sd: for foliage */
2721 int numFoliageInstances;
2723 @@ -1061,6 +1078,7 @@
\r
2724 int mapEntityNum, firstDrawSurf;
2725 int firstBrush, numBrushes; /* only valid during BSP compile */
2727 + qboolean forceNormalSmoothing; /* vortex: true if entity has _smoothnormals/_sn/_smooth key */
2731 @@ -1296,7 +1314,8 @@
\r
2733 /* input and output */
2734 vec3_t color; /* starts out at full color, may be reduced if transparent surfaces are crossed */
2736 + vec3_t colorNoShadow; /* result color with no shadow casting */
2740 int compileFlags; /* for determining surface compile flags traced through */
2741 @@ -1367,6 +1386,13 @@
\r
2742 int numLightClusters, *lightClusters;
2744 int sampleSize, actualSampleSize, axisNum;
2746 + /* vortex: per-surface floodlight */
2747 + float floodlightDirectionScale;
2748 + vec3_t floodlightRGB;
2749 + float floodlightIntensity;
2750 + float floodlightDistance;
2754 vec3_t mins, maxs, axis, origin, *vecs;
2755 @@ -1389,9 +1415,9 @@
\r
2756 float *superOrigins;
2757 float *superNormals;
2760 float *superDeluxels; /* average light direction */
2762 + float *superFloodLight; /* floodlight color */
2766 @@ -1421,8 +1447,6 @@
\r
2772 /* -------------------------------------------------------------------------------
2775 @@ -1556,6 +1580,7 @@
\r
2776 void ParsePatch( qboolean onlyLights );
2777 mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength );
2778 void PatchMapDrawSurfs( entity_t *e );
2779 +void TriangulatePatchSurface( entity_t *e , mapDrawSurface_t *ds );
2783 @@ -1610,6 +1635,8 @@
\r
2784 void AddEntitySurfaceModels( entity_t *e );
2785 int AddSurfaceModels( mapDrawSurface_t *ds );
2786 void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree );
2787 +void EmitPatchSurface( entity_t *e, mapDrawSurface_t *ds );
2788 +static void EmitTriangleSurface( mapDrawSurface_t *ds );
2792 @@ -1704,6 +1732,12 @@
\r
2793 float DirtForSample( trace_t *trace );
2794 void DirtyRawLightmap( int num );
2796 +void SetupFloodLight();
2797 +void FloodlightRawLightmaps();
2798 +void FloodlightIlluminateLightmap( rawLightmap_t *lm );
2799 +float FloodLightForSample( trace_t *trace , float floodLightDistance, qboolean floodLightLowQuality);
2800 +void FloodLightRawLightmap( int num );
2802 void IlluminateRawLightmap( int num );
2803 void IlluminateVertexes( int num );
2805 @@ -1731,7 +1765,6 @@
\r
2806 void StitchSurfaceLightmaps( void );
2807 void StoreSurfaceLightmaps( void );
2811 void ImageFree( image_t *image );
2812 image_t *ImageFind( const char *filename );
2813 @@ -1845,6 +1879,12 @@
\r
2815 #include "game_qfusion.h" /* qfusion game */
2817 + #include "game_darkplaces.h" /* vortex: darkplaces q1 engine */
2819 + #include "game_dq.h" /* vortex: deluxe quake game ( darkplaces q1 engine) */
2821 + #include "game_prophecy.h" /* vortex: prophecy game ( darkplaces q1 engine) */
2823 { NULL } /* null game */
2826 @@ -1929,6 +1969,7 @@
\r
2827 Q_EXTERN char outbase[ 32 ];
2829 Q_EXTERN int sampleSize; /* lightmap sample size in units */
2830 +Q_EXTERN int sampleScale; /* vortex: lightmap sample scale (ie quality)*/
2832 Q_EXTERN int mapEntityNum Q_ASSIGN( 0 );
2834 @@ -2053,6 +2094,7 @@
\r
2835 Q_EXTERN qboolean wolfLight Q_ASSIGN( qfalse );
2836 Q_EXTERN qboolean loMem Q_ASSIGN( qfalse );
2837 Q_EXTERN qboolean noStyles Q_ASSIGN( qfalse );
2838 +Q_EXTERN qboolean keepLights Q_ASSIGN( qfalse );
2840 Q_EXTERN int sampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_SAMPLE_SIZE );
2841 Q_EXTERN qboolean noVertexLighting Q_ASSIGN( qfalse );
2842 @@ -2065,6 +2107,7 @@
\r
2844 Q_EXTERN qboolean deluxemap Q_ASSIGN( qfalse );
2845 Q_EXTERN qboolean debugDeluxemap Q_ASSIGN( qfalse );
2846 +Q_EXTERN int deluxemode Q_ASSIGN( 0 ); /* deluxemap format (0 - modelspace, 1 - tangentspace with renormalization, 2 - tangentspace without renormalization) */
2848 Q_EXTERN qboolean fast Q_ASSIGN( qfalse );
2849 Q_EXTERN qboolean faster Q_ASSIGN( qfalse );
2850 @@ -2098,6 +2141,14 @@
\r
2851 Q_EXTERN float dirtScale Q_ASSIGN( 1.0f );
2852 Q_EXTERN float dirtGain Q_ASSIGN( 1.0f );
2854 +/* 27: floodlighting */
2855 +Q_EXTERN qboolean debugnormals Q_ASSIGN( qfalse );
2856 +Q_EXTERN qboolean floodlighty Q_ASSIGN( qfalse );
2857 +Q_EXTERN qboolean floodlight_lowquality Q_ASSIGN( qfalse );
2858 +Q_EXTERN vec3_t floodlightRGB;
2859 +Q_EXTERN float floodlightIntensity Q_ASSIGN( 512.0f );
2860 +Q_EXTERN float floodlightDistance Q_ASSIGN( 1024.0f );
2862 Q_EXTERN qboolean dump Q_ASSIGN( qfalse );
2863 Q_EXTERN qboolean debug Q_ASSIGN( qfalse );
2864 Q_EXTERN qboolean debugUnused Q_ASSIGN( qfalse );
2865 @@ -2115,9 +2166,14 @@
\r
2866 Q_EXTERN float skyScale Q_ASSIGN( 1.0f );
2867 Q_EXTERN float bounceScale Q_ASSIGN( 0.25f );
2869 +/* vortex: gridscale and gridambientscale */
2870 +Q_EXTERN float gridScale Q_ASSIGN( 1.0f );
2871 +Q_EXTERN float gridAmbientScale Q_ASSIGN( 1.0f );
2873 /* ydnar: lightmap gamma/compensation */
2874 Q_EXTERN float lightmapGamma Q_ASSIGN( 1.0f );
2875 Q_EXTERN float lightmapCompensate Q_ASSIGN( 1.0f );
2876 +Q_EXTERN float lightmapExposure Q_ASSIGN( 1.0f );
2878 /* ydnar: for runtime tweaking of falloff tolerance */
2879 Q_EXTERN float falloffTolerance Q_ASSIGN( 1.0f );
2880 @@ -2221,6 +2277,9 @@
\r
2881 Q_EXTERN int numExtLightmaps Q_ASSIGN( 0 );
2882 Q_EXTERN outLightmap_t *outLightmaps Q_ASSIGN( NULL );
2884 +/* vortex: per surface floodlight statictics */
2885 +Q_EXTERN int numSurfacesFloodlighten Q_ASSIGN( 0 );
2888 Q_EXTERN int numRawGridPoints Q_ASSIGN( 0 );
2889 Q_EXTERN rawGridPoint_t *rawGridPoints Q_ASSIGN( NULL );
2891 ===================================================================
\r
2892 --- shaders.c (revision 158)
\r
2893 +++ shaders.c (working copy)
\r
2894 @@ -793,8 +793,14 @@
\r
2897 if( VectorLength( si->color ) <= 0.0f )
2899 ColorNormalize( color, si->color );
2900 - VectorScale( color, (1.0f / count), si->averageColor );
2901 + VectorScale( color, (1.0f / count), si->averageColor );
2905 + VectorCopy( si->color, si->averageColor );
2910 @@ -804,13 +810,15 @@
\r
2911 finds a shaderinfo for a named shader
2914 +#define MAX_SHADER_DEPRECATION_DEPTH 16
2916 shaderInfo_t *ShaderInfoForShader( const char *shaderName )
2919 + int deprecationDepth;
2921 char shader[ MAX_QPATH ];
2926 if( shaderName == NULL || shaderName[ 0 ] == '\0' )
2928 @@ -823,11 +831,27 @@
\r
2929 StripExtension( shader );
2932 + deprecationDepth = 0;
2933 for( i = 0; i < numShaderInfo; i++ )
2935 si = &shaderInfo[ i ];
2936 if( !Q_stricmp( shader, si->shader ) )
2938 + /* check if shader is deprecated */
2939 + if (deprecationDepth < MAX_SHADER_DEPRECATION_DEPTH && si->deprecateShader && si->deprecateShader[ 0 ] )
2941 + /* override name */
2942 + strcpy( shader, si->deprecateShader );
2943 + StripExtension( shader );
2944 + /* increase deprecation depth */
2945 + deprecationDepth++;
2946 + if (deprecationDepth == MAX_SHADER_DEPRECATION_DEPTH)
2947 + Sys_Printf("WARNING: Max deprecation depth of %i is reached on shader '%s'\n", MAX_SHADER_DEPRECATION_DEPTH, shader);
2948 + /* search again from beginning */
2953 /* load image if necessary */
2954 if( si->finished == qfalse )
2956 @@ -1340,7 +1364,6 @@
\r
2958 surfaceModel_t *model;
2961 /* allocate new model and attach it */
2962 model = safe_malloc( sizeof( *model ) );
2963 memset( model, 0, sizeof( *model ) );
2964 @@ -1465,6 +1488,24 @@
\r
2965 GetTokenAppend( shaderText, qfalse );
2966 si->backsplashDistance = atof( token );
2969 + /* q3map_floodLight <r> <g> <b> <diste> <intensity> <light_direction_power> */
2970 + else if( !Q_stricmp( token, "q3map_floodLight" ) )
2973 + GetTokenAppend( shaderText, qfalse );
2974 + si->floodlightRGB[ 0 ] = atof( token );
2975 + GetTokenAppend( shaderText, qfalse );
2976 + si->floodlightRGB[ 1 ] = atof( token );
2977 + GetTokenAppend( shaderText, qfalse );
2978 + si->floodlightRGB[ 2 ] = atof( token );
2979 + GetTokenAppend( shaderText, qfalse );
2980 + si->floodlightDistance = atof( token );
2981 + GetTokenAppend( shaderText, qfalse );
2982 + si->floodlightIntensity = atof( token );
2983 + GetTokenAppend( shaderText, qfalse );
2984 + si->floodlightDirectionScale = atof( token );
2987 /* q3map_lightmapSampleSize <value> */
2988 else if( !Q_stricmp( token, "q3map_lightmapSampleSize" ) )
2989 @@ -1590,6 +1631,18 @@
\r
2990 strcpy( si->remapShader, token );
2994 + /* q3map_deprecateShader <shader> */
2995 + else if( !Q_stricmp( token, "q3map_deprecateShader" ) )
2997 + GetTokenAppend( shaderText, qfalse );
2998 + if( token[ 0 ] != '\0' )
3001 + si->deprecateShader = safe_malloc( strlen( token ) + 1 );
3002 + strcpy( si->deprecateShader, token );
3006 /* ydnar: q3map_offset <value> */
3007 else if( !Q_stricmp( token, "q3map_offset" ) )
3008 @@ -1896,12 +1949,14 @@
\r
3009 si->styleMarker = 2;
3011 /* ydnar: default to searching for q3map_<surfaceparm> */
3016 - //% Sys_FPrintf( SYS_VRB, "Attempting to match %s with a known surfaceparm\n", token );
3017 + Sys_FPrintf( SYS_VRB, "Attempting to match %s with a known surfaceparm\n", token );
3018 if( ApplySurfaceParm( &token[ 6 ], &si->contentFlags, &si->surfaceFlags, &si->compileFlags ) == qfalse )
3019 - ;//% Sys_Printf( "WARNING: Unknown q3map_* directive \"%s\"\n", token );
3020 + Sys_Printf( "WARNING: Unknown q3map_* directive \"%s\"\n", token );
3027 ===================================================================
\r
3028 --- surface.c (revision 158)
\r
3029 +++ surface.c (working copy)
\r
3030 @@ -304,7 +304,7 @@
\r
3031 out = &mapDrawSurfs[ i ];
3033 /* walk the surface list again until a proper surface is found */
3034 - for( j; j < numMapDrawSurfs; j++ )
3035 + for( ; j < numMapDrawSurfs; j++ )
3037 /* get in surface */
3038 in = &mapDrawSurfs[ j ];
3039 @@ -484,7 +484,7 @@
\r
3042 /* walk the list of surfaces */
3043 - for( numSurfs; numSurfs > 0; numSurfs--, ds++ )
3044 + for( ; numSurfs > 0; numSurfs--, ds++ )
3046 /* ignore bogus (or flare) surfaces */
3047 if( ds->type == SURFACE_BAD || ds->numVerts <= 0 )
3048 @@ -2445,25 +2445,27 @@
\r
3049 numSurfacesByType[ ds->type ]++;
3056 emits a bsp patch drawsurface
3059 -void EmitPatchSurface( mapDrawSurface_t *ds )
3060 +void EmitPatchSurface( entity_t *e, mapDrawSurface_t *ds )
3063 bspDrawSurface_t *out;
3064 int surfaceFlags, contentFlags;
3065 + int forcePatchMeta;
3067 + /* vortex: _patchMeta support */
3068 + forcePatchMeta = IntForKey(e, "_patchMeta" );
3069 + if (!forcePatchMeta)
3070 + forcePatchMeta = IntForKey(e, "patchMeta" );
3073 /* invert the surface if necessary */
3074 if( ds->backSide || ds->shaderInfo->invert )
3076 bspDrawVert_t *dv1, *dv2, temp;
3079 /* walk the verts, flip the normal */
3080 for( i = 0; i < ds->numVerts; i++ )
3081 @@ -2485,7 +2487,7 @@
\r
3083 VectorScale( ds->lightmapVecs[ 2 ], -1.0f, ds->lightmapVecs[ 2 ] );
3087 /* allocate a new surface */
3088 if( numBSPDrawSurfaces == MAX_MAP_DRAW_SURFS )
3089 Error( "MAX_MAP_DRAW_SURFS" );
3090 @@ -2493,12 +2495,12 @@
\r
3091 ds->outputNum = numBSPDrawSurfaces;
3092 numBSPDrawSurfaces++;
3093 memset( out, 0, sizeof( *out ) );
3097 out->surfaceType = MST_PATCH;
3099 out->shaderNum = EmitShader( "debugsurfaces", NULL, NULL );
3100 - else if( patchMeta )
3101 + else if( patchMeta || forcePatchMeta )
3103 /* patch meta requires that we have nodraw patches for collision */
3104 surfaceFlags = ds->shaderInfo->surfaceFlags;
3105 @@ -2548,8 +2550,6 @@
\r
3106 numSurfacesByType[ ds->type ]++;
3112 OptimizeTriangleSurface() - ydnar
3113 optimizes the vertex/index data in a triangle surface
3114 @@ -2677,8 +2677,7 @@
\r
3117 bspDrawSurface_t *out;
3121 /* invert the surface if necessary */
3122 if( ds->backSide || ds->shaderInfo->invert )
3124 @@ -2689,15 +2688,15 @@
\r
3125 ds->indexes[ i ] = ds->indexes[ i + 1 ];
3126 ds->indexes[ i + 1 ] = temp;
3130 /* walk the verts, flip the normal */
3131 for( i = 0; i < ds->numVerts; i++ )
3132 VectorScale( ds->verts[ i ].normal, -1.0f, ds->verts[ i ].normal );
3136 VectorScale( ds->lightmapVecs[ 2 ], -1.0f, ds->lightmapVecs[ 2 ] );
3140 /* allocate a new surface */
3141 if( numBSPDrawSurfaces == MAX_MAP_DRAW_SURFS )
3142 Error( "MAX_MAP_DRAW_SURFS" );
3143 @@ -2804,15 +2803,14 @@
\r
3144 emits a bsp planar winding (brush face) drawsurface
3147 -static void EmitFaceSurface( mapDrawSurface_t *ds )
3148 +static void EmitFaceSurface(mapDrawSurface_t *ds )
3150 /* strip/fan finding was moved elsewhere */
3151 StripFaceSurface( ds );
3152 - EmitTriangleSurface( ds );
3153 + EmitTriangleSurface(ds);
3159 MakeDebugPortalSurfs_r() - ydnar
3160 generates drawsurfaces for passable portals in the bsp
3161 @@ -3502,7 +3500,7 @@
\r
3163 refs = FilterPatchIntoTree( ds, tree );
3165 - EmitPatchSurface( ds );
3166 + EmitPatchSurface( e, ds );
3169 /* handle triangle surfaces */
3170 Index: surface_meta.c
\r
3171 ===================================================================
\r
3172 --- surface_meta.c (revision 158)
\r
3173 +++ surface_meta.c (working copy)
\r
3174 @@ -312,23 +312,41 @@
\r
3175 creates triangles from a patch
3178 -void TriangulatePatchSurface( mapDrawSurface_t *ds )
3179 +void TriangulatePatchSurface( entity_t *e , mapDrawSurface_t *ds )
3181 int iterations, x, y, pw[ 5 ], r;
3182 mapDrawSurface_t *dsNew;
3183 mesh_t src, *subdivided, *mesh;
3186 + int forcePatchMeta;
3188 + int patchSubdivision;
3190 + /* vortex: _patchMeta, _patchQuality, _patchSubdivide support */
3191 + forcePatchMeta = IntForKey(e, "_patchMeta" );
3192 + if (!forcePatchMeta)
3193 + forcePatchMeta = IntForKey(e, "patchMeta" );
3194 + patchQuality = IntForKey(e, "_patchQuality" );
3195 + if (!patchQuality)
3196 + patchQuality = IntForKey(e, "patchQuality" );
3197 + if (!patchQuality)
3198 + patchQuality = 1.0;
3199 + patchSubdivision = IntForKey(e, "_patchSubdivide" );
3200 + if (!patchSubdivision)
3201 + patchSubdivision = IntForKey(e, "patchSubdivide" );
3203 /* try to early out */
3204 - if( ds->numVerts == 0 || ds->type != SURFACE_PATCH || patchMeta == qfalse )
3205 + if(ds->numVerts == 0 || ds->type != SURFACE_PATCH || ( patchMeta == qfalse && !forcePatchMeta) )
3208 /* make a mesh from the drawsurf */
3209 src.width = ds->patchWidth;
3210 src.height = ds->patchHeight;
3211 src.verts = ds->verts;
3212 //% subdivided = SubdivideMesh( src, 8, 999 );
3213 - iterations = IterationsForCurve( ds->longestCurve, patchSubdivisions );
3214 + if (patchSubdivision)
3215 + iterations = IterationsForCurve( ds->longestCurve, patchSubdivision );
3217 + iterations = IterationsForCurve( ds->longestCurve, patchSubdivisions / patchQuality );
3219 subdivided = SubdivideMesh2( src, iterations ); //% ds->maxIterations
3221 /* fit it to the curve and remove colinear verts on rows/columns */
3222 @@ -652,12 +685,12 @@
\r
3226 - TriangulatePatchSurface( ds );
3227 + TriangulatePatchSurface(e, ds );
3230 case SURFACE_TRIANGLES:
3234 case SURFACE_FORCED_META:
3236 SurfaceToMetaTriangles( ds );
3237 @@ -972,8 +1005,8 @@
\r
3238 vec3_t average, diff;
3239 int indexes[ MAX_SAMPLES ];
3240 vec3_t votes[ MAX_SAMPLES ];
3241 + const char *classname;
3245 Sys_FPrintf( SYS_VRB, "--- SmoothMetaTriangles ---\n" );
3247 @@ -994,11 +1027,31 @@
\r
3248 and set per-vertex smoothing angle */
3249 for( i = 0, tri = &metaTriangles[ i ]; i < numMetaTriangles; i++, tri++ )
3251 + /* vortex: try get smoothing from entity key */
3252 + shadeAngle = FloatForKey(&entities[tri->entityNum], "_smoothnormals");
3253 + if (shadeAngle <= 0.0f)
3254 + shadeAngle = FloatForKey(&entities[tri->entityNum], "_sn");
3255 + if (shadeAngle <= 0.0f)
3256 + shadeAngle = FloatForKey(&entities[tri->entityNum], "_smooth");
3257 + if (shadeAngle > 0.0f)
3259 + if (entities[tri->entityNum].forceNormalSmoothing == qfalse)
3261 + entities[tri->entityNum].forceNormalSmoothing = qtrue;
3262 + classname = ValueForKey( &entities[tri->entityNum], "classname" );
3263 + Sys_Printf( "Entity %d (%s) has vertex normal smoothing with breaking angle of %3.0f\n", tri->entityNum, classname, shadeAngle );
3265 + shadeAngle = DEG2RAD( shadeAngle );
3268 /* get shader for shade angle */
3269 - if( tri->si->shadeAngleDegrees > 0.0f )
3270 - shadeAngle = DEG2RAD( tri->si->shadeAngleDegrees );
3272 - shadeAngle = defaultShadeAngle;
3273 + if (shadeAngle <= 0.0f)
3275 + if( tri->si->shadeAngleDegrees > 0.0f )
3276 + shadeAngle = DEG2RAD( tri->si->shadeAngleDegrees );
3278 + shadeAngle = defaultShadeAngle;
3280 if( shadeAngle > maxShadeAngle )
3281 maxShadeAngle = shadeAngle;
3284 ===================================================================
\r
3285 --- writebsp.c (revision 158)
\r
3286 +++ writebsp.c (working copy)
\r
3287 @@ -136,7 +136,6 @@
\r
3295 @@ -278,18 +277,19 @@
\r
3296 void SetLightStyles( void )
3298 int i, j, style, numStyles;
3299 - qboolean keepLights;
3304 char lightTargets[ MAX_SWITCHED_LIGHTS ][ 64 ];
3305 int lightStyles[ MAX_SWITCHED_LIGHTS ];
3309 /* ydnar: determine if we keep lights in the bsp */
3310 - t = ValueForKey( &entities[ 0 ], "_keepLights" );
3311 - keepLights = (t[ 0 ] == '1') ? qtrue : qfalse;
3312 + if (KeyExists(&entities[ 0 ], "_keepLights") == qtrue)
3314 + t = ValueForKey( &entities[ 0 ], "_keepLights" );
3315 + keepLights = (t[ 0 ] == '1') ? qtrue : qfalse;
3318 /* any light that is controlled (has a targetname) must have a unique style number generated for it */