@plasius/gpu-lighting 0.1.17 → 0.1.19

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/CHANGELOG.md CHANGED
@@ -20,6 +20,28 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
20
20
  - **Security**
21
21
  - (placeholder)
22
22
 
23
+ ## [0.1.19] - 2026-06-03
24
+
25
+ - **Added**
26
+ - Added `createEnvironmentLightingConfig(...)` and
27
+ `createWavefrontEnvironmentLightingOptions(...)` so renderers and demos can
28
+ consume lighting-owned environment presets without embedding local ambient
29
+ or sky constants.
30
+ - Concrete hybrid realtime WGSL kernels for `directLighting`,
31
+ `screenTrace`, `radianceCache`, and `finalGather`.
32
+
33
+ - **Changed**
34
+ - README now documents the delivered hybrid realtime kernel scope alongside
35
+ the existing pathtracer and reflection-resolve stages.
36
+
37
+ - **Fixed**
38
+ - Hybrid realtime technique exports no longer ship placeholder WGSL bodies
39
+ for the direct-lighting, screen-trace, radiance-cache, and final-gather
40
+ stages.
41
+
42
+ - **Security**
43
+ - (placeholder)
44
+
23
45
  ## [0.1.17] - 2026-05-13
24
46
 
25
47
  - **Added**
@@ -308,3 +330,4 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
308
330
  [0.1.15]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.15
309
331
  [0.1.16]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.16
310
332
  [0.1.17]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.17
333
+ [0.1.19]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.19
package/README.md CHANGED
@@ -105,6 +105,31 @@ Band plans make near, mid, far, and horizon shadow sources explicit, keep RT
105
105
  shadow/reflection/GI participation independent, and publish temporal reuse plus
106
106
  update cadence expectations for downstream renderer and performance packages.
107
107
 
108
+ ## Environment Lighting Presets
109
+
110
+ ```js
111
+ import {
112
+ createEnvironmentLightingConfig,
113
+ createWavefrontEnvironmentLightingOptions,
114
+ } from "@plasius/gpu-lighting";
115
+
116
+ const lighting = createEnvironmentLightingConfig({
117
+ preset: "product-studio",
118
+ intensity: 1.05,
119
+ });
120
+
121
+ const wavefrontLighting = createWavefrontEnvironmentLightingOptions({
122
+ preset: "moonlit-harbor",
123
+ });
124
+ ```
125
+
126
+ `createEnvironmentLightingConfig(...)` owns the reusable sky/environment
127
+ semantics: horizon and zenith colours, key-light direction, key-light colour,
128
+ environment intensity, exposure, and ambient residual colour.
129
+ `createWavefrontEnvironmentLightingOptions(...)` projects that contract into the
130
+ current `@plasius/gpu-renderer` wavefront renderer options without making the
131
+ renderer depend on this package directly.
132
+
108
133
  ## DAG Scheduling
109
134
 
110
135
  Lighting worker manifests now publish `schedulerMode: "dag"` plus per-job
@@ -172,6 +197,10 @@ reference-first mode you described:
172
197
 
173
198
  The package now ships concrete WGSL contracts for:
174
199
 
200
+ - `hybrid.directLighting`: direct sun/sky resolve with roughness-aware specular shaping
201
+ - `hybrid.screenTrace`: first-hit reflection tracing over the shared hybrid scene contracts
202
+ - `hybrid.radianceCache`: irradiance history updates for cache-backed indirect reuse
203
+ - `hybrid.finalGather`: cache + trace composition with temporal reuse for the hybrid GI path
175
204
  - `pathtracer.pathTrace`: analytic scene tracing, bounce integration, and sky fallback
176
205
  - `pathtracer.accumulate`: progressive history resolve with reset handling
177
206
  - `pathtracer.denoise`: spatial-temporal bilateral filtering for reference previews
package/dist/index.cjs CHANGED
@@ -29,8 +29,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/index.js
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
+ createEnvironmentLightingConfig: () => createEnvironmentLightingConfig,
32
33
  createLightingBandPlan: () => createLightingBandPlan,
33
34
  createLightingProfileModeLadder: () => createLightingProfileModeLadder,
35
+ createWavefrontEnvironmentLightingOptions: () => createWavefrontEnvironmentLightingOptions,
34
36
  defaultAdaptiveLightingProfilePolicy: () => defaultAdaptiveLightingProfilePolicy,
35
37
  defaultLightingProfile: () => defaultLightingProfile,
36
38
  defaultLightingTechnique: () => defaultLightingTechnique,
