-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.html
More file actions
619 lines (606 loc) · 21.8 KB
/
index.html
File metadata and controls
619 lines (606 loc) · 21.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Hugo Locurcio" />
<meta
name="description"
content="Generate SCons options to compile custom export templates with size optimizations."
/>
<meta name="theme-color" content="#3d8fcc" />
<title>Godot build options generator</title>
<link rel="icon" href="favicon.png" />
<link rel="stylesheet" href="main.css" />
<script defer src="thirdparty/alpine.min.js"></script>
</head>
<body>
<main x-data="buildOptionsGenerator()">
<div class="grid">
<div class="options">
<h1>Godot build options generator</h1>
<em style="opacity: 0.7"
>Last updated for <strong>Godot 4.2.x</strong>. This generator may
work with other Godot versions, but certain options may not have an
effect.</em
>
<p>
This tool generates SCons custom option files to build smaller
export templates. After downloading a <code>custom.py</code> file,
place it at the root of your Godot source repository and compile
export templates for the platforms you need. Once this is done,
you'll only have to specify the
<code>platform=<platform> target=release</code> options on the
SCons command line. See
<a
href="https://docs.godotengine.org/en/latest/development/compiling/optimizing_for_size.html"
>Optimizing a build for size</a
>
in the Godot documentation for more information.
</p>
<p>
<strong>Note:</strong> Since this tool is dedicated to building
smaller export templates, it doesn't list modules that are only
compiled in editor builds.
</p>
<h2>Select options and modules</h2>
<template x-for="(option, index) in options" :key="option.id">
<label class="option-label">
<input type="checkbox" x-model="option.enabled" />
<span
x-text="!option.notModule ? `Enable module: ${option.name}` : option.name"
:style="`font-weight: ${option.enabled ? '700' : '400'}`"
></span>
<!-- Visually align the description with the name. -->
<span
x-text="option.description"
style="display: block; margin-left: 30px; opacity: 0.65"
>
</span>
<input
x-show="option.text & option.enabled"
type="text"
x-model="option.value"
/>
</label>
</template>
</div>
<div class="preview">
<h2>Resulting <code>custom.py</code></h2>
<textarea
readonly
x-html="generatedOptions()"
x-ref="textarea"
@click="$refs.textarea.select()"
style="width: 100%; height: 500px"
>
</textarea>
<div style="margin-top: 10px">
<button type="button" @click="downloadOptions()">Download</button>
<button type="button" @click="copyOptionsToClipboard()">
Copy to clipboard
</button>
</div>
</div>
</div>
<footer style="margin: 2rem 0 4rem 0; opacity: 0.8; text-align: center">
© 2020-present Hugo Locurcio and contributors<br />
<a
href="https://github.com/godot-build-options-generator/godot-build-options-generator.github.io"
>
Contribute to this generator on GitHub!
</a>
</footer>
</main>
<script>
function buildOptionsGenerator() {
return {
options: [
{
id: "extra_suffix",
name: "Extra suffix",
description:
'Changes the "custom_build" suffix. Useful for adding your "game_title" to a build.',
text: true,
value: "custom_build",
default: "custom_build",
notModule: true,
},
{
id: "production",
name: "Production",
description: "Set defaults to build Godot for use in production.",
enabled: false,
default: false,
notModule: true,
},
{
id: "disable_3d",
name: "Disable 3D",
description: "Disable 3D nodes for a smaller binary.",
enabled: false,
default: false,
notModule: true,
},
{
id: "optimize",
name: "Optimize for size",
description:
"Optimize the compiled binary for size instead of speed.",
enabled: false,
default: false,
notModule: true,
},
// TODO: Uncomment when Godot 4.3 is released.
// {
// id: "threads",
// name: "Enable threading support",
// description:
// "Disabling this removes SharedArrayBuffer and cross-origin isolation requirements for web exports.",
// enabled: true,
// default: true,
// notModule: true,
// },
{
id: "precision",
name: "Enable double-precision floats",
description:
"Increase precision for large-scale worlds. This has a performance impact and requires GDExtensions specifically compiled for it (i.e. its ABI is not compatible with single-precision builds).",
enabled: false,
default: false,
notModule: true,
},
{
id: "disable_advanced_gui",
name: "Disable advanced GUI",
description:
"Disable advanced GUI nodes and behaviors such as Tree and GraphEdit.",
enabled: false,
default: false,
notModule: true,
},
{
id: "deprecated",
name: "Enable deprecated features",
description:
"Disabling deprecated features can make the binary slightly smaller.",
enabled: true,
default: true,
notModule: true,
},
{
id: "minizip",
name: "Enable Minizip",
description:
"Required to use the ZIPReader and ZIPWriter classes. Also required to run projects that use data packed in a ZIP archive instead of a PCK.",
enabled: true,
default: true,
notModule: true,
},
{
id: "brotli",
name: "Enable Brotli",
description:
"Required to use Brotli (de)compression. Also required to use fonts in the WOFF2 format.",
enabled: true,
default: true,
notModule: true,
},
{
id: "vulkan",
name: "Enable Vulkan",
description:
"Required to use the Forward+ and Mobile rendering methods with Vulkan.",
enabled: true,
default: true,
notModule: true,
},
{
id: "opengl3",
name: "Enable OpenGL",
description:
"Required to use the Compatibility rendering method with OpenGL 3.3/OpenGL ES 3.0/WebGL 2.0.",
enabled: true,
default: true,
notModule: true,
},
// TODO: Uncomment when Godot 4.3 is released.
// {
// id: "d3d12",
// name: "Enable Direct3D 12",
// description:
// "Required to use Forward+ and Mobile rendering methods with Direct3D 12 (only effective when targeting Windows). If enabled, run `misc/scripts/install_d3d12_sdk_windows.py` in the Godot repository to set up dependencies before compiling.",
// enabled: false,
// default: false,
// notModule: true,
// },
// "astcenc" isn't included as it's editor-only.
{
id: "basis_universal",
name: "Basis Universal",
description:
"Required to load textures imported as Basis Universal.",
enabled: true,
default: true,
},
{
id: "bmp",
name: "BMP",
description: "Required to load BMP images.",
enabled: true,
default: true,
},
{
id: "camera",
name: "Camera",
description:
"Required for webcam support (unrelated to the Camera2D/Camera3D nodes).",
enabled: true,
default: true,
},
{
id: "csg",
name: "CSG",
description: "Required to use Constructive Solid Geometry nodes.",
enabled: true,
default: true,
},
// "cvtt" isn't included as "basis_universal" (which depends on it) isn't included either.
{
id: "dds",
name: "DDS",
description: "Required to load DirectDraw Surface images.",
enabled: true,
default: true,
},
// "denoise" isn't included as it's editor-only.
{
id: "enet",
name: "ENet",
description:
"Required to use NetworkedMultiplayerENet and NetworkedMultiplayerPeer.",
enabled: true,
default: true,
},
// "etcpak" isn't included as it's editor-only.
// TODO: Uncomment when Godot 4.3 is released.
// {
// id: "fbx",
// name: "fbx",
// description:
// "Required to load non-imported 3D scenes in the FBX format.",
// enabled: true,
// default: true,
// },
{
id: "freetype",
name: "FreeType",
description:
"Required to render DynamicFonts. Bitmap fonts can still be used without FreeType.",
enabled: true,
default: true,
},
{
id: "gdscript",
name: "GDScript",
description: "Required to run scripts written in GDScript.",
enabled: true,
default: true,
},
// "glslang" isn't included as it's critical for the engine to work.
{
id: "gltf",
name: "GLTF",
description:
"Required to load non-imported 3D scenes in the glTF format.",
enabled: true,
default: true,
},
{
id: "gridmap",
name: "GridMap",
description: "Required to use GridMap nodes.",
enabled: true,
default: true,
},
{
id: "hdr",
name: "HDR",
description: "Required to load Radiance HDR images.",
enabled: true,
default: true,
},
// TODO: Uncomment when Godot 4.3 is released.
// {
// id: "interactive_music",
// name: "Interactive music",
// description:
// "Required to use interactive music (AudioStreamInteractive, AudioStreamPlaylist, AudioStreamSynchronized resources).",
// enabled: true,
// default: true,
// },
{
id: "jpg",
name: "JPG",
description: "Required to load JPEG images.",
enabled: true,
default: true,
},
{
id: "jsonrpc",
name: "JSON-RPC",
description: "Required to use the JSONRPC class.",
enabled: true,
default: true,
},
{
id: "ktx",
name: "KTX",
description: "Required to load Khronos KTX images.",
enabled: true,
default: true,
},
// 'lightmapper_rd' isn't included as it's editor-only.
{
id: "mbedtls",
name: "mbedTLS",
description:
"Required to make secure requests with HTTPClient, HTTPRequest and WebSocket classes.",
enabled: true,
default: true,
},
{
id: "meshoptimizer",
name: "meshoptimizer",
description:
"Required for optimized SurfaceTool usage, including automatic LOD generation.",
enabled: true,
default: true,
},
{
id: "minimp3",
name: "minimp3",
description:
"Required to play back MP3 sounds in AudioStreamPlayer.",
enabled: true,
default: true,
},
{
id: "mobile_vr",
name: "Mobile VR",
description: "Required to use VR on Android and iOS.",
enabled: true,
default: true,
},
{
id: "mono",
name: "Mono",
description:
"Required to run scripts written in C#. (Godot uses .NET in 4.x, despite the option name mentioning Mono.)",
enabled: false,
default: false,
},
{
id: "msdfgen",
name: "MSDFGen",
description:
"Required to use Multichannel Signed Distance Fields on fonts.",
enabled: true,
default: true,
},
{
id: "multiplayer",
name: "Multiplayer",
description:
"Required to use the multiplayer replication system (RPCs).",
enabled: true,
default: true,
},
{
id: "navigation",
name: "Navigation",
description: "Required to use NavigationServer.",
enabled: true,
default: true,
},
{
id: "noise",
name: "Noise",
description:
"Required to use Noise, FastNoiseLite and NoiseTextures that rely on it.",
enabled: true,
default: true,
},
{
id: "ogg",
name: "OGG",
description:
"Required by `vorbis` for Ogg Vorbis audio playback. See also `stb_vorbis`.",
enabled: true,
default: true,
},
{
id: "openxr",
name: "OpenXR",
description:
"Required to use virtual reality and augmented reality with OpenXR.",
enabled: true,
default: true,
},
{
id: "raycast",
name: "Raycast",
description:
"Required to use occlusion culling. (This option is disabled by default in web exports to reduce binary size.)",
enabled: true,
default: true,
},
{
id: "regex",
name: "RegEx",
description:
"Required to parse regular expressions with the RegEx class.",
enabled: true,
default: true,
},
{
id: "squish",
name: "Squish",
description:
"Required to decompress images compressed with Squish (including S3TC VRAM compression).",
enabled: true,
default: true,
},
{
id: "svg",
name: "SVG",
description: "Required to load non-imported SVG images.",
enabled: true,
default: true,
},
{
id: "text_server_adv",
name: "Text Server Advanced",
description:
"Required to use TextServerAdvanced, which is the default TextServer. Supports right-to-left typesetting and complex scripts.",
enabled: true,
default: true,
},
{
id: "text_server_fb",
name: "Text Server Fallback",
description:
"Required to use TextServerFallback. Does not support right-to-left typesetting or complex scripts. Enable this if disabling Text Server Advanced above; otherwise, no text will be displayed.",
enabled: false,
default: false,
},
{
id: "tga",
name: "TGA",
description: "Required to load TrueVision Targa images.",
enabled: true,
default: true,
},
{
id: "theora",
name: "Theora",
description:
"Required to play back Ogg Theora videos in VideoStreamPlayer/VideoPlayer.",
enabled: true,
default: true,
},
// 'tinyexr' isn't included as it's editor-only.
{
id: "upnp",
name: "UPnP",
description:
"Required to use the UPNP classes for network discovery and automatic port forwarding.",
enabled: true,
default: true,
},
{
id: "vhacd",
name: "V-HACD",
description:
"Required to create convex collision shapes in Mesh at runtime. (Not required if convex shapes were created on import.)",
enabled: true,
default: true,
},
{
id: "vorbis",
name: "Vorbis",
description:
"Required to play back Ogg Vorbis sounds in AudioStreamPlayer. See also `ogg`.",
enabled: true,
default: true,
},
// 'webp' isn't included as it's critical for the engine to work since 3.4.
{
id: "webrtc",
name: "WebRTC",
description: "Required to use WebRTC connections.",
enabled: true,
default: true,
},
{
id: "websocket",
name: "WebSocket",
description: "Required to use WebSocket connections.",
enabled: true,
default: true,
},
{
id: "webxr",
name: "WebXR",
description: "Required to run AR/VR on browsers.",
enabled: true,
default: true,
},
{
id: "zip",
name: "ZIP",
description:
"Required to use the ZIPReader and ZIPPacker classes (also requires Minizip to be enabled).",
enabled: true,
default: true,
},
{
id: "custom_modules",
name: "Custom modules path",
description:
"Specifies a path to a folder containing custom C++ modules to build. Useful for keeping custom modules separate from the Godot repository.",
text: true,
value: "",
default: "",
notModule: true,
},
// 'xatlas_unwrap' isn't included as it's editor-only.
],
// Returns the generated output file as a string.
// NOTE: This is displayed into a `x-html` directive so that line
// breaks display as expected. Make sure to escape HTML tags and
// validate user input to avoid XSS vulnerabilities!
generatedOptions() {
generated =
"# Generated using https://godot-build-options-generator.github.io\n\n";
this.options.forEach((option) => {
if (option.text) {
if (option.value != option.default && option.enabled) {
generated += `${option.id} = "${option.value}"\n`;
}
} else if (option.enabled !== option.default) {
if (option.notModule != undefined) {
if (option.id === "optimize") {
generated += `${option.id} = "${option.enabled ? "size" : "speed"}"\n`;
} else if (option.id === "precision") {
generated += `${option.id} = "${option.enabled ? "double" : "single"}"\n`;
} else {
generated += `${option.id} = "${option.enabled ? "yes" : "no"}"\n`;
}
} else {
generated += `module_${option.id}_enabled = "${option.enabled ? "yes" : "no"}"\n`;
}
}
});
return generated;
},
downloadOptions() {
const blob = new Blob([this.generatedOptions()], {
type: "text/plain",
oneTimeOnly: true,
});
const elem = window.document.createElement("a");
elem.href = window.URL.createObjectURL(blob);
elem.download = "custom.py";
document.body.appendChild(elem);
elem.click();
document.body.removeChild(elem);
},
copyOptionsToClipboard() {
navigator.clipboard.writeText(this.generatedOptions());
},
};
}
</script>
</body>
</html>