@ignifx/core 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4817,7 +4817,7 @@ function createServiceKey(name) {
4817
4817
  *
4818
4818
  * @public
4819
4819
  */
4820
- const VERSION = "0.15.0";
4820
+ const VERSION = "0.16.0";
4821
4821
  //#endregion
4822
4822
  //#region src/assets/delivery-system.ts
4823
4823
  /**
@@ -10781,6 +10781,67 @@ const CANVAS_ALPHA_MODES = ["opaque", "premultiplied"];
10781
10781
  */
10782
10782
  const AMBIENT_OCCLUSION_QUALITIES = ["half", "full"];
10783
10783
  /**
10784
+ * The rendering quality tiers, in the order the inspector lists them
10785
+ * (`docs/standards/coding-standards.md` §7 gives each tier's GPU budget).
10786
+ *
10787
+ * @remarks
10788
+ * - `"custom"` (default): every effect is exactly as the section and the `PostProcessStack`s say.
10789
+ * - `"low"`: GTAO at half resolution; no HDR, TAA, contact shadows or SSGI.
10790
+ * - `"medium"`: adds HDR and TAA, and lets a stack run contact shadows.
10791
+ * - `"high"`: GTAO at full resolution, and lets a stack run SSGI.
10792
+ *
10793
+ * @public
10794
+ */
10795
+ const RENDERING_QUALITIES = [
10796
+ "custom",
10797
+ "low",
10798
+ "medium",
10799
+ "high"
10800
+ ];
10801
+ /** The presets of the three named tiers; `"custom"` has none. Bloom and tone mapping stay as authored. */
10802
+ const QUALITY_PRESETS = {
10803
+ low: {
10804
+ hdr: false,
10805
+ taa: false,
10806
+ ambientOcclusion: true,
10807
+ ambientOcclusionQuality: "half",
10808
+ contactShadows: false,
10809
+ ssgi: false
10810
+ },
10811
+ medium: {
10812
+ hdr: true,
10813
+ taa: true,
10814
+ ambientOcclusion: true,
10815
+ ambientOcclusionQuality: "half",
10816
+ contactShadows: true,
10817
+ ssgi: false
10818
+ },
10819
+ high: {
10820
+ hdr: true,
10821
+ taa: true,
10822
+ ambientOcclusion: true,
10823
+ ambientOcclusionQuality: "full",
10824
+ contactShadows: true,
10825
+ ssgi: true
10826
+ }
10827
+ };
10828
+ /**
10829
+ * The preset of a quality tier.
10830
+ *
10831
+ * @param quality - The tier; anything that is not a named tier reads as `"custom"`.
10832
+ * @returns The preset, or `null` for `"custom"`.
10833
+ *
10834
+ * @internal
10835
+ */
10836
+ function renderingQualityPreset(quality) {
10837
+ switch (quality) {
10838
+ case "low":
10839
+ case "medium":
10840
+ case "high": return QUALITY_PRESETS[quality];
10841
+ default: return null;
10842
+ }
10843
+ }
10844
+ /**
10784
10845
  * The name the `rendering` project settings section is registered under.
10785
10846
  *
10786
10847
  * @public
@@ -10875,7 +10936,8 @@ function defaultRenderingSettings() {
10875
10936
  hdr: false,
10876
10937
  autoExposure: defaultAutoExposureSettings(),
10877
10938
  ambientOcclusion: { ...DEFAULT_AMBIENT_OCCLUSION },
10878
- taa: defaultTaaSettings()
10939
+ taa: defaultTaaSettings(),
10940
+ quality: "custom"
10879
10941
  };
10880
10942
  }
10881
10943
  /**
@@ -10966,7 +11028,8 @@ function renderingSettingsSchema() {
10966
11028
  min: 0,
10967
11029
  tooltip: "Camera jump per frame, in world units, that resets history."
10968
11030
  })
10969
- }, { tooltip: "Temporal anti-aliasing (jittered frames accumulated over time). Needs rendering.hdr." })
11031
+ }, { tooltip: "Temporal anti-aliasing (jittered frames accumulated over time). Needs rendering.hdr." }),
11032
+ quality: enumOf(RENDERING_QUALITIES, "custom", { tooltip: "Quality tier. low: half-res GTAO. medium: adds HDR, TAA, contact shadows. high: full-res GTAO, SSGI. custom: as set. Fields you set win." })
10970
11033
  });
10971
11034
  }
10972
11035
  /**
@@ -11134,6 +11197,52 @@ function toAutoExposureOptions(settings) {
11134
11197
  compensation: declared.compensation ?? defaults.compensation
11135
11198
  };
11136
11199
  }
11200
+ /**
11201
+ * The section with its quality tier applied: what the renderer runs with.
11202
+ *
11203
+ * @remarks
11204
+ * `"custom"` returns the section unchanged. A named tier fills `hdr`, `taa.enabled`,
11205
+ * `ambientOcclusion.enabled` and `ambientOcclusion.quality` from its preset, except where the project
11206
+ * wrote the field itself. The resolved section cannot say which fields those are (the store fills
11207
+ * in defaults), so the caller passes what the project declared.
11208
+ *
11209
+ * @param settings - The resolved section.
11210
+ * @param declared - The project's own `rendering` value, before defaults; `undefined` when absent.
11211
+ * @returns The effective section; the input when the tier is `"custom"`.
11212
+ *
11213
+ * @internal
11214
+ */
11215
+ function applyRenderingQuality(settings, declared) {
11216
+ const preset = renderingQualityPreset(settings.quality);
11217
+ if (preset === null) return settings;
11218
+ const section = fieldsOf(declared);
11219
+ const taa = fieldsOf(section["taa"]);
11220
+ const occlusion = fieldsOf(section["ambientOcclusion"]);
11221
+ const resolvedOcclusion = resolveAmbientOcclusion(settings.ambientOcclusion);
11222
+ return {
11223
+ ...settings,
11224
+ hdr: typeof section["hdr"] === "boolean" ? settings.hdr : preset.hdr,
11225
+ taa: {
11226
+ ...resolveTaaSettings(settings),
11227
+ enabled: typeof taa["enabled"] === "boolean" ? taa["enabled"] : preset.taa
11228
+ },
11229
+ ambientOcclusion: {
11230
+ ...resolvedOcclusion,
11231
+ enabled: typeof occlusion["enabled"] === "boolean" ? occlusion["enabled"] : preset.ambientOcclusion,
11232
+ quality: typeof occlusion["quality"] === "string" ? resolvedOcclusion.quality : preset.ambientOcclusionQuality
11233
+ }
11234
+ };
11235
+ }
11236
+ /**
11237
+ * The own fields of a declared record.
11238
+ *
11239
+ * @param value - What the project wrote.
11240
+ * @returns Its fields, or an empty record when it is not an object.
11241
+ */
11242
+ function fieldsOf(value) {
11243
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return {};
11244
+ return Object.fromEntries(Object.entries(value));
11245
+ }
11137
11246
  //#endregion
11138
11247
  //#region src/render/renderer.ts
11139
11248
  /**
@@ -11200,8 +11309,10 @@ const MAX_RESOLUTION_SCALE = 1;
11200
11309
  * @internal
11201
11310
  */
11202
11311
  var RendererImpl = class {
11203
- /** The resolved `rendering` settings section. */
11312
+ /** The resolved `rendering` settings section, with its `quality` tier applied. */
11204
11313
  settings;
11314
+ /** The `rendering.quality` tier's preset, which caps a stack's effects; `null` for `"custom"`. */
11315
+ qualityPreset;
11205
11316
  /** `true` once a topology change needs one `rebuildSceneRenderables` this frame. */
11206
11317
  needsRenderableRebuild = false;
11207
11318
  /** `true` once a `castShadows` or caster-set change needs the caster lists rebuilt this frame. */
@@ -11321,6 +11432,7 @@ var RendererImpl = class {
11321
11432
  constructor(app, settings) {
11322
11433
  this.#app = app;
11323
11434
  this.settings = settings;
11435
+ this.qualityPreset = renderingQualityPreset(settings.quality);
11324
11436
  this.#features = toRenderingFeatures(settings);
11325
11437
  this.#pixelRatio = settings.maxDevicePixelRatio;
11326
11438
  const counters = app.diagnostics.registerGroup(RENDER_DIAGNOSTICS_GROUP, RENDER_DIAGNOSTICS_COUNTERS);
@@ -15288,6 +15400,12 @@ function collectNames(node, out) {
15288
15400
  */
15289
15401
  const MESHOPT_DECODER_FILE = "meshopt_decoder.js";
15290
15402
  /**
15403
+ * The file name of the Draco decoder script Lite injects.
15404
+ *
15405
+ * @internal
15406
+ */
15407
+ const DRACO_DECODER_FILE = "draco_decoder.js";
15408
+ /**
15291
15409
  * The transcoder modules `babylon.ktx2Decoder.js` fetches, as `[class, static property, file]`:
15292
15410
  * the class in the decoder's `KTX2DECODER` namespace whose property holds the URL, and the file
15293
15411
  * name it is served under. These are the defaults in `@babylonjs/ktx2decoder`'s
@@ -15347,8 +15465,9 @@ const KTX2_TRANSCODER_FILES = [
15347
15465
  *
15348
15466
  * @remarks
15349
15467
  * The transcoders are only worth overriding together with the decoder script that reads them, so
15350
- * they are ignored when the manifest has no `babylon.ktx2Decoder.js`. Lite takes the meshopt
15351
- * decoder's **directory**, so its entry is used only when its URL ends in the file name.
15468
+ * they are ignored when the manifest has no `babylon.ktx2Decoder.js`. Lite takes the meshopt and
15469
+ * Draco decoders' **directories**, so an entry is used only when its URL ends in the file name, and
15470
+ * the Draco script only when its WebAssembly is listed in the same directory.
15352
15471
  *
15353
15472
  * @param manifest - The asset manifest.
15354
15473
  * @returns The locations; a `null` field means the manifest does not list that decoder.
@@ -15372,13 +15491,25 @@ function decoderUrlsFromManifest(manifest) {
15372
15491
  [property]: url
15373
15492
  };
15374
15493
  }
15375
- const meshoptUrl = urls.get(MESHOPT_DECODER_FILE);
15494
+ const meshoptBaseUrl = directoryOf(urls.get(MESHOPT_DECODER_FILE), MESHOPT_DECODER_FILE);
15495
+ const dracoDirectory = directoryOf(urls.get(DRACO_DECODER_FILE), DRACO_DECODER_FILE);
15376
15496
  return {
15377
15497
  ktx2Decoder,
15378
15498
  ktx2Transcoders,
15379
- meshoptBaseUrl: meshoptUrl?.endsWith("meshopt_decoder.js") === true ? meshoptUrl.slice(0, meshoptUrl.length - 18) : null
15499
+ meshoptBaseUrl,
15500
+ dracoBaseUrl: dracoDirectory !== null && urls.get("draco_decoder_gltf.wasm") === `${dracoDirectory}draco_decoder_gltf.wasm` ? dracoDirectory : null
15380
15501
  };
15381
15502
  }
15503
+ /**
15504
+ * The directory a file is served from, when its URL ends in the name Lite appends.
15505
+ *
15506
+ * @param url - The manifest URL, or `undefined` when the manifest has no entry.
15507
+ * @param file - The file name Lite appends to the directory.
15508
+ * @returns The directory with its trailing slash, or `null`.
15509
+ */
15510
+ function directoryOf(url, file) {
15511
+ return url?.endsWith(file) === true ? url.slice(0, url.length - file.length) : null;
15512
+ }
15382
15513
  /** What {@link configureDecoders} last handed Lite, so an unchanged manifest costs one comparison. */
15383
15514
  let appliedKey = null;
15384
15515
  /**
@@ -15397,10 +15528,10 @@ let appliedKey = null;
15397
15528
  */
15398
15529
  async function configureDecoders(app) {
15399
15530
  const urls = decoderUrlsFromManifest(app.assets.manifest);
15400
- if (urls.ktx2Decoder === null && urls.meshoptBaseUrl === null) return;
15531
+ if (urls.ktx2Decoder === null && urls.meshoptBaseUrl === null && urls.dracoBaseUrl === null) return;
15401
15532
  const key = JSON.stringify(urls);
15402
15533
  if (key === appliedKey) return;
15403
- (await import("./decoders-CHJ7vduE.js")).applyLiteDecoderUrls(urls);
15534
+ (await import("./decoders-BUQrlS8U.js")).applyLiteDecoderUrls(urls);
15404
15535
  appliedKey = key;
15405
15536
  }
15406
15537
  //#endregion
@@ -15603,9 +15734,11 @@ function createModelAsset(address, container, scene) {
15603
15734
  * ## Decoders
15604
15735
  *
15605
15736
  * A glTF may need one of Lite's run-time decoders: `KHR_texture_basisu` images go through the KTX2
15606
- * decoder and `EXT_meshopt_compression` buffers through the meshopt decoder. Both load from
15607
- * `cdn.babylonjs.com` unless told otherwise, so the loader calls `configureDecoders` first, which
15608
- * points Lite at the copies `@ignifx/vite-plugin` serves (`../decoder-urls.ts`).
15737
+ * decoder, `EXT_meshopt_compression` buffers through the meshopt decoder and
15738
+ * `KHR_draco_mesh_compression` primitives through the Draco decoder. Lite loads them from
15739
+ * `cdn.babylonjs.com` (Draco: from `/`) unless told otherwise, so the loader calls
15740
+ * `configureDecoders` first, which points Lite at the copies `@ignifx/vite-plugin` serves
15741
+ * (`../decoder-urls.ts`). Lite fetches a decoder only when a file uses its extension.
15609
15742
  *
15610
15743
  * ## Headless
15611
15744
  *
@@ -15848,7 +15981,7 @@ function loadTexture(engine, url, options) {
15848
15981
  * @internal
15849
15982
  */
15850
15983
  async function loadKtx2Texture(engine, url, options = {}) {
15851
- return (await import("./decoders-CHJ7vduE.js")).loadKtx2TextureWithOptions(engine, url, options);
15984
+ return (await import("./decoders-BUQrlS8U.js")).loadKtx2TextureWithOptions(engine, url, options);
15852
15985
  }
15853
15986
  /**
15854
15987
  * Loads a Basis Universal (`.basis`) texture from a URL.
@@ -15866,7 +15999,7 @@ async function loadKtx2Texture(engine, url, options = {}) {
15866
15999
  * @internal
15867
16000
  */
15868
16001
  async function loadBasisTexture(engine, url, options = {}) {
15869
- return (await import("./decoders-CHJ7vduE.js")).loadBasisTextureWithOptions(engine, url, options);
16002
+ return (await import("./decoders-BUQrlS8U.js")).loadBasisTextureWithOptions(engine, url, options);
15870
16003
  }
15871
16004
  /**
15872
16005
  * Creates a 2D texture from tightly packed RGBA8 bytes.
@@ -18218,11 +18351,14 @@ var ScreenSpaceEffects = class {
18218
18351
  * @param isEnabled - Whether the stack is enabled in the hierarchy.
18219
18352
  */
18220
18353
  sync(renderer, contact, ssgi, isEnabled) {
18221
- const key = buildKey(renderer, contact, ssgi, isEnabled);
18354
+ const tier = renderer.qualityPreset;
18355
+ const runsContact = contact.enabled && (tier === null || tier.contactShadows);
18356
+ const runsSsgi = ssgi.enabled && (tier === null || tier.ssgi);
18357
+ const key = buildKey(renderer, runsContact, runsSsgi, ssgi.halfResolution, isEnabled);
18222
18358
  if (key !== this.#key) {
18223
18359
  this.#key = key;
18224
18360
  this.#teardown(renderer.isSceneRegistered);
18225
- if (key !== "") this.#build(renderer, contact, ssgi, this.#generation).catch((failure) => {
18361
+ if (key !== "") this.#build(renderer, runsContact ? contact : null, runsSsgi ? ssgi : null, this.#generation).catch((failure) => {
18226
18362
  renderer.app.log.error(`PostProcessStack could not build contact shadows or SSGI: ${failure instanceof Error ? failure.message : String(failure)}`);
18227
18363
  });
18228
18364
  return;
@@ -18259,16 +18395,16 @@ var ScreenSpaceEffects = class {
18259
18395
  * Loads the chunks, leases the scene inputs, and installs the passes.
18260
18396
  *
18261
18397
  * @param renderer - The rendering service.
18262
- * @param contact - The `contactShadows` record.
18263
- * @param ssgi - The `ssgi` record.
18398
+ * @param contact - The `contactShadows` record, or `null` when it does not run.
18399
+ * @param ssgi - The `ssgi` record, or `null` when it does not run.
18264
18400
  * @param generation - The generation this build belongs to.
18265
18401
  */
18266
18402
  async #build(renderer, contact, ssgi, generation) {
18267
18403
  const [inputs, wiring, contactModule, ssgiModule] = await Promise.all([
18268
18404
  renderer.acquireSceneInputs(),
18269
18405
  import("./scene-color-passes-DlNr-qyZ.js"),
18270
- contact.enabled ? import("./contact-shadows-T523EXaP.js") : null,
18271
- ssgi.enabled ? import("./ssgi-Dm-maZrc.js") : null
18406
+ contact === null ? null : import("./contact-shadows-T523EXaP.js"),
18407
+ ssgi === null ? null : import("./ssgi-Dm-maZrc.js")
18272
18408
  ]);
18273
18409
  const presenter = renderer.presenter;
18274
18410
  const camera = renderer.isHeadless ? null : renderer.scene.camera;
@@ -18278,9 +18414,9 @@ var ScreenSpaceEffects = class {
18278
18414
  }
18279
18415
  const { engine, scene } = renderer;
18280
18416
  const passes = [];
18281
- const contactPass = contactModule?.createContactShadowsPass(engine, scene, inputs.depthTarget, camera, contact) ?? null;
18417
+ const contactPass = contact === null ? null : contactModule?.createContactShadowsPass(engine, scene, inputs.depthTarget, camera, contact) ?? null;
18282
18418
  if (contactPass !== null) passes.push(contactPass);
18283
- const ssgiPass = ssgiModule?.createSsgiPass(engine, scene, inputs.depthTarget, camera, {
18419
+ const ssgiPass = ssgi === null ? null : ssgiModule?.createSsgiPass(engine, scene, inputs.depthTarget, camera, {
18284
18420
  tuning: ssgi,
18285
18421
  halfResolution: ssgi.halfResolution,
18286
18422
  usePlugin: renderer.settings.hdr || renderer.features.materialPlugins
@@ -18293,21 +18429,22 @@ var ScreenSpaceEffects = class {
18293
18429
  contact: contactPass,
18294
18430
  ssgi: ssgiPass
18295
18431
  };
18296
- contactPass?.update(contact);
18297
- ssgiPass?.update(ssgi, renderer.isSceneRegistered);
18432
+ if (contact !== null) contactPass?.update(contact);
18433
+ if (ssgi !== null) ssgiPass?.update(ssgi, renderer.isSceneRegistered);
18298
18434
  }
18299
18435
  };
18300
18436
  /**
18301
18437
  * The build's identity: which passes run, SSGI's resolution, and the camera; `""` for none.
18302
18438
  *
18303
18439
  * @param renderer - The rendering service.
18304
- * @param contact - The `contactShadows` record.
18305
- * @param ssgi - The `ssgi` record.
18440
+ * @param runsContact - Whether contact shadows run.
18441
+ * @param runsSsgi - Whether SSGI runs.
18442
+ * @param ssgiHalf - SSGI's `halfResolution`.
18306
18443
  * @param isEnabled - Whether the stack is enabled in the hierarchy.
18307
18444
  * @returns The key.
18308
18445
  */
18309
- function buildKey(renderer, contact, ssgi, isEnabled) {
18310
- if (!isEnabled || !contact.enabled && !ssgi.enabled || renderer.isHeadless || renderer.presenter === null) return "";
18446
+ function buildKey(renderer, runsContact, runsSsgi, ssgiHalf, isEnabled) {
18447
+ if (!isEnabled || !runsContact && !runsSsgi || renderer.isHeadless || renderer.presenter === null) return "";
18311
18448
  const camera = renderer.scene.camera;
18312
18449
  if (camera === null) return "";
18313
18450
  cameraIds ??= /* @__PURE__ */ new WeakMap();
@@ -18317,8 +18454,7 @@ function buildKey(renderer, contact, ssgi, isEnabled) {
18317
18454
  nextCameraId += 1;
18318
18455
  cameraIds.set(camera, id);
18319
18456
  }
18320
- const gi = ssgi.enabled ? `ssgi:${ssgi.halfResolution ? "half" : "full"}` : "";
18321
- return `${contact.enabled ? "contact" : ""}|${gi}|camera:${String(id)}`;
18457
+ return `${runsContact ? "contact" : ""}|${runsSsgi ? `ssgi:${ssgiHalf ? "half" : "full"}` : ""}|camera:${String(id)}`;
18322
18458
  }
18323
18459
  //#endregion
18324
18460
  //#region src/render/post-process-stack.ts
@@ -21649,6 +21785,472 @@ function collectAssetRefs(value, add) {
21649
21785
  for (const key of Object.keys(object)) collectAssetRefs(object[key] ?? null, add);
21650
21786
  }
21651
21787
  //#endregion
21788
+ //#region src/schema/validate.ts
21789
+ /**
21790
+ * The inclusive bounds of a signed 32-bit integer.
21791
+ *
21792
+ * @internal
21793
+ */
21794
+ const I32_RANGE = [-2147483648, 2147483647];
21795
+ /**
21796
+ * The inclusive bounds of an unsigned 32-bit integer.
21797
+ *
21798
+ * @internal
21799
+ */
21800
+ const U32_RANGE = [0, 4294967295];
21801
+ /**
21802
+ * Checks a numeric value against its kind's integer rules and the field's `min`/`max` options.
21803
+ *
21804
+ * @param kind - The numeric field kind.
21805
+ * @param options - The field's options.
21806
+ * @param value - The value to check.
21807
+ * @param path - The property path for reported issues.
21808
+ * @param issues - The collector to append to.
21809
+ *
21810
+ * @internal
21811
+ */
21812
+ function validateNumber(kind, options, value, path, issues) {
21813
+ if (typeof value !== "number") {
21814
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a ${kind} number, received ${typeof value}.`));
21815
+ return;
21816
+ }
21817
+ if (!Number.isFinite(value)) {
21818
+ issues.push(issue(SchemaIssueCode.nonFiniteNumber, path, `${String(value)} cannot be written to JSON.`));
21819
+ return;
21820
+ }
21821
+ if (kind === "i32" || kind === "u32") {
21822
+ if (Number.isInteger(value)) {
21823
+ const [low, high] = kind === "u32" ? U32_RANGE : I32_RANGE;
21824
+ if (value < low || value > high) issues.push(issue(SchemaIssueCode.outOfRange, path, `${value} is outside the ${kind} range.`));
21825
+ } else issues.push(issue(SchemaIssueCode.outOfRange, path, `${kind} requires a whole number, received ${value}.`));
21826
+ }
21827
+ const { min, max } = options;
21828
+ if (min !== void 0 && value < min) issues.push(issue(SchemaIssueCode.outOfRange, path, `${value} is below the declared minimum ${min}.`));
21829
+ if (max !== void 0 && value > max) issues.push(issue(SchemaIssueCode.outOfRange, path, `${value} is above the declared maximum ${max}.`));
21830
+ }
21831
+ /**
21832
+ * Checks that every named channel of an object value is a finite number, optionally within bounds.
21833
+ *
21834
+ * @param names - The channel names to require.
21835
+ * @param bounds - Inclusive `[low, high]` bounds each channel must fall in, or `null` for none.
21836
+ * @param label - How the value is named in messages.
21837
+ * @param value - The value to check.
21838
+ * @param path - The property path for reported issues.
21839
+ * @param issues - The collector to append to.
21840
+ *
21841
+ * @internal
21842
+ */
21843
+ function validateChannels(names, bounds, label, value, path, issues) {
21844
+ if (!isPlainObject(value)) {
21845
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a ${label} object, received ${typeof value}.`));
21846
+ return;
21847
+ }
21848
+ for (const name of names) {
21849
+ const channel = value[name];
21850
+ const channelAt = childPath(path, name);
21851
+ if (typeof channel !== "number") {
21852
+ issues.push(issue(SchemaIssueCode.typeMismatch, channelAt, `expected a number, received ${typeof channel}.`));
21853
+ continue;
21854
+ }
21855
+ if (!Number.isFinite(channel)) {
21856
+ issues.push(issue(SchemaIssueCode.nonFiniteNumber, channelAt, `${String(channel)} cannot be written to JSON.`));
21857
+ continue;
21858
+ }
21859
+ if (bounds !== null && (channel < bounds[0] || channel > bounds[1])) issues.push(issue(SchemaIssueCode.outOfRange, channelAt, `${channel} is outside the ${bounds[0]}–${bounds[1]} range.`));
21860
+ }
21861
+ }
21862
+ /**
21863
+ * Checks one value against one field definition, appending to a collector.
21864
+ *
21865
+ * @param field - The field to check against.
21866
+ * @param value - The value to check.
21867
+ * @param path - The property path for reported issues.
21868
+ * @param issues - The collector to append to.
21869
+ *
21870
+ * @internal
21871
+ */
21872
+ function validateInto(field, value, path, issues) {
21873
+ const { spec } = field;
21874
+ switch (spec.kind) {
21875
+ case "f32":
21876
+ case "f64":
21877
+ case "i32":
21878
+ case "u32":
21879
+ validateNumber(spec.kind, field.options, value, path, issues);
21880
+ return;
21881
+ case "bool":
21882
+ if (typeof value !== "boolean") issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a boolean, received ${typeof value}.`));
21883
+ return;
21884
+ case "str":
21885
+ if (typeof value !== "string") issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a string, received ${typeof value}.`));
21886
+ return;
21887
+ case "vec2":
21888
+ case "vec3":
21889
+ case "vec4":
21890
+ case "quat":
21891
+ validateChannels(VECTOR_COMPONENTS.slice(0, spec.components), null, spec.kind, value, path, issues);
21892
+ return;
21893
+ case "color":
21894
+ validateChannels(COLOR_CHANNELS, [0, 1], "color", value, path, issues);
21895
+ return;
21896
+ case "enum":
21897
+ if (typeof value !== "string") issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a string, received ${typeof value}.`));
21898
+ else if (!spec.values.includes(value)) issues.push(issue(SchemaIssueCode.outOfRange, path, `"${value}" is not one of [${spec.values.join(", ")}].`));
21899
+ return;
21900
+ case "entityRef":
21901
+ case "componentRef":
21902
+ if (value !== null && typeof value !== "object") issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a ${spec.kind} target or null, received ${typeof value}.`));
21903
+ return;
21904
+ case "asset":
21905
+ if (value === null) return;
21906
+ if (!isPlainObject(value)) {
21907
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a loaded asset handle or null.`));
21908
+ return;
21909
+ }
21910
+ if (typeof value["address"] !== "string") issues.push(issue(SchemaIssueCode.typeMismatch, childPath(path, "address"), `expected a string address.`));
21911
+ return;
21912
+ case "array":
21913
+ if (!isArray(value)) {
21914
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected an array, received ${typeof value}.`));
21915
+ return;
21916
+ }
21917
+ for (let index = 0; index < value.length; index += 1) validateInto(spec.item, value[index], indexPath(path, index), issues);
21918
+ return;
21919
+ case "record":
21920
+ if (!isPlainObject(value)) {
21921
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected an object, received ${typeof value}.`));
21922
+ return;
21923
+ }
21924
+ collectPropsIssues(spec.fields, value, path, issues);
21925
+ return;
21926
+ case "map":
21927
+ if (!isPlainObject(value)) {
21928
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected an object, received ${typeof value}.`));
21929
+ return;
21930
+ }
21931
+ for (const [key, entry] of Object.entries(value)) validateInto(spec.value, entry, indexPath(path, key), issues);
21932
+ return;
21933
+ case "optional":
21934
+ if (value !== null) validateInto(spec.inner, value, path, issues);
21935
+ return;
21936
+ case "layerMask":
21937
+ if (!isArray(value)) {
21938
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected an array of layer names.`));
21939
+ return;
21940
+ }
21941
+ for (let index = 0; index < value.length; index += 1) if (typeof value[index] !== "string") issues.push(issue(SchemaIssueCode.typeMismatch, indexPath(path, index), `expected a layer name string.`));
21942
+ return;
21943
+ case "curve": {
21944
+ if (!isPlainObject(value)) {
21945
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a curve object.`));
21946
+ return;
21947
+ }
21948
+ const keys = value["keys"];
21949
+ if (!isArray(keys)) {
21950
+ issues.push(issue(SchemaIssueCode.typeMismatch, childPath(path, "keys"), `expected an array of curve keys.`));
21951
+ return;
21952
+ }
21953
+ for (let index = 0; index < keys.length; index += 1) validateCurveKey(keys[index], indexPath(childPath(path, "keys"), index), issues);
21954
+ return;
21955
+ }
21956
+ case "custom": return;
21957
+ default: assertNever(spec, "schema field kind");
21958
+ }
21959
+ }
21960
+ /**
21961
+ * Checks one animation curve key.
21962
+ *
21963
+ * @param key - The candidate key.
21964
+ * @param path - The property path for reported issues.
21965
+ * @param issues - The collector to append to.
21966
+ *
21967
+ * @internal
21968
+ */
21969
+ function validateCurveKey(key, path, issues) {
21970
+ if (!isArray(key) || key.length !== 4) {
21971
+ issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected [time, value, inTangent, outTangent].`));
21972
+ return;
21973
+ }
21974
+ for (let index = 0; index < 4; index += 1) {
21975
+ const component = key[index];
21976
+ if (typeof component !== "number") issues.push(issue(SchemaIssueCode.typeMismatch, indexPath(path, index), `expected a number.`));
21977
+ else if (!Number.isFinite(component)) issues.push(issue(SchemaIssueCode.nonFiniteNumber, indexPath(path, index), `${String(component)} cannot be written to JSON.`));
21978
+ }
21979
+ }
21980
+ /**
21981
+ * Checks a bag of property values against a schema, appending to a collector.
21982
+ *
21983
+ * @param schema - The schema that says which names are legal and how they are typed.
21984
+ * @param props - The values to check.
21985
+ * @param path - The property path prefix for reported issues.
21986
+ * @param issues - The collector to append to.
21987
+ *
21988
+ * @internal
21989
+ */
21990
+ function collectPropsIssues(schema, props, path, issues) {
21991
+ for (const name of Object.keys(props)) if (!Object.hasOwn(schema, name)) issues.push(issue(SchemaIssueCode.unknownField, childPath(path, name), `the schema declares no field "${name}".`));
21992
+ for (const [name, field] of Object.entries(schema)) {
21993
+ const value = props[name];
21994
+ if (value !== void 0) validateInto(field, value, childPath(path, name), issues);
21995
+ }
21996
+ }
21997
+ /**
21998
+ * Checks one value against one field definition. Nothing is thrown: the result is data, and the
21999
+ * caller decides whether a problem is a development-time error or a logged diagnostic
22000
+ * (`CONSTITUTION.md` §3.9).
22001
+ *
22002
+ * Checks performed are the value's type, finiteness for numbers, whole-number and 32-bit range for
22003
+ * `i32`/`u32`, `min`/`max` from the field options, enum membership, sRGB 0–1 range for colors, and
22004
+ * recursion into `array`, `record`, `map`, and `optional`.
22005
+ *
22006
+ * @param field - The field to check against.
22007
+ * @param value - The value to check.
22008
+ * @param path - A property path prefix used when reporting issues; defaults to the empty path.
22009
+ * @returns Every problem found, in discovery order; empty when the value is valid.
22010
+ *
22011
+ * @example
22012
+ * ```ts
22013
+ * validateValue(f32(0, { min: 0 }), -1);
22014
+ * // [{ path: "", code: "IGX-0606", message: "-1 is below the declared minimum 0." }]
22015
+ * ```
22016
+ *
22017
+ * @public
22018
+ */
22019
+ function validateValue(field, value, path = "") {
22020
+ const issues = [];
22021
+ validateInto(field, value, path, issues);
22022
+ return issues;
22023
+ }
22024
+ /**
22025
+ * Checks a bag of property values against a schema. Names the schema does not declare are reported
22026
+ * as `IGX-0607`; names the caller omits are legal, because omitted props take schema defaults
22027
+ * (`docs/architecture/06-serialization-and-scene-format.md` §2).
22028
+ *
22029
+ * @param schema - The schema to check against.
22030
+ * @param props - The values to check, keyed by field name.
22031
+ * @param path - A property path prefix used when reporting issues; defaults to the empty path.
22032
+ * @returns Every problem found, in discovery order; empty when the props are valid.
22033
+ *
22034
+ * @public
22035
+ */
22036
+ function validateProps(schema, props, path = "") {
22037
+ const issues = [];
22038
+ collectPropsIssues(schema, props, path, issues);
22039
+ return issues;
22040
+ }
22041
+ //#endregion
22042
+ //#region src/settings/settings-store.ts
22043
+ /**
22044
+ * Reports whether a value is a plain object rather than an array, a primitive, or `null`.
22045
+ *
22046
+ * @param value - The candidate.
22047
+ * @returns `true` when the value can be read as a bag of named props.
22048
+ */
22049
+ function isPropertyBag(value) {
22050
+ return typeof value === "object" && value !== null && !Array.isArray(value);
22051
+ }
22052
+ /**
22053
+ * The per-app settings table.
22054
+ *
22055
+ * @internal
22056
+ */
22057
+ var SettingsStore = class {
22058
+ #sections = /* @__PURE__ */ new Map();
22059
+ #input;
22060
+ #mode;
22061
+ #log;
22062
+ #isFrozen = false;
22063
+ /**
22064
+ * Creates the settings table of one app.
22065
+ *
22066
+ * @param input - What the project supplied, keyed by section name.
22067
+ * @param mode - `"development"` throws on an invalid or unknown section; `"production"` logs and
22068
+ * falls back to the registered defaults (§5).
22069
+ * @param log - Where the production-mode complaints go.
22070
+ */
22071
+ constructor(input, mode, log) {
22072
+ this.#input = input;
22073
+ this.#mode = mode;
22074
+ this.#log = log;
22075
+ }
22076
+ /**
22077
+ * The core `layers` section.
22078
+ *
22079
+ * @returns The project's layer names.
22080
+ */
22081
+ get layers() {
22082
+ return this.section("layers");
22083
+ }
22084
+ /**
22085
+ * The core `sortingLayers` section.
22086
+ *
22087
+ * @returns The project's sorting-layer names.
22088
+ */
22089
+ get sortingLayers() {
22090
+ return this.section("sortingLayers");
22091
+ }
22092
+ /**
22093
+ * The core `time` section.
22094
+ *
22095
+ * @returns The initial clock settings.
22096
+ */
22097
+ get time() {
22098
+ return this.section("time");
22099
+ }
22100
+ /**
22101
+ * Reads a resolved section.
22102
+ *
22103
+ * @typeParam S - The section's resolved shape, as its owner declared it.
22104
+ * @param name - The section name.
22105
+ * @returns The frozen resolved section.
22106
+ * @throws IgnifxError with code `IGX-0407` when the section was never registered.
22107
+ */
22108
+ section(name) {
22109
+ const section = this.#sections.get(name);
22110
+ if (section === void 0) throw new IgnifxError(CoreErrorCode.unknownSettingsSection, `${name} is not a registered settings section.`, {
22111
+ context: { section: name },
22112
+ hint: "A section exists once the extension that owns it has run its register() hook."
22113
+ });
22114
+ return section.value;
22115
+ }
22116
+ /**
22117
+ * Registers and immediately resolves a section, so `ctx.settings(name)` works inside the same
22118
+ * `register` call that declared it (`04-extensions.md` §1).
22119
+ *
22120
+ * @param name - The section name as it appears in `ignifx.config.ts`.
22121
+ * @param schema - The schema the project's values are validated against.
22122
+ * @param defaults - The values used for everything the project omits, as a bag of named props.
22123
+ * @param owner - The extension registering the section, named in diagnostics.
22124
+ * @throws IgnifxError with code `IGX-0408` in development when the project's values do not
22125
+ * validate, and with code `IGX-0607` when a field is named after an `Object.prototype` member.
22126
+ */
22127
+ register(name, schema, defaults, owner) {
22128
+ assertNoInheritedFieldNames(schema, "settings");
22129
+ const base = isPropertyBag(defaults) ? defaults : createDefaults(schema);
22130
+ const value = this.#resolve(name, schema, base);
22131
+ this.#sections.set(name, {
22132
+ schema,
22133
+ owner,
22134
+ defaults: base,
22135
+ value: Object.freeze(value)
22136
+ });
22137
+ }
22138
+ /**
22139
+ * What the project itself wrote for a section, before the defaults were merged in.
22140
+ *
22141
+ * @remarks
22142
+ * The resolved section cannot tell a field the project wrote from one it left at its default;
22143
+ * `rendering.quality` needs that, because a field the project wrote wins over its tier.
22144
+ *
22145
+ * @param name - The section name.
22146
+ * @returns The project's raw value, or `undefined` when it declared none.
22147
+ */
22148
+ declared(name) {
22149
+ return this.#input[name];
22150
+ }
22151
+ /**
22152
+ * Every registered section, in registration order, for `describeSettings`.
22153
+ *
22154
+ * @returns The sections, keyed by name.
22155
+ */
22156
+ registrations() {
22157
+ return this.#sections;
22158
+ }
22159
+ /**
22160
+ * Reports whether a section has been registered.
22161
+ *
22162
+ * @param name - The section name.
22163
+ * @returns `true` when an extension owns the section.
22164
+ */
22165
+ has(name) {
22166
+ return this.#sections.has(name);
22167
+ }
22168
+ /**
22169
+ * Checks that every section the project supplied is owned by some extension (§5) and closes the
22170
+ * table to further registration.
22171
+ *
22172
+ * @throws IgnifxError with code `IGX-0407` in development when the project declares a section no
22173
+ * extension registered.
22174
+ */
22175
+ freeze() {
22176
+ for (const name of Object.keys(this.#input)) {
22177
+ if (this.#sections.has(name)) continue;
22178
+ if (this.#mode === "development") throw new IgnifxError(CoreErrorCode.unknownSettingsSection, `${name} is not a registered settings section.`, {
22179
+ context: { section: name },
22180
+ hint: "Register the extension that owns the section, or remove it from the project settings."
22181
+ });
22182
+ this.#log.warn(`Ignoring the unknown settings section ${name}.`);
22183
+ }
22184
+ this.#isFrozen = true;
22185
+ }
22186
+ /**
22187
+ * Whether {@link SettingsStore.freeze} has run.
22188
+ *
22189
+ * @returns `true` once the table is closed.
22190
+ */
22191
+ get isFrozen() {
22192
+ return this.#isFrozen;
22193
+ }
22194
+ /**
22195
+ * Merges the project's values for one section over its defaults, validating them first.
22196
+ *
22197
+ * @param name - The section name.
22198
+ * @param schema - The owner's schema.
22199
+ * @param defaults - The owner's defaults.
22200
+ * @returns The resolved section.
22201
+ * @throws IgnifxError with code `IGX-0408` in development when validation fails.
22202
+ */
22203
+ #resolve(name, schema, defaults) {
22204
+ const provided = this.#input[name];
22205
+ const resolved = { ...defaults };
22206
+ if (provided === void 0) return resolved;
22207
+ const props = this.#toPropertyBag(schema, provided);
22208
+ if (props === null) return this.#reject(name, `${name} settings must be an object.`, resolved);
22209
+ const issues = validateProps(schema, props, name);
22210
+ if (issues.length > 0) {
22211
+ const detail = issues.map((entry) => `${entry.path}: ${entry.message}`).join("; ");
22212
+ return this.#reject(name, detail, resolved);
22213
+ }
22214
+ return Object.assign(resolved, props);
22215
+ }
22216
+ /**
22217
+ * Applies the single-field shorthand: a section whose schema declares exactly one field may be
22218
+ * written as that field's value.
22219
+ *
22220
+ * @param schema - The owner's schema.
22221
+ * @param provided - What the project supplied.
22222
+ * @returns A bag of named props, or `null` when the value cannot be read as one.
22223
+ */
22224
+ #toPropertyBag(schema, provided) {
22225
+ if (isPropertyBag(provided)) return provided;
22226
+ const names = Object.keys(schema);
22227
+ const only = names[0];
22228
+ if (names.length !== 1 || only === void 0) return null;
22229
+ return { [only]: provided };
22230
+ }
22231
+ /**
22232
+ * Handles an invalid section: a throw in development, a log line and the defaults in production
22233
+ * (§5).
22234
+ *
22235
+ * @param name - The section name.
22236
+ * @param detail - What was wrong.
22237
+ * @param defaults - The values to fall back to.
22238
+ * @returns The defaults, in production.
22239
+ * @throws IgnifxError with code `IGX-0408` in development.
22240
+ */
22241
+ #reject(name, detail, defaults) {
22242
+ if (this.#mode === "development") throw new IgnifxError(CoreErrorCode.invalidSettings, `The ${name} settings section is invalid: ${detail}`, {
22243
+ context: {
22244
+ section: name,
22245
+ issues: detail
22246
+ },
22247
+ hint: "Check the section against the schema the owning extension registered."
22248
+ });
22249
+ this.#log.warn("The {section} settings section is invalid and was replaced by its defaults: {issues}", name, detail);
22250
+ return defaults;
22251
+ }
22252
+ };
22253
+ //#endregion
21652
22254
  //#region src/math/quat.ts
21653
22255
  /**
21654
22256
  * A rotation, stored as a unit quaternion. Quaternions are how ignifx stores every rotation:
@@ -24330,13 +24932,17 @@ function registerCore(ctx) {
24330
24932
  * @remarks
24331
24933
  * The order matters in one place: the section is registered *first*, because `ctx.registerSettings`
24332
24934
  * resolves it immediately and {@link RendererImpl} is constructed from the resolved value inside
24333
- * this same `register` call. Everything after that only needs the service to exist.
24935
+ * this same `register` call. Everything after that only needs the service to exist. The renderer
24936
+ * gets the section with its `quality` tier applied, so `renderer.settings` is what actually runs.
24334
24937
  *
24335
24938
  * @param ctx - The registration surface.
24336
24939
  */
24337
24940
  function registerRendering(ctx) {
24338
24941
  ctx.registerSettings(RENDERING_SETTINGS_SECTION, renderingSettingsSchema(), defaultRenderingSettings());
24339
- const renderer = new RendererImpl(ctx.app, ctx.settings(RENDERING_SETTINGS_SECTION));
24942
+ const store = ctx.app.settings;
24943
+ const declared = store instanceof SettingsStore ? store.declared(RENDERING_SETTINGS_SECTION) : void 0;
24944
+ const settings = applyRenderingQuality(ctx.settings(RENDERING_SETTINGS_SECTION), declared);
24945
+ const renderer = new RendererImpl(ctx.app, settings);
24340
24946
  ctx.registerService(RendererService, renderer);
24341
24947
  ctx.registerComponents([
24342
24948
  Camera,
@@ -27672,459 +28278,6 @@ function snap(accumulator, step) {
27672
28278
  return accumulator;
27673
28279
  }
27674
28280
  //#endregion
27675
- //#region src/schema/validate.ts
27676
- /**
27677
- * The inclusive bounds of a signed 32-bit integer.
27678
- *
27679
- * @internal
27680
- */
27681
- const I32_RANGE = [-2147483648, 2147483647];
27682
- /**
27683
- * The inclusive bounds of an unsigned 32-bit integer.
27684
- *
27685
- * @internal
27686
- */
27687
- const U32_RANGE = [0, 4294967295];
27688
- /**
27689
- * Checks a numeric value against its kind's integer rules and the field's `min`/`max` options.
27690
- *
27691
- * @param kind - The numeric field kind.
27692
- * @param options - The field's options.
27693
- * @param value - The value to check.
27694
- * @param path - The property path for reported issues.
27695
- * @param issues - The collector to append to.
27696
- *
27697
- * @internal
27698
- */
27699
- function validateNumber(kind, options, value, path, issues) {
27700
- if (typeof value !== "number") {
27701
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a ${kind} number, received ${typeof value}.`));
27702
- return;
27703
- }
27704
- if (!Number.isFinite(value)) {
27705
- issues.push(issue(SchemaIssueCode.nonFiniteNumber, path, `${String(value)} cannot be written to JSON.`));
27706
- return;
27707
- }
27708
- if (kind === "i32" || kind === "u32") {
27709
- if (Number.isInteger(value)) {
27710
- const [low, high] = kind === "u32" ? U32_RANGE : I32_RANGE;
27711
- if (value < low || value > high) issues.push(issue(SchemaIssueCode.outOfRange, path, `${value} is outside the ${kind} range.`));
27712
- } else issues.push(issue(SchemaIssueCode.outOfRange, path, `${kind} requires a whole number, received ${value}.`));
27713
- }
27714
- const { min, max } = options;
27715
- if (min !== void 0 && value < min) issues.push(issue(SchemaIssueCode.outOfRange, path, `${value} is below the declared minimum ${min}.`));
27716
- if (max !== void 0 && value > max) issues.push(issue(SchemaIssueCode.outOfRange, path, `${value} is above the declared maximum ${max}.`));
27717
- }
27718
- /**
27719
- * Checks that every named channel of an object value is a finite number, optionally within bounds.
27720
- *
27721
- * @param names - The channel names to require.
27722
- * @param bounds - Inclusive `[low, high]` bounds each channel must fall in, or `null` for none.
27723
- * @param label - How the value is named in messages.
27724
- * @param value - The value to check.
27725
- * @param path - The property path for reported issues.
27726
- * @param issues - The collector to append to.
27727
- *
27728
- * @internal
27729
- */
27730
- function validateChannels(names, bounds, label, value, path, issues) {
27731
- if (!isPlainObject(value)) {
27732
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a ${label} object, received ${typeof value}.`));
27733
- return;
27734
- }
27735
- for (const name of names) {
27736
- const channel = value[name];
27737
- const channelAt = childPath(path, name);
27738
- if (typeof channel !== "number") {
27739
- issues.push(issue(SchemaIssueCode.typeMismatch, channelAt, `expected a number, received ${typeof channel}.`));
27740
- continue;
27741
- }
27742
- if (!Number.isFinite(channel)) {
27743
- issues.push(issue(SchemaIssueCode.nonFiniteNumber, channelAt, `${String(channel)} cannot be written to JSON.`));
27744
- continue;
27745
- }
27746
- if (bounds !== null && (channel < bounds[0] || channel > bounds[1])) issues.push(issue(SchemaIssueCode.outOfRange, channelAt, `${channel} is outside the ${bounds[0]}–${bounds[1]} range.`));
27747
- }
27748
- }
27749
- /**
27750
- * Checks one value against one field definition, appending to a collector.
27751
- *
27752
- * @param field - The field to check against.
27753
- * @param value - The value to check.
27754
- * @param path - The property path for reported issues.
27755
- * @param issues - The collector to append to.
27756
- *
27757
- * @internal
27758
- */
27759
- function validateInto(field, value, path, issues) {
27760
- const { spec } = field;
27761
- switch (spec.kind) {
27762
- case "f32":
27763
- case "f64":
27764
- case "i32":
27765
- case "u32":
27766
- validateNumber(spec.kind, field.options, value, path, issues);
27767
- return;
27768
- case "bool":
27769
- if (typeof value !== "boolean") issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a boolean, received ${typeof value}.`));
27770
- return;
27771
- case "str":
27772
- if (typeof value !== "string") issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a string, received ${typeof value}.`));
27773
- return;
27774
- case "vec2":
27775
- case "vec3":
27776
- case "vec4":
27777
- case "quat":
27778
- validateChannels(VECTOR_COMPONENTS.slice(0, spec.components), null, spec.kind, value, path, issues);
27779
- return;
27780
- case "color":
27781
- validateChannels(COLOR_CHANNELS, [0, 1], "color", value, path, issues);
27782
- return;
27783
- case "enum":
27784
- if (typeof value !== "string") issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a string, received ${typeof value}.`));
27785
- else if (!spec.values.includes(value)) issues.push(issue(SchemaIssueCode.outOfRange, path, `"${value}" is not one of [${spec.values.join(", ")}].`));
27786
- return;
27787
- case "entityRef":
27788
- case "componentRef":
27789
- if (value !== null && typeof value !== "object") issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a ${spec.kind} target or null, received ${typeof value}.`));
27790
- return;
27791
- case "asset":
27792
- if (value === null) return;
27793
- if (!isPlainObject(value)) {
27794
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a loaded asset handle or null.`));
27795
- return;
27796
- }
27797
- if (typeof value["address"] !== "string") issues.push(issue(SchemaIssueCode.typeMismatch, childPath(path, "address"), `expected a string address.`));
27798
- return;
27799
- case "array":
27800
- if (!isArray(value)) {
27801
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected an array, received ${typeof value}.`));
27802
- return;
27803
- }
27804
- for (let index = 0; index < value.length; index += 1) validateInto(spec.item, value[index], indexPath(path, index), issues);
27805
- return;
27806
- case "record":
27807
- if (!isPlainObject(value)) {
27808
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected an object, received ${typeof value}.`));
27809
- return;
27810
- }
27811
- collectPropsIssues(spec.fields, value, path, issues);
27812
- return;
27813
- case "map":
27814
- if (!isPlainObject(value)) {
27815
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected an object, received ${typeof value}.`));
27816
- return;
27817
- }
27818
- for (const [key, entry] of Object.entries(value)) validateInto(spec.value, entry, indexPath(path, key), issues);
27819
- return;
27820
- case "optional":
27821
- if (value !== null) validateInto(spec.inner, value, path, issues);
27822
- return;
27823
- case "layerMask":
27824
- if (!isArray(value)) {
27825
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected an array of layer names.`));
27826
- return;
27827
- }
27828
- for (let index = 0; index < value.length; index += 1) if (typeof value[index] !== "string") issues.push(issue(SchemaIssueCode.typeMismatch, indexPath(path, index), `expected a layer name string.`));
27829
- return;
27830
- case "curve": {
27831
- if (!isPlainObject(value)) {
27832
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected a curve object.`));
27833
- return;
27834
- }
27835
- const keys = value["keys"];
27836
- if (!isArray(keys)) {
27837
- issues.push(issue(SchemaIssueCode.typeMismatch, childPath(path, "keys"), `expected an array of curve keys.`));
27838
- return;
27839
- }
27840
- for (let index = 0; index < keys.length; index += 1) validateCurveKey(keys[index], indexPath(childPath(path, "keys"), index), issues);
27841
- return;
27842
- }
27843
- case "custom": return;
27844
- default: assertNever(spec, "schema field kind");
27845
- }
27846
- }
27847
- /**
27848
- * Checks one animation curve key.
27849
- *
27850
- * @param key - The candidate key.
27851
- * @param path - The property path for reported issues.
27852
- * @param issues - The collector to append to.
27853
- *
27854
- * @internal
27855
- */
27856
- function validateCurveKey(key, path, issues) {
27857
- if (!isArray(key) || key.length !== 4) {
27858
- issues.push(issue(SchemaIssueCode.typeMismatch, path, `expected [time, value, inTangent, outTangent].`));
27859
- return;
27860
- }
27861
- for (let index = 0; index < 4; index += 1) {
27862
- const component = key[index];
27863
- if (typeof component !== "number") issues.push(issue(SchemaIssueCode.typeMismatch, indexPath(path, index), `expected a number.`));
27864
- else if (!Number.isFinite(component)) issues.push(issue(SchemaIssueCode.nonFiniteNumber, indexPath(path, index), `${String(component)} cannot be written to JSON.`));
27865
- }
27866
- }
27867
- /**
27868
- * Checks a bag of property values against a schema, appending to a collector.
27869
- *
27870
- * @param schema - The schema that says which names are legal and how they are typed.
27871
- * @param props - The values to check.
27872
- * @param path - The property path prefix for reported issues.
27873
- * @param issues - The collector to append to.
27874
- *
27875
- * @internal
27876
- */
27877
- function collectPropsIssues(schema, props, path, issues) {
27878
- for (const name of Object.keys(props)) if (!Object.hasOwn(schema, name)) issues.push(issue(SchemaIssueCode.unknownField, childPath(path, name), `the schema declares no field "${name}".`));
27879
- for (const [name, field] of Object.entries(schema)) {
27880
- const value = props[name];
27881
- if (value !== void 0) validateInto(field, value, childPath(path, name), issues);
27882
- }
27883
- }
27884
- /**
27885
- * Checks one value against one field definition. Nothing is thrown: the result is data, and the
27886
- * caller decides whether a problem is a development-time error or a logged diagnostic
27887
- * (`CONSTITUTION.md` §3.9).
27888
- *
27889
- * Checks performed are the value's type, finiteness for numbers, whole-number and 32-bit range for
27890
- * `i32`/`u32`, `min`/`max` from the field options, enum membership, sRGB 0–1 range for colors, and
27891
- * recursion into `array`, `record`, `map`, and `optional`.
27892
- *
27893
- * @param field - The field to check against.
27894
- * @param value - The value to check.
27895
- * @param path - A property path prefix used when reporting issues; defaults to the empty path.
27896
- * @returns Every problem found, in discovery order; empty when the value is valid.
27897
- *
27898
- * @example
27899
- * ```ts
27900
- * validateValue(f32(0, { min: 0 }), -1);
27901
- * // [{ path: "", code: "IGX-0606", message: "-1 is below the declared minimum 0." }]
27902
- * ```
27903
- *
27904
- * @public
27905
- */
27906
- function validateValue(field, value, path = "") {
27907
- const issues = [];
27908
- validateInto(field, value, path, issues);
27909
- return issues;
27910
- }
27911
- /**
27912
- * Checks a bag of property values against a schema. Names the schema does not declare are reported
27913
- * as `IGX-0607`; names the caller omits are legal, because omitted props take schema defaults
27914
- * (`docs/architecture/06-serialization-and-scene-format.md` §2).
27915
- *
27916
- * @param schema - The schema to check against.
27917
- * @param props - The values to check, keyed by field name.
27918
- * @param path - A property path prefix used when reporting issues; defaults to the empty path.
27919
- * @returns Every problem found, in discovery order; empty when the props are valid.
27920
- *
27921
- * @public
27922
- */
27923
- function validateProps(schema, props, path = "") {
27924
- const issues = [];
27925
- collectPropsIssues(schema, props, path, issues);
27926
- return issues;
27927
- }
27928
- //#endregion
27929
- //#region src/settings/settings-store.ts
27930
- /**
27931
- * Reports whether a value is a plain object rather than an array, a primitive, or `null`.
27932
- *
27933
- * @param value - The candidate.
27934
- * @returns `true` when the value can be read as a bag of named props.
27935
- */
27936
- function isPropertyBag(value) {
27937
- return typeof value === "object" && value !== null && !Array.isArray(value);
27938
- }
27939
- /**
27940
- * The per-app settings table.
27941
- *
27942
- * @internal
27943
- */
27944
- var SettingsStore = class {
27945
- #sections = /* @__PURE__ */ new Map();
27946
- #input;
27947
- #mode;
27948
- #log;
27949
- #isFrozen = false;
27950
- /**
27951
- * Creates the settings table of one app.
27952
- *
27953
- * @param input - What the project supplied, keyed by section name.
27954
- * @param mode - `"development"` throws on an invalid or unknown section; `"production"` logs and
27955
- * falls back to the registered defaults (§5).
27956
- * @param log - Where the production-mode complaints go.
27957
- */
27958
- constructor(input, mode, log) {
27959
- this.#input = input;
27960
- this.#mode = mode;
27961
- this.#log = log;
27962
- }
27963
- /**
27964
- * The core `layers` section.
27965
- *
27966
- * @returns The project's layer names.
27967
- */
27968
- get layers() {
27969
- return this.section("layers");
27970
- }
27971
- /**
27972
- * The core `sortingLayers` section.
27973
- *
27974
- * @returns The project's sorting-layer names.
27975
- */
27976
- get sortingLayers() {
27977
- return this.section("sortingLayers");
27978
- }
27979
- /**
27980
- * The core `time` section.
27981
- *
27982
- * @returns The initial clock settings.
27983
- */
27984
- get time() {
27985
- return this.section("time");
27986
- }
27987
- /**
27988
- * Reads a resolved section.
27989
- *
27990
- * @typeParam S - The section's resolved shape, as its owner declared it.
27991
- * @param name - The section name.
27992
- * @returns The frozen resolved section.
27993
- * @throws IgnifxError with code `IGX-0407` when the section was never registered.
27994
- */
27995
- section(name) {
27996
- const section = this.#sections.get(name);
27997
- if (section === void 0) throw new IgnifxError(CoreErrorCode.unknownSettingsSection, `${name} is not a registered settings section.`, {
27998
- context: { section: name },
27999
- hint: "A section exists once the extension that owns it has run its register() hook."
28000
- });
28001
- return section.value;
28002
- }
28003
- /**
28004
- * Registers and immediately resolves a section, so `ctx.settings(name)` works inside the same
28005
- * `register` call that declared it (`04-extensions.md` §1).
28006
- *
28007
- * @param name - The section name as it appears in `ignifx.config.ts`.
28008
- * @param schema - The schema the project's values are validated against.
28009
- * @param defaults - The values used for everything the project omits, as a bag of named props.
28010
- * @param owner - The extension registering the section, named in diagnostics.
28011
- * @throws IgnifxError with code `IGX-0408` in development when the project's values do not
28012
- * validate, and with code `IGX-0607` when a field is named after an `Object.prototype` member.
28013
- */
28014
- register(name, schema, defaults, owner) {
28015
- assertNoInheritedFieldNames(schema, "settings");
28016
- const base = isPropertyBag(defaults) ? defaults : createDefaults(schema);
28017
- const value = this.#resolve(name, schema, base);
28018
- this.#sections.set(name, {
28019
- schema,
28020
- owner,
28021
- defaults: base,
28022
- value: Object.freeze(value)
28023
- });
28024
- }
28025
- /**
28026
- * Every registered section, in registration order, for `describeSettings`.
28027
- *
28028
- * @returns The sections, keyed by name.
28029
- */
28030
- registrations() {
28031
- return this.#sections;
28032
- }
28033
- /**
28034
- * Reports whether a section has been registered.
28035
- *
28036
- * @param name - The section name.
28037
- * @returns `true` when an extension owns the section.
28038
- */
28039
- has(name) {
28040
- return this.#sections.has(name);
28041
- }
28042
- /**
28043
- * Checks that every section the project supplied is owned by some extension (§5) and closes the
28044
- * table to further registration.
28045
- *
28046
- * @throws IgnifxError with code `IGX-0407` in development when the project declares a section no
28047
- * extension registered.
28048
- */
28049
- freeze() {
28050
- for (const name of Object.keys(this.#input)) {
28051
- if (this.#sections.has(name)) continue;
28052
- if (this.#mode === "development") throw new IgnifxError(CoreErrorCode.unknownSettingsSection, `${name} is not a registered settings section.`, {
28053
- context: { section: name },
28054
- hint: "Register the extension that owns the section, or remove it from the project settings."
28055
- });
28056
- this.#log.warn(`Ignoring the unknown settings section ${name}.`);
28057
- }
28058
- this.#isFrozen = true;
28059
- }
28060
- /**
28061
- * Whether {@link SettingsStore.freeze} has run.
28062
- *
28063
- * @returns `true` once the table is closed.
28064
- */
28065
- get isFrozen() {
28066
- return this.#isFrozen;
28067
- }
28068
- /**
28069
- * Merges the project's values for one section over its defaults, validating them first.
28070
- *
28071
- * @param name - The section name.
28072
- * @param schema - The owner's schema.
28073
- * @param defaults - The owner's defaults.
28074
- * @returns The resolved section.
28075
- * @throws IgnifxError with code `IGX-0408` in development when validation fails.
28076
- */
28077
- #resolve(name, schema, defaults) {
28078
- const provided = this.#input[name];
28079
- const resolved = { ...defaults };
28080
- if (provided === void 0) return resolved;
28081
- const props = this.#toPropertyBag(schema, provided);
28082
- if (props === null) return this.#reject(name, `${name} settings must be an object.`, resolved);
28083
- const issues = validateProps(schema, props, name);
28084
- if (issues.length > 0) {
28085
- const detail = issues.map((entry) => `${entry.path}: ${entry.message}`).join("; ");
28086
- return this.#reject(name, detail, resolved);
28087
- }
28088
- return Object.assign(resolved, props);
28089
- }
28090
- /**
28091
- * Applies the single-field shorthand: a section whose schema declares exactly one field may be
28092
- * written as that field's value.
28093
- *
28094
- * @param schema - The owner's schema.
28095
- * @param provided - What the project supplied.
28096
- * @returns A bag of named props, or `null` when the value cannot be read as one.
28097
- */
28098
- #toPropertyBag(schema, provided) {
28099
- if (isPropertyBag(provided)) return provided;
28100
- const names = Object.keys(schema);
28101
- const only = names[0];
28102
- if (names.length !== 1 || only === void 0) return null;
28103
- return { [only]: provided };
28104
- }
28105
- /**
28106
- * Handles an invalid section: a throw in development, a log line and the defaults in production
28107
- * (§5).
28108
- *
28109
- * @param name - The section name.
28110
- * @param detail - What was wrong.
28111
- * @param defaults - The values to fall back to.
28112
- * @returns The defaults, in production.
28113
- * @throws IgnifxError with code `IGX-0408` in development.
28114
- */
28115
- #reject(name, detail, defaults) {
28116
- if (this.#mode === "development") throw new IgnifxError(CoreErrorCode.invalidSettings, `The ${name} settings section is invalid: ${detail}`, {
28117
- context: {
28118
- section: name,
28119
- issues: detail
28120
- },
28121
- hint: "Check the section against the schema the owning extension registered."
28122
- });
28123
- this.#log.warn("The {section} settings section is invalid and was replaced by its defaults: {issues}", name, detail);
28124
- return defaults;
28125
- }
28126
- };
28127
- //#endregion
28128
28281
  //#region src/storage/memory-backend.ts
28129
28282
  /**
28130
28283
  * The in-memory storage backend: the default for a headless app, and the one every unit test in the
@@ -35172,10 +35325,10 @@ var AppImpl = class {
35172
35325
  await this.#host.register(list);
35173
35326
  this.#settings.freeze();
35174
35327
  this.assets.applySettings(this.#settings.section("assets"));
35175
- const rendering = this.#settings.section(RENDERING_SETTINGS_SECTION);
35328
+ const renderer = rendererInternals(this.renderer);
35329
+ const rendering = renderer.settings;
35176
35330
  if (this.#mode === "development") await enableLiteErrorDecoding();
35177
35331
  const canvas = this.#canvas;
35178
- const renderer = rendererInternals(this.renderer);
35179
35332
  this.#handles = canvas === null ? createHeadlessEngine() : await createRenderEngine(canvas, this.#engineOptions(rendering), {
35180
35333
  postProcessing: renderer.renderingFeatures.postProcessing,
35181
35334
  hdr: rendering.hdr,
@@ -37929,6 +38082,6 @@ function settingsJsonSchema(app) {
37929
38082
  };
37930
38083
  }
37931
38084
  //#endregion
37932
- export { AMBIENT_OCCLUSION_QUALITIES, ASSET_DIAGNOSTICS_COUNTERS, ASSET_DIAGNOSTICS_GROUP, ASSET_MANIFEST_FORMAT, ASSET_MANIFEST_VERSION, AssetLoadError, CANVAS_ALPHA_MODES, CORE_ERROR_MESSAGES, Camera, Color, Component, ComponentRegistry, CoreErrorCode, DEFAULT_ASSET_CONCURRENCY, DEFAULT_ASSET_ROOT, DEFAULT_BRDF_LUT_ADDRESS, DEFAULT_LAYER, DEFAULT_MEMORY_SINK_LIMIT, DEFAULT_STORAGE_NAMESPACE, DEG_TO_RAD, Diagnostics, EASINGS, EASING_NAMES, EDITOR_ONLY_METADATA_KEY, EMPTY_ASSET_MANIFEST, ENVIRONMENT_ASSET_TYPE, ENVIRONMENT_FILE_EXTENSION, ENVIRONMENT_FILE_EXTENSIONS, ENVIRONMENT_FILE_FORMAT, ENVIRONMENT_FORMAT_VERSION, EPSILON, Entity, Environment, EnvironmentAsset, ErrorRange, FOG_MODE_NAMES, FONT_ASSET_TYPE, FONT_FILE_EXTENSIONS, FRAME_HISTORY_LENGTH, FieldKind, FontAsset, IGNIFX_UNIFORM_NAMES, INVALID_HANDLE, IgnifxError, IndexedDbStorageBackend, InstancedMeshRenderer, LIGHT_TYPES, LITE_MATERIAL_PLUGIN_POINTS, LITE_SYSTEM_UNIFORM_NAMES, LOG_LEVEL_SEVERITY, LayerMask, LayerTable, Light, LogLevel, MAT4_IDENTITY, MATERIAL_ALPHA_MODES, MATERIAL_ASSET_TYPE, MATERIAL_FILE_EXTENSION, MATERIAL_FILE_FORMAT, MATERIAL_FORMAT_VERSION, MATERIAL_KINDS, MATERIAL_PLUGIN_DEFAULT_PRIORITY, MATERIAL_PLUGIN_RESERVED_NAMES, MATERIAL_PLUGIN_SAMPLER_BUDGET, MAX_LAYERS, MAX_ULID_TIME_MS, MESH_ASSET_TYPE, MESH_FILE_EXTENSION, MESH_FILE_FORMAT, MESH_FORMAT_VERSION, MESH_PRIMITIVES, MESH_PRIMITIVE_OPTIONS, MODEL_ASSET_TYPE, MODEL_FILE_EXTENSIONS, Mat4, MaterialAsset, MemoryStorageBackend, MeshAsset, MeshRenderer, Model, ModelAsset, NAMESPACE_SEGMENT_MAX_LENGTH, PBR_TEXTURE_SLOTS, PHASES, PHASE_COUNT, PHASE_NAMES, POST_EFFECT_BUILTIN_UNIFORMS, POST_EFFECT_FUNCTION, PROJECTIONS, Phase, PhysicsCallbackName, PostProcessStack, QUAT_IDENTITY, Quat, RAD_TO_DEG, RENDERING_SETTINGS_SECTION, RENDER_DIAGNOSTICS_COUNTERS, RENDER_DIAGNOSTICS_GROUP, RENDER_TEXTURE_MAX_SIZE, RESERVED_LAYER_NAMES, SCENE_ASSET_TYPE, SCENE_FILE_EXTENSIONS, SCENE_FILE_FORMAT, SCENE_FORMAT_VERSION, SETTINGS_DESCRIPTION_FORMAT, SHADER_ASSET_TYPE, SHADER_ATTRIBUTE_NAMES, SHADER_BLEND_MODES, SHADER_CULL_MODES, SHADER_FILE_EXTENSIONS, SHADER_INSTANCING_MODES, SHADER_KINDS, SHADER_TEXTURE_FALLBACKS, SHADER_UNIFORM_TYPES, SHADOW_TECHNIQUES, STANDARD_TEXTURE_SLOTS, STORAGE_BUFFER_ASSET_TYPE, STORAGE_KEY_MAX_LENGTH, SURFACE_HOOK_NAMES, SURFACE_UNIFORM_BLOCK, SceneAssetToken, SceneInstance, SchemaIssueCode, Script, ScriptCallbackKind, ShaderAsset, Signal, StorageBufferAsset, TEXTURE_ASSET_TYPE, THIRD_PARTY_ERROR_PREFIX, TONE_MAPPING_NAMES, TWEEN_LOOP_FOREVER, TWEEN_SYSTEM_ORDER, TWEEN_VALUE_KINDS, TagSet, TextureAsset, Transform, Tween, UidRemap, VEC2_ONE, VEC2_ZERO, VEC3_BACKWARD, VEC3_DOWN, VEC3_FORWARD, VEC3_LEFT, VEC3_ONE, VEC3_RIGHT, VEC3_UP, VEC3_ZERO, VERSION, Vec2, Vec3, Vec4, World, addComponentFromRecord, applyInit, applyOverridesToAsset, approximately, array, assertNever, assertSceneDependenciesLoaded, asset, assetRef, binaryAssetLoader, bool, canonicalizeNumber, clamp, clamp01, color, componentRef, computeSceneHash, coreExtension, createApp, createAssetManifest, createConsoleSink, createCryptoRandom, createDefaults, createDiagnosticsGroup, createEnvironmentLoader, createErrorCodeRegistry, createFileStorageBackend, createFontLoader, createFrameSample, createLayerTable, createLogger, createManualClock, createMaterialAsset, createMaterialLoader, createMemorySink, createMeshLoader, createModelLoader, createPerformanceClock, createRay, createSceneAsset, createSceneLoader, createSeededRandom, createServiceKey, createShaderLoader, createStorageBufferAsset, createTextureLoader, createUlidFactory, curve, custom, customEffect, decodeProps, decodeValue, defaultAutoExposureSettings, defaultRenderingSettings, defineExtension, defineMaterialPlugin, defineSchema, degToRad, deltaAngleDegrees, describeEnvironmentFileFormat, describeMaterialFileFormat, describeMeshFileFormat, describeRegisteredSchemas, describeSceneFileFormat, describeSchema, describeSchemas, describeSettings, encodeProps, encodeValue, entityRef, enumOf, environmentDefinition, f32, f64, forceRendererDeviceLossForTesting, formatErrorMessage, generateUlid, i32, instantiateScene, inverseLerp, isAssetRef, isIgnifxError, isLiteMaterialPluginPoint, isSceneFileHeader, isUlid, isValidErrorCode, isWebGpuAvailable, jsonAssetLoader, layerMask, lerp, lerpAngleDegrees, loadSceneDependencies, map, meshFileJsonSchema, moveTowards, optional, parseOverridePath, pbrMaterialDefinition, pingPong, platformInternals, quat, radToDeg, record, repeat, resetFrameSample, resolveEase, revertOverrides, sceneFileJsonSchema, serializeComponent, serializeEntity, serializeScene, settingsJsonSchema, shaderMaterialDefinition, sign, smoothStep, standardMaterialDefinition, storageInternals, str, stringifySceneFile, textAssetLoader, toJsonSchema, transformSchema, u32, validateProps, validateSceneFile, validateValue, vec2, vec3, vec4, waitFixedUpdate, waitSeconds, waitSecondsRealtime, waitUntil, waitWhile, wrapAngleDegrees };
38085
+ export { AMBIENT_OCCLUSION_QUALITIES, ASSET_DIAGNOSTICS_COUNTERS, ASSET_DIAGNOSTICS_GROUP, ASSET_MANIFEST_FORMAT, ASSET_MANIFEST_VERSION, AssetLoadError, CANVAS_ALPHA_MODES, CORE_ERROR_MESSAGES, Camera, Color, Component, ComponentRegistry, CoreErrorCode, DEFAULT_ASSET_CONCURRENCY, DEFAULT_ASSET_ROOT, DEFAULT_BRDF_LUT_ADDRESS, DEFAULT_LAYER, DEFAULT_MEMORY_SINK_LIMIT, DEFAULT_STORAGE_NAMESPACE, DEG_TO_RAD, Diagnostics, EASINGS, EASING_NAMES, EDITOR_ONLY_METADATA_KEY, EMPTY_ASSET_MANIFEST, ENVIRONMENT_ASSET_TYPE, ENVIRONMENT_FILE_EXTENSION, ENVIRONMENT_FILE_EXTENSIONS, ENVIRONMENT_FILE_FORMAT, ENVIRONMENT_FORMAT_VERSION, EPSILON, Entity, Environment, EnvironmentAsset, ErrorRange, FOG_MODE_NAMES, FONT_ASSET_TYPE, FONT_FILE_EXTENSIONS, FRAME_HISTORY_LENGTH, FieldKind, FontAsset, IGNIFX_UNIFORM_NAMES, INVALID_HANDLE, IgnifxError, IndexedDbStorageBackend, InstancedMeshRenderer, LIGHT_TYPES, LITE_MATERIAL_PLUGIN_POINTS, LITE_SYSTEM_UNIFORM_NAMES, LOG_LEVEL_SEVERITY, LayerMask, LayerTable, Light, LogLevel, MAT4_IDENTITY, MATERIAL_ALPHA_MODES, MATERIAL_ASSET_TYPE, MATERIAL_FILE_EXTENSION, MATERIAL_FILE_FORMAT, MATERIAL_FORMAT_VERSION, MATERIAL_KINDS, MATERIAL_PLUGIN_DEFAULT_PRIORITY, MATERIAL_PLUGIN_RESERVED_NAMES, MATERIAL_PLUGIN_SAMPLER_BUDGET, MAX_LAYERS, MAX_ULID_TIME_MS, MESH_ASSET_TYPE, MESH_FILE_EXTENSION, MESH_FILE_FORMAT, MESH_FORMAT_VERSION, MESH_PRIMITIVES, MESH_PRIMITIVE_OPTIONS, MODEL_ASSET_TYPE, MODEL_FILE_EXTENSIONS, Mat4, MaterialAsset, MemoryStorageBackend, MeshAsset, MeshRenderer, Model, ModelAsset, NAMESPACE_SEGMENT_MAX_LENGTH, PBR_TEXTURE_SLOTS, PHASES, PHASE_COUNT, PHASE_NAMES, POST_EFFECT_BUILTIN_UNIFORMS, POST_EFFECT_FUNCTION, PROJECTIONS, Phase, PhysicsCallbackName, PostProcessStack, QUAT_IDENTITY, Quat, RAD_TO_DEG, RENDERING_QUALITIES, RENDERING_SETTINGS_SECTION, RENDER_DIAGNOSTICS_COUNTERS, RENDER_DIAGNOSTICS_GROUP, RENDER_TEXTURE_MAX_SIZE, RESERVED_LAYER_NAMES, SCENE_ASSET_TYPE, SCENE_FILE_EXTENSIONS, SCENE_FILE_FORMAT, SCENE_FORMAT_VERSION, SETTINGS_DESCRIPTION_FORMAT, SHADER_ASSET_TYPE, SHADER_ATTRIBUTE_NAMES, SHADER_BLEND_MODES, SHADER_CULL_MODES, SHADER_FILE_EXTENSIONS, SHADER_INSTANCING_MODES, SHADER_KINDS, SHADER_TEXTURE_FALLBACKS, SHADER_UNIFORM_TYPES, SHADOW_TECHNIQUES, STANDARD_TEXTURE_SLOTS, STORAGE_BUFFER_ASSET_TYPE, STORAGE_KEY_MAX_LENGTH, SURFACE_HOOK_NAMES, SURFACE_UNIFORM_BLOCK, SceneAssetToken, SceneInstance, SchemaIssueCode, Script, ScriptCallbackKind, ShaderAsset, Signal, StorageBufferAsset, TEXTURE_ASSET_TYPE, THIRD_PARTY_ERROR_PREFIX, TONE_MAPPING_NAMES, TWEEN_LOOP_FOREVER, TWEEN_SYSTEM_ORDER, TWEEN_VALUE_KINDS, TagSet, TextureAsset, Transform, Tween, UidRemap, VEC2_ONE, VEC2_ZERO, VEC3_BACKWARD, VEC3_DOWN, VEC3_FORWARD, VEC3_LEFT, VEC3_ONE, VEC3_RIGHT, VEC3_UP, VEC3_ZERO, VERSION, Vec2, Vec3, Vec4, World, addComponentFromRecord, applyInit, applyOverridesToAsset, approximately, array, assertNever, assertSceneDependenciesLoaded, asset, assetRef, binaryAssetLoader, bool, canonicalizeNumber, clamp, clamp01, color, componentRef, computeSceneHash, coreExtension, createApp, createAssetManifest, createConsoleSink, createCryptoRandom, createDefaults, createDiagnosticsGroup, createEnvironmentLoader, createErrorCodeRegistry, createFileStorageBackend, createFontLoader, createFrameSample, createLayerTable, createLogger, createManualClock, createMaterialAsset, createMaterialLoader, createMemorySink, createMeshLoader, createModelLoader, createPerformanceClock, createRay, createSceneAsset, createSceneLoader, createSeededRandom, createServiceKey, createShaderLoader, createStorageBufferAsset, createTextureLoader, createUlidFactory, curve, custom, customEffect, decodeProps, decodeValue, defaultAutoExposureSettings, defaultRenderingSettings, defineExtension, defineMaterialPlugin, defineSchema, degToRad, deltaAngleDegrees, describeEnvironmentFileFormat, describeMaterialFileFormat, describeMeshFileFormat, describeRegisteredSchemas, describeSceneFileFormat, describeSchema, describeSchemas, describeSettings, encodeProps, encodeValue, entityRef, enumOf, environmentDefinition, f32, f64, forceRendererDeviceLossForTesting, formatErrorMessage, generateUlid, i32, instantiateScene, inverseLerp, isAssetRef, isIgnifxError, isLiteMaterialPluginPoint, isSceneFileHeader, isUlid, isValidErrorCode, isWebGpuAvailable, jsonAssetLoader, layerMask, lerp, lerpAngleDegrees, loadSceneDependencies, map, meshFileJsonSchema, moveTowards, optional, parseOverridePath, pbrMaterialDefinition, pingPong, platformInternals, quat, radToDeg, record, repeat, resetFrameSample, resolveEase, revertOverrides, sceneFileJsonSchema, serializeComponent, serializeEntity, serializeScene, settingsJsonSchema, shaderMaterialDefinition, sign, smoothStep, standardMaterialDefinition, storageInternals, str, stringifySceneFile, textAssetLoader, toJsonSchema, transformSchema, u32, validateProps, validateSceneFile, validateValue, vec2, vec3, vec4, waitFixedUpdate, waitSeconds, waitSecondsRealtime, waitUntil, waitWhile, wrapAngleDegrees };
37933
38086
 
37934
38087
  //# sourceMappingURL=index.js.map