@@ -40,6 +42,7 @@ __export(index_exports, {
40
42
  getLightingTechniqueWorkerManifest: () => getLightingTechniqueWorkerManifest,
41
43
  lightingDebugOwner: () => lightingDebugOwner,
42
44
  lightingDistanceBands: () => lightingDistanceBands,
45
+ lightingEnvironmentPresetNames: () => lightingEnvironmentPresetNames,
43
46
  lightingJobLabels: () => lightingJobLabels,
44
47
  lightingJobs: () => lightingJobs,
45
48
  lightingPreludeWgslUrl: () => lightingPreludeWgslUrl,
@@ -174,6 +177,11 @@ var lightingProfileModeOrder = Object.freeze([
174
177
  "hybrid",
175
178
  "reference"
176
179
  ]);
180
+ var lightingEnvironmentPresetNames = Object.freeze([
181
+ "moonlit-harbor",
182
+ "product-studio",
183
+ "neutral-studio"
184
+ ]);
177
185
  var defaultAdaptiveLightingProfilePolicy = Object.freeze({
178
186
  preferredProfile: "reference",
179
187
  minimumFrameRate: 30,
@@ -187,6 +195,143 @@ var lightingDistanceBands = Object.freeze([
187
195
  ]);
188
196
  var lightingWorkerQueueClass = "lighting";
189
197
  var lightingDebugOwner = "lighting";
198
+ function freezeVec4(value) {
199
+ return Object.freeze([value[0], value[1], value[2], value[3] ?? 1]);
200
+ }
201
+ function normalizeVector3(value, fallback) {
202
+ if (!Array.isArray(value) || value.length < 3) {
203
+ return [...fallback];
204
+ }
205
+ const vector = [
206
+ Number.isFinite(value[0]) ? value[0] : fallback[0],
207
+ Number.isFinite(value[1]) ? value[1] : fallback[1],
208
+ Number.isFinite(value[2]) ? value[2] : fallback[2]
209
+ ];
210
+ const length = Math.hypot(vector[0], vector[1], vector[2]);
211
+ if (!Number.isFinite(length) || length <= 1e-6) {
212
+ return [...fallback];
213
+ }
214
+ return vector.map((component) => component / length);
215
+ }
216
+ function readColor(value, fallback) {
217
+ if (!Array.isArray(value) || value.length < 3) {
218
+ return freezeVec4(fallback);
219
+ }
220
+ return freezeVec4([
221
+ Number.isFinite(value[0]) ? Math.max(0, value[0]) : fallback[0],
222
+ Number.isFinite(value[1]) ? Math.max(0, value[1]) : fallback[1],
223
+ Number.isFinite(value[2]) ? Math.max(0, value[2]) : fallback[2],
224
+ Number.isFinite(value[3]) ? Math.max(0, Math.min(1, value[3])) : fallback[3] ?? 1
225
+ ]);
226
+ }
227
+ function readFinite(value, fallback) {
228
+ return Number.isFinite(value) ? value : fallback;
229
+ }
230
+ var environmentLightingPresets = Object.freeze({
231
+ "moonlit-harbor": Object.freeze({
232
+ preset: "moonlit-harbor",
233
+ environmentMode: 0,
234
+ environmentIntensity: 0.86,
235
+ exposure: 1,
236
+ horizonColor: freezeVec4([0.33, 0.43, 0.53, 1]),
237
+ zenithColor: freezeVec4([0.035, 0.07, 0.14, 1]),
238
+ sunDirection: Object.freeze(normalizeVector3([0.22, 0.88, 0.42], [0, 1, 0])),
239
+ sunColor: freezeVec4([2.1, 2.25, 2.65, 1]),
240
+ ambientColor: freezeVec4([0.018, 0.023, 0.03, 1])
241
+ }),
242
+ "product-studio": Object.freeze({
243
+ preset: "product-studio",
244
+ environmentMode: 1,
245
+ environmentIntensity: 1.05,
246
+ exposure: 1,
247
+ horizonColor: freezeVec4([0.52, 0.61, 0.65, 1]),
248
+ zenithColor: freezeVec4([0.18, 0.22, 0.26, 1]),
249
+ sunDirection: Object.freeze(normalizeVector3([0.18, 0.93, 0.24], [0, 1, 0])),
250
+ sunColor: freezeVec4([3.8, 3.55, 2.85, 1]),
251
+ ambientColor: freezeVec4([0.024, 0.027, 0.03, 1])
252
+ }),
253
+ "neutral-studio": Object.freeze({
254
+ preset: "neutral-studio",
255
+ environmentMode: 2,
256
+ environmentIntensity: 0.95,
257
+ exposure: 1,
258
+ horizonColor: freezeVec4([0.48, 0.53, 0.55, 1]),
259
+ zenithColor: freezeVec4([0.24, 0.26, 0.29, 1]),
260
+ sunDirection: Object.freeze(normalizeVector3([-0.24, 0.86, 0.36], [0, 1, 0])),
261
+ sunColor: freezeVec4([2.4, 2.35, 2.2, 1]),
262
+ ambientColor: freezeVec4([0.028, 0.029, 0.03, 1])
263
+ })
264
+ });
265
+ function resolveEnvironmentPreset(name) {
266
+ const presetName = typeof name === "string" && name.length > 0 ? name : "product-studio";
267
+ const preset = environmentLightingPresets[presetName];
268
+ if (!preset) {
269
+ throw new Error(
270
+ `Unknown lighting environment preset "${presetName}". Expected one of: ${lightingEnvironmentPresetNames.join(", ")}.`
271
+ );
272
+ }
273
+ return preset;
274
+ }
275
+ function estimateEnvironmentColor(config) {
276
+ const horizonWeight = 0.58;
277
+ const zenithWeight = 1 - horizonWeight;
278
+ const glowWeight = 0.055;
279
+ const intensity = Math.max(config.environmentIntensity, 1e-4);
280
+ return freezeVec4([
281
+ (config.horizonColor[0] * horizonWeight + config.zenithColor[0] * zenithWeight + config.sunColor[0] * glowWeight) * intensity,
282
+ (config.horizonColor[1] * horizonWeight + config.zenithColor[1] * zenithWeight + config.sunColor[1] * glowWeight) * intensity,
283
+ (config.horizonColor[2] * horizonWeight + config.zenithColor[2] * zenithWeight + config.sunColor[2] * glowWeight) * intensity,
284
+ 1
285
+ ]);
286
+ }
287
+ function createEnvironmentLightingConfig(options = {}) {
288
+ const preset = resolveEnvironmentPreset(options.preset ?? options.name);
289
+ const environmentIntensity = Math.max(
290
+ readFinite(options.environmentIntensity ?? options.intensity, preset.environmentIntensity),
291
+ 1e-4
292
+ );
293
+ const config = {
294
+ preset: preset.preset,
295
+ profile: typeof options.profile === "string" ? options.profile : defaultLightingProfile,
296
+ environmentMode: Math.max(0, Math.trunc(readFinite(options.environmentMode, preset.environmentMode))),
297
+ environmentIntensity,
298
+ exposure: Math.max(1e-4, readFinite(options.exposure, preset.exposure)),
299
+ horizonColor: readColor(options.horizonColor, preset.horizonColor),
300
+ zenithColor: readColor(options.zenithColor, preset.zenithColor),
301
+ sunDirection: Object.freeze(
302
+ normalizeVector3(options.sunDirection, preset.sunDirection)
303
+ ),
304
+ sunColor: readColor(options.sunColor, preset.sunColor),
305
+ ambientColor: readColor(options.ambientColor, preset.ambientColor)
306
+ };
307
+ const environmentColor = estimateEnvironmentColor(config);
308
+ return Object.freeze({
309
+ ...config,
310
+ environmentColor,
311
+ wavefront: Object.freeze({
312
+ environmentColor,
313
+ ambientColor: config.ambientColor,
314
+ environmentLighting: Object.freeze({
315
+ horizonColor: config.horizonColor,
316
+ zenithColor: config.zenithColor,
317
+ sunDirection: Object.freeze([...config.sunDirection]),
318
+ sunColor: config.sunColor,
319
+ intensity: config.environmentIntensity,
320
+ mode: config.environmentMode,
321
+ exposure: config.exposure
322
+ })
323
+ })
324
+ });
325
+ }
326
+ function createWavefrontEnvironmentLightingOptions(options = {}) {
327
+ const config = createEnvironmentLightingConfig(options);
328
+ return Object.freeze({
329
+ environmentColor: config.wavefront.environmentColor,
330
+ ambientColor: config.wavefront.ambientColor,
331
+ environmentLighting: config.wavefront.environmentLighting,
332
+ lightingEnvironment: config
333
+ });
334
+ }
190
335
  var lightingImportanceLevels = Object.freeze([
191
336
  "low",
192
337
  "medium",
@@ -1304,8 +1449,10 @@ async function loadLightingProfileWorkerPlan(profileName = defaultLightingProfil
1304
1449
  }
1305
1450
  // Annotate the CommonJS export names for ESM import in node:
1306
1451
  0 && (module.exports = {
1452
+ createEnvironmentLightingConfig,
1307
1453
  createLightingBandPlan,
1308
1454
  createLightingProfileModeLadder,
1455
+ createWavefrontEnvironmentLightingOptions,
1309
1456
  defaultAdaptiveLightingProfilePolicy,
1310
1457
  defaultLightingProfile,
1311
1458
  defaultLightingTechnique,
@@ -1315,6 +1462,7 @@ async function loadLightingProfileWorkerPlan(profileName = defaultLightingProfil
1315
1462
  getLightingTechniqueWorkerManifest,
1316
1463
  lightingDebugOwner,
1317
1464
  lightingDistanceBands,
1465
+ lightingEnvironmentPresetNames,
1318
1466
  lightingJobLabels,
1319
1467
  lightingJobs,
1320
1468
  lightingPreludeWgslUrl,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"sourcesContent":["function createModuleBaseUrl(metaUrl) {\n return Reflect.construct(URL, [String(metaUrl)]);\n}\n\nconst baseUrl = (() => {\n if (typeof __IMPORT_META_URL__ !== \"undefined\") {\n return createModuleBaseUrl(__IMPORT_META_URL__);\n }\n if (typeof __filename !== \"undefined\" && typeof require !== \"undefined\") {\n const { pathToFileURL } = require(\"node:url\");\n return pathToFileURL(__filename);\n }\n const base =\n typeof process !== \"undefined\" && process.cwd\n ? `file://${process.cwd()}/`\n : \"file:///\";\n return new URL(\"./index.js\", base);\n})();\n\nconst techniqueSpecs = {\n hybrid: {\n description:\n \"Lumen-inspired hybrid realtime GI and reflections with radiance cache final gather.\",\n prelude: \"prelude.wgsl\",\n jobs: {\n directLighting: \"direct-lighting.job.wgsl\",\n screenTrace: \"screen-trace.job.wgsl\",\n radianceCache: \"radiance-cache.job.wgsl\",\n finalGather: \"final-gather.job.wgsl\",\n reflectionResolve: \"reflection-resolve.job.wgsl\",\n },\n },\n pathtracer: {\n description:\n \"Monte Carlo path-traced reference mode with progressive accumulation and denoise stage.\",\n prelude: \"prelude.wgsl\",\n jobs: {\n pathTrace: \"pathtrace.job.wgsl\",\n accumulate: \"accumulate.job.wgsl\",\n denoise: \"denoise.job.wgsl\",\n },\n },\n volumetrics: {\n description:\n \"Froxel volumetric lighting for fog, shafts, and participating media shadows.\",\n prelude: \"prelude.wgsl\",\n jobs: {\n froxelIntegrate: \"froxel-integrate.job.wgsl\",\n volumetricShadow: \"volumetric-shadow.job.wgsl\",\n },\n },\n hdri: {\n description:\n \"HDRI and IBL precompute passes including irradiance, specular prefilter, and BRDF LUT.\",\n prelude: \"prelude.wgsl\",\n jobs: {\n irradianceConvolution: \"irradiance-convolution.job.wgsl\",\n specularPrefilter: \"specular-prefilter.job.wgsl\",\n brdfLut: \"brdf-lut.job.wgsl\",\n },\n },\n};\n\nfunction buildTechnique(name, spec) {\n const preludeUrl = new URL(`./techniques/${name}/${spec.prelude}`, baseUrl);\n const jobs = Object.entries(spec.jobs).map(([key, file]) => {\n const label = `lighting.${name}.${key}`;\n return {\n key,\n label,\n url: new URL(`./techniques/${name}/${file}`, baseUrl),\n sourceName: label,\n };\n });\n return {\n name,\n description: spec.description,\n preludeUrl,\n jobs,\n };\n}\n\nexport const lightingTechniques = Object.freeze(\n Object.fromEntries(\n Object.entries(techniqueSpecs).map(([name, spec]) => [\n name,\n buildTechnique(name, spec),\n ])\n )\n);\n\nexport const lightingTechniqueNames = Object.freeze(Object.keys(lightingTechniques));\n\nexport const defaultLightingTechnique = \"hybrid\";\n\nconst profileSpecs = {\n realtime: {\n description:\n \"Primary runtime profile: hybrid GI/reflections with volumetrics and HDRI/IBL.\",\n techniques: [\"hybrid\", \"volumetrics\", \"hdri\"],\n },\n hybrid: {\n description:\n \"Hybrid-focused profile for direct tuning of Lumen-inspired realtime passes.\",\n techniques: [\"hybrid\", \"hdri\"],\n },\n reference: {\n description:\n \"Reference quality profile: path tracing plus volumetrics and HDRI/IBL validation.\",\n techniques: [\"pathtracer\", \"volumetrics\", \"hdri\"],\n },\n};\n\nfunction buildProfile(name, spec) {\n return {\n name,\n description: spec.description,\n techniques: [...spec.techniques],\n };\n}\n\nexport const lightingProfiles = Object.freeze(\n Object.fromEntries(\n Object.entries(profileSpecs).map(([name, spec]) => [\n name,\n buildProfile(name, spec),\n ])\n )\n);\n\nexport const lightingProfileNames = Object.freeze(Object.keys(lightingProfiles));\n\nexport const defaultLightingProfile = \"realtime\";\nexport const lightingProfileModeOrder = Object.freeze([\n \"realtime\",\n \"hybrid\",\n \"reference\",\n]);\nexport const defaultAdaptiveLightingProfilePolicy = Object.freeze({\n preferredProfile: \"reference\",\n minimumFrameRate: 30,\n sampleWindowSize: 4,\n});\nexport const lightingDistanceBands = Object.freeze([\n \"near\",\n \"mid\",\n \"far\",\n \"horizon\",\n]);\n\nexport const lightingWorkerQueueClass = \"lighting\";\nexport const lightingDebugOwner = \"lighting\";\n\nconst lightingImportanceLevels = Object.freeze([\n \"low\",\n \"medium\",\n \"high\",\n \"critical\",\n]);\n\nconst lightingBandPolicySpecs = Object.freeze({\n near: Object.freeze({\n primaryShadowSource: \"ray-traced-primary\",\n assistShadowSources: Object.freeze([\"visibility-raster\", \"shadow-map-assist\"]),\n temporalReuse: \"balanced\",\n updateCadenceDivisor: 1,\n liveObjectShadows: true,\n impressionOnly: false,\n }),\n mid: Object.freeze({\n primaryShadowSource: \"selective-raster-and-proxy\",\n assistShadowSources: Object.freeze([\n \"regional-shadow-map\",\n \"proxy-caster\",\n \"temporal-history\",\n ]),\n temporalReuse: \"aggressive\",\n updateCadenceDivisor: 2,\n liveObjectShadows: true,\n impressionOnly: false,\n }),\n far: Object.freeze({\n primaryShadowSource: \"merged-proxy-casters\",\n assistShadowSources: Object.freeze([\n \"coarse-directional\",\n \"semi-static-occlusion\",\n ]),\n temporalReuse: \"high\",\n updateCadenceDivisor: 8,\n liveObjectShadows: false,\n impressionOnly: false,\n }),\n horizon: Object.freeze({\n primaryShadowSource: \"baked-impression\",\n assistShadowSources: Object.freeze([\"atmospheric-gradient\", \"skyline-darkening\"]),\n temporalReuse: \"baked\",\n updateCadenceDivisor: 60,\n liveObjectShadows: false,\n impressionOnly: true,\n }),\n});\n\nfunction assertLightingImportance(name, value) {\n if (!lightingImportanceLevels.includes(value)) {\n throw new Error(\n `${name} must be one of: ${lightingImportanceLevels.join(\", \")}.`\n );\n }\n return value;\n}\n\nfunction readPositiveIntegerOption(name, value, fallback) {\n if (value === undefined) {\n return fallback;\n }\n\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value) ||\n value <= 0 ||\n Math.round(value) !== value\n ) {\n throw new Error(`${name} must be a positive integer.`);\n }\n\n return value;\n}\n\nfunction resolveBandParticipation(profileName, band, importance) {\n const referenceProfile = profileName === \"reference\";\n const premiumImportance =\n importance === \"critical\" || importance === \"high\";\n\n if (band === \"near\") {\n return Object.freeze({\n directShadows: premiumImportance ? \"premium\" : \"selective\",\n reflections: premiumImportance ? \"premium\" : \"selective\",\n globalIllumination:\n referenceProfile || importance === \"critical\" ? \"premium\" : \"selective\",\n });\n }\n\n if (band === \"mid\") {\n return Object.freeze({\n directShadows: premiumImportance ? \"selective\" : \"proxy\",\n reflections:\n referenceProfile && premiumImportance ? \"selective\" : \"proxy\",\n globalIllumination:\n referenceProfile && importance === \"critical\" ? \"selective\" : \"disabled\",\n });\n }\n\n if (band === \"far\") {\n return Object.freeze({\n directShadows: \"proxy\",\n reflections:\n referenceProfile && importance === \"critical\" ? \"proxy\" : \"disabled\",\n globalIllumination: \"disabled\",\n });\n }\n\n return Object.freeze({\n directShadows: \"disabled\",\n reflections: \"disabled\",\n globalIllumination: \"disabled\",\n });\n}\n\nexport function createLightingBandPlan(options = {}) {\n const profileName = options.profile ?? defaultLightingProfile;\n const profile = getLightingProfile(profileName);\n const importance = assertLightingImportance(\n \"importance\",\n options.importance ?? \"high\"\n );\n\n const bands = Object.freeze(\n lightingDistanceBands.map((band) =>\n Object.freeze({\n band,\n profile: profile.name,\n importance,\n primaryShadowSource: lightingBandPolicySpecs[band].primaryShadowSource,\n assistShadowSources: Object.freeze([\n ...lightingBandPolicySpecs[band].assistShadowSources,\n ]),\n rtParticipation: resolveBandParticipation(profile.name, band, importance),\n temporalReuse: lightingBandPolicySpecs[band].temporalReuse,\n updateCadenceDivisor: lightingBandPolicySpecs[band].updateCadenceDivisor,\n liveObjectShadows: lightingBandPolicySpecs[band].liveObjectShadows,\n impressionOnly: lightingBandPolicySpecs[band].impressionOnly,\n })\n )\n );\n\n return Object.freeze({\n schemaVersion: 1,\n owner: lightingDebugOwner,\n profile: profile.name,\n importance,\n techniques: Object.freeze([...profile.techniques]),\n bands,\n });\n}\n\nconst lightingProfileModeEstimatedCostMs = Object.freeze({\n realtime: 4.5,\n hybrid: 7.5,\n reference: 12.5,\n});\n\nexport function createLightingProfileModeLadder(options = {}) {\n const moduleId =\n typeof options.id === \"string\" && options.id.trim().length > 0\n ? options.id.trim()\n : \"lighting-profile-mode\";\n const preferredProfile = getLightingProfile(\n options.preferredProfile ?? defaultAdaptiveLightingProfilePolicy.preferredProfile\n ).name;\n const initialProfile = getLightingProfile(\n options.initialProfile ?? preferredProfile\n ).name;\n const minimumFrameRate = readPositiveIntegerOption(\n \"minimumFrameRate\",\n options.minimumFrameRate,\n defaultAdaptiveLightingProfilePolicy.minimumFrameRate\n );\n const sampleWindowSize = readPositiveIntegerOption(\n \"sampleWindowSize\",\n options.sampleWindowSize,\n defaultAdaptiveLightingProfilePolicy.sampleWindowSize\n );\n const importance = assertLightingImportance(\n \"importance\",\n options.importance ?? \"high\"\n );\n const moduleImportance = assertLightingImportance(\n \"moduleImportance\",\n options.moduleImportance ?? \"critical\"\n );\n\n const levels = Object.freeze(\n lightingProfileModeOrder.map((profileName) => {\n const profile = getLightingProfile(profileName);\n return Object.freeze({\n id: profile.name,\n estimatedCostMs: lightingProfileModeEstimatedCostMs[profile.name],\n config: Object.freeze({\n profile: profile.name,\n description: profile.description,\n techniques: Object.freeze([...profile.techniques]),\n lightingBandPlan: createLightingBandPlan({\n profile: profile.name,\n importance,\n }),\n policy: Object.freeze({\n preferredProfile,\n minimumFrameRate,\n sampleWindowSize,\n }),\n }),\n });\n })\n );\n\n return Object.freeze({\n id: moduleId,\n domain: \"lighting\",\n authority: \"visual\",\n importance: moduleImportance,\n initialLevel: initialProfile,\n levels,\n target: Object.freeze({\n minimumFrameRate,\n maximumFrameRate: minimumFrameRate,\n preferredFrameRates: Object.freeze([minimumFrameRate]),\n }),\n adaptation: Object.freeze({\n sampleWindowSize,\n minimumSamplesBeforeAdjustment: sampleWindowSize,\n degradeCooldownFrames: 1,\n upgradeCooldownFrames: sampleWindowSize,\n minStableFramesForRecovery: sampleWindowSize,\n }),\n policy: Object.freeze({\n preferredProfile,\n minimumFrameRate,\n sampleWindowSize,\n }),\n });\n}\n\nfunction buildWorkerBudgetLevels(jobType, queueClass, presets) {\n return Object.freeze([\n Object.freeze({\n id: \"low\",\n estimatedCostMs: presets.low.estimatedCostMs,\n config: Object.freeze({\n maxDispatchesPerFrame: presets.low.maxDispatchesPerFrame,\n maxJobsPerDispatch: presets.low.maxJobsPerDispatch,\n cadenceDivisor: presets.low.cadenceDivisor,\n workgroupScale: presets.low.workgroupScale,\n maxQueueDepth: presets.low.maxQueueDepth,\n metadata: Object.freeze({\n owner: lightingDebugOwner,\n queueClass,\n jobType,\n quality: \"low\",\n }),\n }),\n }),\n Object.freeze({\n id: \"medium\",\n estimatedCostMs: presets.medium.estimatedCostMs,\n config: Object.freeze({\n maxDispatchesPerFrame: presets.medium.maxDispatchesPerFrame,\n maxJobsPerDispatch: presets.medium.maxJobsPerDispatch,\n cadenceDivisor: presets.medium.cadenceDivisor,\n workgroupScale: presets.medium.workgroupScale,\n maxQueueDepth: presets.medium.maxQueueDepth,\n metadata: Object.freeze({\n owner: lightingDebugOwner,\n queueClass,\n jobType,\n quality: \"medium\",\n }),\n }),\n }),\n Object.freeze({\n id: \"high\",\n estimatedCostMs: presets.high.estimatedCostMs,\n config: Object.freeze({\n maxDispatchesPerFrame: presets.high.maxDispatchesPerFrame,\n maxJobsPerDispatch: presets.high.maxJobsPerDispatch,\n cadenceDivisor: presets.high.cadenceDivisor,\n workgroupScale: presets.high.workgroupScale,\n maxQueueDepth: presets.high.maxQueueDepth,\n metadata: Object.freeze({\n owner: lightingDebugOwner,\n queueClass,\n jobType,\n quality: \"high\",\n }),\n }),\n }),\n ]);\n}\n\nconst lightingWorkerSpecPresets = {\n hybrid: {\n suggestedAllocationIds: [\n \"lighting.hybrid.radiance-cache\",\n \"lighting.hybrid.reflection-history\",\n \"lighting.hybrid.shadow-atlas\",\n ],\n jobs: {\n directLighting: {\n domain: \"lighting\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.directLighting\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.5,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 128,\n },\n medium: {\n estimatedCostMs: 0.9,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 128,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 256,\n },\n high: {\n estimatedCostMs: 1.2,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 256,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 512,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hybrid.shadow-atlas\"],\n },\n screenTrace: {\n domain: \"reflections\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.screenTrace\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 3,\n workgroupScale: 0.4,\n maxQueueDepth: 96,\n },\n medium: {\n estimatedCostMs: 1.5,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 96,\n cadenceDivisor: 2,\n workgroupScale: 0.7,\n maxQueueDepth: 192,\n },\n high: {\n estimatedCostMs: 2.2,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 192,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 384,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hybrid.reflection-history\"],\n },\n radianceCache: {\n domain: \"lighting\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.radianceCache\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.7,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 96,\n },\n medium: {\n estimatedCostMs: 1.2,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 192,\n },\n high: {\n estimatedCostMs: 1.8,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 128,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 256,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hybrid.radiance-cache\"],\n },\n finalGather: {\n domain: \"lighting\",\n importance: \"critical\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.finalGather\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 1,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 48,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 128,\n },\n medium: {\n estimatedCostMs: 1.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 96,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 256,\n },\n high: {\n estimatedCostMs: 2.6,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 192,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 384,\n },\n }\n ),\n suggestedAllocationIds: [\n \"lighting.hybrid.radiance-cache\",\n \"lighting.hybrid.reflection-history\",\n ],\n },\n reflectionResolve: {\n domain: \"reflections\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.reflectionResolve\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 96,\n },\n medium: {\n estimatedCostMs: 0.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 192,\n },\n high: {\n estimatedCostMs: 1.2,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 128,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 256,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hybrid.reflection-history\"],\n },\n },\n },\n pathtracer: {\n suggestedAllocationIds: [\n \"lighting.pathtracer.path-state\",\n \"lighting.pathtracer.accumulation\",\n \"lighting.pathtracer.denoise-history\",\n ],\n jobs: {\n pathTrace: {\n domain: \"lighting\",\n importance: \"critical\",\n levels: buildWorkerBudgetLevels(\n \"lighting.pathtracer.pathTrace\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 1.2,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 3,\n workgroupScale: 0.45,\n maxQueueDepth: 48,\n },\n medium: {\n estimatedCostMs: 2.3,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 2,\n workgroupScale: 0.7,\n maxQueueDepth: 96,\n },\n high: {\n estimatedCostMs: 3.8,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 128,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.pathtracer.path-state\"],\n },\n accumulate: {\n domain: \"lighting\",\n importance: \"medium\",\n levels: buildWorkerBudgetLevels(\n \"lighting.pathtracer.accumulate\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 32,\n },\n medium: {\n estimatedCostMs: 0.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 64,\n },\n high: {\n estimatedCostMs: 1.1,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 96,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.pathtracer.accumulation\"],\n },\n denoise: {\n domain: \"post-processing\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.pathtracer.denoise\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 32,\n },\n medium: {\n estimatedCostMs: 0.9,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 64,\n },\n high: {\n estimatedCostMs: 1.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 96,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.pathtracer.denoise-history\"],\n },\n },\n },\n volumetrics: {\n suggestedAllocationIds: [\n \"lighting.volumetrics.froxel-grid\",\n \"lighting.volumetrics.shadow-history\",\n ],\n jobs: {\n froxelIntegrate: {\n domain: \"volumetrics\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.volumetrics.froxelIntegrate\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.6,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 96,\n },\n medium: {\n estimatedCostMs: 1.1,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 192,\n },\n high: {\n estimatedCostMs: 1.7,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 128,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 256,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.volumetrics.froxel-grid\"],\n },\n volumetricShadow: {\n domain: \"volumetrics\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.volumetrics.volumetricShadow\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.5,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 24,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 64,\n },\n medium: {\n estimatedCostMs: 0.9,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 48,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 128,\n },\n high: {\n estimatedCostMs: 1.3,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 96,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 192,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.volumetrics.shadow-history\"],\n },\n },\n },\n hdri: {\n suggestedAllocationIds: [\n \"lighting.hdri.cubemap\",\n \"lighting.hdri.prefilter\",\n \"lighting.hdri.brdf-lut\",\n ],\n jobs: {\n irradianceConvolution: {\n domain: \"lighting\",\n importance: \"medium\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hdri.irradianceConvolution\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.3,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 8,\n cadenceDivisor: 3,\n workgroupScale: 0.5,\n maxQueueDepth: 16,\n },\n medium: {\n estimatedCostMs: 0.5,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 2,\n workgroupScale: 0.75,\n maxQueueDepth: 32,\n },\n high: {\n estimatedCostMs: 0.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 48,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hdri.cubemap\"],\n },\n specularPrefilter: {\n domain: \"lighting\",\n importance: \"medium\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hdri.specularPrefilter\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 8,\n cadenceDivisor: 3,\n workgroupScale: 0.5,\n maxQueueDepth: 16,\n },\n medium: {\n estimatedCostMs: 0.7,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 2,\n workgroupScale: 0.75,\n maxQueueDepth: 32,\n },\n high: {\n estimatedCostMs: 1,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 48,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hdri.prefilter\"],\n },\n brdfLut: {\n domain: \"lighting\",\n importance: \"low\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hdri.brdfLut\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.2,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 4,\n cadenceDivisor: 3,\n workgroupScale: 0.5,\n maxQueueDepth: 8,\n },\n medium: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 8,\n cadenceDivisor: 2,\n workgroupScale: 0.75,\n maxQueueDepth: 16,\n },\n high: {\n estimatedCostMs: 0.6,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 24,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hdri.brdf-lut\"],\n },\n },\n },\n};\n\nconst lightingWorkerDagSpecs = {\n hybrid: {\n directLighting: { priority: 4, dependencies: [] },\n screenTrace: { priority: 3, dependencies: [] },\n radianceCache: { priority: 4, dependencies: [\"directLighting\"] },\n finalGather: { priority: 2, dependencies: [\"radianceCache\", \"screenTrace\"] },\n reflectionResolve: {\n priority: 1,\n dependencies: [\"screenTrace\", \"finalGather\"],\n },\n },\n pathtracer: {\n pathTrace: { priority: 4, dependencies: [] },\n accumulate: { priority: 3, dependencies: [\"pathTrace\"] },\n denoise: { priority: 2, dependencies: [\"accumulate\"] },\n },\n volumetrics: {\n volumetricShadow: { priority: 3, dependencies: [] },\n froxelIntegrate: { priority: 2, dependencies: [\"volumetricShadow\"] },\n },\n hdri: {\n irradianceConvolution: { priority: 3, dependencies: [] },\n specularPrefilter: { priority: 3, dependencies: [] },\n brdfLut: {\n priority: 2,\n dependencies: [\"irradianceConvolution\", \"specularPrefilter\"],\n },\n },\n};\n\nfunction resolveLightingQualityDimensions(techniqueName, jobKey) {\n const key = `${techniqueName}.${jobKey}`;\n return Object.freeze(\n {\n \"hybrid.directLighting\": { shadows: 1, lightingSamples: 0.7 },\n \"hybrid.screenTrace\": { rayTracing: 1, temporalReuse: 0.4 },\n \"hybrid.radianceCache\": {\n lightingSamples: 0.8,\n updateCadence: 0.7,\n temporalReuse: 1,\n },\n \"hybrid.finalGather\": { lightingSamples: 1, rayTracing: 0.6 },\n \"hybrid.reflectionResolve\": {\n rayTracing: 0.5,\n temporalReuse: 1,\n shading: 0.3,\n },\n \"pathtracer.pathTrace\": { rayTracing: 1, lightingSamples: 1 },\n \"pathtracer.accumulate\": { temporalReuse: 1, updateCadence: 0.4 },\n \"pathtracer.denoise\": { temporalReuse: 1, shading: 0.4 },\n \"volumetrics.froxelIntegrate\": {\n lightingSamples: 0.6,\n shading: 0.4,\n updateCadence: 0.3,\n },\n \"volumetrics.volumetricShadow\": { shadows: 0.8, updateCadence: 0.5 },\n \"hdri.irradianceConvolution\": {\n lightingSamples: 0.4,\n temporalReuse: 1,\n updateCadence: 1,\n },\n \"hdri.specularPrefilter\": {\n lightingSamples: 0.5,\n temporalReuse: 1,\n updateCadence: 1,\n },\n \"hdri.brdfLut\": {\n shading: 0.4,\n temporalReuse: 1,\n updateCadence: 1,\n },\n }[key] ?? {}\n );\n}\n\nfunction resolveLightingImportanceSignals(techniqueName, jobKey) {\n const key = `${techniqueName}.${jobKey}`;\n return Object.freeze(\n {\n \"hybrid.directLighting\": { visible: true, shadowSignificance: \"high\" },\n \"hybrid.screenTrace\": { visible: true, reflectionSignificance: \"high\" },\n \"hybrid.radianceCache\": { visible: true },\n \"hybrid.finalGather\": {\n visible: true,\n shadowSignificance: \"critical\",\n reflectionSignificance: \"high\",\n },\n \"hybrid.reflectionResolve\": { visible: true, reflectionSignificance: \"high\" },\n \"pathtracer.pathTrace\": {\n visible: true,\n shadowSignificance: \"high\",\n reflectionSignificance: \"high\",\n },\n \"pathtracer.accumulate\": { visible: true },\n \"pathtracer.denoise\": { visible: true },\n \"volumetrics.froxelIntegrate\": { visible: true },\n \"volumetrics.volumetricShadow\": { visible: true, shadowSignificance: \"high\" },\n \"hdri.irradianceConvolution\": { visible: false },\n \"hdri.specularPrefilter\": { visible: false, reflectionSignificance: \"medium\" },\n \"hdri.brdfLut\": { visible: false },\n }[key] ?? {}\n );\n}\n\nfunction buildWorkerManifestJob(techniqueName, job) {\n const spec = lightingWorkerSpecPresets[techniqueName].jobs[job.key];\n const dag = lightingWorkerDagSpecs[techniqueName][job.key];\n const dependencies = dag.dependencies.map(\n (dependency) => `lighting.${techniqueName}.${dependency}`\n );\n\n return Object.freeze({\n key: job.key,\n label: job.label,\n worker: Object.freeze({\n jobType: job.label,\n queueClass: lightingWorkerQueueClass,\n priority: dag.priority,\n dependencies: Object.freeze(dependencies),\n schedulerMode: \"dag\",\n }),\n performance: Object.freeze({\n id: job.label,\n jobType: job.label,\n queueClass: lightingWorkerQueueClass,\n domain: spec.domain,\n authority: \"visual\",\n importance: spec.importance,\n qualityDimensions: resolveLightingQualityDimensions(techniqueName, job.key),\n importanceSignals: resolveLightingImportanceSignals(techniqueName, job.key),\n levels: spec.levels,\n }),\n debug: Object.freeze({\n owner: lightingDebugOwner,\n queueClass: lightingWorkerQueueClass,\n jobType: job.label,\n tags: Object.freeze([\n \"lighting\",\n techniqueName,\n job.key,\n spec.domain,\n ]),\n suggestedAllocationIds: Object.freeze([...spec.suggestedAllocationIds]),\n }),\n });\n}\n\nfunction buildLightingWorkerManifest(name, technique) {\n const spec = lightingWorkerSpecPresets[name];\n\n return Object.freeze({\n schemaVersion: 1,\n owner: lightingDebugOwner,\n technique: name,\n description: technique.description,\n queueClass: lightingWorkerQueueClass,\n schedulerMode: \"dag\",\n suggestedAllocationIds: Object.freeze([...spec.suggestedAllocationIds]),\n jobs: Object.freeze(\n technique.jobs.map((job) => buildWorkerManifestJob(name, job))\n ),\n });\n}\n\nexport const lightingWorkerManifests = Object.freeze(\n Object.fromEntries(\n Object.entries(lightingTechniques).map(([name, technique]) => [\n name,\n buildLightingWorkerManifest(name, technique),\n ])\n )\n);\n\nfunction getTechniqueJob(technique, key) {\n const job = technique.jobs.find((entry) => entry.key === key);\n if (!job) {\n const available = technique.jobs.map((entry) => entry.key).join(\", \");\n throw new Error(\n `Unknown job \"${key}\" for technique \"${technique.name}\". ` +\n `Available: ${available}.`\n );\n }\n return job;\n}\n\nexport function getLightingTechnique(name = defaultLightingTechnique) {\n const technique = lightingTechniques[name];\n if (!technique) {\n const available = lightingTechniqueNames.join(\", \");\n throw new Error(`Unknown lighting technique \"${name}\". Available: ${available}.`);\n }\n return technique;\n}\n\nexport function getLightingProfile(name = defaultLightingProfile) {\n const profile = lightingProfiles[name];\n if (!profile) {\n const available = lightingProfileNames.join(\", \");\n throw new Error(`Unknown lighting profile \"${name}\". Available: ${available}.`);\n }\n return profile;\n}\n\nexport function getLightingTechniqueWorkerManifest(\n name = defaultLightingTechnique\n) {\n const manifest = lightingWorkerManifests[name];\n if (!manifest) {\n const available = lightingTechniqueNames.join(\", \");\n throw new Error(\n `Unknown lighting technique \"${name}\". Available: ${available}.`\n );\n }\n return manifest;\n}\n\nexport function getLightingProfileWorkerManifest(\n name = defaultLightingProfile\n) {\n const profile = getLightingProfile(name);\n const techniques = profile.techniques.map((techniqueName) =>\n getLightingTechniqueWorkerManifest(techniqueName)\n );\n const lightingBandPlan = createLightingBandPlan({ profile: profile.name });\n\n return Object.freeze({\n schemaVersion: 1,\n owner: lightingDebugOwner,\n profile: profile.name,\n description: profile.description,\n schedulerMode: \"dag\",\n techniques: Object.freeze(techniques),\n lightingBands: lightingBandPlan.bands,\n jobs: Object.freeze(techniques.flatMap((technique) => technique.jobs)),\n });\n}\n\nconst defaultTechnique = getLightingTechnique(defaultLightingTechnique);\n\nexport const lightingPreludeWgslUrl = defaultTechnique.preludeUrl;\n\nexport const lightingJobLabels = Object.freeze(\n Object.fromEntries(defaultTechnique.jobs.map((job) => [job.key, job.label]))\n);\n\nexport const lightingJobs = defaultTechnique.jobs.map((job) => ({\n label: job.label,\n url: job.url,\n sourceName: job.sourceName,\n}));\n\nfunction assertNotHtmlWgsl(source, context) {\n const sample = source.slice(0, 200).toLowerCase();\n if (\n sample.includes(\"<!doctype\") ||\n sample.includes(\"<html\") ||\n sample.includes(\"<meta\")\n ) {\n const label = context ? ` for ${context}` : \"\";\n throw new Error(\n `Expected WGSL${label} but received HTML. Check the URL or server root.`\n );\n }\n}\n\nasync function loadWgslSource(options = {}) {\n const { wgsl, url, fetcher = globalThis.fetch, base } = options ?? {};\n if (typeof wgsl === \"string\") {\n assertNotHtmlWgsl(wgsl, \"inline WGSL\");\n return wgsl;\n }\n if (!url) {\n return null;\n }\n const resolved = url instanceof URL ? url : new URL(url, base ?? baseUrl);\n if (!fetcher || resolved.protocol === \"file:\") {\n const { readFile } = await import(\"node:fs/promises\");\n const { fileURLToPath } = await import(\"node:url\");\n const source = await readFile(fileURLToPath(resolved), \"utf8\");\n assertNotHtmlWgsl(source, resolved.href);\n return source;\n }\n const response = await fetcher(resolved);\n if (!response.ok) {\n const status = \"status\" in response ? response.status : \"unknown\";\n const statusText = \"statusText\" in response ? response.statusText : \"\";\n const detail = statusText ? `${status} ${statusText}` : `${status}`;\n throw new Error(`Failed to load WGSL (${detail})`);\n }\n const source = await response.text();\n assertNotHtmlWgsl(source, resolved.href);\n return source;\n}\n\nasync function loadTechniquePrelude(technique, fetcher) {\n const source = await loadWgslSource({ url: technique.preludeUrl, fetcher });\n if (typeof source !== \"string\") {\n throw new Error(`Failed to load ${technique.name} prelude WGSL source.`);\n }\n return source;\n}\n\nasync function loadTechniqueJob(technique, job, fetcher) {\n const source = await loadWgslSource({ url: job.url, fetcher });\n if (typeof source !== \"string\") {\n throw new Error(\n `Failed to load ${technique.name} job \"${job.key}\" WGSL source.`\n );\n }\n return source;\n}\n\nexport async function loadLightingTechniquePreludeWgsl(\n techniqueName,\n options = {}\n) {\n const { fetcher } = options ?? {};\n const technique = getLightingTechnique(techniqueName);\n return loadTechniquePrelude(technique, fetcher);\n}\n\nexport async function loadLightingTechniqueJobWgsl(\n techniqueName,\n jobKey,\n options = {}\n) {\n const { fetcher } = options ?? {};\n const technique = getLightingTechnique(techniqueName);\n const job = getTechniqueJob(technique, jobKey);\n return loadTechniqueJob(technique, job, fetcher);\n}\n\nexport async function loadLightingTechniqueJobs(techniqueName, options = {}) {\n const { fetcher } = options ?? {};\n const technique = getLightingTechnique(techniqueName);\n const preludeWgsl = await loadTechniquePrelude(technique, fetcher);\n const jobSources = await Promise.all(\n technique.jobs.map((job) => loadTechniqueJob(technique, job, fetcher))\n );\n const jobs = technique.jobs.map((job, index) => ({\n wgsl: jobSources[index],\n label: job.label,\n sourceName: job.sourceName,\n }));\n return { preludeWgsl, jobs };\n}\n\nexport async function loadLightingTechniqueWorkerBundle(\n techniqueName = defaultLightingTechnique,\n options = {}\n) {\n const technique = getLightingTechnique(techniqueName);\n const { preludeWgsl, jobs } = await loadLightingTechniqueJobs(\n technique.name,\n options\n );\n\n return {\n technique: technique.name,\n preludeWgsl,\n jobs,\n workerManifest: getLightingTechniqueWorkerManifest(technique.name),\n };\n}\n\nexport async function loadLightingPreludeWgsl(options = {}) {\n const { fetcher } = options ?? {};\n return loadTechniquePrelude(defaultTechnique, fetcher);\n}\n\nexport async function loadLightingJobs(options = {}) {\n return loadLightingTechniqueJobs(defaultLightingTechnique, options);\n}\n\nexport async function loadLightingProfile(profileName, options = {}) {\n const profile = getLightingProfile(profileName);\n const techniques = await Promise.all(\n profile.techniques.map(async (techniqueName) => {\n const { preludeWgsl, jobs } = await loadLightingTechniqueJobs(\n techniqueName,\n options\n );\n return {\n technique: techniqueName,\n preludeWgsl,\n jobs,\n };\n })\n );\n return { profile, techniques };\n}\n\nexport async function loadLightingProfileWorkerPlan(\n profileName = defaultLightingProfile,\n options = {}\n) {\n const profile = getLightingProfile(profileName);\n const techniques = await Promise.all(\n profile.techniques.map((techniqueName) =>\n loadLightingTechniqueWorkerBundle(techniqueName, options)\n )\n );\n\n return {\n profile,\n techniques,\n lightingBandPlan: createLightingBandPlan({ profile: profile.name }),\n workerManifest: getLightingProfileWorkerManifest(profile.name),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,IAAM,WAAW,MAAM;AACrB,MAAI,OAA4C;AAC9C,WAAO,oBAAoB,MAAmB;AAAA,EAChD;AACA,MAAI,OAAO,eAAe,eAAe,OAAO,YAAY,aAAa;AACvE,UAAM,EAAE,cAAc,IAAI,QAAQ,KAAU;AAC5C,WAAO,cAAc,UAAU;AAAA,EACjC;AACA,QAAM,OACJ,OAAO,YAAY,eAAe,QAAQ,MACtC,UAAU,QAAQ,IAAI,CAAC,MACvB;AACN,SAAO,IAAI,IAAI,cAAc,IAAI;AACnC,GAAG;AAEH,IAAM,iBAAiB;AAAA,EACrB,QAAQ;AAAA,IACN,aACE;AAAA,IACF,SAAS;AAAA,IACT,MAAM;AAAA,MACJ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,eAAe;AAAA,MACf,aAAa;AAAA,MACb,mBAAmB;AAAA,IACrB;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,aACE;AAAA,IACF,SAAS;AAAA,IACT,MAAM;AAAA,MACJ,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,SAAS;AAAA,IACX;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W,CAAC;AAChC,SAAO,qBAAqB,kBAAkB,OAAO;AACvD;AAEA,eAAsB,iBAAiB,UAAU,CAAC,GAAG;AACnD,SAAO,0BAA0B,0BAA0B,OAAO;AACpE;AAEA,eAAsB,oBAAoB,aAAa,UAAU,CAAC,GAAG;AACnE,QAAM,UAAU,mBAAmB,WAAW;AAC9C,QAAM,aAAa,MAAM,QAAQ;AAAA,IAC/B,QAAQ,WAAW,IAAI,OAAO,kBAAkB;AAC9C,YAAM,EAAE,aAAa,KAAK,IAAI,MAAM;AAAA,QAClC;AAAA,QACA;AAAA,MACF;AACA,aAAO;AAAA,QACL,WAAW;AAAA,QACX;AAAA,QACA;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO,EAAE,SAAS,WAAW;AAC/B;AAEA,eAAsB,8BACpB,cAAc,wBACd,UAAU,CAAC,GACX;AACA,QAAM,UAAU,mBAAmB,WAAW;AAC9C,QAAM,aAAa,MAAM,QAAQ;AAAA,IAC/B,QAAQ,WAAW;AAAA,MAAI,CAAC,kBACtB,kCAAkC,eAAe,OAAO;AAAA,IAC1D;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,kBAAkB,uBAAuB,EAAE,SAAS,QAAQ,KAAK,CAAC;AAAA,IAClE,gBAAgB,iCAAiC,QAAQ,IAAI;AAAA,EAC/D;AACF;","names":["source"]}
1
+ {"version":3,"sources":["../src/index.js"],"sourcesContent":["function createModuleBaseUrl(metaUrl) {\n return Reflect.construct(URL, [String(metaUrl)]);\n}\n\nconst baseUrl = (() => {\n if (typeof __IMPORT_META_URL__ !== \"undefined\") {\n return createModuleBaseUrl(__IMPORT_META_URL__);\n }\n if (typeof __filename !== \"undefined\" && typeof require !== \"undefined\") {\n const { pathToFileURL } = require(\"node:url\");\n return pathToFileURL(__filename);\n }\n const base =\n typeof process !== \"undefined\" && process.cwd\n ? `file://${process.cwd()}/`\n : \"file:///\";\n return new URL(\"./index.js\", base);\n})();\n\nconst techniqueSpecs = {\n hybrid: {\n description:\n \"Lumen-inspired hybrid realtime GI and reflections with radiance cache final gather.\",\n prelude: \"prelude.wgsl\",\n jobs: {\n directLighting: \"direct-lighting.job.wgsl\",\n screenTrace: \"screen-trace.job.wgsl\",\n radianceCache: \"radiance-cache.job.wgsl\",\n finalGather: \"final-gather.job.wgsl\",\n reflectionResolve: \"reflection-resolve.job.wgsl\",\n },\n },\n pathtracer: {\n description:\n \"Monte Carlo path-traced reference mode with progressive accumulation and denoise stage.\",\n prelude: \"prelude.wgsl\",\n jobs: {\n pathTrace: \"pathtrace.job.wgsl\",\n accumulate: \"accumulate.job.wgsl\",\n denoise: \"denoise.job.wgsl\",\n },\n },\n volumetrics: {\n description:\n \"Froxel volumetric lighting for fog, shafts, and participating media shadows.\",\n prelude: \"prelude.wgsl\",\n jobs: {\n froxelIntegrate: \"froxel-integrate.job.wgsl\",\n volumetricShadow: \"volumetric-shadow.job.wgsl\",\n },\n },\n hdri: {\n description:\n \"HDRI and IBL precompute passes including irradiance, specular prefilter, and BRDF LUT.\",\n prelude: \"prelude.wgsl\",\n jobs: {\n irradianceConvolution: \"irradiance-convolution.job.wgsl\",\n specularPrefilter: \"specular-prefilter.job.wgsl\",\n brdfLut: \"brdf-lut.job.wgsl\",\n },\n },\n};\n\nfunction buildTechnique(name, spec) {\n const preludeUrl = new URL(`./techniques/${name}/${spec.prelude}`, baseUrl);\n const jobs = Object.entries(spec.jobs).map(([key, file]) => {\n const label = `lighting.${name}.${key}`;\n return {\n key,\n label,\n url: new URL(`./techniques/${name}/${file}`, baseUrl),\n sourceName: label,\n };\n });\n return {\n name,\n description: spec.description,\n preludeUrl,\n jobs,\n };\n}\n\nexport const lightingTechniques = Object.freeze(\n Object.fromEntries(\n Object.entries(techniqueSpecs).map(([name, spec]) => [\n name,\n buildTechnique(name, spec),\n ])\n )\n);\n\nexport const lightingTechniqueNames = Object.freeze(Object.keys(lightingTechniques));\n\nexport const defaultLightingTechnique = \"hybrid\";\n\nconst profileSpecs = {\n realtime: {\n description:\n \"Primary runtime profile: hybrid GI/reflections with volumetrics and HDRI/IBL.\",\n techniques: [\"hybrid\", \"volumetrics\", \"hdri\"],\n },\n hybrid: {\n description:\n \"Hybrid-focused profile for direct tuning of Lumen-inspired realtime passes.\",\n techniques: [\"hybrid\", \"hdri\"],\n },\n reference: {\n description:\n \"Reference quality profile: path tracing plus volumetrics and HDRI/IBL validation.\",\n techniques: [\"pathtracer\", \"volumetrics\", \"hdri\"],\n },\n};\n\nfunction buildProfile(name, spec) {\n return {\n name,\n description: spec.description,\n techniques: [...spec.techniques],\n };\n}\n\nexport const lightingProfiles = Object.freeze(\n Object.fromEntries(\n Object.entries(profileSpecs).map(([name, spec]) => [\n name,\n buildProfile(name, spec),\n ])\n )\n);\n\nexport const lightingProfileNames = Object.freeze(Object.keys(lightingProfiles));\n\nexport const defaultLightingProfile = \"realtime\";\nexport const lightingProfileModeOrder = Object.freeze([\n \"realtime\",\n \"hybrid\",\n \"reference\",\n]);\nexport const lightingEnvironmentPresetNames = Object.freeze([\n \"moonlit-harbor\",\n \"product-studio\",\n \"neutral-studio\",\n]);\nexport const defaultAdaptiveLightingProfilePolicy = Object.freeze({\n preferredProfile: \"reference\",\n minimumFrameRate: 30,\n sampleWindowSize: 4,\n});\nexport const lightingDistanceBands = Object.freeze([\n \"near\",\n \"mid\",\n \"far\",\n \"horizon\",\n]);\n\nexport const lightingWorkerQueueClass = \"lighting\";\nexport const lightingDebugOwner = \"lighting\";\n\nfunction freezeVec4(value) {\n return Object.freeze([value[0], value[1], value[2], value[3] ?? 1]);\n}\n\nfunction normalizeVector3(value, fallback) {\n if (!Array.isArray(value) || value.length < 3) {\n return [...fallback];\n }\n const vector = [\n Number.isFinite(value[0]) ? value[0] : fallback[0],\n Number.isFinite(value[1]) ? value[1] : fallback[1],\n Number.isFinite(value[2]) ? value[2] : fallback[2],\n ];\n const length = Math.hypot(vector[0], vector[1], vector[2]);\n if (!Number.isFinite(length) || length <= 0.000001) {\n return [...fallback];\n }\n return vector.map((component) => component / length);\n}\n\nfunction readColor(value, fallback) {\n if (!Array.isArray(value) || value.length < 3) {\n return freezeVec4(fallback);\n }\n return freezeVec4([\n Number.isFinite(value[0]) ? Math.max(0, value[0]) : fallback[0],\n Number.isFinite(value[1]) ? Math.max(0, value[1]) : fallback[1],\n Number.isFinite(value[2]) ? Math.max(0, value[2]) : fallback[2],\n Number.isFinite(value[3]) ? Math.max(0, Math.min(1, value[3])) : fallback[3] ?? 1,\n ]);\n}\n\nfunction readFinite(value, fallback) {\n return Number.isFinite(value) ? value : fallback;\n}\n\nconst environmentLightingPresets = Object.freeze({\n \"moonlit-harbor\": Object.freeze({\n preset: \"moonlit-harbor\",\n environmentMode: 0,\n environmentIntensity: 0.86,\n exposure: 1,\n horizonColor: freezeVec4([0.33, 0.43, 0.53, 1]),\n zenithColor: freezeVec4([0.035, 0.07, 0.14, 1]),\n sunDirection: Object.freeze(normalizeVector3([0.22, 0.88, 0.42], [0, 1, 0])),\n sunColor: freezeVec4([2.1, 2.25, 2.65, 1]),\n ambientColor: freezeVec4([0.018, 0.023, 0.03, 1]),\n }),\n \"product-studio\": Object.freeze({\n preset: \"product-studio\",\n environmentMode: 1,\n environmentIntensity: 1.05,\n exposure: 1,\n horizonColor: freezeVec4([0.52, 0.61, 0.65, 1]),\n zenithColor: freezeVec4([0.18, 0.22, 0.26, 1]),\n sunDirection: Object.freeze(normalizeVector3([0.18, 0.93, 0.24], [0, 1, 0])),\n sunColor: freezeVec4([3.8, 3.55, 2.85, 1]),\n ambientColor: freezeVec4([0.024, 0.027, 0.03, 1]),\n }),\n \"neutral-studio\": Object.freeze({\n preset: \"neutral-studio\",\n environmentMode: 2,\n environmentIntensity: 0.95,\n exposure: 1,\n horizonColor: freezeVec4([0.48, 0.53, 0.55, 1]),\n zenithColor: freezeVec4([0.24, 0.26, 0.29, 1]),\n sunDirection: Object.freeze(normalizeVector3([-0.24, 0.86, 0.36], [0, 1, 0])),\n sunColor: freezeVec4([2.4, 2.35, 2.2, 1]),\n ambientColor: freezeVec4([0.028, 0.029, 0.03, 1]),\n }),\n});\n\nfunction resolveEnvironmentPreset(name) {\n const presetName = typeof name === \"string\" && name.length > 0 ? name : \"product-studio\";\n const preset = environmentLightingPresets[presetName];\n if (!preset) {\n throw new Error(\n `Unknown lighting environment preset \"${presetName}\". Expected one of: ${lightingEnvironmentPresetNames.join(\", \")}.`\n );\n }\n return preset;\n}\n\nfunction estimateEnvironmentColor(config) {\n const horizonWeight = 0.58;\n const zenithWeight = 1 - horizonWeight;\n const glowWeight = 0.055;\n const intensity = Math.max(config.environmentIntensity, 0.0001);\n return freezeVec4([\n (config.horizonColor[0] * horizonWeight + config.zenithColor[0] * zenithWeight + config.sunColor[0] * glowWeight) * intensity,\n (config.horizonColor[1] * horizonWeight + config.zenithColor[1] * zenithWeight + config.sunColor[1] * glowWeight) * intensity,\n (config.horizonColor[2] * horizonWeight + config.zenithColor[2] * zenithWeight + config.sunColor[2] * glowWeight) * intensity,\n 1,\n ]);\n}\n\nexport function createEnvironmentLightingConfig(options = {}) {\n const preset = resolveEnvironmentPreset(options.preset ?? options.name);\n const environmentIntensity = Math.max(\n readFinite(options.environmentIntensity ?? options.intensity, preset.environmentIntensity),\n 0.0001\n );\n const config = {\n preset: preset.preset,\n profile: typeof options.profile === \"string\" ? options.profile : defaultLightingProfile,\n environmentMode: Math.max(0, Math.trunc(readFinite(options.environmentMode, preset.environmentMode))),\n environmentIntensity,\n exposure: Math.max(0.0001, readFinite(options.exposure, preset.exposure)),\n horizonColor: readColor(options.horizonColor, preset.horizonColor),\n zenithColor: readColor(options.zenithColor, preset.zenithColor),\n sunDirection: Object.freeze(\n normalizeVector3(options.sunDirection, preset.sunDirection)\n ),\n sunColor: readColor(options.sunColor, preset.sunColor),\n ambientColor: readColor(options.ambientColor, preset.ambientColor),\n };\n const environmentColor = estimateEnvironmentColor(config);\n\n return Object.freeze({\n ...config,\n environmentColor,\n wavefront: Object.freeze({\n environmentColor,\n ambientColor: config.ambientColor,\n environmentLighting: Object.freeze({\n horizonColor: config.horizonColor,\n zenithColor: config.zenithColor,\n sunDirection: Object.freeze([...config.sunDirection]),\n sunColor: config.sunColor,\n intensity: config.environmentIntensity,\n mode: config.environmentMode,\n exposure: config.exposure,\n }),\n }),\n });\n}\n\nexport function createWavefrontEnvironmentLightingOptions(options = {}) {\n const config = createEnvironmentLightingConfig(options);\n return Object.freeze({\n environmentColor: config.wavefront.environmentColor,\n ambientColor: config.wavefront.ambientColor,\n environmentLighting: config.wavefront.environmentLighting,\n lightingEnvironment: config,\n });\n}\n\nconst lightingImportanceLevels = Object.freeze([\n \"low\",\n \"medium\",\n \"high\",\n \"critical\",\n]);\n\nconst lightingBandPolicySpecs = Object.freeze({\n near: Object.freeze({\n primaryShadowSource: \"ray-traced-primary\",\n assistShadowSources: Object.freeze([\"visibility-raster\", \"shadow-map-assist\"]),\n temporalReuse: \"balanced\",\n updateCadenceDivisor: 1,\n liveObjectShadows: true,\n impressionOnly: false,\n }),\n mid: Object.freeze({\n primaryShadowSource: \"selective-raster-and-proxy\",\n assistShadowSources: Object.freeze([\n \"regional-shadow-map\",\n \"proxy-caster\",\n \"temporal-history\",\n ]),\n temporalReuse: \"aggressive\",\n updateCadenceDivisor: 2,\n liveObjectShadows: true,\n impressionOnly: false,\n }),\n far: Object.freeze({\n primaryShadowSource: \"merged-proxy-casters\",\n assistShadowSources: Object.freeze([\n \"coarse-directional\",\n \"semi-static-occlusion\",\n ]),\n temporalReuse: \"high\",\n updateCadenceDivisor: 8,\n liveObjectShadows: false,\n impressionOnly: false,\n }),\n horizon: Object.freeze({\n primaryShadowSource: \"baked-impression\",\n assistShadowSources: Object.freeze([\"atmospheric-gradient\", \"skyline-darkening\"]),\n temporalReuse: \"baked\",\n updateCadenceDivisor: 60,\n liveObjectShadows: false,\n impressionOnly: true,\n }),\n});\n\nfunction assertLightingImportance(name, value) {\n if (!lightingImportanceLevels.includes(value)) {\n throw new Error(\n `${name} must be one of: ${lightingImportanceLevels.join(\", \")}.`\n );\n }\n return value;\n}\n\nfunction readPositiveIntegerOption(name, value, fallback) {\n if (value === undefined) {\n return fallback;\n }\n\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value) ||\n value <= 0 ||\n Math.round(value) !== value\n ) {\n throw new Error(`${name} must be a positive integer.`);\n }\n\n return value;\n}\n\nfunction resolveBandParticipation(profileName, band, importance) {\n const referenceProfile = profileName === \"reference\";\n const premiumImportance =\n importance === \"critical\" || importance === \"high\";\n\n if (band === \"near\") {\n return Object.freeze({\n directShadows: premiumImportance ? \"premium\" : \"selective\",\n reflections: premiumImportance ? \"premium\" : \"selective\",\n globalIllumination:\n referenceProfile || importance === \"critical\" ? \"premium\" : \"selective\",\n });\n }\n\n if (band === \"mid\") {\n return Object.freeze({\n directShadows: premiumImportance ? \"selective\" : \"proxy\",\n reflections:\n referenceProfile && premiumImportance ? \"selective\" : \"proxy\",\n globalIllumination:\n referenceProfile && importance === \"critical\" ? \"selective\" : \"disabled\",\n });\n }\n\n if (band === \"far\") {\n return Object.freeze({\n directShadows: \"proxy\",\n reflections:\n referenceProfile && importance === \"critical\" ? \"proxy\" : \"disabled\",\n globalIllumination: \"disabled\",\n });\n }\n\n return Object.freeze({\n directShadows: \"disabled\",\n reflections: \"disabled\",\n globalIllumination: \"disabled\",\n });\n}\n\nexport function createLightingBandPlan(options = {}) {\n const profileName = options.profile ?? defaultLightingProfile;\n const profile = getLightingProfile(profileName);\n const importance = assertLightingImportance(\n \"importance\",\n options.importance ?? \"high\"\n );\n\n const bands = Object.freeze(\n lightingDistanceBands.map((band) =>\n Object.freeze({\n band,\n profile: profile.name,\n importance,\n primaryShadowSource: lightingBandPolicySpecs[band].primaryShadowSource,\n assistShadowSources: Object.freeze([\n ...lightingBandPolicySpecs[band].assistShadowSources,\n ]),\n rtParticipation: resolveBandParticipation(profile.name, band, importance),\n temporalReuse: lightingBandPolicySpecs[band].temporalReuse,\n updateCadenceDivisor: lightingBandPolicySpecs[band].updateCadenceDivisor,\n liveObjectShadows: lightingBandPolicySpecs[band].liveObjectShadows,\n impressionOnly: lightingBandPolicySpecs[band].impressionOnly,\n })\n )\n );\n\n return Object.freeze({\n schemaVersion: 1,\n owner: lightingDebugOwner,\n profile: profile.name,\n importance,\n techniques: Object.freeze([...profile.techniques]),\n bands,\n });\n}\n\nconst lightingProfileModeEstimatedCostMs = Object.freeze({\n realtime: 4.5,\n hybrid: 7.5,\n reference: 12.5,\n});\n\nexport function createLightingProfileModeLadder(options = {}) {\n const moduleId =\n typeof options.id === \"string\" && options.id.trim().length > 0\n ? options.id.trim()\n : \"lighting-profile-mode\";\n const preferredProfile = getLightingProfile(\n options.preferredProfile ?? defaultAdaptiveLightingProfilePolicy.preferredProfile\n ).name;\n const initialProfile = getLightingProfile(\n options.initialProfile ?? preferredProfile\n ).name;\n const minimumFrameRate = readPositiveIntegerOption(\n \"minimumFrameRate\",\n options.minimumFrameRate,\n defaultAdaptiveLightingProfilePolicy.minimumFrameRate\n );\n const sampleWindowSize = readPositiveIntegerOption(\n \"sampleWindowSize\",\n options.sampleWindowSize,\n defaultAdaptiveLightingProfilePolicy.sampleWindowSize\n );\n const importance = assertLightingImportance(\n \"importance\",\n options.importance ?? \"high\"\n );\n const moduleImportance = assertLightingImportance(\n \"moduleImportance\",\n options.moduleImportance ?? \"critical\"\n );\n\n const levels = Object.freeze(\n lightingProfileModeOrder.map((profileName) => {\n const profile = getLightingProfile(profileName);\n return Object.freeze({\n id: profile.name,\n estimatedCostMs: lightingProfileModeEstimatedCostMs[profile.name],\n config: Object.freeze({\n profile: profile.name,\n description: profile.description,\n techniques: Object.freeze([...profile.techniques]),\n lightingBandPlan: createLightingBandPlan({\n profile: profile.name,\n importance,\n }),\n policy: Object.freeze({\n preferredProfile,\n minimumFrameRate,\n sampleWindowSize,\n }),\n }),\n });\n })\n );\n\n return Object.freeze({\n id: moduleId,\n domain: \"lighting\",\n authority: \"visual\",\n importance: moduleImportance,\n initialLevel: initialProfile,\n levels,\n target: Object.freeze({\n minimumFrameRate,\n maximumFrameRate: minimumFrameRate,\n preferredFrameRates: Object.freeze([minimumFrameRate]),\n }),\n adaptation: Object.freeze({\n sampleWindowSize,\n minimumSamplesBeforeAdjustment: sampleWindowSize,\n degradeCooldownFrames: 1,\n upgradeCooldownFrames: sampleWindowSize,\n minStableFramesForRecovery: sampleWindowSize,\n }),\n policy: Object.freeze({\n preferredProfile,\n minimumFrameRate,\n sampleWindowSize,\n }),\n });\n}\n\nfunction buildWorkerBudgetLevels(jobType, queueClass, presets) {\n return Object.freeze([\n Object.freeze({\n id: \"low\",\n estimatedCostMs: presets.low.estimatedCostMs,\n config: Object.freeze({\n maxDispatchesPerFrame: presets.low.maxDispatchesPerFrame,\n maxJobsPerDispatch: presets.low.maxJobsPerDispatch,\n cadenceDivisor: presets.low.cadenceDivisor,\n workgroupScale: presets.low.workgroupScale,\n maxQueueDepth: presets.low.maxQueueDepth,\n metadata: Object.freeze({\n owner: lightingDebugOwner,\n queueClass,\n jobType,\n quality: \"low\",\n }),\n }),\n }),\n Object.freeze({\n id: \"medium\",\n estimatedCostMs: presets.medium.estimatedCostMs,\n config: Object.freeze({\n maxDispatchesPerFrame: presets.medium.maxDispatchesPerFrame,\n maxJobsPerDispatch: presets.medium.maxJobsPerDispatch,\n cadenceDivisor: presets.medium.cadenceDivisor,\n workgroupScale: presets.medium.workgroupScale,\n maxQueueDepth: presets.medium.maxQueueDepth,\n metadata: Object.freeze({\n owner: lightingDebugOwner,\n queueClass,\n jobType,\n quality: \"medium\",\n }),\n }),\n }),\n Object.freeze({\n id: \"high\",\n estimatedCostMs: presets.high.estimatedCostMs,\n config: Object.freeze({\n maxDispatchesPerFrame: presets.high.maxDispatchesPerFrame,\n maxJobsPerDispatch: presets.high.maxJobsPerDispatch,\n cadenceDivisor: presets.high.cadenceDivisor,\n workgroupScale: presets.high.workgroupScale,\n maxQueueDepth: presets.high.maxQueueDepth,\n metadata: Object.freeze({\n owner: lightingDebugOwner,\n queueClass,\n jobType,\n quality: \"high\",\n }),\n }),\n }),\n ]);\n}\n\nconst lightingWorkerSpecPresets = {\n hybrid: {\n suggestedAllocationIds: [\n \"lighting.hybrid.radiance-cache\",\n \"lighting.hybrid.reflection-history\",\n \"lighting.hybrid.shadow-atlas\",\n ],\n jobs: {\n directLighting: {\n domain: \"lighting\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.directLighting\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.5,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 128,\n },\n medium: {\n estimatedCostMs: 0.9,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 128,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 256,\n },\n high: {\n estimatedCostMs: 1.2,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 256,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 512,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hybrid.shadow-atlas\"],\n },\n screenTrace: {\n domain: \"reflections\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.screenTrace\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 3,\n workgroupScale: 0.4,\n maxQueueDepth: 96,\n },\n medium: {\n estimatedCostMs: 1.5,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 96,\n cadenceDivisor: 2,\n workgroupScale: 0.7,\n maxQueueDepth: 192,\n },\n high: {\n estimatedCostMs: 2.2,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 192,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 384,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hybrid.reflection-history\"],\n },\n radianceCache: {\n domain: \"lighting\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.radianceCache\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.7,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 96,\n },\n medium: {\n estimatedCostMs: 1.2,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 192,\n },\n high: {\n estimatedCostMs: 1.8,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 128,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 256,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hybrid.radiance-cache\"],\n },\n finalGather: {\n domain: \"lighting\",\n importance: \"critical\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.finalGather\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 1,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 48,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 128,\n },\n medium: {\n estimatedCostMs: 1.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 96,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 256,\n },\n high: {\n estimatedCostMs: 2.6,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 192,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 384,\n },\n }\n ),\n suggestedAllocationIds: [\n \"lighting.hybrid.radiance-cache\",\n \"lighting.hybrid.reflection-history\",\n ],\n },\n reflectionResolve: {\n domain: \"reflections\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hybrid.reflectionResolve\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 96,\n },\n medium: {\n estimatedCostMs: 0.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 192,\n },\n high: {\n estimatedCostMs: 1.2,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 128,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 256,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hybrid.reflection-history\"],\n },\n },\n },\n pathtracer: {\n suggestedAllocationIds: [\n \"lighting.pathtracer.path-state\",\n \"lighting.pathtracer.accumulation\",\n \"lighting.pathtracer.denoise-history\",\n ],\n jobs: {\n pathTrace: {\n domain: \"lighting\",\n importance: \"critical\",\n levels: buildWorkerBudgetLevels(\n \"lighting.pathtracer.pathTrace\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 1.2,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 3,\n workgroupScale: 0.45,\n maxQueueDepth: 48,\n },\n medium: {\n estimatedCostMs: 2.3,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 2,\n workgroupScale: 0.7,\n maxQueueDepth: 96,\n },\n high: {\n estimatedCostMs: 3.8,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 128,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.pathtracer.path-state\"],\n },\n accumulate: {\n domain: \"lighting\",\n importance: \"medium\",\n levels: buildWorkerBudgetLevels(\n \"lighting.pathtracer.accumulate\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 32,\n },\n medium: {\n estimatedCostMs: 0.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 64,\n },\n high: {\n estimatedCostMs: 1.1,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 96,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.pathtracer.accumulation\"],\n },\n denoise: {\n domain: \"post-processing\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.pathtracer.denoise\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 32,\n },\n medium: {\n estimatedCostMs: 0.9,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 64,\n },\n high: {\n estimatedCostMs: 1.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 96,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.pathtracer.denoise-history\"],\n },\n },\n },\n volumetrics: {\n suggestedAllocationIds: [\n \"lighting.volumetrics.froxel-grid\",\n \"lighting.volumetrics.shadow-history\",\n ],\n jobs: {\n froxelIntegrate: {\n domain: \"volumetrics\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.volumetrics.froxelIntegrate\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.6,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 96,\n },\n medium: {\n estimatedCostMs: 1.1,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 64,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 192,\n },\n high: {\n estimatedCostMs: 1.7,\n maxDispatchesPerFrame: 2,\n maxJobsPerDispatch: 128,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 256,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.volumetrics.froxel-grid\"],\n },\n volumetricShadow: {\n domain: \"volumetrics\",\n importance: \"high\",\n levels: buildWorkerBudgetLevels(\n \"lighting.volumetrics.volumetricShadow\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.5,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 24,\n cadenceDivisor: 2,\n workgroupScale: 0.5,\n maxQueueDepth: 64,\n },\n medium: {\n estimatedCostMs: 0.9,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 48,\n cadenceDivisor: 1,\n workgroupScale: 0.75,\n maxQueueDepth: 128,\n },\n high: {\n estimatedCostMs: 1.3,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 96,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 192,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.volumetrics.shadow-history\"],\n },\n },\n },\n hdri: {\n suggestedAllocationIds: [\n \"lighting.hdri.cubemap\",\n \"lighting.hdri.prefilter\",\n \"lighting.hdri.brdf-lut\",\n ],\n jobs: {\n irradianceConvolution: {\n domain: \"lighting\",\n importance: \"medium\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hdri.irradianceConvolution\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.3,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 8,\n cadenceDivisor: 3,\n workgroupScale: 0.5,\n maxQueueDepth: 16,\n },\n medium: {\n estimatedCostMs: 0.5,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 2,\n workgroupScale: 0.75,\n maxQueueDepth: 32,\n },\n high: {\n estimatedCostMs: 0.8,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 48,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hdri.cubemap\"],\n },\n specularPrefilter: {\n domain: \"lighting\",\n importance: \"medium\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hdri.specularPrefilter\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 8,\n cadenceDivisor: 3,\n workgroupScale: 0.5,\n maxQueueDepth: 16,\n },\n medium: {\n estimatedCostMs: 0.7,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 2,\n workgroupScale: 0.75,\n maxQueueDepth: 32,\n },\n high: {\n estimatedCostMs: 1,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 32,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 48,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hdri.prefilter\"],\n },\n brdfLut: {\n domain: \"lighting\",\n importance: \"low\",\n levels: buildWorkerBudgetLevels(\n \"lighting.hdri.brdfLut\",\n lightingWorkerQueueClass,\n {\n low: {\n estimatedCostMs: 0.2,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 4,\n cadenceDivisor: 3,\n workgroupScale: 0.5,\n maxQueueDepth: 8,\n },\n medium: {\n estimatedCostMs: 0.4,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 8,\n cadenceDivisor: 2,\n workgroupScale: 0.75,\n maxQueueDepth: 16,\n },\n high: {\n estimatedCostMs: 0.6,\n maxDispatchesPerFrame: 1,\n maxJobsPerDispatch: 16,\n cadenceDivisor: 1,\n workgroupScale: 1,\n maxQueueDepth: 24,\n },\n }\n ),\n suggestedAllocationIds: [\"lighting.hdri.brdf-lut\"],\n },\n },\n },\n};\n\nconst lightingWorkerDagSpecs = {\n hybrid: {\n directLighting: { priority: 4, dependencies: [] },\n screenTrace: { priority: 3, dependencies: [] },\n radianceCache: { priority: 4, dependencies: [\"directLighting\"] },\n finalGather: { priority: 2, dependencies: [\"radianceCache\", \"screenTrace\"] },\n reflectionResolve: {\n priority: 1,\n dependencies: [\"screenTrace\", \"finalGather\"],\n },\n },\n pathtracer: {\n pathTrace: { priority: 4, dependencies: [] },\n accumulate: { priority: 3, dependencies: [\"pathTrace\"] },\n denoise: { priority: 2, dependencies: [\"accumulate\"] },\n },\n volumetrics: {\n volumetricShadow: { priority: 3, dependencies: [] },\n froxelIntegrate: { priority: 2, dependencies: [\"volumetricShadow\"] },\n },\n hdri: {\n irradianceConvolution: { priority: 3, dependencies: [] },\n specularPrefilter: { priority: 3, dependencies: [] },\n brdfLut: {\n priority: 2,\n dependencies: [\"irradianceConvolution\", \"specularPrefilter\"],\n },\n },\n};\n\nfunction resolveLightingQualityDimensions(techniqueName, jobKey) {\n const key = `${techniqueName}.${jobKey}`;\n return Object.freeze(\n {\n \"hybrid.directLighting\": { shadows: 1, lightingSamples: 0.7 },\n \"hybrid.screenTrace\": { rayTracing: 1, temporalReuse: 0.4 },\n \"hybrid.radianceCache\": {\n lightingSamples: 0.8,\n updateCadence: 0.7,\n temporalReuse: 1,\n },\n \"hybrid.finalGather\": { lightingSamples: 1, rayTracing: 0.6 },\n \"hybrid.reflectionResolve\": {\n rayTracing: 0.5,\n temporalReuse: 1,\n shading: 0.3,\n },\n \"pathtracer.pathTrace\": { rayTracing: 1, lightingSamples: 1 },\n \"pathtracer.accumulate\": { temporalReuse: 1, updateCadence: 0.4 },\n \"pathtracer.denoise\": { temporalReuse: 1, shading: 0.4 },\n \"volumetrics.froxelIntegrate\": {\n lightingSamples: 0.6,\n shading: 0.4,\n updateCadence: 0.3,\n },\n \"volumetrics.volumetricShadow\": { shadows: 0.8, updateCadence: 0.5 },\n \"hdri.irradianceConvolution\": {\n lightingSamples: 0.4,\n temporalReuse: 1,\n updateCadence: 1,\n },\n \"hdri.specularPrefilter\": {\n lightingSamples: 0.5,\n temporalReuse: 1,\n updateCadence: 1,\n },\n \"hdri.brdfLut\": {\n shading: 0.4,\n temporalReuse: 1,\n updateCadence: 1,\n },\n }[key] ?? {}\n );\n}\n\nfunction resolveLightingImportanceSignals(techniqueName, jobKey) {\n const key = `${techniqueName}.${jobKey}`;\n return Object.freeze(\n {\n \"hybrid.directLighting\": { visible: true, shadowSignificance: \"high\" },\n \"hybrid.screenTrace\": { visible: true, reflectionSignificance: \"high\" },\n \"hybrid.radianceCache\": { visible: true },\n \"hybrid.finalGather\": {\n visible: true,\n shadowSignificance: \"critical\",\n reflectionSignificance: \"high\",\n },\n \"hybrid.reflectionResolve\": { visible: true, reflectionSignificance: \"high\" },\n \"pathtracer.pathTrace\": {\n visible: true,\n shadowSignificance: \"high\",\n reflectionSignificance: \"high\",\n },\n \"pathtracer.accumulate\": { visible: true },\n \"pathtracer.denoise\": { visible: true },\n \"volumetrics.froxelIntegrate\": { visible: true },\n \"volumetrics.volumetricShadow\": { visible: true, shadowSignificance: \"high\" },\n \"hdri.irradianceConvolution\": { visible: false },\n \"hdri.specularPrefilter\": { visible: false, reflectionSignificance: \"medium\" },\n \"hdri.brdfLut\": { visible: false },\n }[key] ?? {}\n );\n}\n\nfunction buildWorkerManifestJob(techniqueName, job) {\n const spec = lightingWorkerSpecPresets[techniqueName].jobs[job.key];\n const dag = lightingWorkerDagSpecs[techniqueName][job.key];\n const dependencies = dag.dependencies.map(\n (dependency) => `lighting.${techniqueName}.${dependency}`\n );\n\n return Object.freeze({\n key: job.key,\n label: job.label,\n worker: Object.freeze({\n jobType: job.label,\n queueClass: lightingWorkerQueueClass,\n priority: dag.priority,\n dependencies: Object.freeze(dependencies),\n schedulerMode: \"dag\",\n }),\n performance: Object.freeze({\n id: job.label,\n jobType: job.label,\n queueClass: lightingWorkerQueueClass,\n domain: spec.domain,\n authority: \"visual\",\n importance: spec.importance,\n qualityDimensions: resolveLightingQualityDimensions(techniqueName, job.key),\n importanceSignals: resolveLightingImportanceSignals(techniqueName, job.key),\n levels: spec.levels,\n }),\n debug: Object.freeze({\n owner: lightingDebugOwner,\n queueClass: lightingWorkerQueueClass,\n jobType: job.label,\n tags: Object.freeze([\n \"lighting\",\n techniqueName,\n job.key,\n spec.domain,\n ]),\n suggestedAllocationIds: Object.freeze([...spec.suggestedAllocationIds]),\n }),\n });\n}\n\nfunction buildLightingWorkerManifest(name, technique) {\n const spec = lightingWorkerSpecPresets[name];\n\n return Object.freeze({\n schemaVersion: 1,\n owner: lightingDebugOwner,\n technique: name,\n description: technique.description,\n queueClass: lightingWorkerQueueClass,\n schedulerMode: \"dag\",\n suggestedAllocationIds: Object.freeze([...spec.suggestedAllocationIds]),\n jobs: Object.freeze(\n technique.jobs.map((job) => buildWorkerManifestJob(name, job))\n ),\n });\n}\n\nexport const lightingWorkerManifests = Object.freeze(\n Object.fromEntries(\n Object.entries(lightingTechniques).map(([name, technique]) => [\n name,\n buildLightingWorkerManifest(name, technique),\n ])\n )\n);\n\nfunction getTechniqueJob(technique, key) {\n const job = technique.jobs.find((entry) => entry.key === key);\n if (!job) {\n const available = technique.jobs.map((entry) => entry.key).join(\", \");\n throw new Error(\n `Unknown job \"${key}\" for technique \"${technique.name}\". ` +\n `Available: ${available}.`\n );\n }\n return job;\n}\n\nexport function getLightingTechnique(name = defaultLightingTechnique) {\n const technique = lightingTechniques[name];\n if (!technique) {\n const available = lightingTechniqueNames.join(\", \");\n throw new Error(`Unknown lighting technique \"${name}\". Available: ${available}.`);\n }\n return technique;\n}\n\nexport function getLightingProfile(name = defaultLightingProfile) {\n const profile = lightingProfiles[name];\n if (!profile) {\n const available = lightingProfileNames.join(\", \");\n throw new Error(`Unknown lighting profile \"${name}\". Available: ${available}.`);\n }\n return profile;\n}\n\nexport function getLightingTechniqueWorkerManifest(\n name = defaultLightingTechnique\n) {\n const manifest = lightingWorkerManifests[name];\n if (!manifest) {\n const available = lightingTechniqueNames.join(\", \");\n throw new Error(\n `Unknown lighting technique \"${name}\". Available: ${available}.`\n );\n }\n return manifest;\n}\n\nexport function getLightingProfileWorkerManifest(\n name = defaultLightingProfile\n) {\n const profile = getLightingProfile(name);\n const techniques = profile.techniques.map((techniqueName) =>\n getLightingTechniqueWorkerManifest(techniqueName)\n );\n const lightingBandPlan = createLightingBandPlan({ profile: profile.name });\n\n return Object.freeze({\n schemaVersion: 1,\n owner: lightingDebugOwner,\n profile: profile.name,\n description: profile.description,\n schedulerMode: \"dag\",\n techniques: Object.freeze(techniques),\n lightingBands: lightingBandPlan.bands,\n jobs: Object.freeze(techniques.flatMap((technique) => technique.jobs)),\n });\n}\n\nconst defaultTechnique = getLightingTechnique(defaultLightingTechnique);\n\nexport const lightingPreludeWgslUrl = defaultTechnique.preludeUrl;\n\nexport const lightingJobLabels = Object.freeze(\n Object.fromEntries(defaultTechnique.jobs.map((job) => [job.key, job.label]))\n);\n\nexport const lightingJobs = defaultTechnique.jobs.map((job) => ({\n label: job.label,\n url: job.url,\n sourceName: job.sourceName,\n}));\n\nfunction assertNotHtmlWgsl(source, context) {\n const sample = source.slice(0, 200).toLowerCase();\n if (\n sample.includes(\"<!doctype\") ||\n sample.includes(\"<html\") ||\n sample.includes(\"<meta\")\n ) {\n const label = context ? ` for ${context}` : \"\";\n throw new Error(\n `Expected WGSL${label} but received HTML. Check the URL or server root.`\n );\n }\n}\n\nasync function loadWgslSource(options = {}) {\n const { wgsl, url, fetcher = globalThis.fetch, base } = options ?? {};\n if (typeof wgsl === \"string\") {\n assertNotHtmlWgsl(wgsl, \"inline WGSL\");\n return wgsl;\n }\n if (!url) {\n return null;\n }\n const resolved = url instanceof URL ? url : new URL(url, base ?? baseUrl);\n if (!fetcher || resolved.protocol === \"file:\") {\n const { readFile } = await import(\"node:fs/promises\");\n const { fileURLToPath } = await import(\"node:url\");\n const source = await readFile(fileURLToPath(resolved), \"utf8\");\n assertNotHtmlWgsl(source, resolved.href);\n return source;\n }\n const response = await fetcher(resolved);\n if (!response.ok) {\n const status = \"status\" in response ? response.status : \"unknown\";\n const statusText = \"statusText\" in response ? response.statusText : \"\";\n const detail = statusText ? `${status} ${statusText}` : `${status}`;\n throw new Error(`Failed to load WGSL (${detail})`);\n }\n const source = await response.text();\n assertNotHtmlWgsl(source, resolved.href);\n return source;\n}\n\nasync function loadTechniquePrelude(technique, fetcher) {\n const source = await loadWgslSource({ url: technique.preludeUrl, fetcher });\n if (typeof source !== \"string\") {\n throw new Error(`Failed to load ${technique.name} prelude WGSL source.`);\n }\n return source;\n}\n\nasync function loadTechniqueJob(technique, job, fetcher) {\n const source = await loadWgslSource({ url: job.url, fetcher });\n if (typeof source !== \"string\") {\n throw new Error(\n `Failed to load ${technique.name} job \"${job.key}\" WGSL source.`\n );\n }\n return source;\n}\n\nexport async function loadLightingTechniquePreludeWgsl(\n techniqueName,\n options = {}\n) {\n const { fetcher } = options ?? {};\n const technique = getLightingTechnique(techniqueName);\n return loadTechniquePrelude(technique, fetcher);\n}\n\nexport async function loadLightingTechniqueJobWgsl(\n techniqueName,\n jobKey,\n options = {}\n) {\n const { fetcher } = options ?? {};\n const technique = getLightingTechnique(techniqueName);\n const job = getTechniqueJob(technique, jobKey);\n return loadTechniqueJob(technique, job, fetcher);\n}\n\nexport async function loadLightingTechniqueJobs(techniqueName, options = {}) {\n const { fetcher } = options ?? {};\n const technique = getLightingTechnique(techniqueName);\n const preludeWgsl = await loadTechniquePrelude(technique, fetcher);\n const jobSources = await Promise.all(\n technique.jobs.map((job) => loadTechniqueJob(technique, job, fetcher))\n );\n const jobs = technique.jobs.map((job, index) => ({\n wgsl: jobSources[index],\n label: job.label,\n sourceName: job.sourceName,\n }));\n return { preludeWgsl, jobs };\n}\n\nexport async function loadLightingTechniqueWorkerBundle(\n techniqueName = defaultLightingTechnique,\n options = {}\n) {\n const technique = getLightingTechnique(techniqueName);\n const { preludeWgsl, jobs } = await loadLightingTechniqueJobs(\n technique.name,\n options\n );\n\n return {\n technique: technique.name,\n preludeWgsl,\n jobs,\n workerManifest: getLightingTechniqueWorkerManifest(technique.name),\n };\n}\n\nexport async function loadLightingPreludeWgsl(options = {}) {\n const { fetcher } = options ?? {};\n return loadTechniquePrelude(defaultTechnique, fetcher);\n}\n\nexport async function loadLightingJobs(options = {}) {\n return loadLightingTechniqueJobs(defaultLightingTechnique, options);\n}\n\nexport async function loadLightingProfile(profileName, options = {}) {\n const profile = getLightingProfile(profileName);\n const techniques = await Promise.all(\n profile.techniques.map(async (techniqueName) => {\n const { preludeWgsl, jobs } = await loadLightingTechniqueJobs(\n techniqueName,\n options\n );\n return {\n technique: techniqueName,\n preludeWgsl,\n jobs,\n };\n })\n );\n return { profile, techniques };\n}\n\nexport async function loadLightingProfileWorkerPlan(\n profileName = defaultLightingProfile,\n options = {}\n) {\n const profile = getLightingProfile(profileName);\n const techniques = await Promise.all(\n profile.techniques.map((techniqueName) =>\n loadLightingTechniqueWorkerBundle(techniqueName, options)\n )\n );\n\n return {\n profile,\n techniques,\n lightingBandPlan: createLightingBandPlan({ profile: profile.name }),\n workerManifest: getLightingProfileWorkerManifest(profile.name),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,IAAM,WAAW,MAAM;AACrB,MAAI,OAA4C;AAC9C,WAAO,oBAAoB,MAAmB;AAAA,EAChD;AACA,MAAI,OAAO,eAAe,eAAe,OAAO,YAAY,aAAa;AACvE,UAAM,EAAE,cAAc,IAAI,QAAQ,KAAU;AAC5C,WAAO,cAAc,UAAU;AAAA,EACjC;AACA,QAAM,OACJ,OAAO,YAAY,eAAe,QAAQ,MACtC,UAAU,QAA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