FS2_Open
Open source remastering of the Freespace 2 engine
def_files.cpp
Go to the documentation of this file.
1 /*
2  * Def_Files.cpp
3  *
4  * You may not sell or otherwise commercially exploit the source or things you
5  * create based on the source.
6  */
7 
8 
9 
10 
11 #include <string.h>
12 #include "globalincs/pstypes.h"
13 
14 //Struct used to hold data about file defaults
15 typedef struct def_file
16 {
17  const char* filename;
18  const char *contents;
19 } def_file;
20 
21 //:PART 1:
22 //**********
23 extern char *Default_species_table;
24 extern char *Default_iff_table;
25 extern char *Default_shiptypes_table;
26 extern char *Default_ai_profiles_table;
27 extern char *Default_autopilot_table;
28 extern char *Default_fonts_table;
29 extern char *Default_controlconfig_table;
30 extern char *Default_mod_table;
32 extern char* Default_main_vertex_shader;
33 extern char* Default_main_fragment_shader;
34 extern char* Default_main_geometry_shader;
35 extern char* Default_fxaa_vertex_shader;
36 extern char* Default_fxaa_fragment_shader;
37 extern char* Default_blur_fragment_shader;
39 extern char* Default_post_fragment_shader;
40 extern char* Default_post_vertex_shader;
41 extern char* Default_fxaa_prepass_shader;
42 extern char* Default_effect_vertex_shader;
52 extern char* Default_video_vertex_shader;
58 //**********
59 
60 //:PART 2:
61 //**********
63 {
64  { "species_defs.tbl", Default_species_table },
65  { "iff_defs.tbl", Default_iff_table },
66  { "objecttypes.tbl", Default_shiptypes_table },
67  { "ai_profiles.tbl", Default_ai_profiles_table },
68  { "autopilot.tbl", Default_autopilot_table },
69  { "fonts.tbl", Default_fonts_table },
70  { "controlconfigdefaults.tbl", Default_controlconfig_table },
71  { "game_settings.tbl", Default_mod_table},
72  { "post_processing.tbl", Default_post_processing_table},
73  { "main-f.sdr", Default_main_fragment_shader},
74  { "main-v.sdr", Default_main_vertex_shader},
75  { "main-g.sdr", Default_main_geometry_shader},
76  { "fxaa-v.sdr", Default_fxaa_vertex_shader},
77  { "fxaa-f.sdr", Default_fxaa_fragment_shader},
78  { "blur-f.sdr", Default_blur_fragment_shader},
79  { "brightpass-f.sdr", Default_brightpass_fragment_shader},
80  { "post-f.sdr", Default_post_fragment_shader},
81  { "post-v.sdr", Default_post_vertex_shader},
82  { "fxaapre-f.sdr", Default_fxaa_prepass_shader},
83  { "effect-v.sdr", Default_effect_vertex_shader},
84  { "effect-f.sdr", Default_effect_fragment_shader},
85  { "effect-particle-f.sdr", Default_effect_particle_fragment_shader},
86  { "effect-distort-v.sdr", Default_effect_distortion_vertex_shader},
87  { "effect-distort-f.sdr", Default_effect_distortion_fragment_shader},
88  { "effect-screen-g.sdr", Default_effect_screen_geometry_shader},
89  { "shadowdebug-v.sdr", Default_shadowdebug_vertex_shader},
90  { "shadowdebug-f.sdr", Default_shadowdebug_fragment_shader},
92  { "video-v.sdr", Default_video_vertex_shader},
93  { "video-f.sdr", Default_video_fragment_shader},
94  { "deferred-v.sdr", Default_deferred_vertex_shader},
95  { "deferred-f.sdr", Default_deferred_fragment_shader},
96  { "deferred-clear-v.sdr", Default_deferred_clear_vertex_shader},
97  { "deferred-clear-f.sdr", Default_deferred_clear_fragment_shader}
98 };
99 
100 static int Num_default_files = sizeof(Default_files) / sizeof(def_file);
101 //**********
102 
103 const char *defaults_get_file(const char *filename)
104 {
105  for(int i = 0; i < Num_default_files; i++)
106  {
107  if(!stricmp(Default_files[i].filename, filename))
108  {
109  return Default_files[i].contents;
110  }
111  }
112 
113  //WMC - This is really bad, because it means we have a default table missing.
114  Error(LOCATION, "Default table '%s' missing from executable - contact a coder.", filename);
115  return NULL;
116 }
117 
118 //:PART 3:
119 //**********
120 //=========================================================================
121 
122 // This is the default table.
123 // Please note that the {\n\}s should be removed from the end of each line
124 // if you intend to use this to format your own table.
125 
127 ;; Mod.tbl should be used for settings which affect the entire mod and \n\
128 ;; only very rarely need to be changed (if ever). \n\
129  \n\
130 #CAMPAIGN SETTINGS \n\
131  \n\
132 ;; Sets default campaign file the game will look for with new pilots \n\
133 $Default Campaign File Name: FreeSpace2 \n\
134  \n\
135  \n\
136 #HUD SETTINGS \n\
137  \n\
138 ;; Sets the delay before a directive will appear on the screen (ms) \n\
139 $Directive Wait Time: 3000 \n\
140  \n\
141 ;; If set, shows the HUD during in-game cutscenes \n\
142 $Cutscene camera displays HUD: NO \n\
143  \n\
144 ;; If set, uses the colors of the ANI instead of the colors of the HUD \n\
145 $Full color head animations: NO \n\
146  \n\
147  \n\
148 #SEXP SETTINGS \n\
149  \n\
150 ;; When set, this makes the argument SEXPs loop through all the SEXPs \n\
151 ;; before it moves on to the next argument. Default behaviour is the \n\
152 ;; exact opposite, each SEXP is called for all arguments. \n\
153 $Loop SEXPs Then Arguments: NO \n\
154  \n\
155 ;; When set, this makes the event chaining behavior act as people \n\
156 ;; expected it to be in Mantis #82. \n\
157 $Use Alternate Chaining Behavior: NO \n\
158  \n\
159  \n\
160 #GRAPHICS SETTINGS \n\
161  \n\
162 ;; When set, this enables the loading of external shader files \n\
163 $Enable external shaders: NO \n\
164  \n\
165  \n\
166 #OTHER SETTINGS \n\
167  \n\
168 ;; If not set, a hit to a turret's barrels will not count as a hit to \n\
169 ;; the turret unless it is also within the turret base's radius. \n\
170 $Fixed Turret Collisions: NO \n\
171  \n""\
172 ;; If not set, hits will damage nearest subsystem first, rather than the\n\
173 ;; impacted physical subsystem first. \n\
174 $Damage Impacted Subsystem First: NO \n\
175  \n\
176 ;; used when no ani is specified or ship_select_3d is active \n\
177 $Default ship select effect: FS2 \n\
178  \n\
179 ;; used when no ani is specified or weapon_select_3d is active \n\
180 $Default weapon select effect: FS2 \n\
181  \n\
182 ;; Enable weapons to inherit their parent object's collision group setting \n\
183 $Weapons inherit parent collision group: NO \n\
184  \n\
185 #END \n\
186 ";
187 
188 
190  \n\
191 #SPECIES DEFS \n\
192  \n\
193 ;------------------------ \n\
194 ; Terran \n\
195 ;------------------------ \n\
196 $Species_Name: Terran \n\
197 $Default IFF: Friendly \n\
198 $FRED Color: ( 0, 0, 192 ) \n\
199 $MiscAnims: \n\
200  +Debris_Texture: debris01a \n\
201  +Shield_Hit_ani: shieldhit01a \n\
202 $ThrustAnims: \n\
203  +Normal: thruster01 \n\
204  +Afterburn: thruster01a \n\
205 $ThrustGlows: \n\
206  +Normal: thrusterglow01 \n\
207  +Afterburn: thrusterglow01a \n\
208 $AwacsMultiplier: 1.00 \n\
209  \n\
210 ;------------------------ \n\
211 ; Vasudan \n\
212 ;------------------------ \n\
213 $Species_Name: Vasudan \n\
214 $Default IFF: Friendly \n\
215 $FRED Color: ( 0, 128, 0 ) \n\
216 $MiscAnims: \n\
217  +Debris_Texture: debris01b \n\
218  +Shield_Hit_ani: shieldhit01a \n\
219 $ThrustAnims: \n\
220  +Normal: thruster02 \n\
221  +Afterburn: thruster02a \n\
222 $ThrustGlows: \n\
223  +Normal: thrusterglow02 \n\
224  +Afterburn: thrusterglow02a \n\
225 $AwacsMultiplier: 1.25 \n\
226  \n\
227 ;------------------------ \n\
228 ; Shivan \n\
229 ;------------------------ \n\
230 $Species_Name: Shivan \n\
231 $Default IFF: Hostile \n\
232 $FRED Color: ( 192, 0, 0 ) \n\
233 $MiscAnims: \n\
234  +Debris_Texture: debris01c \n\
235  +Shield_Hit_ani: shieldhit01a \n\
236 $ThrustAnims: \n\
237  +Normal: thruster03 \n\
238  +Afterburn: thruster03a \n\
239 $ThrustGlows: \n\
240  +Normal: thrusterglow03 \n\
241  +Afterburn: thrusterglow03a \n\
242 $AwacsMultiplier: 1.50 \n\
243  \n\
244 #END \n\
245 ";
246 
247 //=========================================================================
248 
249 // This is the default table.
250 // Please note that the {\n\}s should be removed from the end of each line
251 // and the {\"}s should be replaced with {"}s if you intend to use this to
252 // format your own table.
253 
255  \n\
256 #IFFs \n\
257  \n\
258 ;; Every iff_defs.tbl must contain a Traitor entry. Traitors attack \n\
259 ;; one another (required by the dogfighting code) but it is up to you \n\
260 ;; to decide who attacks the traitor or whom else the traitor attacks. \n\
261 $Traitor IFF: Traitor \n\
262  \n\
263 ;------------------------ \n\
264 ; Friendly \n\
265 ;------------------------ \n\
266 $IFF Name: Friendly \n\
267 $Color: ( 0, 255, 0 ) \n\
268 $Attacks: ( \"Hostile\" \"Neutral\" \"Traitor\" ) \n\
269 $Flags: ( \"support allowed\" ) \n\
270 $Default Ship Flags: ( \"cargo-known\" ) \n\
271  \n\
272 ;------------------------ \n\
273 ; Hostile \n\
274 ;------------------------ \n\
275 $IFF Name: Hostile \n\
276 $Color: ( 255, 0, 0 ) \n\
277 $Attacks: ( \"Friendly\" \"Neutral\" \"Traitor\" ) \n\
278 +Sees Friendly As: ( 255, 0, 0 ) \n\
279 +Sees Hostile As: ( 0, 255, 0 ) \n\
280  \n\
281 ;------------------------ \n\
282 ; Neutral \n\
283 ;------------------------ \n\
284 $IFF Name: Neutral \n\
285 $Color: ( 255, 0, 0 ) \n\
286 $Attacks: ( \"Friendly\" \"Traitor\" ) \n\
287 +Sees Friendly As: ( 255, 0, 0 ) \n\
288 +Sees Hostile As: ( 0, 255, 0 ) \n\
289 +Sees Neutral As: ( 0, 255, 0 ) \n\
290  \n\
291 ;------------------------ \n\
292 ; Unknown \n\
293 ;------------------------ \n\
294 $IFF Name: Unknown \n\
295 $Color: ( 255, 0, 255 ) \n\
296 $Attacks: ( \"Hostile\" ) \n\
297 +Sees Neutral As: ( 0, 255, 0 ) \n\
298 +Sees Traitor As: ( 0, 255, 0 ) \n\
299 $Flags: ( \"exempt from all teams at war\" ) \n\
300  \n\
301 ;------------------------ \n\
302 ; Traitor \n\
303 ;------------------------ \n\
304 $IFF Name: Traitor \n\
305 $Color: ( 255, 0, 0 ) \n\
306 $Attacks: ( \"Friendly\" \"Hostile\" \"Neutral\" \"Traitor\" ) \n\
307 +Sees Friendly As: ( 255, 0, 0 ) \n\
308  \n\
309 #End \n\
310 ";
311 
312 //=========================================================================
313 
314 // This is the default table.
315 // Please note that the {\n\}s and {""\}s should be removed from the end of
316 // each line and the {\"}s should be replaced with {"}s if you intend to
317 // use this to format your own table.
318 
320  \n\
321 #Ship types \n\
322 ""\
323 $Name: Navbuoy \n\
324 $Max Debris Speed: 200 \n\
325 $FF Multiplier: 1.0 \n\
326 $EMP Multiplier: 10.0 \n\
327 $Fog: \n\
328  +Start dist: 10.0 \n\
329  +Compl dist: 500.0 \n\
330 $AI: \n\
331  +Actively Pursues: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
332  +Turrets attack this: YES \n\
333  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
334 $Vaporize Percent Chance: 0.0 \n\
335 ""\
336 $Name: Sentry Gun \n\
337 $Counts for Alone: YES \n\
338 $On Hotkey List: YES \n\
339 $Target as Threat: YES \n\
340 $Show Attack Direction: YES \n\
341 $Max Debris Speed: 200 \n\
342 $FF Multiplier: 0.10 \n\
343 $EMP Multiplier: 10.0 \n\
344 $Protected on cripple: YES \n\
345 $Fog: \n\
346  +Start dist: 10.0 \n\
347  +Compl dist: 500.0 \n\
348 $AI: \n\
349  +Accept Player Orders: NO \n\
350  +Auto attacks: YES \n\
351  +Actively Pursues: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
352  +Guards attack this: YES \n\
353  +Turrets attack this: YES \n\
354  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
355 $Vaporize Percent Chance: 0.0 \n\
356 ""\
357 $Name: Escape Pod \n\
358 $Praise Destruction: YES \n\
359 $On Hotkey List: YES \n\
360 $Warp Pushable: YES \n\
361 $Turrets prioritize ship target: YES \n\
362 $Max Debris Speed: 200 \n\
363 $FF Multiplier: 1.0 \n\
364 $EMP Multiplier: 10.0 \n\
365 $Protected on cripple: YES \n\
366 $Fog: \n\
367  +Start dist: 10.0 \n\
368  +Compl dist: 600.0 \n\
369 $AI: \n\
370  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"dock\" \"waypoints\" \"waypoints once\" \"depart\" \"undock\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
371  +Actively Pursues: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
372  +Turrets attack this: YES \n\
373  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
374 $Vaporize Percent Chance: 0.0 \n\
375 ""\
376 $Name: Cargo \n\
377 $Scannable: YES \n\
378 $Max Debris Speed: 200 \n\
379 $FF Multiplier: 0.10 \n\
380 $EMP Multiplier: 10.0 \n\
381 $Beams Easily Hit: YES \n\
382 $Protected on cripple: YES \n\
383 $Fog: \n\
384  +Start dist: 10.0 \n\
385  +Compl dist: 500.0 \n\
386 $AI: \n\
387  +Passive docks: ( \"cargo\" ) \n\
388 $Vaporize Percent Chance: 0.0 \n\
389 ""\
390 $Name: Support \n\
391 $Counts for Alone: YES \n\
392 $Praise Destruction: YES \n\
393 $On Hotkey List: YES \n\
394 $Target as Threat: YES \n\
395 $Show Attack Direction: YES \n\
396 $Warp Pushable: YES \n\
397 $Turrets prioritize ship target: YES \n\
398 $Max Debris Speed: 200 \n\
399 $FF Multiplier: 1.0 \n\
400 $EMP Multiplier: 3.5 \n\
401 $Protected on cripple: YES \n\
402 $Fog: \n\
403  +Start dist: 10.0 \n\
404  +Compl dist: 500.0 \n\
405 $AI: \n\
406  +Valid goals: ( \"fly to ship\" \"dock\" \"undock\" \"waypoints\" \"waypoints once\" \"stay near ship\" \"keep safe dist\" \"stay still\" \"play dead\" ) \n\
407  +Accept Player Orders: YES \n\
408  +Player orders: ( \"rearm me\" \"abort rearm\" \"depart\" ) \n\
409  +Auto attacks: YES \n\
410  +Actively Pursues: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
411  +Guards attack this: YES \n\
412  +Turrets attack this: YES \n\
413  +Active docks: ( \"support\" ) \n\
414  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
415 $Vaporize Percent Chance: 0.0 \n\
416 ""\
417 ;;WMC - Stealth ships always have another type, so this isn't used \n\
418 $Name: Stealth \n\
419 $Counts for Alone: YES \n\
420 $Praise Destruction: YES \n\
421 $On Hotkey List: YES \n\
422 $Target as Threat: YES \n\
423 $Show Attack Direction: YES \n\
424 $Max Debris Speed: 200 \n\
425 $FF Multiplier: 1.0 \n\
426 $EMP Multiplier: 4.0 \n\
427 $Protected on cripple: YES \n\
428 $Fog: \n\
429  +Start dist: 10.0 \n\
430  +Compl dist: 500.0 \n\
431 $AI: \n\
432  +Valid goals: ( \"fly to ship\" \"attack ship\" \"waypoints\" \"waypoints once\" \"depart\" \"attack subsys\" \"attack wing\" \"guard ship\" \"disable ship\" \"disarm ship\" \"attack any\" \"ignore ship\" \"ignore ship (new)\" \"guard wing\" \"evade ship\" \"stay still\" \"play dead\" \"stay near ship\" \"keep safe dist\" ) \n\
433  +Accept Player Orders: YES \n\
434  +Player Orders: ( \"attack ship\" \"disable ship\" \"disarm ship\" \"guard ship\" \"ignore ship\" \"ignore ship (new)\" \"form on wing\" \"cover me\" \"attack any\" \"depart\" \"disable subsys\" ) \n\
435  +Auto attacks: YES \n\
436  +Actively Pursues: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
437  +Guards attack this: YES \n\
438  +Turrets attack this: YES \n\
439  +Passive docks: ( \"support\" ) \n\
440  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
441 $Vaporize Percent Chance: 0.0 \n\
442 ""\
443 $Name: Fighter \n\
444 $Counts for Alone: YES \n\
445 $Praise Destruction: YES \n\
446 $On Hotkey List: YES \n\
447 $Target as Threat: YES \n\
448 $Show Attack Direction: YES \n\
449 $Warp Pushable: YES \n\
450 $Turrets prioritize ship target: YES \n\
451 $Max Debris Speed: 200 \n\
452 $FF Multiplier: 1.0 \n\
453 $EMP Multiplier: 4.0 \n\
454 $Protected on cripple: YES \n\
455 $Fog: \n\
456  +Start dist: 10.0 \n\
457  +Compl dist: 500.0 \n\
458 $AI: \n\
459  +Valid goals: ( \"fly to ship\" \"attack ship\" \"waypoints\" \"waypoints once\" \"depart\" \"attack subsys\" \"attack wing\" \"guard ship\" \"disable ship\" \"disarm ship\" \"attack any\" \"ignore ship\" \"ignore ship (new)\" \"guard wing\" \"evade ship\" \"stay still\" \"play dead\" \"stay near ship\" \"keep safe dist\" \"form on wing\") \n\
460  +Accept Player Orders: YES \n\
461  +Player Orders: ( \"attack ship\" \"disable ship\" \"disarm ship\" \"guard ship\" \"ignore ship\" \"ignore ship (new)\" \"form on wing\" \"cover me\" \"attack any\" \"depart\" \"disable subsys\" ) \n\
462  +Auto attacks: YES \n\
463  +Actively Pursues: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
464  +Guards attack this: YES \n\
465  +Turrets attack this: YES \n\
466  +Can Form Wing: YES \n\
467  +Passive docks: ( \"support\" ) \n\
468  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
469 $Vaporize Percent Chance: 0.0 \n\
470 ""\
471 $Name: Bomber \n\
472 $Counts for Alone: YES \n\
473 $Praise Destruction: YES \n\
474 $On Hotkey List: YES \n\
475 $Target as Threat: YES \n\
476 $Show Attack Direction: YES \n\
477 $Warp Pushable: YES \n\
478 $Turrets prioritize ship target: YES \n\
479 $Max Debris Speed: 200 \n\
480 $FF Multiplier: 1.0 \n\
481 $EMP Multiplier: 4.0 \n\
482 $Protected on cripple: YES \n\
483 $Fog: \n\
484  +Start dist: 10.0 \n\
485  +Compl dist: 500.0 \n\
486 $AI: \n\
487  +Valid goals: ( \"fly to ship\" \"attack ship\" \"waypoints\" \"waypoints once\" \"depart\" \"attack subsys\" \"attack wing\" \"guard ship\" \"disable ship\" \"disarm ship\" \"attack any\" \"ignore ship\" \"ignore ship (new)\" \"guard wing\" \"evade ship\" \"stay still\" \"play dead\" \"stay near ship\" \"keep safe dist\" \"form on wing\" ) \n\
488  +Accept Player Orders: YES \n\
489  +Player Orders: ( \"attack ship\" \"disable ship\" \"disarm ship\" \"guard ship\" \"ignore ship\" \"ignore ship (new)\" \"form on wing\" \"cover me\" \"attack any\" \"depart\" \"disable subsys\" ) \n\
490  +Auto attacks: YES \n\
491  +Actively Pursues: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
492  +Guards attack this: YES \n\
493  +Turrets attack this: YES \n\
494  +Can Form Wing: YES \n\
495  +Passive docks: ( \"support\" ) \n\
496  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
497 $Vaporize Percent Chance: 0.0 \n\
498 ""\
499 ;;WMC - This fighter/bomber type doesn't seem to be used anywhere, because no ship is set as both fighter and bomber \n\
500 $Name: Fighter/bomber \n\
501 $Counts for Alone: YES \n\
502 $Praise Destruction: YES \n\
503 $On Hotkey List: YES \n\
504 $Target as Threat: YES \n\
505 $Show Attack Direction: YES \n\
506 $Warp Pushable: YES \n\
507 $Max Debris Speed: 200 \n\
508 $FF Multiplier: 1.0 \n\
509 $EMP Multiplier: 4.0 \n\
510 $Protected on cripple: YES \n\
511 $Fog: \n\
512  +Start dist: 10.0 \n\
513  +Compl dist: 500.0 \n\
514 $AI: \n\
515  +Valid goals: ( \"fly to ship\" \"attack ship\" \"waypoints\" \"waypoints once\" \"depart\" \"attack subsys\" \"attack wing\" \"guard ship\" \"disable ship\" \"disarm ship\" \"attack any\" \"ignore ship\" \"ignore ship (new)\" \"guard wing\" \"evade ship\" \"stay still\" \"play dead\" \"stay near ship\" \"keep safe dist\" \"form on wing\" ) \n\
516  +Accept Player Orders: YES \n\
517  +Player Orders: ( \"attack ship\" \"disable ship\" \"disarm ship\" \"guard ship\" \"ignore ship\" \"ignore ship (new)\" \"form on wing\" \"cover me\" \"attack any\" \"depart\" \"disable subsys\" ) \n\
518  +Auto attacks: YES \n\
519  +Actively Pursues: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
520  +Guards attack this: YES \n\
521  +Turrets attack this: YES \n\
522  +Can Form Wing: YES \n\
523  +Passive docks: ( \"support\" ) \n\
524  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
525 $Vaporize Percent Chance: 0.0 \n\
526 ""\
527 $Name: Transport \n\
528 $Counts for Alone: YES \n\
529 $Praise Destruction: YES \n\
530 $On Hotkey List: YES \n\
531 $Target as Threat: YES \n\
532 $Show Attack Direction: YES \n\
533 $Max Debris Speed: 150 \n\
534 $FF Multiplier: 1.0 \n\
535 $EMP Multiplier: 2.0 \n\
536 $Beams Easily Hit: YES \n\
537 $Protected on cripple: YES \n\
538 $Fog: \n\
539  +Start dist: 10.0 \n\
540  +Compl dist: 500.0 \n\
541 $AI: \n\
542  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"dock\" \"waypoints\" \"waypoints once\" \"depart\" \"undock\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
543  +Accept Player Orders: YES \n\
544  +Player Orders: ( \"attack ship\" \"dock\" \"depart\" ) \n\
545  +Auto attacks: YES \n\
546  +Attempt Broadside: YES \n\
547  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
548  +Guards attack this: YES \n\
549  +Turrets attack this: YES \n\
550  +Can Form Wing: YES \n\
551  +Passive docks: ( \"support\" ) \n\
552  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
553 $Vaporize Percent Chance: 0.0 \n\
554 ""\
555 $Name: Freighter \n\
556 $Counts for Alone: YES \n\
557 $Praise Destruction: YES \n\
558 $On Hotkey List: YES \n\
559 $Target as Threat: YES \n\
560 $Show Attack Direction: YES \n\
561 $Scannable: YES \n\
562 $Max Debris Speed: 150 \n\
563 $FF Multiplier: 1.0 \n\
564 $EMP Multiplier: 1.75 \n\
565 $Beams Easily Hit: YES \n\
566 $Protected on cripple: YES \n\
567 $Fog: \n\
568  +Start dist: 10.0 \n\
569  +Compl dist: 600.0 \n\
570 $AI: \n\
571  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"dock\" \"waypoints\" \"waypoints once\" \"depart\" \"undock\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
572  +Accept Player Orders: YES \n\
573  +Player Orders: ( \"attack ship\" \"dock\" \"depart\" ) \n\
574  +Auto attacks: YES \n\
575  +Attempt Broadside: YES \n\
576  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
577  +Guards attack this: YES \n\
578  +Turrets attack this: YES \n\
579  +Can Form Wing: YES \n\
580  +Active docks: ( \"cargo\" ) \n\
581  +Passive docks: ( \"support\" ) \n\
582  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
583 $Vaporize Percent Chance: 0.0 \n\
584 ""\
585 $Name: AWACS \n\
586 $Counts for Alone: YES \n\
587 $Praise Destruction: YES \n\
588 $On Hotkey List: YES \n\
589 $Target as Threat: YES \n\
590 $Show Attack Direction: YES \n\
591 $Max Debris Speed: 150 \n\
592 $FF Multiplier: 1.0 \n\
593 $EMP Multiplier: 0.8 \n\
594 $Beams Easily Hit: YES \n\
595 $Protected on cripple: YES \n\
596 $Fog: \n\
597  +Start dist: 10.0 \n\
598  +Compl dist: 600.0 \n\
599 $AI: \n\
600  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"dock\" \"waypoints\" \"waypoints once\" \"depart\" \"undock\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
601  +Accept Player Orders: YES \n\
602  +Player Orders: ( \"attack ship\" \"depart\" ) \n\
603  +Auto attacks: YES \n\
604  +Attempt Broadside: YES \n\
605  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
606  +Guards attack this: YES \n\
607  +Turrets attack this: YES \n\
608  +Can Form Wing: YES \n\
609  +Passive docks: ( \"support\" ) \n\
610  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
611 $Vaporize Percent Chance: 0.0 \n\
612 ""\
613 $Name: Gas Miner \n\
614 $Counts for Alone: YES \n\
615 $Praise Destruction: YES \n\
616 $On Hotkey List: YES \n\
617 $Target as Threat: YES \n\
618 $Show Attack Direction: YES \n\
619 $Max Debris Speed: 150 \n\
620 $FF Multiplier: 1.0 \n\
621 $EMP Multiplier: 1.0 \n\
622 $Beams Easily Hit: YES \n\
623 $Protected on cripple: YES \n\
624 $Fog: \n\
625  +Start dist: 10.0 \n\
626  +Compl dist: 600.0 \n\
627 $AI: \n\
628  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"dock\" \"waypoints\" \"waypoints once\" \"depart\" \"undock\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
629  +Accept Player Orders: YES \n\
630  +Player Orders: ( \"attack ship\" \"depart\" ) \n\
631  +Auto attacks: YES \n\
632  +Attempt Broadside: YES \n\
633  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
634  +Guards attack this: YES \n\
635  +Turrets attack this: YES \n\
636  +Can Form Wing: YES \n\
637  +Passive docks: ( \"support\" ) \n\
638  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
639 $Vaporize Percent Chance: 0.0 \n\
640 ""\
641 $Name: Cruiser \n\
642 $Counts for Alone: YES \n\
643 $Praise Destruction: YES \n\
644 $On Hotkey List: YES \n\
645 $Target as Threat: YES \n\
646 $Show Attack Direction: YES \n\
647 $Max Debris Speed: 150 \n\
648 $FF Multiplier: 1.0 \n\
649 $EMP Multiplier: 0.9 \n\
650 $Beams Easily Hit: YES \n\
651 $Protected on cripple: YES \n\
652 $Fog: \n\
653  +Start dist: 10.0 \n\
654  +Compl dist: 600.0 \n\
655 $AI: \n\
656  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"dock\" \"waypoints\" \"waypoints once\" \"depart\" \"undock\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
657  +Accept Player Orders: YES \n\
658  +Player Orders: ( \"attack ship\" \"depart\" ) \n\
659  +Auto attacks: YES \n\
660  +Attempt Broadside: YES \n\
661  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
662  +Guards attack this: YES \n\
663  +Turrets attack this: YES \n\
664  +Can Form Wing: YES \n\
665  +Passive docks: ( \"support\" ) \n\
666  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
667 $Vaporize Percent Chance: 0.0 \n\
668 ""\
669 $Name: Corvette \n\
670 $Counts for Alone: YES \n\
671 $Praise Destruction: YES \n\
672 $On Hotkey List: YES \n\
673 $Target as Threat: YES \n\
674 $Show Attack Direction: YES \n\
675 $Max Debris Speed: 150 \n\
676 $FF Multiplier: 1.0 \n\
677 $EMP Multiplier: 0.3333 \n\
678 $Beams Easily Hit: YES \n\
679 $Protected on cripple: YES \n\
680 $Fog: \n\
681  +Start dist: 10.0 \n\
682  +Compl dist: 600.0 \n\
683 $AI: \n\
684  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"dock\" \"waypoints\" \"waypoints once\" \"depart\" \"undock\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
685  +Accept Player Orders: YES \n\
686  +Player Orders: ( \"attack ship\" \"depart\" ) \n\
687  +Auto attacks: YES \n\
688  +Attempt Broadside: YES \n\
689  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
690  +Guards attack this: YES \n\
691  +Turrets attack this: YES \n\
692  +Can Form Wing: YES \n\
693  +Passive docks: ( \"support\" ) \n\
694  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
695 $Vaporize Percent Chance: 0.0 \n\
696 ""\
697 $Name: Capital \n\
698 $Counts for Alone: YES \n\
699 $Praise Destruction: YES \n\
700 $On Hotkey List: YES \n\
701 $Target as Threat: YES \n\
702 $Show Attack Direction: YES \n\
703 $Warp Pushes: YES \n\
704 $Max Debris Speed: 100 \n\
705 $FF Multiplier: 1.0 \n\
706 $EMP Multiplier: 0.2 \n\
707 $Beams Easily Hit: YES \n\
708 $Protected on cripple: NO \n\
709 $Fog: \n\
710  +Start dist: 10.0 \n\
711  +Compl dist: 750.0 \n\
712 $AI: \n\
713  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"waypoints\" \"waypoints once\" \"depart\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
714  +Accept Player Orders: YES \n\
715  +Player Orders: ( \"depart\" ) \n\
716  +Auto attacks: YES \n\
717  +Attempt Broadside: YES \n\
718  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
719  +Guards attack this: YES \n\
720  +Turrets attack this: YES \n\
721  +Can Form Wing: YES \n\
722  +Passive docks: ( \"support\" ) \n\
723  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
724 $Vaporize Percent Chance: 0.0 \n\
725 ""\
726 $Name: Super Cap \n\
727 $Counts for Alone: YES \n\
728 $Praise Destruction: YES \n\
729 $On Hotkey List: YES \n\
730 $Target as Threat: YES \n\
731 $Show Attack Direction: YES \n\
732 $Warp Pushes: YES \n\
733 $Max Debris Speed: 100 \n\
734 $FF Multiplier: 1.0 \n\
735 $EMP Multiplier: 0.075 \n\
736 $Beams Easily Hit: YES \n\
737 $Protected on cripple: NO \n\
738 $Fog: \n\
739  +Start dist: 10.0 \n\
740  +Compl dist: 1000.0 \n\
741 $AI: \n\
742  +Valid goals: ( \"fly to ship\" \"attack ship\" \"attack wing\" \"waypoints\" \"waypoints once\" \"depart\" \"stay still\" \"play dead\" \"stay near ship\" ) \n\
743  +Auto attacks: YES \n\
744  +Attempt Broadside: YES \n\
745  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
746  +Guards attack this: YES \n\
747  +Turrets attack this: YES \n\
748  +Can Form Wing: YES \n\
749  +Passive docks: ( \"support\" ) \n\
750  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
751 $Vaporize Percent Chance: 0.0 \n\
752 ""\
753 $Name: Drydock \n\
754 $Counts for Alone: YES \n\
755 $Praise Destruction: YES \n\
756 $On Hotkey List: YES \n\
757 $Target as Threat: YES \n\
758 $Show Attack Direction: YES \n\
759 $Max Debris Speed: 100 \n\
760 $FF Multiplier: 1.0 \n\
761 $EMP Multiplier: 0.5 \n\
762 $Beams Easily Hit: YES \n\
763 $Protected on cripple: NO \n\
764 $Fog: \n\
765  +Start dist: 10.0 \n\
766  +Compl dist: 750.0 \n\
767 $AI: \n\
768  +Accept Player Orders: YES \n\
769  +Auto attacks: YES \n\
770  +Attempt Broadside: YES \n\
771  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
772  +Guards attack this: YES \n\
773  +Turrets attack this: YES \n\
774  +Passive docks: ( \"support\" ) \n\
775  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
776 $Vaporize Percent Chance: 0.0 \n\
777 ""\
778 $Name: Knossos Device \n\
779 $Counts for Alone: YES \n\
780 $Praise Destruction: YES \n\
781 $On Hotkey List: YES \n\
782 $Target as Threat: YES \n\
783 $Show Attack Direction: YES \n\
784 $Max Debris Speed: 100 \n\
785 $FF Multiplier: 1.0 \n\
786 $EMP Multiplier: 0.10 \n\
787 $Protected on cripple: NO \n\
788 $Fog: \n\
789  +Start dist: 10.0 \n\
790  +Compl dist: 1000.0 \n\
791 $AI: \n\
792  +Auto attacks: YES \n\
793  +Attempt Broadside: YES \n\
794  +Actively Pursues: ( \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
795  +Guards attack this: YES \n\
796  +Turrets attack this: YES \n\
797  +Passive docks: ( \"support\" ) \n\
798  +Ignored on cripple by: ( \"navbuoy\" \"sentry gun\" \"escape pod\" \"cargo\" \"support\" \"stealth\" \"fighter\" \"bomber\" \"fighter/bomber\" \"transport\" \"freighter\" \"awacs\" \"gas miner\" \"cruiser\" \"corvette\" \"capital\" \"super cap\" \"drydock\" \"knossos device\" ) \n\
799 $Vaporize Percent Chance: 0.0 \n\
800 ""\
801 #End \n\
802 ";
803 
804 //=========================================================================
805 
806 // This is the default table.
807 // Please note that the {\n\}s and {\n""\}s should be removed from the end
808 // of each line if you intend to use this to format your own table.
809 
811  \n\
812 ;; AI Profiles table. Incorporates stuff from the old difficulty.tbl \n\
813 ;; plus additional flags previously covered under the blanket New AI \n\
814 ;; flag. \n\
815 ;; \n\
816 ;; This is what the retail table would look like, but you don't have to \n\
817 ;; specify it as it's stored internally by the game. This leaves you \n\
818 ;; with four other slots to specify four other profiles. Every setting \n\
819 ;; is optional, so if you don't specify something it will inherit from \n\
820 ;; the FS2 retail setting. If you don't specify a default profile, it \n\
821 ;; will set the default to retail as well. \n\
822 ;; \n\
823  \n\
824 #AI Profiles \n\
825  \n\
826 $Default Profile: FS2 RETAIL \n\
827  \n\
828  \n\
829 $Profile Name: FS2 RETAIL \n\
830  \n\
831  \n\
832 ;; Difficulty-related values; much of this was originally in \n\
833 ;; difficulty.tbl. Each option specifies a list corresponding to the \n\
834 ;; five skill values (Very Easy, Easy, Medium, Hard, Insane). \n\
835  \n\
836  \n\
837 ;; speed of afterburner recharge \n\
838 $Player Afterburner Recharge Scale: 5, 3, 2, 1.5, 1 \n\
839  \n\
840 ;; maximum damage inflicted by friendly beam fire \n\
841 $Max Beam Friendly Fire Damage: 0, 5, 10, 20, 30 \n\
842  \n\
843 ;; factor applied to player countermeasure lifetime \n\
844 $Player Countermeasure Life Scale: 3, 2, 1.5, 1.25, 1 \n\
845  \n\
846 ;; chance a countermeasure will be fired by an AI-controlled ship \n\
847 ;; (this is scaled by ai_class) \n\
848 $AI Countermeasure Firing Chance: 0.2, 0.3, 0.5, 0.9, 1.1 \n\
849  \n\
850 ;; seconds to add to the time it takes for an enemy to come in range of \n\
851 ;; (i.e. target) a friendly ship \n\
852 $AI In Range Time: 2, 1.4, 0.75, 0, -1 \n\
853  \n""\
854 ;; AI ships will link ballistic primaries if ammo levels are greater \n\
855 ;; than these percents \n\
856 $AI Always Links Ammo Weapons: 95, 80, 60, 40, 20 \n\
857 $AI Maybe Links Ammo Weapons: 90, 60, 40, 20, 10 \n\
858  \n\
859 ;; Multiplier that modifies the length and frequency of bursts used \n\
860 ;; by the AI for ballistic primary weapons \n\
861 $Primary Ammo Burst Multiplier: 0, 0, 0, 0, 0 \n\
862  \n\
863 ;; AI ships will link laser primaries if energy levels are greater \n\
864 ;; than these percents \n\
865 $AI Always Links Energy Weapons: 100, 80, 60, 40, 20 \n\
866 $AI Maybe Links Energy Weapons: 90, 60, 40, 20, 10 \n\
867  \n\
868 ;; maximum number of missiles allowed to be homing in on a player at a \n\
869 ;; given time (single-player only; no restriction in multiplayer) \n\
870 $Max Missiles Locked on Player: 2, 3, 4, 7, 99 \n\
871  \n\
872 ;; maximum number of ships allowed to be attacking the player at a \n\
873 ;; given time (single-player only; no restriction in multiplayer) \n\
874 $Max Player Attackers: 2, 3, 4, 5, 99 \n\
875  \n\
876 ;; maximum number of active (i.e. 'thrown') asteroids that can be \n\
877 ;; heading toward a friendly ship at any given time \n\
878 $Max Incoming Asteroids: 3, 4, 5, 7, 10 \n\
879  \n\
880 ;; factor applied to damage suffered by the player \n\
881 $Player Damage Factor: 0.25, 0.5, 0.65, 0.85, 1 \n\
882  \n\
883 ;; factor applied to subsystem damage suffered by the player \n\
884 ;; (in addition to Player Damage Factor) \n\
885 $Player Subsys Damage Factor: 0.2, 0.4, 0.6, 0.8, 1 \n\
886  \n\
887 ;; measure of time (in F1_0 units) after which the AI will recalculate \n\
888 ;; the position of its target \n\
889 $Predict Position Delay: 2, 1.5, 1.333, 0.5, 0 \n\
890  \n\
891 ;; seconds between each instance of an AI ship managing its shields \n\
892 $AI Shield Manage Delay: 5, 4, 2.5, 1.2, 0.1 \n\
893  \n""\
894 ;; factor applied to 'fire wait' for friendly ships \n\
895 $Friendly AI Fire Delay Scale: 2, 1.4, 1.25, 1.1, 1 \n\
896  \n\
897 ;; factor applied to 'fire wait' for hostile ships \n\
898 $Hostile AI Fire Delay Scale: 4, 2.5, 1.75, 1.25, 1 \n\
899  \n\
900 ;; factor applied to 'fire wait' for secondaries of friendly ships \n\
901 $Friendly AI Secondary Fire Delay Scale: 0.4, 0.6, 0.8, 1.0, 1.2 \n\
902  \n\
903 ;; factor applied to 'fire wait' for secondaries of hostile ships \n\
904 $Hostile AI Secondary Fire Delay Scale: 1.4, 1.2, 1.0, 0.8, 0.6 \n\
905  \n\
906 ;; factor applied to time it takes for enemy ships to turn \n\
907 $AI Turn Time Scale: 3, 2.2, 1.6, 1.3, 1 \n\
908  \n\
909 ;; Percentage of the time where AI ships will use the glide attack \n\
910 ;; when it is an option. \n\
911 $Glide Attack Percent: 0, 0, 0, 0, 0 \n\
912  \n\
913 ;; Percentage of the time where AI ships will use circle strafe \n\
914 ;; when it is an option. \n\
915 $Circle Strafe Percent: 0, 0, 0, 0, 0 \n\
916  \n\
917 ;; Percentage of the time where AI ships will use glide to strafe \n\
918 ;; capital ships when it is an option. \n""\
919 $Glide Strafe Percent: 0, 0, 0, 0, 0 \n\
920  \n\
921 ;; Percentage of the time where AI ships will randomly sidethrust in a \n\
922 ;; dogfight. \n\
923 $Random Sidethrust Percent: 0, 0, 0, 0, 0 \n\
924  \n\
925 ;; The amount of time required for the AI to detect \n\
926 ;; (and try to break) dogfight stalemate. \n\
927 $Stalemate Time Threshold: 0, 0, 0, 0, 0 \n\
928  \n\
929 ;; The maximum distance the AI and target must be within \n\
930 ;; for a dogfight stalemate \n\
931 $Stalemate Distance Threshold: 0, 0, 0, 0, 0 \n\
932  \n\
933 ;; Sets the factor applied to the speed at which the player's shields \n\
934 ;; recharge \n\
935 $Player Shield Recharge Scale: 4, 2, 1.5, 1.25, 1 \n\
936  \n\
937 ;; factor applied to the speed at which the player's weapons recharge \n\
938 $Player Weapon Recharge Scale: 10, 4, 2.5, 2, 1.5 \n\
939  \n\
940 ;; maximum number of turrets on one ship allowed to be attacking a \n\
941 ;; target at a given time \n\
942 $Max Turret Target Ownage: 3, 4, 7, 12, 19 \n\
943  \n\
944 ;; maximum number of turrets on one ship allowed to be attacking the \n\
945 ;; player at a given time \n\
946 $Max Turret Player Ownage: 3, 4, 7, 12, 19 \n""\
947  \n\
948 ;; the minimum percentage of the total assessed damage a player \n\
949 ;; must inflict in order to be awarded a kill \n\
950 $Percentage Required For Kill Scale: 0.30, 0.30, 0.30, 0.30, 0.30 \n\
951  \n\
952 ;; the minimum percentage of the total assessed damage a player \n\
953 ;; must inflict in order to be awarded an assist \n\
954 $Percentage Required For Assist Scale: 0.15, 0.15, 0.15, 0.15, 0.15 \n\
955  \n\
956 ;; in TvT and Coop missions all teammates will be granted this \n\
957 ;; percentage of the capships score when someone scores a kill \n\
958 $Percentage Awarded For Capship Assist: 0.1, 0.2, 0.35, 0.5, 0.6 \n\
959  \n\
960 ;; the amount to subtract from the player's score if they are \n\
961 ;; repaired by a support ship \n\
962 $Repair Penalty: 10, 20, 35, 50, 60 \n\
963  \n\
964 ;; time delay after bombs have been fired before they can collide \n\
965 ;; with other weapons (ie. be shot down) \n\
966 $Delay Before Allowing Bombs to Be Shot Down: 1.5, 1.5, 1.5, 1.5, 1.5 \n\
967  \n\
968 ;; Chance AI has to fire missiles at player is (value + 1) / 7 in every \n\
969 ;; 10 second interval \n""\
970 $Chance AI Has to Fire Missiles at Player: 0, 1, 2, 3, 4 \n\
971  \n\
972 ;; The maximum amount of delay allowed before the AI will update its \n\
973 ;; aim. Applies for small ships vs small ships \n\
974 $Max Aim Update Delay: 0, 0, 0, 0, 0 \n\
975  \n\
976 ;; The maximum amount of delay allowed before turret AI will update its \n\
977 ;; aim. Applies for turrets vs small ships \n\
978 $Turret Max Aim Update Delay: 0, 0, 0, 0, 0 \n\
979  \n\
980 ;; Size of the player autoaim cone for each difficulty level \n\
981 ;; Only affects the player. If the ship has autoaim, the wider FOV value\n\
982 ;; will be used. Uses convergence. \n\
983 $Player Autoaim FOV: 0, 0, 0, 0, 0 \n\
984  \n\
985 ;; The multiplier that affects at what range LOD switching will occur. \n\
986 ;; NOTE THAT THIS IS NOT BY DIFFICULTY LEVEL (it's by model detail level\n\
987 ;; in the Options menu) \n\
988 $Detail Distance Multiplier: 0.125, 0.25, 1.0, 4.0, 8.0 \n\
989  \n\
990 ;; General AI-related flags. These were previously all lumped together \n\
991 ;; under the New AI mission flag. \n\
992  \n\
993  \n\
994 ;; if set, big ships can attack a beam turret that's firing on them \n\
995 ;; from a ship that they don't currently have targeted. \n\
996 $big ships can attack beam turrets on untargeted ships: NO \n\
997  \n\
998 ;; if set, enables the new primary weapon selection method \n\
999 $smart primary weapon selection: NO \n\
1000  \n\
1001 ;; if set, enables the new secondary weapon selection method (including \n\
1002 ;; proper use of bomber+ missiles) \n\
1003 $smart secondary weapon selection: NO \n\
1004  \n\
1005 ;; if set, shields will devote all their charging energy to the weakest \n\
1006 ;; quadrant(s) and not waste energy on fully-charged quadrants \n\
1007 ;; (previously was -smart_shields on the command line) \n\
1008 $smart shield management: NO \n\
1009  \n""\
1010 ;; if set, the AI will properly use brief pulses of afterburner power \n\
1011 ;; instead of afterburning until fuel is exhausted \n\
1012 $smart afterburner management: NO \n\
1013  \n\
1014 ;; if set, allows an AI ship to switch to rapid fire for dumbfire \n\
1015 ;; missiles \n\
1016 $allow rapid secondary dumbfire: NO \n\
1017  \n\
1018 ;; if set, causes huge turret weapons (including anti-capship beams) to \n\
1019 ;; not target bombs \n\
1020 $huge turret weapons ignore bombs: NO \n\
1021  \n\
1022 ;; if set, removes the random turret fire delay (from .1 to .9 seconds) \n\
1023 ;; inserted in addition to AI Fire Delay Scale \n\
1024 $don't insert random turret fire delay: NO \n\
1025  \n\
1026 ;; if set, triggers a hack to improves the accuracy of non-homing swarm \n\
1027 ;; missiles by firing them along the turret's last fire direction \n\
1028 ;; rather than the direction it currently faces \n\
1029 $hack improve non-homing swarm turret fire accuracy: NO \n\
1030  \n\
1031 ;; if set, shockwaves will cause damage to small ship subsystems \n\
1032 ;; (like in FS1) \n\
1033 $shockwaves damage small ship subsystems: NO \n\
1034  \n\
1035 ;; if set, ships will not be able to engage their jump drive if their \n\
1036 ;; navigation subsystem is damaged or destroyed \n\
1037 $navigation subsystem governs warpout capability: NO \n\
1038  \n\
1039 ;; if set, will not use a minimum speed limit for docked ships \n""\
1040 ;; (like in FS1) \n\
1041 $ignore lower bound for minimum speed of docked ship: NO \n\
1042  \n\
1043 ;; if set, will remove the increased delay when weapons are linked \n\
1044 $disable linked fire penalty: NO \n\
1045  \n\
1046 ;; if set, will not scale weapon damage according to capital/supercap \n\
1047 ;; (like in FS1) \n\
1048 $disable weapon damage scaling: NO \n\
1049  \n\
1050 ;; if set, will add the weapon velocity to the firing ship's velocity \n\
1051 $use additive weapon velocity: NO \n\
1052  \n\
1053 ;; if set, will dampening closer to real newtonian physics \n\
1054 $use newtonian dampening: NO \n\
1055  \n\
1056 ;; if set, beam damage is counted when calculating kills and assists \n\
1057 $include beams for kills and assists: NO \n\
1058  \n\
1059 ;; if set, kills gain score based on the percentage damage the killer \n\
1060 ;; inflicted on the dead ship \n\
1061 $score kills based on damage caused: NO \n\
1062  \n\
1063 ;; if set, kills gain score based on the percentage damage the player \n\
1064 ;; gaining the assist inflicted on the dead ship \n\
1065 $score assists based on damage caused: NO \n\
1066  \n\
1067 ;; if set, players (rather than just their team) can gain score from \n\
1068 ;; events in multiplayer \n\
1069 $allow event and goal scoring in multiplayer: NO \n\
1070  \n\
1071 ;; if set, the AI will properly link primaries according to \n\
1072 ;; specified percentages of energy levels, instead of retail behavior \n\
1073 ;; where it mistakenly linked according to absolute energy levels \n\
1074 $fix linked primary weapon decision bug: NO \n\
1075  \n\
1076 ;; if set, prevents turrets from targeting bombs beyond maximum \n\
1077 ;; range of the weapons of the turret \n\
1078 $prevent turrets targeting too distant bombs: NO \n\
1079  \n""\
1080 ;; if set, prevents turrets from trying to target subsystems beyond \n\
1081 ;; their fov limits, also keeps the turret subsystem targeting \n\
1082 ;; preference order intact regardless of the angle to the target \n\
1083 $smart subsystem targeting for turrets: NO \n\
1084  \n\
1085 ;; if set, heat-seeking missiles will not home in on stealth ships \n\
1086 ;; (this mirrors the established behavior where heat-seeking missiles \n\
1087 ;; do not home in on ships that are hidden from sensors) \n\
1088 $fix heat seekers homing on stealth ships bug: NO \n\
1089  \n\
1090 ;; allow a player to commit into a multiplayer game without primaries \n\
1091 $multi allow empty primaries: NO \n\
1092  \n\
1093 ;; allow a player to commit into a multiplayer game without secondaries \n\
1094 $multi allow empty secondaries: NO \n\
1095  \n\
1096 ;; if set, allows turrets target other weapons than bombs assuming \n\
1097 ;; it is within allowed target priorities \n\
1098 $allow turrets target weapons freely: NO \n\
1099  \n\
1100 ;; if set forces turrets to use only the set turret fov limits and \n\
1101 ;; ignore hard coded limits (with 'fire_down_normals' flag) \n\
1102 $use only single fov for turrets: NO \n\
1103  \n\
1104 ;; allow AI ships to dodge weapons vertically as well as horizontally \n\
1105 $allow vertical dodge: NO \n\
1106  \n""\
1107 ;; If set makes beam turrets use same FOV rules as other weapons do. \n\
1108 ;; Prevents beam from a turret from following the target beyond the \n\
1109 ;; turret's FOV. \n\
1110 $force beam turrets to use normal fov: NO \n\
1111  \n\
1112 ;; Fixes a bug where AI class is not properly set if set in the mission \n\
1113 ;; This should be YES if you want anything in AI.tbl to mean anything \n\
1114 $fix AI class bug: NO \n\
1115  \n\
1116 ;; TBD \n\
1117 $turrets ignore targets radius in range checks: NO \n\
1118  \n\
1119 ;; If set, the AI will NOT make extra effort to avoid ramming the player\n\
1120 ;; during dogfights. This results in more aggressive AI. \n\
1121 $no extra collision avoidance vs player: NO \n\
1122  \n\
1123 ;; If set, the game will not check if the dying ship is a player's \n\
1124 ;; wingman, or if the maximum number of screams have been played, or \n\
1125 ;; even if the dying ship is on the player's team before making it give \n\
1126 ;; a death scream \n\
1127 $perform fewer checks for death screams: NO \n\
1128  \n\
1129 ;; TBD \n\
1130 $advanced turret fov edge checks: NO \n\
1131  \n\
1132 ;; TBD \n\
1133 $require turrets to have target in fov: NO \n\
1134  \n\
1135 ;; If set, allows shield management for all ships \n\
1136 ;; (including capships). \n\
1137 $all ships manage shields: NO \n\
1138  \n\
1139 ;; If set, ai aims using ship center instead of first gunpoint \n\
1140 $ai aims from ship center: NO \n\
1141  \n\
1142 ;; If set, allows AI fighters to link their weapons at the beginning of \n\
1143 ;; a mission instead of imposing a delay of 30s to 120s \n\
1144 $allow primary link at mission start: NO \n\
1145  \n\
1146 ;; If set, prevents beams from instantly killing all weapons from first \n\
1147 ;; hit, instead allows weapon hitpoints to be used instead \n\
1148 $allow beams to damage bombs: NO \n\
1149  \n\
1150 ;; TBD \n\
1151 $disable weapon damage scaling for player: NO \n""\
1152  \n\
1153 ;; TBD \n\
1154 $countermeasures affect aspect seekers: NO \n\
1155  \n\
1156 ;; TBD \n\
1157 $ai path mode: normal \n\
1158  \n\
1159 ;; TBD \n\
1160 $no warp camera: NO \n\
1161  \n\
1162 ;; If set, this flag overrides the retail behavior whereby a ship \n\
1163 ;; assigned to guard a ship in a wing will instead guard the entire wing\n\
1164 $ai guards specific ship in wing: NO \n\
1165  \n\
1166 #End \n\
1167 ";
1168 
1169 //=========================================================================
1170 
1171 // This is the default table.
1172 // Please note that the {\n\}s should be removed from the end of each line
1173 // if you intend to use this to format your own table.
1174 
1176 #Autopilot \n\
1177  \n\
1178 $Link Distance: 1000 \n\
1179  \n\
1180 $No Nav Selected: \n\
1181  +Msg: Cannot engage autopilot, no navpoint selected. \n\
1182  +Snd File: none \n\
1183 $Gliding: \n\
1184  +Msg: Cannot engage autopilot while gliding. \n\
1185  +Snd File: none \n\
1186 $Too Close: \n\
1187  +Msg: Cannot engage autopilot: waypoint too close. \n\
1188  +Snd File: none \n\
1189 $Hostiles: \n\
1190  +Msg: Cannot engage autopilot: hostile craft near. \n\
1191  +Snd File: none \n\
1192 $Linked: \n\
1193  +Msg: Autopilot Linked \n\
1194  +Snd File: none \n\
1195 $Hazard: \n\
1196  +Msg: Cannot engage autopilot: Hazard Near \n\
1197  +Snd File: none \n\
1198 $Support Present: \n\
1199  +Msg: Cannot engage autopilot: Support Ship Present \n\
1200  +Snd File: none \n\
1201 $Support Working: \n\
1202  +Msg: Cannot engage autopilot: Support Ship is rearming or repairing a ship \n\
1203  +Snd File: none \n\
1204  \n\
1205 #END \n\
1206 ";
1207 
1208 //=========================================================================
1209 
1210 // This is the default table.
1211 // Please note that the {\n\}s should be removed from the end of each line
1212 // if you intend to use this to format your own table.
1213 
1215 #Fonts \n\
1216  \n\
1217 $Font: font01.vf \n\
1218 $Font: font02.vf \n\
1219 $Font: font03.vf \n\
1220  \n\
1221 #End \n\
1222 ";
1223 
1224 //=========================================================================
1225 
1226 // This is the default table.
1227 // Please note that the {\n\}s should be removed from the end of each line
1228 // if you intend to use this to format your own table.
1229 
1231  #ControlConfigOverride \n\
1232  \
1233  #End\n\
1234  ";
1235 
1236 
1237 //=========================================================================
1238 
1239 // This is the default table.
1240 // Please note that the {\n\}s should be removed from the end of each line
1241 // if you intend to use this to format your own table.
1242 
1244 #Effects \n\
1245  \n\
1246 $Name: distort noise \n\
1247 $Uniform: noise_amount \n\
1248 $Define: FLAG_DISTORT_NOISE \n\
1249 $AlwaysOn: false \n\
1250 $Default: 0.0 \n\
1251 $Div: 20000 \n\
1252 $Add: 0 \n\
1253  \n\
1254 $Name: saturation \n\
1255 $Uniform: saturation \n\
1256 $Define: FLAG_SATURATION \n\
1257 $AlwaysOn: false \n\
1258 $Default: 0.9 \n\
1259 $Div: 50 \n\
1260 $Add: 0 \n\
1261  \n\
1262 $Name: brightness \n\
1263 $Uniform: brightness \n\
1264 $Define: FLAG_BRIGHTNESS \n\
1265 $AlwaysOn: false \n\
1266 $Default: 1.11 \n\
1267 $Div: 50 \n\
1268 $Add: 0 \n\
1269  \n\
1270 $Name: contrast \n\
1271 $Uniform: contrast \n\
1272 $Define: FLAG_CONTRAST \n\
1273 $AlwaysOn: false \n\
1274 $Default: 1.015 \n\
1275 $Div: 50 \n\
1276 $Add: 0 \n\
1277  \n\
1278 $Name: film grain \n\
1279 $Uniform: film_grain \n\
1280 $Define: FLAG_GRAIN \n\
1281 $AlwaysOn: false \n\
1282 $Default: 0.1 \n\
1283 $Div: 50 \n\
1284 $Add: 0 \n\
1285  \n\
1286 $Name: stripes \n\
1287 $Uniform: tv_stripes \n\
1288 $Define: FLAG_STRIPES \n\
1289 $AlwaysOn: false \n\
1290 $Default: 0.0 \n\
1291 $Div: 50 \n\
1292 $Add: 0 \n\
1293  \n\
1294 $Name: cutoff \n\
1295 $Uniform: cutoff \n\
1296 $Define: FLAG_CUTOFF \n\
1297 $AlwaysOn: false \n\
1298 $Default: 2.0 \n\
1299 $Div: 50 \n\
1300 $Add: 0.0 \n\
1301  \n\
1302 $Name: dithering \n\
1303 $Uniform: dither \n\
1304 $Define: FLAG_DITH \n\
1305 $AlwaysOn: false \n\
1306 $Default: 0.0 \n\
1307 $Div: 50 \n\
1308 $Add: 0 \n\
1309  \n\
1310 #End \n\
1311 ";
1312 
1313 //===========================================================
1314 // DEFAULT SHADERS
1315 //===========================================================
1316 
1318 "#ifdef APPLE\n"
1319 " #extension GL_ARB_draw_instanced : enable\n"
1320 "#else\n"
1321 " #ifdef __GLSL_CG_DATA_TYPES\n"
1322 " #extension GL_EXT_draw_instanced : enable\n"
1323 " #else\n"
1324 " #extension GL_ARB_draw_instanced : enable\n"
1325 " #endif\n"
1326 "#endif\n"
1327 "#ifdef FLAG_ENV_MAP\n"
1328 "uniform mat4 envMatrix;\n"
1329 "varying vec3 envReflect;\n"
1330 "#endif\n"
1331 "#ifdef FLAG_NORMAL_MAP\n"
1332 "varying mat3 tbnMatrix;\n"
1333 "#endif\n"
1334 "#ifdef FLAG_FOG\n"
1335 "varying float fogDist;\n"
1336 "#endif\n"
1337 "#ifdef FLAG_TRANSFORM\n"
1338 "#extension GL_ARB_texture_buffer_object : enable\n"
1339 "attribute float model_id;\n"
1340 "uniform samplerBuffer transform_tex;\n"
1341 "uniform int buffer_matrix_offset;\n"
1342  "#ifdef FLAG_SHADOW_MAP\n"
1343 "varying float not_visible_g;\n"
1344  "#else\n"
1345 "varying float not_visible;\n"
1346  "#endif\n"
1347 "#endif\n"
1348 "#ifdef FLAG_SHADOW_MAP\n"
1349 "varying float Instance;\n"
1350 "uniform mat4 shadow_proj_matrix[4];\n"
1351 "#endif\n"
1352 "#ifdef FLAG_SHADOWS\n"
1353 "uniform mat4 shadow_mv_matrix;\n"
1354 "uniform mat4 shadow_proj_matrix[4];\n"
1355 "uniform mat4 model_matrix;\n"
1356 "varying vec4 shadow_vec[4];\n"
1357 "varying vec4 pos_shadow;\n"
1358 "#endif\n"
1359 "#ifdef FLAG_THRUSTER\n"
1360 "uniform float thruster_scale;\n"
1361 "#endif\n"
1362 "#ifdef FLAG_CLIP\n"
1363 "uniform int use_clip_plane;\n"
1364 "uniform vec3 clip_normal;\n"
1365 "uniform vec3 clip_position;\n"
1366 "//uniform vec4 clip_plane;\n"
1367 "uniform mat4 world_matrix;\n"
1368 "#ifdef FLAG_SHADOW_MAP\n"
1369 "varying float clip_distance_g;\n"
1370 "#else\n"
1371 "varying float clip_distance;\n"
1372 "#endif\n"
1373 "#endif\n"
1374 "varying vec4 position;\n"
1375 "varying vec3 lNormal;\n"
1376 "#ifdef FLAG_TRANSFORM\n"
1377 "#define TEXELS_PER_MATRIX 4\n"
1378 "void getModelTransform(inout mat4 transform, inout float invisible, int id, int matrix_offset)\n"
1379 "{\n"
1380 " transform[0] = texelFetch(transform_tex, (matrix_offset + id) * TEXELS_PER_MATRIX);\n"
1381 " transform[1] = texelFetch(transform_tex, (matrix_offset + id) * TEXELS_PER_MATRIX + 1);\n"
1382 " transform[2] = texelFetch(transform_tex, (matrix_offset + id) * TEXELS_PER_MATRIX + 2);\n"
1383 " transform[3] = texelFetch(transform_tex, (matrix_offset + id) * TEXELS_PER_MATRIX + 3);\n"
1384 " invisible = transform[3].w;\n"
1385 " transform[3].w = 1.0;\n"
1386 "}\n"
1387 "#endif\n"
1388 "#ifdef FLAG_SHADOWS\n"
1389 "vec4 transformToShadowMap(int i, vec4 pos)\n"
1390 "{\n"
1391 " vec4 shadow_proj;\n"
1392 " shadow_proj = shadow_proj_matrix[i] * pos;\n"
1393 " shadow_proj += 1.0;\n"
1394 " shadow_proj *= 0.5;\n"
1395 " shadow_proj.w = shadow_proj.z;\n"
1396 " shadow_proj.z = float(i);\n"
1397 " return shadow_proj;\n"
1398 "}\n"
1399 "#endif\n"
1400 "void main()\n"
1401 "{\n"
1402 " mat4 orient = mat4(1.0);\n"
1403 " mat4 scale = mat4(1.0);\n"
1404 " #ifdef FLAG_TRANSFORM\n"
1405 " float invisible;"
1406 " getModelTransform(orient, invisible, int(model_id), buffer_matrix_offset);\n"
1407 " #ifdef FLAG_SHADOW_MAP\n"
1408 " not_visible_g = invisible;\n"
1409 " #else\n"
1410 " not_visible = invisible;\n"
1411 " #endif\n"
1412 " #endif\n"
1413 " gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;\n"
1414 " vec4 vertex = gl_Vertex;\n"
1415 " #ifdef FLAG_THRUSTER\n"
1416 " if(vertex.z < -1.5) {\n"
1417 " vertex.z *= thruster_scale;\n"
1418 " }\n"
1419 " #endif\n"
1420 " position = gl_ModelViewMatrix * orient * vertex;\n"
1421 " #ifdef FLAG_SHADOW_MAP\n"
1422 " gl_Position = position;\n"
1423 " #ifdef APPLE\n"
1424 " Instance = float(gl_InstanceIDARB);\n"
1425 " #else\n"
1426 " Instance = float(gl_InstanceID);\n"
1427 " #endif\n"
1428 " #else\n"
1429 " gl_Position = gl_ProjectionMatrix * position;\n"
1430 " #endif\n"
1431 " gl_FrontColor = gl_Color;\n"
1432 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
1433 " // Transform the normal into eye space and normalize the result.\n"
1434 " vec3 normal = normalize(gl_NormalMatrix * mat3(orient) * gl_Normal);\n"
1435 " lNormal = normal;\n"
1436 " #ifdef FLAG_SHADOWS\n"
1437 " pos_shadow = shadow_mv_matrix * model_matrix * orient * gl_Vertex;\n"
1438 " shadow_vec[0] = transformToShadowMap(0, pos_shadow);\n"
1439 " shadow_vec[1] = transformToShadowMap(1, pos_shadow);\n"
1440 " shadow_vec[2] = transformToShadowMap(2, pos_shadow);\n"
1441 " shadow_vec[3] = transformToShadowMap(3, pos_shadow);\n"
1442 " #endif\n"
1443 " #ifdef FLAG_NORMAL_MAP\n"
1444 " // Setup stuff for normal maps\n"
1445 " vec3 t = normalize(gl_NormalMatrix * mat3(orient) * gl_MultiTexCoord1.xyz);\n"
1446 " vec3 b = cross(normal, t) * gl_MultiTexCoord1.w;\n"
1447 " tbnMatrix = mat3(t, b, normal);\n"
1448 " #endif\n"
1449 " #ifdef FLAG_ENV_MAP\n"
1450 " // Environment mapping reflection vector.\n"
1451 " envReflect = reflect(normalize(position.xyz), normal);\n"
1452 " envReflect = vec3(envMatrix * vec4(envReflect, 0.0));\n"
1453 " envReflect = normalize(envReflect);\n"
1454 " #endif\n"
1455 " #ifdef FLAG_FOG\n"
1456 " fogDist = clamp((gl_Position.z - gl_Fog.start) * 0.75 * gl_Fog.scale, 0.0, 1.0);\n"
1457 " #endif\n"
1458 " #ifdef FLAG_CLIP\n"
1459 " float clip_dist = 0.0;\n"
1460 " if(use_clip_plane == 1) clip_dist = dot(normalize((world_matrix*orient*vertex).xyz - clip_position), clip_normal);\n"
1461 " #ifdef FLAG_SHADOW_MAP\n"
1462 " clip_distance_g = clip_dist;\n"
1463 " #else\n"
1464 " clip_distance = clip_dist;\n"
1465 " #endif\n"
1466 " #endif\n"
1467 " gl_ClipVertex = (gl_ModelViewMatrix * orient * vertex);\n"
1468 "}";
1469 
1471 "#extension GL_EXT_texture_array : enable\n"
1472 "#ifdef FLAG_LIGHT\n"
1473 "uniform int n_lights;\n"
1474 "uniform float light_factor;\n"
1475 "#endif\n"
1476 "#ifdef FLAG_DIFFUSE_MAP\n"
1477 "uniform sampler2D sBasemap;\n"
1478 "uniform int desaturate;\n"
1479 "uniform vec3 desaturate_clr;\n"
1480 "uniform int blend_alpha;\n"
1481 "#endif\n"
1482 "#ifdef FLAG_GLOW_MAP\n"
1483 "uniform sampler2D sGlowmap;\n"
1484 "#endif\n"
1485 "#ifdef FLAG_SPEC_MAP\n"
1486 "uniform sampler2D sSpecmap;\n"
1487 "#endif\n"
1488 "#ifdef FLAG_ENV_MAP\n"
1489 "uniform samplerCube sEnvmap;\n"
1490 "uniform bool alpha_spec;\n"
1491 "varying vec3 envReflect;\n"
1492 "#endif\n"
1493 "#ifdef FLAG_NORMAL_MAP\n"
1494 "uniform sampler2D sNormalmap;\n"
1495 "varying mat3 tbnMatrix;\n"
1496 "#endif\n"
1497 "#ifdef FLAG_FOG\n"
1498 "varying float fogDist;\n"
1499 "#endif\n"
1500 "#ifdef FLAG_ANIMATED\n"
1501 "uniform sampler2D sFramebuffer;\n"
1502 "uniform int effect_num;\n"
1503 "uniform float anim_timer;\n"
1504 "uniform float vpwidth;\n"
1505 "uniform float vpheight;\n"
1506 "#endif\n"
1507 "#ifdef FLAG_TRANSFORM\n"
1508 "varying float not_visible;\n"
1509 "#endif\n"
1510 "#ifdef FLAG_TEAMCOLOR\n"
1511 "uniform vec3 base_color;\n"
1512 "uniform vec3 stripe_color;\n"
1513 "uniform bool team_glow_enabled;\n"
1514 "vec2 teamMask = vec2(0.0, 0.0);\n"
1515 "#endif\n"
1516 "#ifdef FLAG_MISC_MAP\n"
1517 "uniform sampler2D sMiscmap;\n"
1518 "#endif\n"
1519 "#ifdef FLAG_SHADOWS\n"
1520 "varying vec4 shadow_vec[4];\n"
1521 "varying vec4 pos_shadow;\n"
1522 "//uniform sampler2DArrayShadow shadow_map;\n"
1523 "uniform sampler2DArray shadow_map;\n"
1524 "//uniform sampler2D shadow_map;\n"
1525 "uniform float znear;\n"
1526 "uniform float zfar;\n"
1527 "uniform float veryneardist;\n"
1528 "uniform float neardist;\n"
1529 "uniform float middist;\n"
1530 "uniform float fardist;\n"
1531 "#endif\n"
1532 "#ifdef FLAG_CLIP\n"
1533 "uniform int use_clip_plane;\n"
1534 "varying float clip_distance;\n"
1535 "#endif\n"
1536 "varying vec4 position;\n"
1537 "varying vec3 lNormal;\n"
1538 "\n"
1539 "#if __VERSION__ == 120\n"
1540 " #define MAX_LIGHTS 2\n"
1541 "#else\n"
1542 " #define MAX_LIGHTS 8\n"
1543 "#endif\n"
1544 "#define SPEC_INTENSITY_POINT 5.3 // Point light\n"
1545 "#define SPEC_INTENSITY_DIRECTIONAL 3.0 // Directional light\n"
1546 "#define SPECULAR_FACTOR 1.75\n"
1547 "#define SPECULAR_ALPHA 0.1\n"
1548 "#define SPEC_FACTOR_NO_SPEC_MAP 0.6\n"
1549 "#define ENV_ALPHA_FACTOR 0.3\n"
1550 "#define GLOW_MAP_INTENSITY 1.5\n"
1551 "#define AMBIENT_LIGHT_BOOST 1.0\n"
1552 "#define VARIANCE_SHADOW_SCALE 1000000.0\n"
1553 "#define VARIANCE_SHADOW_SCALE_INV 1.0/VARIANCE_SHADOW_SCALE\n"
1554 "\n"
1555 "#ifdef FLAG_SHADOWS\n"
1556 "vec2 sampleShadowMap(vec2 uv, vec2 offset_uv, int cascade, float shadowMapSizeInv)\n"
1557 "{\n"
1558 " return texture2DArray(shadow_map, vec3(uv + offset_uv * shadowMapSizeInv, float(cascade))).xy;\n"
1559 "}\n"
1560 "\n"
1561 "float computeShadowFactor(vec2 moments, float bias)\n"
1562 "{\n"
1563 " float shadow = 1.0;\n"
1564 " if((moments.x - bias) > pos_shadow.z)\n"
1565 " {\n"
1566 " // variance shadow mapping using Chebychev's Formula\n"
1567 " float variance = moments.y * VARIANCE_SHADOW_SCALE - moments.x * moments.x;\n"
1568 " float mD = moments.x - bias - pos_shadow.z;\n"
1569 " shadow = variance / (variance + mD * mD);\n"
1570 " shadow = clamp(shadow, 0.0, 1.0);\n"
1571 " }\n"
1572 " return shadow;\n"
1573 "}\n"
1574 "\n"
1575 "float sampleNoPCF(int cascade)\n"
1576 "{\n"
1577 " return computeShadowFactor(sampleShadowMap(shadow_vec[cascade].xy, vec2(0.0, 0.0), cascade, 1.0/1024.0), 0.05);\n"
1578 "}\n"
1579 "\n"
1580 "float samplePoissonPCF(int cascade)\n"
1581 "{\n"
1582 " if(cascade > 3 || cascade < 0) return 1.0;\n"
1583 " vec2 poissonDisc[16];\n"
1584 " poissonDisc[0] = vec2(-0.76275, -0.3432573);\n"
1585 " poissonDisc[1] = vec2(-0.5226235, -0.8277544);\n"
1586 " poissonDisc[2] = vec2(-0.3780261, 0.01528688);\n"
1587 " poissonDisc[3] = vec2(-0.7742821, 0.4245702);\n"
1588 " poissonDisc[4] = vec2(0.04196143, -0.02622231);\n"
1589 " poissonDisc[5] = vec2(-0.2974772, -0.4722782);\n"
1590 " poissonDisc[6] = vec2(-0.516093, 0.71495);\n"
1591 " poissonDisc[7] = vec2(-0.3257416, 0.3910343);\n"
1592 " poissonDisc[8] = vec2(0.2705966, 0.6670476);\n"
1593 " poissonDisc[9] = vec2(0.4918377, 0.1853267);\n"
1594 " poissonDisc[10] = vec2(0.4428544, -0.6251478);\n"
1595 " poissonDisc[11] = vec2(-0.09204347, 0.9267113);\n"
1596 " poissonDisc[12] = vec2(0.391505, -0.2558275);\n"
1597 " poissonDisc[13] = vec2(0.05605913, -0.7570801);\n"
1598 " poissonDisc[14] = vec2(0.81772, -0.02475523);\n"
1599 " poissonDisc[15] = vec2(0.6890262, 0.5191521);\n"
1600 " float maxUVOffset[4];\n"
1601 " maxUVOffset[0] = 1.0/300.0;\n"
1602 " maxUVOffset[1] = 1.0/250.0;\n"
1603 " maxUVOffset[2] = 1.0/200.0;\n"
1604 " maxUVOffset[3] = 1.0/200.0;\n"
1605 " vec2 sum = sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[0], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1606 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[1], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1607 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[2], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1608 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[3], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1609 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[4], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1610 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[5], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1611 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[6], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1612 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[7], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1613 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[8], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1614 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[9], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1615 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[10], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1616 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[11], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1617 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[12], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1618 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[13], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1619 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[14], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1620 " sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[15], cascade, maxUVOffset[cascade])*(1.0/16.0);\n"
1621 " return computeShadowFactor(sum, 0.1);\n"
1622 "}\n"
1623 "float getShadowValue()\n"
1624 "{\n"
1625 " // Valathil's Shadows\n"
1626 " float depth = -position.z;\n"
1627 " int cascade = 4;\n"
1628 " cascade -= int(step(depth, fardist));\n"
1629 " cascade -= int(step(depth, middist));\n"
1630 " cascade -= int(step(depth, neardist));\n"
1631 " cascade -= int(step(depth, veryneardist));\n"
1632 " float cascade_start_dist[5];\n"
1633 " cascade_start_dist[0] = 0.0;\n"
1634 " cascade_start_dist[1] = veryneardist;\n"
1635 " cascade_start_dist[2] = neardist;\n"
1636 " cascade_start_dist[3] = middist;\n"
1637 " cascade_start_dist[4] = fardist;\n"
1638 " if(cascade > 3 || cascade < 0) return 1.0;\n"
1639 " float dist_threshold = (cascade_start_dist[cascade+1] - cascade_start_dist[cascade])*0.2;\n"
1640 " if(cascade_start_dist[cascade+1] - dist_threshold > depth)\n"
1641 " return samplePoissonPCF(cascade);\n"
1642 " return mix(samplePoissonPCF(cascade), samplePoissonPCF(cascade+1), smoothstep(cascade_start_dist[cascade+1] - dist_threshold, cascade_start_dist[cascade+1], depth));\n"
1643 "}\n"
1644 "#endif\n"
1645 "void main()\n"
1646 "{\n"
1647 "#ifdef FLAG_TRANSFORM\n"
1648 " if(not_visible >= 0.9) { discard; }\n"
1649 "#endif\n"
1650 "#ifdef FLAG_SHADOW_MAP\n"
1651 " #ifdef FLAG_CLIP\n"
1652 " if(use_clip_plane == 1) { if(clip_distance <= 0.0) { discard; } }\n"
1653 " #endif\n"
1654 " // need depth and depth squared for variance shadow maps\n"
1655 " gl_FragData[0] = vec4(position.z, position.z * position.z * VARIANCE_SHADOW_SCALE_INV, 0.0, 1.0);\n"
1656 " return;\n"
1657 "#endif\n"
1658 " vec3 eyeDir = vec3(normalize(-position).xyz);\n"
1659 " vec3 lightAmbientDiffuse = vec3(0.0, 0.0, 0.0);\n"
1660 " vec3 lightDiffuse = vec3(0.0, 0.0, 0.0);\n"
1661 " vec3 lightAmbient = vec3(0.0, 0.0, 0.0);\n"
1662 " vec4 lightSpecular = vec4(0.0, 0.0, 0.0, 1.0);\n"
1663 " vec2 texCoord = gl_TexCoord[0].xy;\n"
1664 " vec4 baseColor = gl_Color;\n"
1665 " vec4 posData = vec4(position.xyz,1.0);\n"
1666 " vec4 normData = vec4(0.0, 0.0, 0.0, 1.0);\n"
1667 " vec4 specData = vec4(0.0, 0.0, 0.0, 1.0);\n"
1668 " vec3 unitNormal = normalize(lNormal);\n"
1669 " vec3 normal = unitNormal;\n"
1670 "#ifdef FLAG_NORMAL_MAP\n"
1671 " // Normal map - convert from DXT5nm\n"
1672 " vec2 normalSample;\n"
1673 " normal.rg = normalSample = (texture2D(sNormalmap, texCoord).ag * 2.0) - 1.0;\n"
1674 " normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));\n"
1675 " normal = tbnMatrix * normal;\n"
1676 " float norm = length(normal);\n"
1677 " // prevent breaking of normal maps\n"
1678 " if (norm > 0.0)\n"
1679 " normal /= norm;\n"
1680 " else\n"
1681 " normal = unitNormal;\n"
1682 "#endif\n"
1683 " normData = vec4(normal,1.0);\n"
1684 "\n"
1685 "#ifdef FLAG_ANIMATED\n"
1686 " vec2 distort = vec2(cos(position.x*position.w*0.005+anim_timer*20.0)*sin(position.y*position.w*0.005),sin(position.x*position.w*0.005+anim_timer*20.0)*cos(position.y*position.w*0.005))*0.03;\n"
1687 "#endif\n"
1688 "\n"
1689 "#ifdef FLAG_DIFFUSE_MAP\n"
1690 " vec2 diffuseTexCoord = texCoord;\n"
1691 " #ifdef FLAG_ANIMATED\n"
1692 " if (effect_num == 2) {\n"
1693 " diffuseTexCoord = texCoord + distort*(1.0-anim_timer);\n"
1694 " }\n"
1695 " #endif\n"
1696 " baseColor = texture2D(sBasemap, diffuseTexCoord);\n"
1697 " if ( blend_alpha == 0 && baseColor.a < 0.95 ) discard; // if alpha blending is not on, discard transparent pixels\n"
1698 " // premultiply alpha if blend_alpha is 1. assume that our blend function is srcColor + (1-Alpha)*destColor.\n"
1699 " // if blend_alpha is 2, assume blend func is additive and don't modify color\n"
1700 " if(blend_alpha == 1) baseColor.rgb = baseColor.rgb * baseColor.a;\n"
1701 "#endif\n"
1702 "\n"
1703 " specData = vec4(baseColor.rgb * SPEC_FACTOR_NO_SPEC_MAP, 1.0);\n"
1704 "#ifdef FLAG_SPEC_MAP\n"
1705 " vec4 specColour = texture2D(sSpecmap, texCoord);\n"
1706 " specData = vec4(specColour.rgb * SPECULAR_FACTOR, 1.0);\n"
1707 "#endif\n"
1708 "\n"
1709 "#ifdef FLAG_MISC_MAP\n"
1710 " #ifdef FLAG_TEAMCOLOR\n"
1711 " vec4 teamMask = vec4(0.0, 0.0, 0.0, 0.0);\n"
1712 " teamMask = texture2D(sMiscmap, texCoord);\n"
1713 " vec3 base = base_color - vec3(0.5);\n"
1714 " vec3 stripe = stripe_color - vec3(0.5);\n"
1715 " baseColor.rgb += (base * teamMask.x) + (stripe * teamMask.y);\n"
1716 " #endif\n"
1717 "#endif\n"
1718 "\n"
1719 " float shadow = 1.0;\n"
1720 "#ifdef FLAG_SHADOWS\n"
1721 " shadow = getShadowValue();\n"
1722 "#endif\n"
1723 "\n"
1724 "#ifdef FLAG_LIGHT\n"
1725 " vec3 lightDir;\n"
1726 " lightAmbient = vec3(gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient));\n"
1727 " float dist;\n"
1728 " #pragma optionNV unroll all\n"
1729 " for (int i = 0; i < MAX_LIGHTS; ++i) {\n"
1730 " #if __VERSION__ > 120\n"
1731 " if (i > n_lights)\n"
1732 " break;\n"
1733 " #endif\n"
1734 " if(i > 0)\n"
1735 " shadow = 1.0;\n"
1736 " float specularIntensity = SPEC_INTENSITY_DIRECTIONAL;\n"
1737 " lightDir = normalize(gl_LightSource[i].position.xyz);\n"
1738 " float attenuation = 1.0;\n"
1739 " #ifndef FLAG_DEFERRED\n"
1740 " #if __VERSION__ > 120\n"
1741 " if (gl_LightSource[i].position.w == 1.0) {\n"
1742 " #else\n"
1743 " if (gl_LightSource[i].position.w == 1.0 && i != 0) {\n"
1744 " #endif\n"
1745 " // Positional light source\n"
1746 " dist = distance(gl_LightSource[i].position.xyz, position.xyz);\n"
1747 " lightDir = (gl_LightSource[i].position.xyz - position.xyz);\n"
1748 " #if __VERSION__ > 120\n"
1749 " if (gl_LightSource[i].spotCutoff < 91.0) { // Tube light\n"
1750 " float beamlength = length(gl_LightSource[i].spotDirection);\n"
1751 " vec3 beamDir = normalize(gl_LightSource[i].spotDirection);\n"
1752 " // Get nearest point on line\n"
1753 " float neardist = dot(position.xyz - gl_LightSource[i].position.xyz , beamDir);\n"
1754 " // Move back from the endpoint of the beam along the beam by the distance we calculated\n"
1755 " vec3 nearest = gl_LightSource[i].position.xyz - beamDir * abs(neardist);\n"
1756 " lightDir = nearest - position.xyz;\n"
1757 " dist = length(lightDir);\n"
1758 " }\n"
1759 " #endif\n"
1760 " lightDir = normalize(lightDir);\n"
1761 " attenuation = 1.0 / (gl_LightSource[i].constantAttenuation + (gl_LightSource[i].linearAttenuation * dist) + (gl_LightSource[i].quadraticAttenuation * dist * dist));\n"
1762 " specularIntensity = SPEC_INTENSITY_POINT;\n"
1763 " }\n"
1764 " #endif\n"
1765 " // Attenuation and light direction\n"
1766 " vec3 half_vec = normalize(lightDir + eyeDir);\n"
1767 " // Ambient and Diffuse\n"
1768 " lightAmbient += (gl_FrontLightProduct[i].ambient.rgb * attenuation) * shadow;\n"
1769 " lightDiffuse += (gl_FrontLightProduct[i].diffuse.rgb * light_factor * (max(dot(normal, lightDir), 0.0)) * attenuation) * shadow;\n"
1770 " // Specular\n"
1771 " float NdotHV = clamp(dot(normal, half_vec), 0.0, 1.0);\n"
1772 " lightSpecular += ((gl_FrontLightProduct[i].specular * pow(NdotHV, gl_FrontMaterial.shininess)) * attenuation) * specularIntensity * shadow;\n"
1773 " }\n"
1774 " lightAmbientDiffuse = lightAmbient + lightDiffuse;\n"
1775 "#else\n"
1776 " lightAmbientDiffuse = gl_Color.rgb;\n"
1777 " lightSpecular = gl_SecondaryColor;\n"
1778 "#endif\n"
1779 "\n"
1780 " baseColor.rgb *= max(lightAmbientDiffuse.rgb * AMBIENT_LIGHT_BOOST, gl_LightModel.ambient.rgb - 0.425);\n"
1781 " baseColor.rgb += lightSpecular.rgb * specData.rgb;\n"
1782 "#ifdef FLAG_ENV_MAP\n"
1783 " vec3 envReflectNM = envReflect;\n"
1784 " #ifdef FLAG_NORMAL_MAP\n"
1785 " envReflectNM += vec3(normalSample, 0.0);\n"
1786 " #endif\n"
1787 " vec4 envColour = textureCube(sEnvmap, envReflectNM);\n"
1788 " vec3 envIntensity = (alpha_spec) ? vec3(specColour.a) : specColour.rgb;\n"
1789 " baseColor.rgb += envColour.rgb * envIntensity;\n"
1790 "#endif\n"
1791 "\n"
1792 "#ifdef FLAG_GLOW_MAP\n"
1793 " vec3 glowColor = texture2D(sGlowmap, texCoord).rgb;\n"
1794 " #ifdef FLAG_MISC_MAP\n"
1795 " #ifdef FLAG_TEAMCOLOR\n"
1796 " float glowColorLuminance = dot(glowColor, vec3(0.299, 0.587, 0.114));\n"
1797 " glowColor = team_glow_enabled ? mix((base * teamMask.b) + (stripe * teamMask.a), glowColor, clamp(glowColorLuminance - teamMask.b - teamMask.a, 0.0, 1.0)) : glowColor;\n"
1798 " #endif\n"
1799 " #endif\n"
1800 " baseColor.rgb += glowColor * GLOW_MAP_INTENSITY;\n"
1801 "#endif\n"
1802 "\n"
1803 "#ifdef FLAG_FOG\n"
1804 " vec3 fogColor = gl_Fog.color.rgb;\n"
1805 " #ifdef FLAG_DIFFUSE_MAP\n"
1806 " if(blend_alpha == 1) fogColor *= baseColor.a;\n"
1807 " #endif\n"
1808 " baseColor.rgb = mix(baseColor.rgb, fogColor, fogDist);\n"
1809 " specData.rgb *= fogDist;\n"
1810 "#endif\n"
1811 "\n"
1812 "#ifdef FLAG_DIFFUSE_MAP\n"
1813 " if(desaturate == 1) {\n"
1814 " baseColor.rgb = desaturate_clr * dot(vec3(1.0), baseColor.rgb) * 0.3333333;\n"
1815 " }\n"
1816 "#endif\n"
1817 "#ifdef FLAG_ANIMATED\n"
1818 " if (effect_num == 0) {\n"
1819 " float shinefactor = 1.0/(1.0 + pow(abs((fract(abs(texCoord.x))-anim_timer) * 1000.0), 2.0)) * 1000.0;\n"
1820 " baseColor.rgb = baseColor.rgb + vec3(shinefactor);\n"
1821 " baseColor.a = baseColor.a * clamp(shinefactor * (fract(abs(texCoord.x))-anim_timer) * -10000.0,0.0,1.0);\n"
1822 " }\n"
1823 " if (effect_num == 1) {\n"
1824 " float shinefactor = 1.0/(1.0 + pow(abs(position.y-anim_timer), 2.0));\n"
1825 " baseColor.rgb = baseColor.rgb + vec3(shinefactor);\n"
1826 " #ifdef FLAG_LIGHT\n"
1827 " baseColor.a = baseColor.a;\n"
1828 " #else\n"
1829 " // ATI Wireframe fix *grumble*\n"
1830 " baseColor.a = clamp((position.y-anim_timer) * 10000.0,0.0,1.0);\n"
1831 " #endif\n"
1832 " }\n"
1833 " if (effect_num == 2) {\n"
1834 " vec2 screenPos = gl_FragCoord.xy * vec2(vpwidth,vpheight);\n"
1835 " baseColor.a = baseColor.a;\n"
1836 " float cloak_interp = (sin(position.x*position.w*0.005+anim_timer*20.0)*sin(position.y*position.w*0.005)*0.5)-0.5;\n"
1837 " #ifdef FLAG_LIGHT\n"
1838 " baseColor.rgb = mix(texture2D(sFramebuffer, screenPos + distort*anim_timer + anim_timer*0.1*normal.xy).rgb,baseColor.rgb,clamp(cloak_interp+anim_timer*2.0,0.0,1.0));\n"
1839 " #else\n"
1840 " baseColor.rgb = mix(texture2D(sFramebuffer, screenPos + distort*anim_timer + anim_timer*0.1*lNormal.xy).rgb,baseColor.rgb,clamp(cloak_interp+anim_timer*2.0,0.0,1.0));\n"
1841 " #endif\n"
1842 " }\n"
1843 "#endif\n"
1844 "#ifdef FLAG_CLIP\n"
1845 " // for some odd reason if we try to discard the pixel early for plane clipping, it screws up glow maps so let's just do it down here.\n"
1846 " if(use_clip_plane == 1) { if(clip_distance <= 0.0) { discard; } }\n"
1847 "#endif\n"
1848 " gl_FragData[0] = baseColor;\n"
1849 "#ifdef FLAG_DEFERRED\n"
1850 " gl_FragData[1] = posData;\n"
1851 " gl_FragData[2] = normData;\n"
1852 " gl_FragData[3] = specData;\n"
1853 "#endif\n"
1854 "}";
1855 
1857 "#extension GL_EXT_geometry_shader4 : enable\n"
1858 "uniform mat4 shadow_proj_matrix[4];\n"
1859 "varying in float Instance[3];\n"
1860 "varying out vec4 position;\n"
1861 "#ifdef FLAG_TRANSFORM\n"
1862 "varying in float not_visible_g[];\n"
1863 "varying out float not_visible;\n"
1864 "#endif\n"
1865 "#ifdef FLAG_CLIP\n"
1866 "varying in float clip_distance_g[];\n"
1867 "varying out float clip_distance;\n"
1868 "#endif\n"
1869 "void main(void)\n"
1870 "{\n"
1871 " int instanceID = int(Instance[0]);\n"
1872 " for(int vert = 0; vert < gl_VerticesIn; vert++)\n"
1873 " {\n"
1874 " gl_Position = shadow_proj_matrix[instanceID] * gl_PositionIn[vert];\n"
1875 " if(gl_Position.z < -1.0)\n"
1876 " gl_Position.z = -1.0;\n"
1877 " position = gl_PositionIn[vert];\n"
1878 " gl_ClipVertex = gl_ClipVertexIn[vert];\n"
1879 " gl_Layer = instanceID;\n"
1880 "#ifdef FLAG_TRANSFORM\n"
1881 " not_visible = not_visible_g[0];\n"
1882 "#endif\n"
1883 "#ifdef FLAG_CLIP\n"
1884 " clip_distance = clip_distance_g[0];\n"
1885 "#endif\n"
1886 " EmitVertex();\n"
1887 " }\n"
1888 " EndPrimitive();\n"
1889 "}";
1890 
1892 "#extension GL_EXT_gpu_shader4 : enable\n"
1893 "uniform float rt_w;\n"
1894 "uniform float rt_h;\n"
1895 "varying vec2 v_rcpFrame;\n"
1896 "noperspective varying vec2 v_pos;\n"
1897 "void main() {\n"
1898 " gl_Position = gl_Vertex;\n"
1899 " v_rcpFrame = vec2(1.0/rt_w, 1.0/rt_h);\n"
1900 " v_pos = gl_Vertex.xy*0.5 + 0.5;\n"
1901 "}";
1902 
1904 "#extension GL_EXT_gpu_shader4 : enable\n"
1905 "#define FXAA_EARLY_EXIT 1\n"
1906 "#define FXAA_DISCARD 1\n"
1907 "#ifndef FXAA_FAST_PIXEL_OFFSET\n"
1908 " #ifdef GL_EXT_gpu_shader4\n"
1909 " #define FXAA_FAST_PIXEL_OFFSET 1\n"
1910 " #endif\n"
1911 " #ifdef GL_NV_gpu_shader5\n"
1912 " #extension GL_NV_gpu_shader5 : enable\n"
1913 " #define FXAA_FAST_PIXEL_OFFSET 1\n"
1914 " #endif\n"
1915 " #ifdef GL_ARB_gpu_shader5\n"
1916 " #extension GL_ARB_gpu_shader5 : enable\n"
1917 " #define FXAA_FAST_PIXEL_OFFSET 1\n"
1918 " #endif\n"
1919 " #ifndef FXAA_FAST_PIXEL_OFFSET\n"
1920 " #define FXAA_FAST_PIXEL_OFFSET 0\n"
1921 " #endif\n"
1922 "#endif\n"
1923 "#ifndef FXAA_GATHER4_ALPHA\n"
1924 " #ifdef GL_ARB_gpu_shader5\n"
1925 " #extension GL_ARB_gpu_shader5 : enable\n"
1926 " #define FXAA_GATHER4_ALPHA 1\n"
1927 " #endif\n"
1928 " #ifdef GL_NV_gpu_shader5\n"
1929 " #extension GL_NV_gpu_shader5 : enable\n"
1930 " #define FXAA_GATHER4_ALPHA 1\n"
1931 " #endif\n"
1932 " #ifndef FXAA_GATHER4_ALPHA\n"
1933 " #define FXAA_GATHER4_ALPHA 0\n"
1934 " #endif\n"
1935 "#endif\n"
1936 "#if (FXAA_QUALITY_PRESET == 10)\n"
1937 " #define FXAA_QUALITY_PS 3\n"
1938 " #define FXAA_QUALITY_P0 1.5\n"
1939 " #define FXAA_QUALITY_P1 3.0\n"
1940 " #define FXAA_QUALITY_P2 12.0\n"
1941 "#endif\n"
1942 "#if (FXAA_QUALITY_PRESET == 11)\n"
1943 " #define FXAA_QUALITY_PS 4\n"
1944 " #define FXAA_QUALITY_P0 1.0\n"
1945 " #define FXAA_QUALITY_P1 1.5\n"
1946 " #define FXAA_QUALITY_P2 3.0\n"
1947 " #define FXAA_QUALITY_P3 12.0\n"
1948 "#endif\n"
1949 "#if (FXAA_QUALITY_PRESET == 12)\n"
1950 " #define FXAA_QUALITY_PS 5\n"
1951 " #define FXAA_QUALITY_P0 1.0\n"
1952 " #define FXAA_QUALITY_P1 1.5\n"
1953 " #define FXAA_QUALITY_P2 2.0\n"
1954 " #define FXAA_QUALITY_P3 4.0\n"
1955 " #define FXAA_QUALITY_P4 12.0\n"
1956 "#endif\n"
1957 "#if (FXAA_QUALITY_PRESET == 13)\n"
1958 " #define FXAA_QUALITY_PS 6\n"
1959 " #define FXAA_QUALITY_P0 1.0\n"
1960 " #define FXAA_QUALITY_P1 1.5\n"
1961 " #define FXAA_QUALITY_P2 2.0\n"
1962 " #define FXAA_QUALITY_P3 2.0\n"
1963 " #define FXAA_QUALITY_P4 4.0\n"
1964 " #define FXAA_QUALITY_P5 12.0\n"
1965 "#endif\n"
1966 "#if (FXAA_QUALITY_PRESET == 14)\n"
1967 " #define FXAA_QUALITY_PS 7\n"
1968 " #define FXAA_QUALITY_P0 1.0\n"
1969 " #define FXAA_QUALITY_P1 1.5\n"
1970 " #define FXAA_QUALITY_P2 2.0\n"
1971 " #define FXAA_QUALITY_P3 2.0\n"
1972 " #define FXAA_QUALITY_P4 2.0\n"
1973 " #define FXAA_QUALITY_P5 4.0\n"
1974 " #define FXAA_QUALITY_P6 12.0\n"
1975 "#endif\n"
1976 "#if (FXAA_QUALITY_PRESET == 25)\n"
1977 " #define FXAA_QUALITY_PS 8\n"
1978 " #define FXAA_QUALITY_P0 1.0\n"
1979 " #define FXAA_QUALITY_P1 1.5\n"
1980 " #define FXAA_QUALITY_P2 2.0\n"
1981 " #define FXAA_QUALITY_P3 2.0\n"
1982 " #define FXAA_QUALITY_P4 2.0\n"
1983 " #define FXAA_QUALITY_P5 2.0\n"
1984 " #define FXAA_QUALITY_P6 4.0\n"
1985 " #define FXAA_QUALITY_P7 8.0\n"
1986 "#endif\n"
1987 "#if (FXAA_QUALITY_PRESET == 26)\n"
1988 " #define FXAA_QUALITY_PS 9\n"
1989 " #define FXAA_QUALITY_P0 1.0\n"
1990 " #define FXAA_QUALITY_P1 1.5\n"
1991 " #define FXAA_QUALITY_P2 2.0\n"
1992 " #define FXAA_QUALITY_P3 2.0\n"
1993 " #define FXAA_QUALITY_P4 2.0\n"
1994 " #define FXAA_QUALITY_P5 2.0\n"
1995 " #define FXAA_QUALITY_P6 2.0\n"
1996 " #define FXAA_QUALITY_P7 4.0\n"
1997 " #define FXAA_QUALITY_P8 8.0\n"
1998 "#endif\n"
1999 "#if (FXAA_QUALITY_PRESET == 27)\n"
2000 " #define FXAA_QUALITY_PS 10\n"
2001 " #define FXAA_QUALITY_P0 1.0\n"
2002 " #define FXAA_QUALITY_P1 1.5\n"
2003 " #define FXAA_QUALITY_P2 2.0\n"
2004 " #define FXAA_QUALITY_P3 2.0\n"
2005 " #define FXAA_QUALITY_P4 2.0\n"
2006 " #define FXAA_QUALITY_P5 2.0\n"
2007 " #define FXAA_QUALITY_P6 2.0\n"
2008 " #define FXAA_QUALITY_P7 2.0\n"
2009 " #define FXAA_QUALITY_P8 4.0\n"
2010 " #define FXAA_QUALITY_P9 8.0\n"
2011 "#endif\n"
2012 "#if (FXAA_QUALITY_PRESET == 28)\n"
2013 " #define FXAA_QUALITY_PS 11\n"
2014 " #define FXAA_QUALITY_P0 1.0\n"
2015 " #define FXAA_QUALITY_P1 1.5\n"
2016 " #define FXAA_QUALITY_P2 2.0\n"
2017 " #define FXAA_QUALITY_P3 2.0\n"
2018 " #define FXAA_QUALITY_P4 2.0\n"
2019 " #define FXAA_QUALITY_P5 2.0\n"
2020 " #define FXAA_QUALITY_P6 2.0\n"
2021 " #define FXAA_QUALITY_P7 2.0\n"
2022 " #define FXAA_QUALITY_P8 2.0\n"
2023 " #define FXAA_QUALITY_P9 4.0\n"
2024 " #define FXAA_QUALITY_P10 8.0\n"
2025 "#endif\n"
2026 "#if (FXAA_QUALITY_PRESET == 39)\n"
2027 " #define FXAA_QUALITY_PS 12\n"
2028 " #define FXAA_QUALITY_P0 1.0\n"
2029 " #define FXAA_QUALITY_P1 1.0\n"
2030 " #define FXAA_QUALITY_P2 1.0\n"
2031 " #define FXAA_QUALITY_P3 1.0\n"
2032 " #define FXAA_QUALITY_P4 1.0\n"
2033 " #define FXAA_QUALITY_P5 1.5\n"
2034 " #define FXAA_QUALITY_P6 2.0\n"
2035 " #define FXAA_QUALITY_P7 2.0\n"
2036 " #define FXAA_QUALITY_P8 2.0\n"
2037 " #define FXAA_QUALITY_P9 2.0\n"
2038 " #define FXAA_QUALITY_P10 4.0\n"
2039 " #define FXAA_QUALITY_P11 8.0\n"
2040 "#endif\n"
2041 "#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n"
2042 " #define FxaaBool bool\n"
2043 " #define FxaaDiscard discard\n"
2044 " #define FxaaFloat float\n"
2045 " #define FxaaFloat2 vec2\n"
2046 " #define FxaaFloat3 vec3\n"
2047 " #define FxaaFloat4 vec4\n"
2048 " #define FxaaHalf float\n"
2049 " #define FxaaHalf2 vec2\n"
2050 " #define FxaaHalf3 vec3\n"
2051 " #define FxaaHalf4 vec4\n"
2052 " #define FxaaInt2 ivec2\n"
2053 " #define FxaaSat(x) clamp(x, 0.0, 1.0)\n"
2054 " #define FxaaTex sampler2D\n"
2055 "#else\n"
2056 " #define FxaaBool bool\n"
2057 " #define FxaaDiscard clip(-1)\n"
2058 " #define FxaaFloat float\n"
2059 " #define FxaaFloat2 float2\n"
2060 " #define FxaaFloat3 float3\n"
2061 " #define FxaaFloat4 float4\n"
2062 " #define FxaaHalf half\n"
2063 " #define FxaaHalf2 half2\n"
2064 " #define FxaaHalf3 half3\n"
2065 " #define FxaaHalf4 half4\n"
2066 " #define FxaaSat(x) saturate(x)\n"
2067 "#endif\n"
2068 "#if (FXAA_GLSL_120 == 1)\n"
2069 " #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n"
2070 " #if (FXAA_FAST_PIXEL_OFFSET == 1)\n"
2071 " #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)\n"
2072 " #else\n"
2073 " #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\n"
2074 " #endif\n"
2075 " #if (FXAA_GATHER4_ALPHA == 1)\n"
2076 " #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n"
2077 " #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n"
2078 " #define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n"
2079 " #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n"
2080 " #endif\n"
2081 "#endif\n"
2082 "#if (FXAA_GLSL_130 == 1)\n"
2083 " #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n"
2084 " #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)\n"
2085 " #if (FXAA_GATHER4_ALPHA == 1)\n"
2086 " #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n"
2087 " #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n"
2088 " #define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n"
2089 " #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n"
2090 " #endif\n"
2091 "#endif\n"
2092 "FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\n"
2093 "FxaaFloat4 FxaaPixelShader(\n"
2094 " FxaaFloat2 pos,\n"
2095 " FxaaTex tex,\n"
2096 " FxaaFloat2 fxaaQualityRcpFrame,\n"
2097 " FxaaFloat fxaaQualitySubpix,\n"
2098 " FxaaFloat fxaaQualityEdgeThreshold,\n"
2099 " FxaaFloat fxaaQualityEdgeThresholdMin\n"
2100 ") {\n"
2101 " FxaaFloat2 posM;\n"
2102 " posM.x = pos.x;\n"
2103 " posM.y = pos.y;\n"
2104 " #if (FXAA_GATHER4_ALPHA == 1)\n"
2105 " #if (FXAA_DISCARD == 0)\n"
2106 " FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n"
2107 " #define lumaM rgbyM.y\n"
2108 " #endif\n"
2109 " FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);\n"
2110 " FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));\n"
2111 " #if (FXAA_DISCARD == 1)\n"
2112 " #define lumaM luma4A.w\n"
2113 " #endif\n"
2114 " #define lumaE luma4A.z\n"
2115 " #define lumaS luma4A.x\n"
2116 " #define lumaSE luma4A.y\n"
2117 " #define lumaNW luma4B.w\n"
2118 " #define lumaN luma4B.z\n"
2119 " #define lumaW luma4B.x\n"
2120 " #else\n"
2121 " FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n"
2122 " #define lumaM rgbyM.w\n"
2123 " FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\n"
2124 " FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\n"
2125 " FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\n"
2126 " FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n"
2127 " #endif\n"
2128 " FxaaFloat maxSM = max(lumaS, lumaM);\n"
2129 " FxaaFloat minSM = min(lumaS, lumaM);\n"
2130 " FxaaFloat maxESM = max(lumaE, maxSM);\n"
2131 " FxaaFloat minESM = min(lumaE, minSM);\n"
2132 " FxaaFloat maxWN = max(lumaN, lumaW);\n"
2133 " FxaaFloat minWN = min(lumaN, lumaW);\n"
2134 " FxaaFloat rangeMax = max(maxWN, maxESM);\n"
2135 " FxaaFloat rangeMin = min(minWN, minESM);\n"
2136 " FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n"
2137 " FxaaFloat range = rangeMax - rangeMin;\n"
2138 " FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n"
2139 " FxaaBool earlyExit = range < rangeMaxClamped;\n"
2140 " if (earlyExit)\n"
2141 " #if (FXAA_DISCARD == 1)\n"
2142 " FxaaDiscard;\n"
2143 " #else\n"
2144 " return rgbyM;\n"
2145 " #endif\n"
2146 " #if (FXAA_GATHER4_ALPHA == 0)\n"
2147 " FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\n"
2148 " FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\n"
2149 " FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\n"
2150 " FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n"
2151 " #else\n"
2152 " FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n"
2153 " FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n"
2154 " #endif\n"
2155 " FxaaFloat lumaNS = lumaN + lumaS;\n"
2156 " FxaaFloat lumaWE = lumaW + lumaE;\n"
2157 " FxaaFloat subpixRcpRange = 1.0/range;\n"
2158 " FxaaFloat subpixNSWE = lumaNS + lumaWE;\n"
2159 " FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n"
2160 " FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n"
2161 " FxaaFloat lumaNESE = lumaNE + lumaSE;\n"
2162 " FxaaFloat lumaNWNE = lumaNW + lumaNE;\n"
2163 " FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n"
2164 " FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n"
2165 " FxaaFloat lumaNWSW = lumaNW + lumaSW;\n"
2166 " FxaaFloat lumaSWSE = lumaSW + lumaSE;\n"
2167 " FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n"
2168 " FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n"
2169 " FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n"
2170 " FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n"
2171 " FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n"
2172 " FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n"
2173 " FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n"
2174 " FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n"
2175 " FxaaBool horzSpan = edgeHorz >= edgeVert;\n"
2176 " FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n"
2177 " if (!horzSpan) lumaN = lumaW;\n"
2178 " if (!horzSpan) lumaS = lumaE;\n"
2179 " if (horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n"
2180 " FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\n"
2181 " FxaaFloat gradientN = lumaN - lumaM;\n"
2182 " FxaaFloat gradientS = lumaS - lumaM;\n"
2183 " FxaaFloat lumaNN = lumaN + lumaM;\n"
2184 " FxaaFloat lumaSS = lumaS + lumaM;\n"
2185 " FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n"
2186 " FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n"
2187 " if (pairN) lengthSign = -lengthSign;\n"
2188 " FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n"
2189 " FxaaFloat2 posB;\n"
2190 " posB.x = posM.x;\n"
2191 " posB.y = posM.y;\n"
2192 " FxaaFloat2 offNP;\n"
2193 " offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n"
2194 " offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n"
2195 " if (!horzSpan) posB.x += lengthSign * 0.5;\n"
2196 " if (horzSpan) posB.y += lengthSign * 0.5;\n"
2197 " FxaaFloat2 posN;\n"
2198 " posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\n"
2199 " posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\n"
2200 " FxaaFloat2 posP;\n"
2201 " posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\n"
2202 " posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\n"
2203 " FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\n"
2204 " FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n"
2205 " FxaaFloat subpixE = subpixC * subpixC;\n"
2206 " FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\n"
2207 " if (!pairN) lumaNN = lumaSS;\n"
2208 " FxaaFloat gradientScaled = gradient * 1.0/4.0;\n"
2209 " FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n"
2210 " FxaaFloat subpixF = subpixD * subpixE;\n"
2211 " FxaaBool lumaMLTZero = lumaMM < 0.0;\n"
2212 " lumaEndN -= lumaNN * 0.5;\n"
2213 " lumaEndP -= lumaNN * 0.5;\n"
2214 " FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n"
2215 " FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n"
2216 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\n"
2217 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\n"
2218 " FxaaBool doneNP = (!doneN) || (!doneP);\n"
2219 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\n"
2220 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\n"
2221 " if (doneNP) {\n"
2222 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2223 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2224 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2225 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2226 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2227 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2228 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\n"
2229 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\n"
2230 " doneNP = (!doneN) || (!doneP);\n"
2231 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\n"
2232 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n"
2233 " #if (FXAA_QUALITY_PS > 3)\n"
2234 " if (doneNP) {\n"
2235 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2236 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2237 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2238 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2239 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2240 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2241 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\n"
2242 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\n"
2243 " doneNP = (!doneN) || (!doneP);\n"
2244 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\n"
2245 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n"
2246 " #if (FXAA_QUALITY_PS > 4)\n"
2247 " if (doneNP) {\n"
2248 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2249 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2250 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2251 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2252 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2253 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2254 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\n"
2255 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\n"
2256 " doneNP = (!doneN) || (!doneP);\n"
2257 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\n"
2258 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n"
2259 " #if (FXAA_QUALITY_PS > 5)\n"
2260 " if (doneNP) {\n"
2261 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2262 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2263 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2264 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2265 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2266 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2267 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\n"
2268 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\n"
2269 " doneNP = (!doneN) || (!doneP);\n"
2270 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\n"
2271 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n"
2272 " #if (FXAA_QUALITY_PS > 6)\n"
2273 " if (doneNP) {\n"
2274 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2275 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2276 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2277 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2278 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2279 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2280 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\n"
2281 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\n"
2282 " doneNP = (!doneN) || (!doneP);\n"
2283 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\n"
2284 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n"
2285 " #if (FXAA_QUALITY_PS > 7)\n"
2286 " if (doneNP) {\n"
2287 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2288 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2289 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2290 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2291 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2292 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2293 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\n"
2294 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\n"
2295 " doneNP = (!doneN) || (!doneP);\n"
2296 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\n"
2297 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n"
2298 " #if (FXAA_QUALITY_PS > 8)\n"
2299 " if (doneNP) {\n"
2300 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2301 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2302 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2303 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2304 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2305 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2306 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\n"
2307 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\n"
2308 " doneNP = (!doneN) || (!doneP);\n"
2309 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\n"
2310 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n"
2311 " #if (FXAA_QUALITY_PS > 9)\n"
2312 " if (doneNP) {\n"
2313 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2314 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2315 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2316 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2317 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2318 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2319 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\n"
2320 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\n"
2321 " doneNP = (!doneN) || (!doneP);\n"
2322 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\n"
2323 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n"
2324 " #if (FXAA_QUALITY_PS > 10)\n"
2325 " if (doneNP) {\n"
2326 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2327 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2328 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2329 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2330 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2331 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2332 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\n"
2333 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\n"
2334 " doneNP = (!doneN) || (!doneP);\n"
2335 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\n"
2336 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n"
2337 " #if (FXAA_QUALITY_PS > 11)\n"
2338 " if (doneNP) {\n"
2339 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2340 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2341 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2342 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2343 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2344 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2345 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\n"
2346 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\n"
2347 " doneNP = (!doneN) || (!doneP);\n"
2348 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\n"
2349 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n"
2350 " #if (FXAA_QUALITY_PS > 12)\n"
2351 " if (doneNP) {\n"
2352 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
2353 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
2354 " if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n"
2355 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
2356 " doneN = abs(lumaEndN) >= gradientScaled;\n"
2357 " doneP = abs(lumaEndP) >= gradientScaled;\n"
2358 " if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\n"
2359 " if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\n"
2360 " doneNP = (!doneN) || (!doneP);\n"
2361 " if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\n"
2362 " if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n"
2363 " }\n"
2364 " #endif\n"
2365 " }\n"
2366 " #endif\n"
2367 " }\n"
2368 " #endif\n"
2369 " }\n"
2370 " #endif\n"
2371 " }\n"
2372 " #endif\n"
2373 " }\n"
2374 " #endif\n"
2375 " }\n"
2376 " #endif\n"
2377 " }\n"
2378 " #endif\n"
2379 " }\n"
2380 " #endif\n"
2381 " }\n"
2382 " #endif\n"
2383 " }\n"
2384 " FxaaFloat dstN = posM.x - posN.x;\n"
2385 " FxaaFloat dstP = posP.x - posM.x;\n"
2386 " if (!horzSpan) dstN = posM.y - posN.y;\n"
2387 " if (!horzSpan) dstP = posP.y - posM.y;\n"
2388 " FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n"
2389 " FxaaFloat spanLength = (dstP + dstN);\n"
2390 " FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n"
2391 " FxaaFloat spanLengthRcp = 1.0/spanLength;\n"
2392 " FxaaBool directionN = dstN < dstP;\n"
2393 " FxaaFloat dst = min(dstN, dstP);\n"
2394 " FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n"
2395 " FxaaFloat subpixG = subpixF * subpixF;\n"
2396 " FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n"
2397 " FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n"
2398 " FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n"
2399 " FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n"
2400 " if (!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n"
2401 " if (horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n"
2402 " #if (FXAA_DISCARD == 1)\n"
2403 " return FxaaTexTop(tex, posM);\n"
2404 " #else\n"
2405 " return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n"
2406 " #endif\n"
2407 "}\n"
2408 "uniform sampler2D tex0;\n"
2409 "varying vec2 v_rcpFrame;\n"
2410 "noperspective varying vec2 v_pos;\n"
2411 "void main() {\n"
2412 " gl_FragColor = FxaaPixelShader(v_pos, tex0, v_rcpFrame, FXAA_QUALITY_SUBPIX, FXAA_QUALITY_EDGE_THRESHOLD, FXAA_QUALITY_EDGE_THRESHOLD_MIN);\n"
2413 "}";
2414 
2416 "varying float blurSize;\n"
2417 "uniform sampler2D tex;\n"
2418 "#define BLUR_SIZE_DIV 3.0\n"
2419 "// Gaussian Blur\n"
2420 "// 512x512 and smaller textures give best results\n"
2421 "// 2 passes required\n"
2422 "void main()\n"
2423 "{\n"
2424 " // Echelon9 - Due to Apple not implementing array constructors in OS X's\n"
2425 " // GLSL implementation we need to setup the arrays this way as a workaround\n"
2426 " float BlurWeights[6];\n"
2427 " BlurWeights[5] = 0.0402;\n"
2428 " BlurWeights[4] = 0.0623;\n"
2429 " BlurWeights[3] = 0.0877;\n"
2430 " BlurWeights[2] = 0.1120;\n"
2431 " BlurWeights[1] = 0.1297;\n"
2432 " BlurWeights[0] = 0.1362;\n"
2433 " vec4 sum = texture2D(tex, gl_TexCoord[0].xy) * BlurWeights[0];\n"
2434 "#ifdef PASS_0\n"
2435 " for (int i = 1; i < 6; i++) {\n"
2436 " sum += texture2D(tex, vec2(clamp(gl_TexCoord[0].x - float(i) * (blurSize/BLUR_SIZE_DIV), 0.0, 1.0), gl_TexCoord[0].y)) * BlurWeights[i];\n"
2437 " sum += texture2D(tex, vec2(clamp(gl_TexCoord[0].x + float(i) * (blurSize/BLUR_SIZE_DIV), 0.0, 1.0), gl_TexCoord[0].y)) * BlurWeights[i];\n"
2438 " }\n"
2439 "#endif\n"
2440 "#ifdef PASS_1\n"
2441 " for (int i = 1; i < 6; i++) {\n"
2442 " sum += texture2D(tex, vec2(gl_TexCoord[0].x, clamp(gl_TexCoord[0].y - float(i) * (blurSize/BLUR_SIZE_DIV), 0.0, 1.0))) * BlurWeights[i];\n"
2443 " sum += texture2D(tex, vec2(gl_TexCoord[0].x, clamp(gl_TexCoord[0].y + float(i) * (blurSize/BLUR_SIZE_DIV), 0.0, 1.0))) * BlurWeights[i];\n"
2444 " }\n"
2445 "#endif\n"
2446 " gl_FragColor = sum;\n"
2447 "}";
2448 
2450 "uniform sampler2D tex;\n"
2451 "const float Luminance = 0.08;\n"
2452 "const float fMiddleGray = 0.2;\n"
2453 "const float fWhiteCutoff = 0.4;\n"
2454 "// High-pass filter\n"
2455 "void main() {\n"
2456 " vec4 ColorOut = texture2D(tex, gl_TexCoord[0].xy);\n"
2457 " ColorOut *= fMiddleGray / (Luminance + 0.001);\n"
2458 " ColorOut *= (1.0 + (ColorOut / (fWhiteCutoff * fWhiteCutoff)));\n"
2459 " ColorOut -= 6.0;\n"
2460 " ColorOut /= (10.0 + ColorOut);\n"
2461 " gl_FragColor = ColorOut;\n"
2462 "}";
2463 
2465 "uniform sampler2D tex;\n"
2466 "uniform float timer;\n"
2467 "uniform sampler2D bloomed;\n"
2468 "uniform float bloom_intensity;\n"
2469 "#ifdef FLAG_DISTORT_NOISE\n"
2470 "uniform float noise_amount;\n"
2471 "#endif\n"
2472 "#ifdef FLAG_SATURATION\n"
2473 "uniform float saturation;\n"
2474 "#endif\n"
2475 "#ifdef FLAG_BRIGHTNESS\n"
2476 "uniform float brightness;\n"
2477 "#endif\n"
2478 "#ifdef FLAG_CONTRAST\n"
2479 "uniform float contrast;\n"
2480 "#endif\n"
2481 "#ifdef FLAG_GRAIN\n"
2482 "uniform float film_grain;\n"
2483 "#endif\n"
2484 "#ifdef FLAG_STRIPES\n"
2485 "uniform float tv_stripes;\n"
2486 "#endif\n"
2487 "#ifdef FLAG_CUTOFF\n"
2488 "uniform float cutoff;\n"
2489 "#endif\n"
2490 "#ifdef FLAG_DITH\n"
2491 "uniform float dither;\n"
2492 "#endif\n"
2493 "uniform sampler2D blurred_tex;\n"
2494 "uniform sampler2D depth_tex;\n"
2495 "void main()\n"
2496 "{\n"
2497 " #ifdef FLAG_DISTORT_NOISE\n"
2498 " // Distort noise\n"
2499 " float distort_factor = timer * sin(gl_TexCoord[0].x * gl_TexCoord[0].y * 100.0 + timer);\n"
2500 " distort_factor = mod(distort_factor, 8.0) * mod(distort_factor, 4.0);\n"
2501 " vec2 distort;\n"
2502 " distort = vec2(mod(distort_factor, noise_amount), mod(distort_factor, noise_amount + 0.002));\n"
2503 " #else\n"
2504 " vec2 distort = vec2(0, 0);\n"
2505 " #endif\n"
2506 " // Global constant\n"
2507 " vec4 color_in;\n"
2508 " vec4 color_out;\n"
2509 " // Bloom\n"
2510 " if (bloom_intensity > 0.0) {\n"
2511 " color_in = texture2D(tex, gl_TexCoord[0].xy + distort);\n"
2512 " vec4 color_bloom = texture2D(bloomed, gl_TexCoord[0].xy + distort);\n"
2513 " color_in = mix(color_in, max(color_in + 0.7 * color_bloom, color_bloom), bloom_intensity);\n"
2514 " } else {\n"
2515 " color_in = texture2D(tex, gl_TexCoord[0].xy + distort);\n"
2516 " }\n"
2517 " #ifdef FLAG_SATURATION\n"
2518 " // Saturation\n"
2519 " vec4 color_grayscale = color_in;\n"
2520 " color_grayscale.rgb = vec3(dot(color_in.rgb, vec3(0.299, 0.587, 0.184)));\n"
2521 " color_out = mix(color_in, color_grayscale, 1.0 - saturation);\n"
2522 " #else\n"
2523 " color_out = color_in;\n"
2524 " #endif\n"
2525 " #ifdef FLAG_BRIGHTNESS\n"
2526 " // Brightness\n"
2527 " vec3 Afactor = vec3(brightness);\n"
2528 " color_out.rgb = color_out.rgb * Afactor;\n"
2529 " #endif\n"
2530 " #ifdef FLAG_CONTRAST\n"
2531 " // Contrast\n"
2532 " vec3 Bfactor = vec3(0.5 - 0.5 * contrast);\n"
2533 " color_out.rgb = color_out.rgb + Bfactor;\n"
2534 " #endif\n"
2535 " #ifdef FLAG_GRAIN\n"
2536 " // Film Grain\n"
2537 " float x = gl_TexCoord[0].x * gl_TexCoord[0].y * timer * 1000.0;\n"
2538 " x = mod(x, 13.0) * mod(x, 123.0);\n"
2539 " float dx = mod(x, 0.01);\n"
2540 " vec3 result = color_out.rgb + color_out.rgb * clamp(0.1 + dx * 100.0, 0.0, 1.0);\n"
2541 " color_out.rgb = mix(color_out.rgb, result, film_grain);\n"
2542 " #endif\n"
2543 " #ifdef FLAG_STRIPES\n"
2544 " // TV-Stripes (Old School)\n"
2545 " vec2 sc;\n"
2546 " sc.x = sin(gl_TexCoord[0].y * 2048.0);\n"
2547 " sc.y = cos(gl_TexCoord[0].y * 2048.0);\n"
2548 " vec3 stripes = color_out.rgb + color_out.rgb * vec3(sc.x, sc.y, sc.x) * 0.8;\n"
2549 " color_out.rgb = mix(color_out.rgb, stripes, tv_stripes);\n"
2550 " #endif\n"
2551 " #ifdef FLAG_CUTOFF\n"
2552 " // Experimental cutoff shader\n"
2553 " if (cutoff > 0.0) {\n"
2554 " vec4 color_greyscale;\n"
2555 " color_greyscale.rgb = vec3(dot(color_in.rgb, vec3(0.299, 0.587, 0.184)));\n"
2556 " vec4 normalized_col;\n"
2557 " float col_length = (length(color_out.rgb));\n"
2558 " if (col_length > 1.0) {\n"
2559 " normalized_col = ((color_out)/col_length);\n"
2560 " } else {\n"
2561 " normalized_col = color_out;\n"
2562 " }\n"
2563 " vec3 unit_grey = vec3(0.5773);\n"
2564 " float sat = dot(normalized_col.rgb, unit_grey);\n"
2565 " color_out = mix(color_greyscale, color_out, sat * cutoff);\n"
2566 " }\n"
2567 " #endif\n"
2568 " #ifdef FLAG_DITH\n"
2569 " // Dithering\n"
2570 " float downsampling_factor = 4;\n"
2571 " float bias = 0.5;\n"
2572 " color_out.rgb = floor(color_out.rgb * downsampling_factor + bias) / downsampling_factor;\n"
2573 " #endif\n"
2574 " color_out.a = 1.0;\n"
2575 " gl_FragColor = color_out;\n"
2576 "}";
2577 
2579 "varying float blurSize;\n"
2580 "uniform float bsize;\n"
2581 "void main()\n"
2582 "{\n"
2583 " gl_TexCoord[0] = gl_MultiTexCoord0;\n"
2584 " gl_Position = gl_Vertex;\n"
2585 " gl_FrontColor = gl_Color;\n"
2586 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2587 " blurSize = 1.0 / bsize;\n"
2588 "// Check necessary for ATI specific behavior\n"
2589 " #ifdef __GLSL_CG_DATA_TYPES\n"
2590 " gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);\n"
2591 " #endif\n"
2592 "}";
2593 
2595 "uniform sampler2D tex;\n"
2596 "void main() {\n"
2597 " vec4 color = texture2D(tex, gl_TexCoord[0].xy);\n"
2598 " gl_FragColor = vec4(color.rgb, dot(color.rgb, vec3(0.299, 0.587, 0.114)) );\n"
2599 "}";
2600 
2602 "attribute float radius;\n"
2603 "#ifdef FLAG_EFFECT_GEOMETRY\n"
2604 " attribute vec3 uvec;\n"
2605 " varying vec3 up_g;\n"
2606 " varying float radius_g;\n"
2607 "#else\n"
2608 " varying float radius_p;\n"
2609 " varying vec4 position_p;\n"
2610 "#endif\n"
2611 "#ifdef FLAG_EFFECT_DISTORTION\n"
2612 "varying float offset_out;\n"
2613 "uniform float use_offset;\n"
2614 "#endif\n"
2615 "void main()\n"
2616 "{\n"
2617 " #ifdef FLAG_EFFECT_GEOMETRY\n"
2618 " radius_g = radius;\n"
2619 " up_g = uvec;\n"
2620 " gl_Position = gl_ModelViewMatrix * gl_Vertex;\n"
2621 " #else\n"
2622 " radius_p = radius;\n"
2623 " gl_Position = ftransform();\n"
2624 " position_p = gl_ModelViewMatrix * gl_Vertex;\n"
2625 " #endif\n"
2626 " #ifdef FLAG_EFFECT_DISTORTION\n"
2627 " offset_out = radius * use_offset;\n"
2628 " #endif\n"
2629 " gl_TexCoord[0] = gl_MultiTexCoord0;\n"
2630 " gl_FrontColor = gl_Color;\n"
2631 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2632 " #ifdef __GLSL_CG_DATA_TYPES\n"
2633 " // Check necessary for ATI specific behavior\n"
2634 " gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);\n"
2635 " #endif\n"
2636 "}";
2637 
2639 "uniform sampler2D baseMap;\n"
2640 "uniform sampler2D depthMap;\n"
2641 "uniform float window_width;\n"
2642 "uniform float window_height;\n"
2643 "uniform float nearZ;\n"
2644 "uniform float farZ;\n"
2645 "uniform int linear_depth;\n"
2646 "varying float radius_p;\n"
2647 "varying vec4 position_p;\n"
2648 "void main()\n"
2649 "{\n"
2650 " vec4 fragmentColor = texture2D(baseMap, gl_TexCoord[0].xy)*gl_Color.a;\n"
2651 " vec2 offset = vec2(radius_p * abs(0.5 - gl_TexCoord[0].x) * 2.0, radius_p * abs(0.5 - gl_TexCoord[0].y) * 2.0);\n"
2652 " float offset_len = length(offset);\n"
2653 " if ( offset_len > radius_p ) {\n"
2654 " gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
2655 " return;\n"
2656 " }\n"
2657 " vec2 depthCoord = vec2(gl_FragCoord.x / window_width, gl_FragCoord.y / window_height );\n"
2658 " vec4 sceneDepth = texture2D(depthMap, depthCoord);\n"
2659 " float sceneDepthLinear;\n"
2660 " float fragDepthLinear;\n"
2661 " if ( linear_depth == 1 ) {\n"
2662 " sceneDepthLinear = -sceneDepth.z;\n"
2663 " fragDepthLinear = -position_p.z;\n"
2664 " } else {\n"
2665 " sceneDepthLinear = ( 2.0 * farZ * nearZ ) / ( farZ + nearZ - sceneDepth.x * (farZ-nearZ) );\n"
2666 " fragDepthLinear = ( 2.0 * farZ * nearZ ) / ( farZ + nearZ - gl_FragCoord.z * (farZ-nearZ) );\n"
2667 " }\n"
2668 " // assume UV of 0.5, 0.5 is the centroid of this sphere volume\n"
2669 " float depthOffset = sqrt(pow(radius_p, 2.0) - pow(offset_len, 2.0));\n"
2670 " float frontDepth = fragDepthLinear - depthOffset;\n"
2671 " float backDepth = fragDepthLinear + depthOffset;\n"
2672 " float ds = min(sceneDepthLinear, backDepth) - max(nearZ, frontDepth);\n"
2673 " fragmentColor = fragmentColor * ( ds / (depthOffset*2.0) );\n"
2674 " gl_FragColor = fragmentColor;\n"
2675 "}";
2676 
2678 "attribute float radius;\n"
2679 "varying float offset_out;\n"
2680 "uniform float use_offset;\n"
2681 "void main()\n"
2682 "{\n"
2683 " gl_Position = ftransform();\n"
2684 " offset_out = radius * use_offset;\n"
2685 " gl_TexCoord[0] = gl_MultiTexCoord0;\n"
2686 " gl_FrontColor = gl_Color;\n"
2687 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2688 " #ifdef __GLSL_CG_DATA_TYPES\n"
2689 " // Check necessary for ATI specific behavior\n"
2690 " gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);\n"
2691 " #endif\n"
2692 "}";
2693 
2695 "uniform sampler2D baseMap;\n"
2696 "uniform sampler2D depthMap;\n"
2697 "uniform float window_width;\n"
2698 "uniform float window_height;\n"
2699 "uniform sampler2D distMap;\n"
2700 "uniform sampler2D frameBuffer;\n"
2701 "varying float offset_out;\n"
2702 "void main()\n"
2703 "{\n"
2704 " vec2 depthCoord = vec2(gl_FragCoord.x / window_width, gl_FragCoord.y / window_height);\n"
2705 " vec4 fragmentColor = texture2D(baseMap, gl_TexCoord[0].xy)*gl_Color.a;\n"
2706 " vec2 distortion = texture2D(distMap, gl_TexCoord[0].xy+vec2(0.0, offset_out)).rg;\n"
2707 " float alpha = clamp(dot(fragmentColor.rgb,vec3(0.3333))*10.0,0.0,1.0);\n"
2708 " distortion = ((distortion - 0.5) * 0.01) * alpha;\n"
2709 " gl_FragColor = texture2D(frameBuffer,depthCoord+distortion);\n"
2710 " gl_FragColor.a = alpha;\n"
2711 "}";
2712 
2714 "uniform sampler2D baseMap;\n"
2715 "void main()\n"
2716 "{\n"
2717 " vec4 fragmentColor = texture2D(baseMap, gl_TexCoord[0].xy)*gl_Color.a;\n"
2718 " gl_FragColor = fragmentColor;\n"
2719 "}";
2720 
2722 "#extension GL_EXT_geometry_shader4 : enable\n"
2723 "varying in vec3 up_g[];\n"
2724 "varying in float radius_g[];\n"
2725 "varying out float radius_p;\n"
2726 "varying out vec4 position_p;\n"
2727 "void main(void)\n"
2728 "{\n"
2729 " vec3 forward_vec = vec3(0.0, 0.0, 1.0);\n"
2730 " vec3 up_vec = normalize(up_g[0]);\n"
2731 " vec3 right_vec = cross(forward_vec, up_vec);\n"
2732 " vec4 pos = vec4(0.0, 0.0, 0.0, 0.0);\n"
2733 " right_vec = normalize(right_vec);\n"
2734 " pos = (gl_PositionIn[0] - vec4(radius_g[0] * up_vec, 0.0) - vec4(radius_g[0] * right_vec, 0.0));\n"
2735 " gl_Position = gl_ProjectionMatrix * pos;\n"
2736 " position_p = pos;\n"
2737 " gl_TexCoord[0] = vec4(0.0, 0.0, 0.0, 0.0);\n"
2738 " radius_p = radius_g[0];\n"
2739 " gl_FrontColor = gl_FrontColorIn[0];\n"
2740 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2741 " EmitVertex();\n"
2742 
2743 " pos = (gl_PositionIn[0] - vec4(radius_g[0] * up_vec, 0.0) + vec4(radius_g[0] * right_vec, 0.0));\n"
2744 " gl_Position = gl_ProjectionMatrix * pos;\n"
2745 " position_p = pos;\n"
2746 " gl_TexCoord[0] = vec4(0.0, 1.0, 0.0, 0.0);\n"
2747 " radius_p = radius_g[0];\n"
2748 " gl_FrontColor = gl_FrontColorIn[0];\n"
2749 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2750 " EmitVertex();\n"
2751 
2752 " pos = (gl_PositionIn[0] + vec4(radius_g[0] * up_vec, 0.0) - vec4(radius_g[0] * right_vec, 0.0));\n"
2753 " gl_Position = gl_ProjectionMatrix * pos;\n"
2754 " position_p = pos;\n"
2755 " gl_TexCoord[0] = vec4(1.0, 0.0, 0.0, 0.0);\n"
2756 " radius_p = radius_g[0];\n"
2757 " gl_FrontColor = gl_FrontColorIn[0];\n"
2758 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2759 " EmitVertex();\n"
2760 
2761 " pos = (gl_PositionIn[0] + vec4(radius_g[0] * up_vec, 0.0) + vec4(radius_g[0] * right_vec, 0.0));\n"
2762 " gl_Position = gl_ProjectionMatrix * pos;\n"
2763 " position_p = pos;\n"
2764 " gl_TexCoord[0] = vec4(1.0, 1.0, 0.0, 0.0);\n"
2765 " radius_p = radius_g[0];\n"
2766 " gl_FrontColor = gl_FrontColorIn[0];\n"
2767 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2768 " EmitVertex();\n"
2769 " EndPrimitive();\n"
2770 "}";
2771 
2773 "void main()\n"
2774 "{\n"
2775 " gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;\n"
2776 " gl_FrontColor = vec4(1.0);\n"
2777 " gl_Position = gl_Vertex;\n"
2778 " #ifdef __GLSL_CG_DATA_TYPES\n"
2779 " // Check necessary for ATI specific behavior\n"
2780 " gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);\n"
2781 " #endif\n"
2782 "}\n";
2783 
2785 "#extension GL_EXT_texture_array : enable\n"
2786 "uniform sampler2DArray shadow_map;\n"
2787 "//uniform sampler2D shadow_map;\n"
2788 "uniform int index;\n"
2789 "void main()\n"
2790 "{\n"
2791 " vec3 texcoord = vec3(gl_TexCoord[0].xy, float(index));\n"
2792 " gl_FragColor = vec4(texture2DArray(shadow_map, texcoord).rgb,1.0);\n"
2793 " //gl_FragColor = vec4(texture2D(shadow_map, gl_TexCoord[0].xy).rgb,1.0);\n"
2794 "}\n";
2795 
2797 "uniform sampler2D scene;\n"
2798 "uniform sampler2D cockpit;\n"
2799 "uniform vec2 sun_pos;\n"
2800 "uniform float density;\n"
2801 "uniform float weight;\n"
2802 "uniform float falloff;\n"
2803 "uniform float intensity;\n"
2804 "uniform float cp_intensity;\n"
2805 "void main()\n"
2806 "{\n"
2807 " vec2 step = vec2( gl_TexCoord[0].st - sun_pos.xy );\n"
2808 " vec2 pos = gl_TexCoord[0].st;\n"
2809 " step *= 1.0 / float(SAMPLE_NUM) * density;\n"
2810 " float decay = 1.0;\n"
2811 " vec4 sum = vec4(0.0);\n"
2812 " vec4 mask = texture2D(cockpit, gl_TexCoord[0].st);\n"
2813 " if (mask.r < 1.0) {\n"
2814 " gl_FragColor = vec4(cp_intensity);\n"
2815 " return;\n"
2816 " }\n"
2817 " for(int i=0; i < SAMPLE_NUM ; i++) {\n"
2818 " pos.st -= step;\n"
2819 " vec4 tex_sample = texture2D(scene, pos);\n"
2820 " if (tex_sample.r == 1.0)\n"
2821 " sum += decay * weight;\n"
2822 " decay *= falloff;\n"
2823 " }\n"
2824 " gl_FragColor = sum * intensity;\n"
2825 " gl_FragColor.a = 1.0;\n"
2826 "}";
2827 
2829 "void main()\n"
2830 "{\n"
2831 " gl_TexCoord[0] = gl_MultiTexCoord0;\n"
2832 " gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;\n"
2833 " gl_FrontColor = vec4(1.0);\n"
2834 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2835 "}";
2836 
2838 "uniform sampler2D ytex;\n"
2839 "uniform sampler2D utex;\n"
2840 "uniform sampler2D vtex;\n"
2841 "void main()\n"
2842 "{\n"
2843 " vec3 val = vec3(texture2D(ytex, gl_TexCoord[0].st).r - 0.0625, texture2D(utex, gl_TexCoord[0].st).r - 0.5, texture2D(vtex, gl_TexCoord[0].st).r - 0.5);\n"
2844 " gl_FragColor.r = dot(val, vec3(1.1640625, 0.0, 1.59765625));\n"
2845 " gl_FragColor.g = dot(val, vec3(1.1640625, -0.390625, -0.8125));\n"
2846 " gl_FragColor.b = dot(val, vec3(1.1640625, 2.015625, 0.0));\n"
2847 " gl_FragColor.a = 1.0;\n"
2848 "}";
2849 
2851 "uniform vec3 scale;\n"
2852 "uniform int lightType;\n"
2853 "\n"
2854 "varying vec3 lightPosition;\n"
2855 "varying vec3 beamVec;\n"
2856 "\n"
2857 "void main()\n"
2858 "{\n"
2859 " gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * vec4(gl_Vertex.xyz * scale,1.0);\n"
2860 " lightPosition = gl_ModelViewMatrix[3].xyz;\n"
2861 " if(lightType == 1)\n"
2862 " beamVec = vec3(gl_ModelViewMatrix * vec4(0.0, 0.0, -scale.z, 0.0));\n"
2863 "}";
2864 
2866 "uniform sampler2D ColorBuffer;\n"
2867 "uniform sampler2D NormalBuffer;\n"
2868 "uniform sampler2D PositionBuffer;\n"
2869 "uniform sampler2D SpecBuffer;\n"
2870 "uniform float specFactor;\n"
2871 "uniform float invScreenWidth;\n"
2872 "uniform float invScreenHeight;\n"
2873 "uniform int lightType;\n"
2874 "varying vec3 lightPosition;\n"
2875 "uniform float lightRadius;\n"
2876 "varying vec3 beamVec;\n"
2877 "uniform vec3 diffuseLightColor;\n"
2878 "uniform vec3 specLightColor;\n"
2879 "uniform float coneAngle;\n"
2880 "uniform float coneInnerAngle;\n"
2881 "uniform bool dualCone;\n"
2882 "uniform vec3 coneDir;\n"
2883 "\n"
2884 "#define SPEC_INTENSITY_POINT 5.3 // Point light\n"
2885 "#define SPEC_INTENSITY_DIRECTIONAL 3.0 // Directional light\n"
2886 "#define SPECULAR_FACTOR 1.75\n"
2887 "#define SPECULAR_ALPHA 0.1\n"
2888 "#define SPEC_FACTOR_NO_SPEC_MAP 0.6\n"
2889 "#define ENV_ALPHA_FACTOR 0.3\n"
2890 "#define GLOW_MAP_INTENSITY 1.5\n"
2891 "#define AMBIENT_LIGHT_BOOST 1.0\n"
2892 "void main()\n"
2893 "{\n"
2894 " vec2 screenPos = gl_FragCoord.xy * vec2(invScreenWidth, invScreenHeight);\n"
2895 " vec3 position = texture2D(PositionBuffer, screenPos).xyz;\n"
2896 "\n"
2897 " if(abs(dot(position, position)) < 0.1)\n"
2898 " discard;\n"
2899 " vec3 lightDir = lightPosition - position.xyz;\n"
2900 " float dist = length(lightDir);\n"
2901 " float attenuation = (1.0 - dist/lightRadius);\n"
2902 " if(lightType == 2)\n"
2903 " {\n"
2904 " float coneDot = dot(normalize(-lightDir), coneDir);\n"
2905 " if(dualCone) {\n"
2906 " if(abs(coneDot) < coneAngle)\n"
2907 " discard;\n"
2908 " else\n"
2909 " attenuation *= smoothstep(coneAngle, coneInnerAngle, abs(coneDot));\n"
2910 " } else {\n"
2911 " if(coneDot < coneAngle)\n"
2912 " discard;\n"
2913 " else\n"
2914 " attenuation *= smoothstep(coneAngle, coneInnerAngle, coneDot);\n"
2915 " }\n"
2916 " }\n"
2917 " if(dist > lightRadius && lightType != 1)\n"
2918 " discard;\n"
2919 " vec3 color = texture2D(ColorBuffer, screenPos).rgb;\n"
2920 " vec4 normal = texture2D(NormalBuffer, screenPos);\n"
2921 " vec3 specfactor = texture2D(SpecBuffer, screenPos).rgb;\n"
2922 " vec3 eyeDir = normalize(-position);\n"
2923 "\n"
2924 " if(lightType == 1)\n"
2925 " {\n"
2926 " float beamLength = length(beamVec);\n"
2927 " vec3 beamDir = beamVec / beamLength;\n"
2928 " // Get nearest point on line\n"
2929 " float neardist = clamp(dot(lightDir, beamDir), 0.0, beamLength);\n"
2930 " // Move back from the endpoint of the beam along the beam by the distance we calculated\n"
2931 " vec3 nearest = lightPosition - beamDir * neardist;\n"
2932 " lightDir = nearest - position.xyz;\n"
2933 " dist = length(lightDir);\n"
2934 " if(dist > lightRadius)\n"
2935 " discard;\n"
2936 " }\n"
2937 " lightDir /= dist;\n"
2938 " vec3 halfVec = normalize(lightDir + eyeDir);\n"
2939 " float NdotHV = clamp(dot(normal.xyz, halfVec), 0.0, 1.0);\n"
2940 " gl_FragData[0].rgb = color * (diffuseLightColor * (max(dot(normal.xyz, lightDir), 0.0)) * attenuation);\n"
2941 " gl_FragData[0].rgb += pow(NdotHV, specFactor) * SPEC_INTENSITY_POINT * specfactor * specLightColor * attenuation;\n"
2942 " gl_FragData[0].a = 1.0;\n"
2943 "}";
2944 
2946 "void main()\n"
2947 "{\n"
2948 " gl_TexCoord[0] = gl_MultiTexCoord0;\n"
2949 " gl_Position = gl_Vertex;\n"
2950 " gl_FrontColor = vec4(1.0);\n"
2951 " gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
2952 "}";
2953 
2955 "void main()\n"
2956 "{\n"
2957 " gl_FragData[0] = vec4(0.0, 0.0, 0.0, 1.0); // color\n"
2958 " gl_FragData[1] = vec4(0.0, 0.0, -1000000.0, 1.0); // position\n"
2959 " gl_FragData[2] = vec4(0.0, 0.0, 0.0, 1.0); // normal\n"
2960 " gl_FragData[3] = vec4(0.0, 0.0, 0.0, 1.0); // specular\n"
2961 "}\n";
int i
Definition: multi_pxo.cpp:466
char * Default_effect_vertex_shader
Definition: def_files.cpp:2601
char * Default_main_geometry_shader
Definition: def_files.cpp:1856
char * Default_blur_fragment_shader
Definition: def_files.cpp:2415
char * Default_effect_ribbon_geometry_shader
char * Default_ai_profiles_table
Definition: def_files.cpp:810
char * Default_deferred_fragment_shader
Definition: def_files.cpp:2865
def_file Default_files[]
Definition: def_files.cpp:62
char * Default_effect_distortion_fragment_shader
Definition: def_files.cpp:2694
const char * contents
Definition: def_files.cpp:18
const char * defaults_get_file(const char *filename)
Definition: def_files.cpp:103
char * Default_deferred_clear_fragment_shader
Definition: def_files.cpp:2954
char * Default_fxaa_vertex_shader
Definition: def_files.cpp:1891
char * Default_main_vertex_shader
Definition: def_files.cpp:1317
char * Default_lightshaft_fragment_shader
Definition: def_files.cpp:2796
char * Default_effect_screen_geometry_shader
Definition: def_files.cpp:2721
char * Default_deferred_vertex_shader
Definition: def_files.cpp:2850
char * filename
char * Default_post_processing_table
Definition: def_files.cpp:1243
char * Default_deferred_clear_vertex_shader
Definition: def_files.cpp:2945
char * Default_controlconfig_table
Definition: def_files.cpp:1230
char * Default_brightpass_fragment_shader
Definition: def_files.cpp:2449
char * Default_fxaa_fragment_shader
Definition: def_files.cpp:1903
char * Default_post_vertex_shader
Definition: def_files.cpp:2578
char * Default_mod_table
Definition: def_files.cpp:126
void _cdecl void void _cdecl Error(const char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
char * Default_autopilot_table
Definition: def_files.cpp:1175
char * Default_fonts_table
Definition: def_files.cpp:1214
struct def_file def_file
char * Default_video_fragment_shader
Definition: def_files.cpp:2837
char * Default_effect_distortion_vertex_shader
Definition: def_files.cpp:2677
const char * filename
Definition: def_files.cpp:17
char * Default_main_fragment_shader
Definition: def_files.cpp:1470
char * Default_post_fragment_shader
Definition: def_files.cpp:2464
#define LOCATION
Definition: pstypes.h:245
char * Default_effect_particle_fragment_shader
Definition: def_files.cpp:2638
char * Default_shadowdebug_vertex_shader
Definition: def_files.cpp:2772
char * Default_iff_table
Definition: def_files.cpp:254
char * Default_effect_fragment_shader
Definition: def_files.cpp:2713
char * Default_species_table
Definition: def_files.cpp:189
char * Default_fxaa_prepass_shader
Definition: def_files.cpp:2594
char * Default_video_vertex_shader
Definition: def_files.cpp:2828
#define stricmp(s1, s2)
Definition: config.h:271
char * Default_shadowdebug_fragment_shader
Definition: def_files.cpp:2784
char * Default_shiptypes_table
Definition: def_files.cpp:319