1 Index: tools/quake3/q3map2/game_ja.h
2 ===================================================================
3 --- tools/quake3/q3map2/game_ja.h.orig 2008-09-06 15:32:04.000000000 +0200
4 +++ tools/quake3/q3map2/game_ja.h 2008-09-06 15:32:16.000000000 +0200
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 "RBSP", /* bsp file prefix */
12 1, /* bsp file version */
13 Index: tools/quake3/q3map2/game_tremulous.h
14 ===================================================================
15 --- tools/quake3/q3map2/game_tremulous.h.orig 2008-09-06 15:32:04.000000000 +0200
16 +++ tools/quake3/q3map2/game_tremulous.h 2008-09-06 15:32:16.000000000 +0200
18 qfalse, /* wolf lighting model? */
19 128, /* lightmap width/height */
20 1.0f, /* lightmap gamma */
21 + 1.0f, /* lightmap exposure */
22 1.0f, /* lightmap compensate */
23 "IBSP", /* bsp file prefix */
24 46, /* bsp file version */
25 Index: tools/quake3/q3map2/game_wolfet.h
26 ===================================================================
27 --- tools/quake3/q3map2/game_wolfet.h.orig 2008-09-06 15:32:04.000000000 +0200
28 +++ tools/quake3/q3map2/game_wolfet.h 2008-09-06 15:32:16.000000000 +0200
30 qtrue, /* wolf lighting model? */
31 128, /* lightmap width/height */
32 1.0f, /* lightmap gamma */
33 + 1.0f, /* lightmap exposure */
34 1.0f, /* lightmap compensate */
35 "IBSP", /* bsp file prefix */
36 47, /* bsp file version */
37 Index: tools/quake3/q3map2/game_wolf.h
38 ===================================================================
39 --- tools/quake3/q3map2/game_wolf.h.orig 2008-09-06 15:32:04.000000000 +0200
40 +++ tools/quake3/q3map2/game_wolf.h 2008-09-06 15:32:16.000000000 +0200
42 qtrue, /* wolf lighting model? */
43 128, /* lightmap width/height */
44 1.0f, /* lightmap gamma */
45 + 1.0f, /* lightmap exposure */
46 1.0f, /* lightmap compensate */
47 "IBSP", /* bsp file prefix */
48 47, /* bsp file version */
49 Index: tools/quake3/q3map2/game_sof2.h
50 ===================================================================
51 --- tools/quake3/q3map2/game_sof2.h.orig 2008-09-06 15:32:04.000000000 +0200
52 +++ tools/quake3/q3map2/game_sof2.h 2008-09-06 15:32:16.000000000 +0200
54 qfalse, /* wolf lighting model? */
55 128, /* lightmap width/height */
56 1.0f, /* lightmap gamma */
57 + 1.0f, /* lightmap exposure */
58 1.0f, /* lightmap compensate */
59 "RBSP", /* bsp file prefix */
60 1, /* bsp file version */
61 Index: tools/quake3/q3map2/game_etut.h
62 ===================================================================
63 --- tools/quake3/q3map2/game_etut.h.orig 2008-09-06 15:32:04.000000000 +0200
64 +++ tools/quake3/q3map2/game_etut.h 2008-09-06 15:32:16.000000000 +0200
66 qfalse, /* wolf lighting model? */
67 128, /* lightmap width/height */
68 2.2f, /* lightmap gamma */
69 + 1.0f, /* lightmap exposure */
70 1.0f, /* lightmap compensate */
71 "IBSP", /* bsp file prefix */
72 47, /* bsp file version */
73 Index: tools/quake3/q3map2/game_jk2.h
74 ===================================================================
75 --- tools/quake3/q3map2/game_jk2.h.orig 2008-09-06 15:32:04.000000000 +0200
76 +++ tools/quake3/q3map2/game_jk2.h 2008-09-06 15:32:16.000000000 +0200
78 qfalse, /* wolf lighting model? */
79 128, /* lightmap width/height */
80 1.0f, /* lightmap gamma */
81 + 1.0f, /* lightmap exposure */
82 1.0f, /* lightmap compensate */
83 "RBSP", /* bsp file prefix */
84 1, /* bsp file version */
85 Index: tools/quake3/q3map2/game_qfusion.h
86 ===================================================================
87 --- tools/quake3/q3map2/game_qfusion.h.orig 2008-09-06 15:32:04.000000000 +0200
88 +++ tools/quake3/q3map2/game_qfusion.h 2008-09-06 15:32:16.000000000 +0200
90 qfalse, /* wolf lighting model? */
91 512, /* lightmap width/height */
92 1.0f, /* lightmap gamma */
93 + 1.0f, /* lightmap exposure */
94 1.0f, /* lightmap compensate */
95 "FBSP", /* bsp file prefix */
96 1, /* bsp file version */
97 Index: tools/quake3/q3map2/game_tenebrae.h
98 ===================================================================
99 --- tools/quake3/q3map2/game_tenebrae.h.orig 2008-09-06 15:32:04.000000000 +0200
100 +++ tools/quake3/q3map2/game_tenebrae.h 2008-09-06 15:32:16.000000000 +0200
102 qfalse, /* wolf lighting model? */
103 512, /* lightmap width/height */
104 2.0f, /* lightmap gamma */
105 + 1.0f, /* lightmap exposure */
106 1.0f, /* lightmap compensate */
107 "IBSP", /* bsp file prefix */
108 46, /* bsp file version */
109 Index: tools/quake3/q3map2/game_quake3.h
110 ===================================================================
111 --- tools/quake3/q3map2/game_quake3.h.orig 2008-09-06 15:32:04.000000000 +0200
112 +++ tools/quake3/q3map2/game_quake3.h 2008-09-06 15:32:16.000000000 +0200
114 qfalse, /* wolf lighting model? */
115 128, /* lightmap width/height */
116 1.0f, /* lightmap gamma */
117 + 1.0f, /* lightmap exposure */
118 1.0f, /* lightmap compensate */
119 "IBSP", /* bsp file prefix */
120 47, /* bsp file version */
121 Index: tools/quake3/q3map2/game_ef.h
122 ===================================================================
123 --- tools/quake3/q3map2/game_ef.h.orig 2008-09-06 15:32:04.000000000 +0200
124 +++ tools/quake3/q3map2/game_ef.h 2008-09-06 15:32:16.000000000 +0200
126 qfalse, /* wolf lighting model? */
127 128, /* lightmap width/height */
128 1.0f, /* lightmap gamma */
129 + 1.0f, /* lightmap exposure */
130 1.0f, /* lightmap compensate */
131 "IBSP", /* bsp file prefix */
132 46, /* bsp file version */
133 Index: tools/quake3/q3map2/light_ydnar.c
134 ===================================================================
135 --- tools/quake3/q3map2/light_ydnar.c.orig 2008-09-06 15:32:14.000000000 +0200
136 +++ tools/quake3/q3map2/light_ydnar.c 2008-09-06 15:32:16.000000000 +0200
144 /* ydnar: scaling necessary for simulating r_overbrightBits on external lightmaps */
147 sample[ i ] = pow( sample[ i ] / 255.0f, gamma ) * 255.0f;
150 - /* clamp with color normalization */
152 - if( sample[ 1 ] > max )
154 - if( sample[ 2 ] > max )
157 - VectorScale( sample, (255.0f / max), sample );
159 + if (lightmapExposure == 1)
161 + /* clamp with color normalization */
163 + if( sample[ 1 ] > max )
165 + if( sample[ 2 ] > max )
168 + VectorScale( sample, (255.0f / max), sample );
172 + if (lightmapExposure==0)
174 + lightmapExposure=1.0f;
176 + inv=1.f/lightmapExposure;
180 + if( sample[ 1 ] > max )
182 + if( sample[ 2 ] > max )
185 + dif = (1- exp(-max * inv) ) * 255;
203 /* compensate for ingame overbrighting/bitshifting */
204 VectorScale( sample, (1.0f / lightmapCompensate), sample );
205 Index: tools/quake3/q3map2/q3map2.h
206 ===================================================================
207 --- tools/quake3/q3map2/q3map2.h.orig 2008-09-06 15:32:14.000000000 +0200
208 +++ tools/quake3/q3map2/q3map2.h 2008-09-06 15:32:16.000000000 +0200
210 qboolean wolfLight; /* when true, lights work like wolf q3map */
211 int lightmapSize; /* bsp lightmap width/height */
212 float lightmapGamma; /* default lightmap gamma */
213 + float lightmapExposure; /* default lightmap exposure */
214 float lightmapCompensate; /* default lightmap compensate value */
215 char *bspIdent; /* 4-letter bsp file prefix */
216 int bspVersion; /* bsp version to use */
217 @@ -2139,6 +2140,7 @@
219 /* ydnar: lightmap gamma/compensation */
220 Q_EXTERN float lightmapGamma Q_ASSIGN( 1.0f );
221 +Q_EXTERN float lightmapExposure Q_ASSIGN( 1.0f );
222 Q_EXTERN float lightmapCompensate Q_ASSIGN( 1.0f );
224 /* ydnar: for runtime tweaking of falloff tolerance */
225 Index: tools/quake3/q3map2/light.c
226 ===================================================================
227 --- tools/quake3/q3map2/light.c.orig 2008-09-06 15:32:14.000000000 +0200
228 +++ tools/quake3/q3map2/light.c 2008-09-06 15:32:16.000000000 +0200
229 @@ -1893,6 +1893,14 @@
233 + else if( !strcmp( argv[ i ], "-exposure" ) )
235 + f = atof( argv[ i + 1 ] );
236 + lightmapExposure = f;
237 + Sys_Printf( "Lighting exposure set to %f\n", lightmapExposure );
241 else if( !strcmp( argv[ i ], "-compensate" ) )
243 f = atof( argv[ i + 1 ] );