rayzee 7.23.2 → 7.24.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/rayzee.es.js CHANGED
@@ -16251,48 +16251,49 @@ function cm(e, t) {
16251
16251
  }
16252
16252
  //#endregion
16253
16253
  //#region src/Passes/OIDNDenoiser.js
16254
- var lm = si("oidn"), um = null, dm = null;
16255
- async function fm() {
16256
- if (!um) {
16257
- let [e, t] = await Promise.all([import("oidn-web"), import("@tensorflow/tfjs-core")]);
16258
- um = e.initUNetFromURL, dm = t.engine;
16259
- }
16260
- return um;
16261
- }
16262
- function pm() {
16263
- if (dm) try {
16264
- let e = dm();
16265
- e?.registryFactory && "webgpu-oidn" in e.registryFactory && e.removeBackend("webgpu-oidn");
16266
- } catch (e) {
16267
- lm.warn("failed to clear cached TFJS backend", e);
16268
- }
16254
+ var lm = si("oidn"), um = null;
16255
+ async function dm() {
16256
+ return um ||= (await import("oidn-web")).initUNetFromURL, um;
16269
16257
  }
16270
- var mm = new Float32Array(3), hm = {
16258
+ var fm = new Float32Array(3), pm = {
16271
16259
  QUALITY_MODELS: {
16272
- fast: "rt_hdr_alb_nrm_small",
16273
- balance: "rt_hdr_calb_cnrm",
16274
- high: "rt_hdr_calb_cnrm_large"
16260
+ fast: {
16261
+ model: "rt_hdr_alb_nrm_small",
16262
+ cleanAux: !1
16263
+ },
16264
+ "fast-clean": {
16265
+ model: "rt_hdr_calb_cnrm_small",
16266
+ cleanAux: !0
16267
+ },
16268
+ balance: {
16269
+ model: "rt_hdr_calb_cnrm",
16270
+ cleanAux: !0
16271
+ },
16272
+ high: {
16273
+ model: "rt_hdr_calb_cnrm_large",
16274
+ cleanAux: !0
16275
+ }
16275
16276
  },
16276
16277
  DEFAULT_OPTIONS: {
16277
16278
  enableOIDN: !0,
16278
16279
  oidnQuality: "fast",
16279
16280
  debugGbufferMaps: !0,
16280
- tileSize: 512
16281
+ tileSize: 1024
16281
16282
  }
16282
- }, gm = "\n@group(0) @binding(0) var<storage, read_write> col: array<vec4<f32>>;\n@group(0) @binding(1) var<uniform> scale: f32;\n\n@compute @workgroup_size(64)\nfn main( @builtin(global_invocation_id) gid: vec3<u32>,\n @builtin(num_workgroups) nwg: vec3<u32> ) {\n let i = gid.y * nwg.x * 64u + gid.x;\n if ( i >= arrayLength( &col ) ) { return; }\n let c = col[ i ];\n col[ i ] = vec4<f32>( c.xyz * scale, c.w );\n}\n", _m = 64, vm = 32768, ym = .18;
16283
- function bm(e, t) {
16283
+ }, mm = "\n@group(0) @binding(0) var<storage, read_write> col: array<vec4<f32>>;\n@group(0) @binding(1) var<uniform> scale: f32;\n\n@compute @workgroup_size(64)\nfn main( @builtin(global_invocation_id) gid: vec3<u32>,\n @builtin(num_workgroups) nwg: vec3<u32> ) {\n let i = gid.y * nwg.x * 64u + gid.x;\n if ( i >= arrayLength( &col ) ) { return; }\n let c = col[ i ];\n col[ i ] = vec4<f32>( c.xyz * scale, c.w );\n}\n", hm = 64, gm = 32768, _m = .18;
16284
+ function vm(e, t) {
16284
16285
  let n = 0;
16285
16286
  for (let r = 0; r < t; r++) {
16286
16287
  let t = r * 4, i = .212671 * e[t] + .71516 * e[t + 1] + .072169 * e[t + 2];
16287
16288
  n += Math.log2(Math.max(i, 0) + 1e-4);
16288
16289
  }
16289
- let r = ym / 2 ** (n / t);
16290
+ let r = _m / 2 ** (n / t);
16290
16291
  return Number.isFinite(r) && r > 0 ? r : 1;
16291
16292
  }
16292
- var xm = class extends lt {
16293
+ var ym = class extends lt {
16293
16294
  constructor(e, t, n, r, i = {}) {
16294
16295
  if (super(), !e || !t || !n || !r) throw Error("OIDNDenoiser requires output canvas, renderer, scene, and camera");
16295
- this.renderer = t, this.scene = n, this.camera = r, this.input = t.domElement, this.output = e, this.extractGBufferData = i.extractGBufferData || null, this.getMRTRenderTarget = i.getMRTRenderTarget || null, this.backendParamsGetter = i.backendParams || null, this.getGPUTextures = i.getGPUTextures || null, this.getExposure = i.getExposure || (() => 1), this.getToneMapping = i.getToneMapping || (() => He), this.getSaturation = i.getSaturation || (() => 1), this.getTransparentBackground = i.getTransparentBackground || (() => !1), this.isGPUMode = !!this.backendParamsGetter, this.gpuDevice = null, this._gpuInputBuffers = {
16296
+ this.renderer = t, this.scene = n, this.camera = r, this.input = t.domElement, this.output = e, this.extractGBufferData = i.extractGBufferData || null, this.getMRTRenderTarget = i.getMRTRenderTarget || null, this.backendParamsGetter = i.backendParams || null, this.getGPUTextures = i.getGPUTextures || null, this.refreshInput = i.refreshInput || null, this.getExposure = i.getExposure || (() => 1), this.getToneMapping = i.getToneMapping || (() => He), this.getSaturation = i.getSaturation || (() => 1), this.getTransparentBackground = i.getTransparentBackground || (() => !1), this.isGPUMode = !!this.backendParamsGetter, this.gpuDevice = null, this._gpuInputBuffers = {
16296
16297
  color: null,
16297
16298
  albedo: null,
16298
16299
  normal: null
@@ -16300,9 +16301,9 @@ var xm = class extends lt {
16300
16301
  width: 0,
16301
16302
  height: 0
16302
16303
  }, this._gpuInputPadBuffer = null, this._gpuInputPaddedRowBytes = 0, this._colorScalePipeline = null, this._colorScaleBindGroup = null, this._colorScaleUniform = null, this._oidnInputScale = 1, this._alphaReadbackBuffer = null, this._alphaReadbackMapped = !1, this._cachedAlpha = null, this._cachedAlphaWidth = 0, this.config = {
16303
- ...hm.DEFAULT_OPTIONS,
16304
+ ...pm.DEFAULT_OPTIONS,
16304
16305
  ...i
16305
- }, this.enabled = this.config.enableOIDN, this.quality = this.config.oidnQuality, this.debugGbufferMaps = this.config.debugGbufferMaps, this.tileSize = this.config.tileSize, this._activeTileSize = 0, this.state = {
16306
+ }, this.enabled = this.config.enableOIDN, this.quality = this.config.oidnQuality, this.debugGbufferMaps = this.config.debugGbufferMaps, this.maxTileSize = this.config.tileSize, this._activeTileSize = 0, this.state = {
16306
16307
  isDenoising: !1,
16307
16308
  isLoading: !1,
16308
16309
  abortController: null
@@ -16335,11 +16336,28 @@ var xm = class extends lt {
16335
16336
  alpha: !0
16336
16337
  });
16337
16338
  }
16339
+ expectsCleanAux(e = this.quality) {
16340
+ let { QUALITY_MODELS: t } = pm;
16341
+ return (t[e] || t.balance).cleanAux;
16342
+ }
16343
+ getRuntimeInfo() {
16344
+ return this.unet?.getRuntimeInfo?.() ?? null;
16345
+ }
16346
+ profileNextDenoise() {
16347
+ return this.unet?.profileNextExecution?.() ?? !1;
16348
+ }
16349
+ async getLastDenoiseProfile() {
16350
+ return await this.unet?.getLastExecutionProfile?.() ?? null;
16351
+ }
16352
+ _resolveTileSize() {
16353
+ let e = Math.max(this.output?.width || 0, this.output?.height || 0);
16354
+ return e ? Math.min(e, this.maxTileSize) : this.maxTileSize;
16355
+ }
16338
16356
  async _setupUNetDenoiser() {
16339
16357
  if (this.state.isLoading) return;
16340
16358
  this.state.isLoading = !0;
16341
- let e = this._generateTzaUrl();
16342
- if (this.currentTZAUrl === e && this._activeTileSize === this.tileSize && this.unet) {
16359
+ let e = this._generateTzaUrl(), t = this._resolveTileSize();
16360
+ if (this.currentTZAUrl === e && this._activeTileSize === t && this.unet) {
16343
16361
  this.state.isLoading = !1;
16344
16362
  return;
16345
16363
  }
@@ -16348,16 +16366,17 @@ var xm = class extends lt {
16348
16366
  type: "loading",
16349
16367
  message: "Loading UNet denoiser..."
16350
16368
  }), this.unet &&= (this.unet.dispose(), null);
16351
- let t;
16369
+ let n;
16352
16370
  if (this.isGPUMode && this.backendParamsGetter) {
16353
16371
  let e = this.backendParamsGetter();
16354
- this.gpuDevice = e?.device ?? null, t = e?.device ? e : void 0;
16372
+ this.gpuDevice = e?.device ?? null, n = e?.device ? e : void 0;
16355
16373
  }
16356
- this.unet = await (await fm())(e, t, {
16374
+ this.unet = await (await dm())(e, n, {
16357
16375
  aux: !0,
16358
16376
  hdr: !0,
16359
- maxTileSize: this.tileSize
16360
- }), this.currentTZAUrl = e, this._activeTileSize = this.tileSize, this.dispatchEvent({ type: "loaded" }), lm.debug("UNet weights loaded:", e);
16377
+ maxTileSize: t,
16378
+ dynamicTile: !1
16379
+ }), this.currentTZAUrl = e, this._activeTileSize = t, this.dispatchEvent({ type: "loaded" }), lm.debug("UNet weights loaded:", e);
16361
16380
  } catch (e) {
16362
16381
  lm.error("UNet weights failed to load:", e), this.dispatchEvent({
16363
16382
  type: "error",
@@ -16368,19 +16387,19 @@ var xm = class extends lt {
16368
16387
  }
16369
16388
  }
16370
16389
  _generateTzaUrl() {
16371
- let { oidnWeightsBaseUrl: e } = pl(), { QUALITY_MODELS: t } = hm;
16372
- return `${e}${t[this.quality] || t.balance}.tza`;
16390
+ let { oidnWeightsBaseUrl: e } = pl(), { QUALITY_MODELS: t } = pm;
16391
+ return `${e}${(t[this.quality] || t.balance).model}.tza`;
16373
16392
  }
16374
16393
  async updateConfiguration(e) {
16375
- Object.keys(e).some((t) => this.config[t] !== e[t]) && (Object.assign(this.config, e), this.quality = this.config.oidnQuality, this.debugGbufferMaps = this.config.debugGbufferMaps, this.tileSize = this.config.tileSize, await this._setupUNetDenoiser());
16394
+ Object.keys(e).some((t) => this.config[t] !== e[t]) && (Object.assign(this.config, e), this.quality = this.config.oidnQuality, this.debugGbufferMaps = this.config.debugGbufferMaps, this.maxTileSize = this.config.tileSize, await this._setupUNetDenoiser());
16376
16395
  }
16377
16396
  async updateQuality(e) {
16378
- if (!Object.prototype.hasOwnProperty.call(hm.QUALITY_MODELS, e)) throw Error(`Invalid quality setting: ${e}. Must be one of: ${Object.keys(hm.QUALITY_MODELS).join(", ")}`);
16397
+ if (!Object.prototype.hasOwnProperty.call(pm.QUALITY_MODELS, e)) throw Error(`Invalid quality setting: ${e}. Must be one of: ${Object.keys(pm.QUALITY_MODELS).join(", ")}`);
16379
16398
  await this.updateConfiguration({ oidnQuality: e });
16380
16399
  }
16381
16400
  async start() {
16382
16401
  if (!this.enabled || this.state.isDenoising) return !1;
16383
- if (this.state.isLoading) return this._pendingStart = !0, !1;
16402
+ if (this.unet && !this.state.isLoading && this._activeTileSize !== this._resolveTileSize() && await this._setupUNetDenoiser(), this.state.isLoading) return this._pendingStart = !0, !1;
16384
16403
  this.dispatchEvent({ type: "start" });
16385
16404
  let e = performance.now(), t = await this.execute();
16386
16405
  if (t) {
@@ -16390,9 +16409,12 @@ var xm = class extends lt {
16390
16409
  }
16391
16410
  return t;
16392
16411
  }
16412
+ _revealOutput() {
16413
+ this.output.style.display = "block", this.input.style.opacity = "0";
16414
+ }
16393
16415
  async execute() {
16394
16416
  if (!this.enabled || !this.unet) return !1;
16395
- this.state.abortController = new AbortController(), this.state.isDenoising = !0, this.input.style.opacity = "0", this.output.style.display = "block";
16417
+ this.state.abortController = new AbortController(), this.state.isDenoising = !0;
16396
16418
  try {
16397
16419
  return await this._executeUNet(), !0;
16398
16420
  } catch (e) {
@@ -16411,7 +16433,7 @@ var xm = class extends lt {
16411
16433
  if (!n?.color) return lm.warn("GPU textures not ready yet"), !1;
16412
16434
  let r = this.gpuDevice;
16413
16435
  if (!r) return lm.warn("gpuDevice not available"), !1;
16414
- this._ensureGPUInputBuffers(e, t);
16436
+ this.refreshInput?.(), this.ctx.drawImage(this.input, 0, 0, e, t), this._revealOutput(), this._ensureGPUInputBuffers(e, t);
16415
16437
  let i = r.createCommandEncoder({ label: "oidn-tex-to-buf" }), a = e * 16, o = this._gpuInputPaddedRowBytes, s = o > a, c = this._gpuInputPadBuffer, l = (n, r) => {
16416
16438
  if (!s) i.copyTextureToBuffer({
16417
16439
  texture: n,
@@ -16443,7 +16465,7 @@ var xm = class extends lt {
16443
16465
  for (let e = 0; e < t; e++) i.copyBufferToBuffer(c, e * o, r, e * a, a);
16444
16466
  }
16445
16467
  };
16446
- l(n.color, this._gpuInputBuffers.color), l(n.albedo, this._gpuInputBuffers.albedo), l(n.normal, this._gpuInputBuffers.normal), r.queue.submit([i.finish()]), await this._readbackColor(r, e, t), globalThis.__OIDN_NO_INPUT_SCALE && (this._oidnInputScale = 1), this._applyColorScale(r, e * t), this.ctx.drawImage(this.input, 0, 0, e, t);
16468
+ l(n.color, this._gpuInputBuffers.color), l(n.albedo, this._gpuInputBuffers.albedo), l(n.normal, this._gpuInputBuffers.normal), r.queue.submit([i.finish()]), await this._readbackColor(r, e, t), globalThis.__OIDN_NO_INPUT_SCALE && (this._oidnInputScale = 1), this._applyColorScale(r, e * t);
16447
16469
  let u = {
16448
16470
  color: {
16449
16471
  data: this._gpuInputBuffers.color,
@@ -16520,7 +16542,7 @@ var xm = class extends lt {
16520
16542
  return;
16521
16543
  }
16522
16544
  let o = new Float32Array(i.getMappedRange()), s = t * n;
16523
- this._oidnInputScale = bm(o, s);
16545
+ this._oidnInputScale = vm(o, s);
16524
16546
  let c = null;
16525
16547
  if (this.getTransparentBackground()) {
16526
16548
  c = new Uint8Array(s);
@@ -16535,7 +16557,7 @@ var xm = class extends lt {
16535
16557
  let n = this._oidnInputScale;
16536
16558
  if (!this._ensureColorScalePipeline(e)) return;
16537
16559
  e.queue.writeBuffer(this._colorScaleUniform, 0, new Float32Array([n]));
16538
- let r = Math.ceil(t / _m), i = Math.min(r, vm), a = Math.ceil(r / i), o = e.createCommandEncoder({ label: "oidn-color-scale" }), s = o.beginComputePass({ label: "oidn-color-scale" });
16560
+ let r = Math.ceil(t / hm), i = Math.min(r, gm), a = Math.ceil(r / i), o = e.createCommandEncoder({ label: "oidn-color-scale" }), s = o.beginComputePass({ label: "oidn-color-scale" });
16539
16561
  s.setPipeline(this._colorScalePipeline), s.setBindGroup(0, this._colorScaleBindGroup), s.dispatchWorkgroups(i, a, 1), s.end(), e.queue.submit([o.finish()]);
16540
16562
  }
16541
16563
  _ensureColorScalePipeline(e) {
@@ -16546,7 +16568,7 @@ var xm = class extends lt {
16546
16568
  compute: {
16547
16569
  module: e.createShaderModule({
16548
16570
  label: "oidn-color-scale",
16549
- code: gm
16571
+ code: mm
16550
16572
  }),
16551
16573
  entryPoint: "main"
16552
16574
  }
@@ -16606,7 +16628,7 @@ var xm = class extends lt {
16606
16628
  let e = new Float32Array(u.getMappedRange()), t = new ImageData(o, s), r = this._outputExposure(), c = this.getSaturation(), l = nm.get(this.getToneMapping()) || nm.get(He), d = this._cachedAlpha, f = this._cachedAlphaWidth;
16607
16629
  for (let i = 0, a = e.length; i < a; i += 4) {
16608
16630
  let a = e[i] * r, s = e[i + 1] * r, u = e[i + 2] * r;
16609
- if (c !== 1 && (mm[0] = a, mm[1] = s, mm[2] = u, cm(mm, c), a = mm[0], s = mm[1], u = mm[2]), l(a, s, u, 1, mm), t.data[i] = im(mm[0]) * 255 + .5 | 0, t.data[i + 1] = im(mm[1]) * 255 + .5 | 0, t.data[i + 2] = im(mm[2]) * 255 + .5 | 0, d) {
16631
+ if (c !== 1 && (fm[0] = a, fm[1] = s, fm[2] = u, cm(fm, c), a = fm[0], s = fm[1], u = fm[2]), l(a, s, u, 1, fm), t.data[i] = im(fm[0]) * 255 + .5 | 0, t.data[i + 1] = im(fm[1]) * 255 + .5 | 0, t.data[i + 2] = im(fm[2]) * 255 + .5 | 0, d) {
16610
16632
  let e = (i >> 2) % o, r = (i >> 2) / o | 0;
16611
16633
  t.data[i + 3] = d[(n.y + r) * f + n.x + e];
16612
16634
  } else t.data[i + 3] = 255;
@@ -16647,7 +16669,7 @@ var xm = class extends lt {
16647
16669
  let s = new Float32Array(a.getMappedRange()), c = new ImageData(t, n), l = this._outputExposure(), u = this.getSaturation(), d = nm.get(this.getToneMapping()) || nm.get(He), f = this._cachedAlpha;
16648
16670
  for (let e = 0, t = s.length; e < t; e += 4) {
16649
16671
  let t = s[e] * l, n = s[e + 1] * l, r = s[e + 2] * l;
16650
- u !== 1 && (mm[0] = t, mm[1] = n, mm[2] = r, cm(mm, u), t = mm[0], n = mm[1], r = mm[2]), d(t, n, r, 1, mm), c.data[e] = im(mm[0]) * 255 + .5 | 0, c.data[e + 1] = im(mm[1]) * 255 + .5 | 0, c.data[e + 2] = im(mm[2]) * 255 + .5 | 0, c.data[e + 3] = f ? f[e >> 2] : 255;
16672
+ u !== 1 && (fm[0] = t, fm[1] = n, fm[2] = r, cm(fm, u), t = fm[0], n = fm[1], r = fm[2]), d(t, n, r, 1, fm), c.data[e] = im(fm[0]) * 255 + .5 | 0, c.data[e + 1] = im(fm[1]) * 255 + .5 | 0, c.data[e + 2] = im(fm[2]) * 255 + .5 | 0, c.data[e + 3] = f ? f[e >> 2] : 255;
16651
16673
  }
16652
16674
  a.unmap(), this.ctx.putImageData(c, 0, 0);
16653
16675
  } finally {
@@ -16668,13 +16690,13 @@ var xm = class extends lt {
16668
16690
  this._pendingStagingBuffers.clear();
16669
16691
  }
16670
16692
  dispose() {
16671
- this.abort(), this._destroyPendingStagingBuffers(), this.unet?.dispose(), pm(), this._destroyGPUInputBuffers(), this._colorScalePipeline = null, this.output?.parentNode && this.output.remove(), this.unet = null, this.ctx = null, this.state.abortController = null, this.removeAllListeners?.(), lm.debug("disposed");
16693
+ this.abort(), this._destroyPendingStagingBuffers(), this.unet?.dispose(), this._destroyGPUInputBuffers(), this._colorScalePipeline = null, this.output?.parentNode && this.output.remove(), this.unet = null, this.ctx = null, this.state.abortController = null, this.removeAllListeners?.(), lm.debug("disposed");
16672
16694
  }
16673
- }, Sm = "let e={ortRuntimeUrl:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.24.3/dist/ort.webgpu.bundle.min.mjs`,ortWasmPaths:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.24.3/dist/`,cacheNamespace:`rayzee`},t=null;async function n(){return t||(t=await import(e.ortRuntimeUrl),t.env.wasm.wasmPaths=e.ortWasmPaths,t.env.logLevel=`error`,t)}function r(){return`${e.cacheNamespace}:ai-upscaler-models`}const i=`models`;let a=null,o=null;function s(){return new Promise((e,t)=>{let n=indexedDB.open(r(),1);n.onupgradeneeded=()=>n.result.createObjectStore(i),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function c(e){try{let t=await s();return await new Promise((n,r)=>{let a=t.transaction(i,`readonly`).objectStore(i).get(e);a.onsuccess=()=>n(a.result||null),a.onerror=()=>r(a.error)})}catch{return null}}async function l(e,t){try{let n=await s();await new Promise((r,a)=>{let o=n.transaction(i,`readwrite`);o.objectStore(i).put(t,e),o.oncomplete=()=>r(),o.onerror=()=>a(o.error)})}catch{}}async function u(e){let t=await c(e);if(t)return console.log(`AI Upscaler Worker: model loaded from cache (${(t.byteLength/1024/1024).toFixed(1)}MB)`),t;let n=await fetch(e);if(!n.ok)throw Error(`Failed to fetch model: ${n.status}`);let r=await n.arrayBuffer();return l(e,r.slice(0)),r}async function d(e,t){if(a&&o===e){self.postMessage({type:`loaded`,backend:`webgpu`});return}a&&=(await a.release(),null);let[r,i]=await Promise.all([u(e),n()]);a=await i.InferenceSession.create(r,t),o=e;let s=512;try{let e=await navigator.gpu?.requestAdapter(),t=await e?.requestAdapterInfo?.()||e?.info,n=/apple|swiftshader|llvmpipe/i.test(t?.vendor||``)||/apple|swiftshader/i.test(t?.architecture||``),r=t?.device?.toLowerCase?.()?.includes(`integrated`)||/intel.*iris|intel.*uhd|intel.*hd|amd.*vega|radeon.*graphics/i.test(t?.description||``);s=n?128:r?256:512,console.log(`AI Upscaler Worker: GPU=\"${t?.description||t?.device||`unknown`}\", tileSize=${s}`)}catch{}let c=(r.byteLength/1024/1024).toFixed(1);console.log(`AI Upscaler Worker: model loaded (${c}MB), backend: webgpu`),self.postMessage({type:`loaded`,backend:`webgpu`,tileSize:s})}async function f(e,t,r,i){let o=await n(),s=a.inputNames[0],c=a.outputNames[0],l=new o.Tensor(`float32`,e,[1,3,r,t]),u=(await a.run({[s]:l}))[c].data;self.postMessage({type:`inferred`,outputData:u,id:i},[u.buffer])}self.onmessage=async t=>{let{type:n}=t.data;try{n===`load`?(t.data.ortRuntimeUrl&&(e.ortRuntimeUrl=t.data.ortRuntimeUrl),t.data.ortWasmPaths&&(e.ortWasmPaths=t.data.ortWasmPaths),t.data.cacheNamespace&&(e.cacheNamespace=t.data.cacheNamespace),await d(t.data.url,t.data.sessionOptions)):n===`infer`?await f(t.data.tileData,t.data.width,t.data.height,t.data.id):n===`dispose`&&a&&(await a.release(),a=null,o=null)}catch(e){self.postMessage({type:`error`,message:e.message,id:t.data?.id})}};", Cm = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Sm], { type: "text/javascript;charset=utf-8" });
16674
- function wm(e) {
16695
+ }, bm = "let e={ortRuntimeUrl:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.24.3/dist/ort.webgpu.bundle.min.mjs`,ortWasmPaths:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.24.3/dist/`,cacheNamespace:`rayzee`},t=null;async function n(){return t||(t=await import(e.ortRuntimeUrl),t.env.wasm.wasmPaths=e.ortWasmPaths,t.env.logLevel=`error`,t)}function r(){return`${e.cacheNamespace}:ai-upscaler-models`}const i=`models`;let a=null,o=null;function s(){return new Promise((e,t)=>{let n=indexedDB.open(r(),1);n.onupgradeneeded=()=>n.result.createObjectStore(i),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function c(e){try{let t=await s();return await new Promise((n,r)=>{let a=t.transaction(i,`readonly`).objectStore(i).get(e);a.onsuccess=()=>n(a.result||null),a.onerror=()=>r(a.error)})}catch{return null}}async function l(e,t){try{let n=await s();await new Promise((r,a)=>{let o=n.transaction(i,`readwrite`);o.objectStore(i).put(t,e),o.oncomplete=()=>r(),o.onerror=()=>a(o.error)})}catch{}}async function u(e){let t=await c(e);if(t)return console.log(`AI Upscaler Worker: model loaded from cache (${(t.byteLength/1024/1024).toFixed(1)}MB)`),t;let n=await fetch(e);if(!n.ok)throw Error(`Failed to fetch model: ${n.status}`);let r=await n.arrayBuffer();return l(e,r.slice(0)),r}async function d(e,t){if(a&&o===e){self.postMessage({type:`loaded`,backend:`webgpu`});return}a&&=(await a.release(),null);let[r,i]=await Promise.all([u(e),n()]);a=await i.InferenceSession.create(r,t),o=e;let s=512;try{let e=await navigator.gpu?.requestAdapter(),t=await e?.requestAdapterInfo?.()||e?.info,n=/apple|swiftshader|llvmpipe/i.test(t?.vendor||``)||/apple|swiftshader/i.test(t?.architecture||``),r=t?.device?.toLowerCase?.()?.includes(`integrated`)||/intel.*iris|intel.*uhd|intel.*hd|amd.*vega|radeon.*graphics/i.test(t?.description||``);s=n?128:r?256:512,console.log(`AI Upscaler Worker: GPU=\"${t?.description||t?.device||`unknown`}\", tileSize=${s}`)}catch{}let c=(r.byteLength/1024/1024).toFixed(1);console.log(`AI Upscaler Worker: model loaded (${c}MB), backend: webgpu`),self.postMessage({type:`loaded`,backend:`webgpu`,tileSize:s})}async function f(e,t,r,i){let o=await n(),s=a.inputNames[0],c=a.outputNames[0],l=new o.Tensor(`float32`,e,[1,3,r,t]),u=(await a.run({[s]:l}))[c].data;self.postMessage({type:`inferred`,outputData:u,id:i},[u.buffer])}self.onmessage=async t=>{let{type:n}=t.data;try{n===`load`?(t.data.ortRuntimeUrl&&(e.ortRuntimeUrl=t.data.ortRuntimeUrl),t.data.ortWasmPaths&&(e.ortWasmPaths=t.data.ortWasmPaths),t.data.cacheNamespace&&(e.cacheNamespace=t.data.cacheNamespace),await d(t.data.url,t.data.sessionOptions)):n===`infer`?await f(t.data.tileData,t.data.width,t.data.height,t.data.id):n===`dispose`&&a&&(await a.release(),a=null,o=null)}catch(e){self.postMessage({type:`error`,message:e.message,id:t.data?.id})}};", xm = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", bm], { type: "text/javascript;charset=utf-8" });
16696
+ function Sm(e) {
16675
16697
  let t;
16676
16698
  try {
16677
- if (t = Cm && (self.URL || self.webkitURL).createObjectURL(Cm), !t) throw "";
16699
+ if (t = xm && (self.URL || self.webkitURL).createObjectURL(xm), !t) throw "";
16678
16700
  let n = new Worker(t, {
16679
16701
  type: "module",
16680
16702
  name: e?.name
@@ -16683,7 +16705,7 @@ function wm(e) {
16683
16705
  (self.URL || self.webkitURL).revokeObjectURL(t);
16684
16706
  }), n;
16685
16707
  } catch {
16686
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Sm), {
16708
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(bm), {
16687
16709
  type: "module",
16688
16710
  name: e?.name
16689
16711
  });
@@ -16691,7 +16713,7 @@ function wm(e) {
16691
16713
  }
16692
16714
  //#endregion
16693
16715
  //#region src/Passes/AIUpscaler.js
16694
- var Tm = {
16716
+ var Cm = {
16695
16717
  fast: {
16696
16718
  2: "2x-spanx2-ch48.onnx",
16697
16719
  4: "4xNomos8k_span_otf_strong_fp32_opset17.onnx"
@@ -16705,17 +16727,17 @@ var Tm = {
16705
16727
  4: "4xNomos2_hq_mosr_fp32.onnx"
16706
16728
  }
16707
16729
  };
16708
- function Em() {
16730
+ function wm() {
16709
16731
  let { upscalerModelBaseUrl: e } = pl(), t = {};
16710
- for (let n in Tm) {
16732
+ for (let n in Cm) {
16711
16733
  t[n] = {};
16712
- for (let r in Tm[n]) t[n][r] = e + Tm[n][r];
16734
+ for (let r in Cm[n]) t[n][r] = e + Cm[n][r];
16713
16735
  }
16714
16736
  return t;
16715
16737
  }
16716
- var Dm = {
16738
+ var Tm = {
16717
16739
  get QUALITY_PRESETS() {
16718
- return Em();
16740
+ return wm();
16719
16741
  },
16720
16742
  TILE_SIZE: 512,
16721
16743
  TILE_OVERLAP: 16,
@@ -16726,17 +16748,17 @@ var Dm = {
16726
16748
  }],
16727
16749
  graphOptimizationLevel: "all"
16728
16750
  }
16729
- }, Om = class extends lt {
16751
+ }, Em = class extends lt {
16730
16752
  constructor(e, t, n = {}) {
16731
16753
  if (super(), !e || !t) throw Error("AIUpscaler requires output canvas and renderer");
16732
- this.renderer = t, this.input = t.domElement, this.output = e, this.getSourceCanvas = n.getSourceCanvas || null, this.getGPUTextures = n.getGPUTextures || null, this.getExposure = n.getExposure || (() => 1), this.getToneMapping = n.getToneMapping || (() => He), this.getSaturation = n.getSaturation || (() => 1), this.enabled = !1, this.hdr = !1, this.scaleFactor = n.scaleFactor || 2, this.quality = n.quality || "fast", this.tileSize = n.tileSize || Dm.TILE_SIZE, this._tileSizeOverride = !!n.tileSize, this.state = {
16754
+ this.renderer = t, this.input = t.domElement, this.output = e, this.getSourceCanvas = n.getSourceCanvas || null, this.getGPUTextures = n.getGPUTextures || null, this.getExposure = n.getExposure || (() => 1), this.getToneMapping = n.getToneMapping || (() => He), this.getSaturation = n.getSaturation || (() => 1), this.enabled = !1, this.hdr = !1, this.scaleFactor = n.scaleFactor || 2, this.quality = n.quality || "fast", this.refreshInput = n.refreshInput || null, this.tileSize = n.tileSize || Tm.TILE_SIZE, this._tileSizeOverride = !!n.tileSize, this.state = {
16733
16755
  isUpscaling: !1,
16734
16756
  isLoading: !1,
16735
16757
  abortController: null
16736
16758
  }, this._worker = null, this._currentModelUrl = null, this._tileId = 0, this._pendingWorkerHandlers = /* @__PURE__ */ new Set(), this._upscaledAlpha = null, this._upscaledAlphaWidth = 0, this._backupCanvas = null, this._baseWidth = e.width, this._baseHeight = e.height, this._hdrStagingBuffer = null, this._hdrStagingWidth = 0, this._hdrStagingHeight = 0;
16737
16759
  }
16738
16760
  async _ensureSession() {
16739
- let e = Dm.QUALITY_PRESETS[this.quality];
16761
+ let e = Tm.QUALITY_PRESETS[this.quality];
16740
16762
  if (!e) throw Error(`Unknown quality preset: ${this.quality}`);
16741
16763
  let t = e[this.scaleFactor];
16742
16764
  if (!t) throw Error(`No model for ${this.quality}/${this.scaleFactor}x`);
@@ -16746,14 +16768,14 @@ var Dm = {
16746
16768
  message: `Loading ${this.scaleFactor}x upscale model...`
16747
16769
  });
16748
16770
  try {
16749
- this._worker ||= new wm(), await new Promise((e, n) => {
16771
+ this._worker ||= new Sm(), await new Promise((e, n) => {
16750
16772
  let r = (t) => {
16751
16773
  t.data.type === "loaded" ? (this._worker.removeEventListener("message", r), t.data.tileSize && !this._tileSizeOverride && (this.tileSize = t.data.tileSize), console.log(`AI Upscaler: ${this.scaleFactor}x model loaded, backend: ${t.data.backend}, tileSize: ${this.tileSize}`), e()) : t.data.type === "error" && (this._worker.removeEventListener("message", r), n(Error(t.data.message)));
16752
16774
  }, { ortRuntimeUrl: i, ortWasmPaths: a, cacheNamespace: o } = pl();
16753
16775
  this._worker.addEventListener("message", r), this._worker.postMessage({
16754
16776
  type: "load",
16755
16777
  url: t,
16756
- sessionOptions: Dm.SESSION_OPTIONS,
16778
+ sessionOptions: Tm.SESSION_OPTIONS,
16757
16779
  ortRuntimeUrl: i,
16758
16780
  ortWasmPaths: a,
16759
16781
  cacheNamespace: o
@@ -16780,16 +16802,19 @@ var Dm = {
16780
16802
  }
16781
16803
  return t;
16782
16804
  }
16805
+ _revealOutput() {
16806
+ this.output.style.display = "block", this.input.style.opacity = "0";
16807
+ }
16783
16808
  async execute() {
16784
16809
  if (!this.enabled) return !1;
16785
- this.state.abortController = new AbortController(), this.state.isUpscaling = !0, this.input.style.opacity = "0", this.output.style.display = "block", this.hdr && this.getGPUTextures ? this._capturedSource = await this._captureSourceHDR() : this._capturedSource = this._captureSource(), this._createBackup(this._capturedSource);
16810
+ this.state.abortController = new AbortController(), this.state.isUpscaling = !0, this.hdr && this.getGPUTextures ? this._capturedSource = await this._captureSourceHDR() : this._capturedSource = this._captureSource(), this._createBackup(this._capturedSource);
16786
16811
  let e = this._capturedSource.width * this.scaleFactor, t = this._capturedSource.height * this.scaleFactor;
16787
16812
  this.output.width = e, this.output.height = t;
16788
16813
  let n = this.output.getContext("2d", {
16789
16814
  willReadFrequently: !0,
16790
16815
  alpha: !0
16791
16816
  });
16792
- n.imageSmoothingEnabled = !0, n.imageSmoothingQuality = "high", n.drawImage(this._backupCanvas, 0, 0, e, t);
16817
+ n.imageSmoothingEnabled = !0, n.imageSmoothingQuality = "high", n.drawImage(this._backupCanvas, 0, 0, e, t), this._revealOutput();
16793
16818
  try {
16794
16819
  return await this._ensureSession(), await this._runUpscale(), this.dispatchEvent({
16795
16820
  type: "resolution_changed",
@@ -16824,7 +16849,7 @@ var Dm = {
16824
16849
  alpha: !0
16825
16850
  });
16826
16851
  this._cacheUpscaledAlpha(t, n * i, r * i), t.isHDR && (this._hdrToneMapFn = nm.get(this.getToneMapping()) || nm.get(He), this._hdrExposure = this.getExposure(), this._hdrSaturation = this.getSaturation(), this._tmOut = new Float32Array(3));
16827
- let o = Dm.TILE_OVERLAP, s = this.tileSize, c = s - o * 2, l = Math.ceil(n / c), u = Math.ceil(r / c), d = l * u, f = 0;
16852
+ let o = Tm.TILE_OVERLAP, s = this.tileSize, c = s - o * 2, l = Math.ceil(n / c), u = Math.ceil(r / c), d = l * u, f = 0;
16828
16853
  for (let o = 0; o < u; o++) for (let u = 0; u < l; u++) {
16829
16854
  if (e.aborted) throw new DOMException("Aborted", "AbortError");
16830
16855
  let l = Math.min(u * c, Math.max(0, n - s)), p = Math.min(o * c, Math.max(0, r - s)), m = Math.min(s, n - l), h = Math.min(s, r - p), g = this._extractTile(t, l, p, m, h), _ = await this._inferTile(g, m, h), v = l * i, y = p * i, b = m * i, x = h * i, S = this._tensorToImageData(_, b, x, v, y);
@@ -16853,6 +16878,7 @@ var Dm = {
16853
16878
  _captureSource() {
16854
16879
  let e = this.getSourceCanvas ? this.getSourceCanvas() : null;
16855
16880
  if (e && e !== this.output) {
16881
+ this.refreshInput?.();
16856
16882
  let t = document.createElement("canvas");
16857
16883
  t.width = e.width, t.height = e.height;
16858
16884
  let n = t.getContext("2d");
@@ -16970,7 +16996,7 @@ var Dm = {
16970
16996
  this.hdr = !!e;
16971
16997
  }
16972
16998
  setQuality(e) {
16973
- if (!Dm.QUALITY_PRESETS[e]) {
16999
+ if (!Tm.QUALITY_PRESETS[e]) {
16974
17000
  console.warn(`AIUpscaler: Invalid quality "${e}", must be fast/balanced/quality`);
16975
17001
  return;
16976
17002
  }
@@ -16993,7 +17019,7 @@ var Dm = {
16993
17019
  async dispose() {
16994
17020
  this.abort(), this._cleanupPendingWorkerHandlers(), this._worker &&= (this._worker.postMessage({ type: "dispose" }), this._worker.terminate(), null), this._currentModelUrl = null, this._backupCanvas = null, this._upscaledAlpha = null, this.state.abortController = null, this._hdrStagingBuffer?.destroy(), this._hdrStagingBuffer = null, this._hdrStagingWidth = 0, this._hdrStagingHeight = 0, console.log("AIUpscaler disposed");
16995
17021
  }
16996
- }, km = class extends lt {
17022
+ }, Dm = class extends lt {
16997
17023
  constructor({ renderer: e, mainCanvas: t, scene: n, camera: r, stages: i, pipeline: a, getExposure: o, getSaturation: s, getTransparentBg: c }) {
16998
17024
  super(), this.renderer = e, this.mainCanvas = t, this.denoiserCanvas = this._createDenoiserCanvas(t), this.scene = n, this.camera = r, this.pipeline = a, this._stages = i, this._getExposure = o, this._getSaturation = s, this._getTransparentBg = c, this.denoiser = null, this.upscaler = null, this._onReset = null, this._onPostProcessRefresh = null, this._lastRenderWidth = 0, this._lastRenderHeight = 0, this._pendingStartUpscaler = null, this._denoiserStartHandler = null, this._denoiserEndHandler = null, this._upscalerResChangedHandler = null, this._upscalerStartHandler = null, this._upscalerProgressHandler = null, this._upscalerEndHandler = null;
16999
17025
  }
@@ -17014,12 +17040,16 @@ var Dm = {
17014
17040
  setupDenoiser() {
17015
17041
  if (!this.denoiserCanvas) return;
17016
17042
  let e = this._stages.pathTracer;
17017
- this.denoiser = new xm(this.denoiserCanvas, this.renderer, this.scene, this.camera, {
17043
+ this.denoiser = new ym(this.denoiserCanvas, this.renderer, this.scene, this.camera, {
17018
17044
  ...Y,
17019
17045
  backendParams: () => ({
17020
17046
  device: this.renderer.backend.device,
17021
17047
  adapterInfo: null
17022
17048
  }),
17049
+ refreshInput: () => {
17050
+ let e = this.pipeline?.context;
17051
+ this._stages.compositor && e && this._stages.compositor.render(e);
17052
+ },
17023
17053
  getGPUTextures: () => {
17024
17054
  if (!e?.storageTextures?.readTarget) return null;
17025
17055
  let t = e.storageTextures.getReadTextures(), { backend: n } = this.renderer;
@@ -17039,10 +17069,14 @@ var Dm = {
17039
17069
  setupUpscaler() {
17040
17070
  if (!this.denoiserCanvas) return;
17041
17071
  let e = this._stages.pathTracer;
17042
- this.upscaler = new Om(this.denoiserCanvas, this.renderer, {
17072
+ this.upscaler = new Em(this.denoiserCanvas, this.renderer, {
17043
17073
  scaleFactor: Y.upscalerScale || 2,
17044
17074
  quality: Y.upscalerQuality || "fast",
17045
17075
  getSourceCanvas: () => this.denoiser?.enabled ? null : this.renderer.domElement,
17076
+ refreshInput: () => {
17077
+ let e = this.pipeline?.context;
17078
+ this._stages.compositor && e && this._stages.compositor.render(e);
17079
+ },
17046
17080
  getGPUTextures: () => {
17047
17081
  if (!e?.storageTextures?.readTarget) return null;
17048
17082
  let t = e.storageTextures.getReadTextures();
@@ -17102,11 +17136,11 @@ var Dm = {
17102
17136
  this._pendingStartUpscaler && this.denoiser && this.denoiser.removeEventListener("end", this._pendingStartUpscaler), this._pendingStartUpscaler = null;
17103
17137
  }
17104
17138
  onRenderComplete({ isStillComplete: e, context: t }) {
17105
- this._cleanupCompletionListener(), (this.denoiser?.enabled || this.upscaler?.enabled) && this.denoiserCanvas && (this.denoiserCanvas.style.display = "block");
17139
+ this._cleanupCompletionListener();
17106
17140
  let n = () => {
17107
17141
  this._pendingStartUpscaler = null, e() && this.upscaler?.enabled && this.upscaler.start();
17108
17142
  };
17109
- this.denoiser?.enabled ? (this._pendingStartUpscaler = n, this.denoiser.addEventListener("end", n, { once: !0 }), this.denoiser.start()) : (this.upscaler?.enabled && this._stages.compositor && t && this._stages.compositor.render(t), n());
17143
+ this.denoiser?.enabled ? (this._pendingStartUpscaler = n, this.denoiser.addEventListener("end", n, { once: !0 }), this.denoiser.start()) : n();
17110
17144
  }
17111
17145
  abort(e) {
17112
17146
  this._cleanupCompletionListener(), e && (e.style.opacity = "1"), this.upscaler && this.upscaler.abort(), this.denoiser && (this.denoiser.enabled && this.denoiser.abort(), this.denoiser.output && (this.denoiser.output.style.display = "none"));
@@ -17145,7 +17179,7 @@ var Dm = {
17145
17179
  this.denoiser && (this.denoiser.enabled = e), this._syncGBufferStages(), this._onPostProcessRefresh?.();
17146
17180
  }
17147
17181
  setOIDNQuality(e) {
17148
- this.denoiser?.updateQuality(e), this._stages.pathTracer?.setCleanAuxNormal?.(!!this.denoiser?.enabled && e !== "fast"), this._onPostProcessRefresh?.();
17182
+ this.denoiser?.updateQuality(e), this._stages.pathTracer?.setCleanAuxNormal?.(!!this.denoiser?.enabled && !!this.denoiser?.expectsCleanAux(e)), this._onPostProcessRefresh?.();
17149
17183
  }
17150
17184
  setTileHelperEnabled(e) {
17151
17185
  this._setTileHelper(e);
@@ -17190,7 +17224,7 @@ var Dm = {
17190
17224
  let t = Ar[e];
17191
17225
  t && (this._stages.asvgf?.updateParameters(t), this._stages.bilateralFilter?.updateParameters(t), this._stages.variance && t.varianceBoost !== void 0 && (this._stages.variance.varianceBoost.value = t.varianceBoost));
17192
17226
  }
17193
- }, Am = class {
17227
+ }, Om = class {
17194
17228
  constructor() {
17195
17229
  this.layer = "hud", this.visible = !1, this._tileBounds = null, this._imageWidth = 1, this._imageHeight = 1, this.enabled = !0, this._borderColor = "rgba(255, 0, 0, 0.6)", this._borderWidthRatio = 1 / 540, this._borderWidthMin = 1.5, this._borderWidthMax = 4;
17196
17230
  }
@@ -17214,7 +17248,7 @@ var Dm = {
17214
17248
  dispose() {
17215
17249
  this.visible = !1;
17216
17250
  }
17217
- }, jm = class {
17251
+ }, km = class {
17218
17252
  constructor(n, r) {
17219
17253
  this.layer = "scene", this._enabled = !0, this._outlineNode = bn(n, r, {
17220
17254
  selectedObjects: [],
@@ -17245,11 +17279,11 @@ var Dm = {
17245
17279
  this._enabled = !1, this._outlineNode?.dispose(), this._material?.dispose(), this._quad = null;
17246
17280
  }
17247
17281
  };
17248
- function Mm(e = !1) {
17282
+ function Am(e = !1) {
17249
17283
  let t = document.createElement("canvas");
17250
17284
  return t.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;" + (e ? "display:none;" : ""), t;
17251
17285
  }
17252
- function Nm(e, t = Infinity) {
17286
+ function jm(e, t = Infinity) {
17253
17287
  let n = e?.getBoundingClientRect();
17254
17288
  if (!n || n.width === 0 || n.height === 0) return null;
17255
17289
  let r = Math.min(window.devicePixelRatio || 1, 2), i = Math.round(n.width * r), a = Math.round(n.height * r), o = t / Math.max(i, a);
@@ -17260,9 +17294,9 @@ function Nm(e, t = Infinity) {
17260
17294
  }
17261
17295
  //#endregion
17262
17296
  //#region src/managers/helpers/ViewOverlayRenderer.js
17263
- var Pm = 4096, Fm = class {
17297
+ var Mm = 4096, Nm = class {
17264
17298
  constructor() {
17265
- this.canvas = Mm(!0), this._visible = !1, this.renderer = null, this._sizeSource = null;
17299
+ this.canvas = Am(!0), this._visible = !1, this.renderer = null, this._sizeSource = null;
17266
17300
  }
17267
17301
  async init({ device: e, sizeSource: t }) {
17268
17302
  this._sizeSource = t;
@@ -17279,7 +17313,7 @@ var Pm = 4096, Fm = class {
17279
17313
  }
17280
17314
  syncSize() {
17281
17315
  if (!this.renderer) return;
17282
- let e = Nm(this._sizeSource, Pm);
17316
+ let e = jm(this._sizeSource, Mm);
17283
17317
  !e || e.width === this.canvas.width && e.height === this.canvas.height || this.renderer.setSize(e.width, e.height, !1);
17284
17318
  }
17285
17319
  begin() {
@@ -17291,18 +17325,18 @@ var Pm = 4096, Fm = class {
17291
17325
  dispose() {
17292
17326
  xr(this.renderer), this.renderer = null, this.canvas.parentElement?.removeChild(this.canvas);
17293
17327
  }
17294
- }, Im = si("overlay"), Lm = (e, t) => e.visible && e.layer === t && e.render, Rm = class {
17328
+ }, Pm = si("overlay"), Fm = (e, t) => e.visible && e.layer === t && e.render, Im = class {
17295
17329
  constructor(e) {
17296
- this.camera = e, this._helpers = /* @__PURE__ */ new Map(), this._hudCanvas = Mm(), this._hudCtx = this._hudCanvas.getContext("2d"), this._helperScene = null, this._viewOverlay = null;
17330
+ this.camera = e, this._helpers = /* @__PURE__ */ new Map(), this._hudCanvas = Am(), this._hudCtx = this._hudCanvas.getContext("2d"), this._helperScene = null, this._viewOverlay = null;
17297
17331
  }
17298
17332
  async initViewRenderer({ device: e, sizeSource: t }) {
17299
17333
  if (!(!e || !t)) try {
17300
- this._viewOverlay = await new Fm().init({
17334
+ this._viewOverlay = await new Nm().init({
17301
17335
  device: e,
17302
17336
  sizeSource: t
17303
17337
  });
17304
17338
  } catch (e) {
17305
- Im.error("overlay surface unavailable — light gizmos, transform gizmo and outlines are disabled", e), this._viewOverlay = null;
17339
+ Pm.error("overlay surface unavailable — light gizmos, transform gizmo and outlines are disabled", e), this._viewOverlay = null;
17306
17340
  }
17307
17341
  }
17308
17342
  setHelperScene(e) {
@@ -17318,11 +17352,11 @@ var Pm = 4096, Fm = class {
17318
17352
  }
17319
17353
  setupDefaultHelpers({ helperScene: e, meshScene: t, pipeline: n, denoisingManager: r, app: i, renderWidth: a, renderHeight: o }) {
17320
17354
  this.setHelperScene(e);
17321
- let s = new Am();
17355
+ let s = new Om();
17322
17356
  this.register("tiles", s), s.setRenderSize(a || 1, o || 1), i.addEventListener("resolution_changed", (e) => {
17323
17357
  s.setRenderSize(e.width, e.height);
17324
17358
  }), n.eventBus.on("pipeline:reset", () => s.hide()), this._wireDenoiserTileEvents(s, r);
17325
- let c = new jm(t, this.camera);
17359
+ let c = new km(t, this.camera);
17326
17360
  this.register("outline", c);
17327
17361
  }
17328
17362
  _wireDenoiserTileEvents(e, t) {
@@ -17334,7 +17368,7 @@ var Pm = 4096, Fm = class {
17334
17368
  }));
17335
17369
  }
17336
17370
  register(e, t) {
17337
- this._helpers.has(e) && (Im.warn(`helper "${e}" already registered — replacing.`), this._helpers.get(e).dispose?.()), this._helpers.set(e, t);
17371
+ this._helpers.has(e) && (Pm.warn(`helper "${e}" already registered — replacing.`), this._helpers.get(e).dispose?.()), this._helpers.set(e, t);
17338
17372
  }
17339
17373
  unregister(e) {
17340
17374
  let t = this._helpers.get(e);
@@ -17372,16 +17406,16 @@ var Pm = 4096, Fm = class {
17372
17406
  }
17373
17407
  _renderSceneLayer(e) {
17374
17408
  this._helperScene?.render(e, this.camera);
17375
- for (let t of this._helpers.values()) Lm(t, "scene") && t.render(e, this.camera);
17409
+ for (let t of this._helpers.values()) Fm(t, "scene") && t.render(e, this.camera);
17376
17410
  }
17377
17411
  _hasVisibleSceneOverlay() {
17378
17412
  if (this._helperScene?.isDrawing) return !0;
17379
- for (let e of this._helpers.values()) if (Lm(e, "scene")) return !0;
17413
+ for (let e of this._helpers.values()) if (Fm(e, "scene")) return !0;
17380
17414
  return !1;
17381
17415
  }
17382
17416
  refreshHUD() {
17383
17417
  let e = this._hudCanvas, t = this._hudCtx, n = !1;
17384
- for (let e of this._helpers.values()) if (Lm(e, "hud")) {
17418
+ for (let e of this._helpers.values()) if (Fm(e, "hud")) {
17385
17419
  n = !0;
17386
17420
  break;
17387
17421
  }
@@ -17390,10 +17424,10 @@ var Pm = 4096, Fm = class {
17390
17424
  return;
17391
17425
  }
17392
17426
  e.style.display !== "" && (e.style.display = "");
17393
- let r = e.clientWidth, i = e.clientHeight, a = r > 0 && i > 0 ? Nm(e) : null;
17427
+ let r = e.clientWidth, i = e.clientHeight, a = r > 0 && i > 0 ? jm(e) : null;
17394
17428
  if (a) {
17395
17429
  (e.width !== a.width || e.height !== a.height) && (e.width = a.width, e.height = a.height), t.clearRect(0, 0, a.width, a.height), t.save(), t.scale(a.width / r, a.height / i);
17396
- for (let e of this._helpers.values()) Lm(e, "hud") && e.render(t, r, i);
17430
+ for (let e of this._helpers.values()) Fm(e, "hud") && e.render(t, r, i);
17397
17431
  t.restore(), e.style.display !== "" && (e.style.display = "");
17398
17432
  }
17399
17433
  }
@@ -17401,7 +17435,7 @@ var Pm = 4096, Fm = class {
17401
17435
  for (let e of this._helpers.values()) e.dispose?.();
17402
17436
  this._helpers.clear(), this._viewOverlay?.dispose(), this._viewOverlay = null, this._hudCanvas.parentElement && this._hudCanvas.parentElement.removeChild(this._hudCanvas);
17403
17437
  }
17404
- }, zm = class extends lt {
17438
+ }, Lm = class extends lt {
17405
17439
  constructor() {
17406
17440
  super(), this.mixer = null, this.timer = new tn(), this.actions = [], this.isPlaying = !1, this._scene = null, this._mixerRoot = null, this._meshes = null, this._meshTriRanges = null, this._posBuffer = null, this._tempVec = new sn(), this._skinnedCache = null, this._clipsCache = null, this._savedTimeScale = 1, this.onFinished = null, this.wakeCallback = null;
17407
17441
  }
@@ -17501,7 +17535,7 @@ var Pm = 4096, Fm = class {
17501
17535
  dispose() {
17502
17536
  this.mixer &&= (this.mixer.stopAllAction(), this.mixer.uncacheRoot(this._mixerRoot), null), this.actions = [], this.isPlaying = !1, this.timer.reset(), this._scene = null, this._mixerRoot = null, this._meshes = null, this._meshTriRanges = null, this._posBuffer = null, this._skinnedCache = null, this._clipsCache = null;
17503
17537
  }
17504
- }, Bm = new sn(0, 0, -1), Vm = class {
17538
+ }, Rm = new sn(0, 0, -1), zm = class {
17505
17539
  constructor({ camera: e, canvas: t, orbitControls: n, app: r }) {
17506
17540
  this._app = r, this._orbitControls = n, this._camera = e, this._controls = new xn(e, t), this._gizmoScene = new Jt(), this._gizmoScene.add(this._controls.getHelper()), this._attached = null, this._isDragging = !1, this._meshes = null, this._meshTriRanges = null, this._posBuffer = null, this._normalBuffer = null, this._skinnedCache = null, this._normalCache = null, this._tempVec = new sn(), this._normalMatrix = new xt(), this._refitInFlight = !1, this._baselineComputed = !1, this._tempForward = new sn(), this._lightTargetDistance = null, this._lastLightPosition = null, this._onDraggingChanged = this._onDraggingChanged.bind(this), this._onObjectChange = this._onObjectChange.bind(this), this._controls.addEventListener("dragging-changed", this._onDraggingChanged), this._controls.addEventListener("objectChange", this._onObjectChange);
17507
17541
  }
@@ -17522,7 +17556,7 @@ var Pm = 4096, Fm = class {
17522
17556
  attach(e) {
17523
17557
  if (this._attached !== e && (this._controls.attach(e), this._attached = e, this._lightTargetDistance = null, this._lastLightPosition = null, e.isLight && e.target)) {
17524
17558
  let t = e.target.position.clone().sub(e.position), n = t.length();
17525
- n > 1e-4 ? (e.quaternion.setFromUnitVectors(Bm, t.normalize()), this._lightTargetDistance = n) : this._lightTargetDistance = 1, this._lastLightPosition = e.position.clone();
17559
+ n > 1e-4 ? (e.quaternion.setFromUnitVectors(Rm, t.normalize()), this._lightTargetDistance = n) : this._lightTargetDistance = 1, this._lastLightPosition = e.position.clone();
17526
17560
  }
17527
17561
  }
17528
17562
  detach() {
@@ -17634,7 +17668,7 @@ var Pm = 4096, Fm = class {
17634
17668
  dispose() {
17635
17669
  this._controls.removeEventListener("dragging-changed", this._onDraggingChanged), this._controls.removeEventListener("objectChange", this._onObjectChange), this.detach(), this._gizmoScene.remove(this._controls.getHelper()), this._controls.dispose(), this._meshes = null, this._meshTriRanges = null, this._posBuffer = null, this._normalBuffer = null, this._skinnedCache = null, this._normalCache = null, this._baselineComputed = !1, this._tempForward = null, this._lightTargetDistance = null, this._lastLightPosition = null, this._app = null, this._orbitControls = null, this._camera = null, this._controls = null, this._gizmoScene = null;
17636
17670
  }
17637
- }, Hm = class {
17671
+ }, Bm = class {
17638
17672
  constructor(e) {
17639
17673
  this.layer = "scene", this._transformManager = e, this._enabled = !0;
17640
17674
  }
@@ -17653,21 +17687,21 @@ var Pm = 4096, Fm = class {
17653
17687
  dispose() {
17654
17688
  this._enabled = !1;
17655
17689
  }
17656
- }, Um = /* @__PURE__ */ new WeakMap(), Wm = si("engine");
17657
- function Gm(e, t) {
17690
+ }, Vm = /* @__PURE__ */ new WeakMap(), Hm = si("engine");
17691
+ function Um(e, t) {
17658
17692
  e.lost.then((e) => {
17659
17693
  t.app && t.app._handleDeviceLost(e);
17660
17694
  });
17661
17695
  }
17662
- var Km = class extends lt {
17696
+ var Wm = class extends lt {
17663
17697
  constructor(e, t = {}) {
17664
17698
  super();
17665
17699
  try {
17666
- Um.get(e)?.dispose();
17700
+ Vm.get(e)?.dispose();
17667
17701
  } catch (e) {
17668
- Wm.warn("prior canvas owner dispose failed", e);
17702
+ Hm.warn("prior canvas owner dispose failed", e);
17669
17703
  }
17670
- Um.set(e, this), this.canvas = e, this._autoResize = t.autoResize !== !1, this._container = t.container || null, this.settings = new Mp(Y), this.renderer = null, this.scene = null, this.meshScene = null, this._sceneHelpers = null, this.assetLoader = null, this._sdf = null, this._animRefitInFlight = !1, this._maxTextureSize = Y.maxTextureSize, this.pipeline = null, this._pendingReservedRenderSize = null, this.stages = {}, this.cameraManager = null, this.lightManager = null, this.goboManager = null, this.iesManager = null, this.denoisingManager = null, this.overlayManager = null, this.interactionManager = null, this.transformManager = null, this.animationManager = new zm(), this.environmentManager = null, this.isInitialized = !1, this.pauseRendering = !1, this._pathTracerEnabled = !0, this._rasterPrecompile = null, this.animationManagerId = null, this.needsReset = !1, this._loadingInProgress = !1, this._needsDisplayRefresh = !1, this._paused = !1, this._emissiveSamplingUserSet = !1, this.completion = new qf(), this._resizeDebounceTimer = null, this._trackedListeners = [], this._disposed = !1, this._deviceLost = !1, this._gpuDevice = null, this._deviceLostHolder = null, this._deterministic = !1, this._dispatchPinned = !1, this._deterministicRestore = null;
17704
+ Vm.set(e, this), this.canvas = e, this._autoResize = t.autoResize !== !1, this._container = t.container || null, this.settings = new Mp(Y), this.renderer = null, this.scene = null, this.meshScene = null, this._sceneHelpers = null, this.assetLoader = null, this._sdf = null, this._animRefitInFlight = !1, this._maxTextureSize = Y.maxTextureSize, this.pipeline = null, this._pendingReservedRenderSize = null, this.stages = {}, this.cameraManager = null, this.lightManager = null, this.goboManager = null, this.iesManager = null, this.denoisingManager = null, this.overlayManager = null, this.interactionManager = null, this.transformManager = null, this.animationManager = new Lm(), this.environmentManager = null, this.isInitialized = !1, this.pauseRendering = !1, this._pathTracerEnabled = !0, this._rasterPrecompile = null, this.animationManagerId = null, this.needsReset = !1, this._loadingInProgress = !1, this._needsDisplayRefresh = !1, this._paused = !1, this._emissiveSamplingUserSet = !1, this.completion = new qf(), this._resizeDebounceTimer = null, this._trackedListeners = [], this._disposed = !1, this._deviceLost = !1, this._gpuDevice = null, this._deviceLostHolder = null, this._deterministic = !1, this._dispatchPinned = !1, this._deterministicRestore = null;
17671
17705
  }
17672
17706
  _addTrackedListener(e, t, n) {
17673
17707
  e && (e.addEventListener(t, n), this._trackedListeners.push({
@@ -17680,12 +17714,12 @@ var Km = class extends lt {
17680
17714
  for (let { target: e, type: t, handler: n } of this._trackedListeners) try {
17681
17715
  e.removeEventListener(t, n);
17682
17716
  } catch (e) {
17683
- Wm.warn("failed to remove listener", t, e);
17717
+ Hm.warn("failed to remove listener", t, e);
17684
17718
  }
17685
17719
  this._trackedListeners.length = 0;
17686
17720
  }
17687
17721
  async init() {
17688
- return await this._initRenderer(), this._applyPendingReservedRenderSize(), this._initCameraManager(), this._initScenes(), this._initAssetPipeline(), this._initPipeline(), await this._initManagers(), this._wireEvents(), this.stages.pathTracer.setTriangleData(new Float32Array(32), 0), this.stages.pathTracer.setBVHData(new Float32Array(16)), this.stages.pathTracer.materialData.setMaterialData(new Float32Array(16)), this.stages.pathTracer.setupMaterial(), this.isInitialized = !0, Wm.debug("WebGPU path tracer app initialized"), this;
17722
+ return await this._initRenderer(), this._applyPendingReservedRenderSize(), this._initCameraManager(), this._initScenes(), this._initAssetPipeline(), this._initPipeline(), await this._initManagers(), this._wireEvents(), this.stages.pathTracer.setTriangleData(new Float32Array(32), 0), this.stages.pathTracer.setBVHData(new Float32Array(16)), this.stages.pathTracer.materialData.setMaterialData(new Float32Array(16)), this.stages.pathTracer.setupMaterial(), this.isInitialized = !0, Hm.debug("WebGPU path tracer app initialized"), this;
17689
17723
  }
17690
17724
  animate() {
17691
17725
  if (!this._deviceLost) {
@@ -17695,7 +17729,7 @@ var Km = class extends lt {
17695
17729
  }
17696
17730
  if (this.cameraManager.controls && this.cameraManager.controls.update(), this.animationManager?.isPlaying && !this._animRefitInFlight) {
17697
17731
  let e = this.animationManager.update();
17698
- e && (this._animRefitInFlight = !0, this.refitBVH(e).catch((e) => Wm.error("animation refit error:", e)).finally(() => {
17732
+ e && (this._animRefitInFlight = !0, this.refitBVH(e).catch((e) => Hm.error("animation refit error:", e)).finally(() => {
17699
17733
  this._animRefitInFlight = !1;
17700
17734
  }));
17701
17735
  }
@@ -17729,7 +17763,7 @@ var Km = class extends lt {
17729
17763
  this.animationManagerId &&= (cancelAnimationFrame(this.animationManagerId), null);
17730
17764
  }
17731
17765
  _handleDeviceLost(e) {
17732
- this._deviceLost || (this._deviceLost = !0, Wm.error(`WebGPU device lost (${e?.reason || "unknown"}): ${e?.message || ""}`), this.stopAnimation(), this.dispatchEvent({
17766
+ this._deviceLost || (this._deviceLost = !0, Hm.error(`WebGPU device lost (${e?.reason || "unknown"}): ${e?.message || ""}`), this.stopAnimation(), this.dispatchEvent({
17733
17767
  type: ur.DEVICE_LOST,
17734
17768
  reason: e?.reason,
17735
17769
  message: e?.message
@@ -17759,9 +17793,9 @@ var Km = class extends lt {
17759
17793
  let e = Ae().value, t = k().value;
17760
17794
  e?._listeners?.dispose && (e._listeners.dispose.length = 0), t?._listeners?.dispose && (t._listeners.dispose.length = 0);
17761
17795
  } catch (e) {
17762
- Wm.warn("failed to clear TSL texture singleton listeners", e);
17796
+ Hm.warn("failed to clear TSL texture singleton listeners", e);
17763
17797
  }
17764
- this.canvas && Um.get(this.canvas) === this && Um.delete(this.canvas), this._gpuDevice &&= (this._gpuDevice.onuncapturederror = null, null), this._deviceLostHolder &&= (this._deviceLostHolder.app = null, null), xr(this.renderer), this.renderer = null, this.stages = {}, this.isInitialized = !1;
17798
+ this.canvas && Vm.get(this.canvas) === this && Vm.delete(this.canvas), this._gpuDevice &&= (this._gpuDevice.onuncapturederror = null, null), this._deviceLostHolder &&= (this._deviceLostHolder.app = null, null), xr(this.renderer), this.renderer = null, this.stages = {}, this.isInitialized = !1;
17765
17799
  }
17766
17800
  }
17767
17801
  unloadScene() {
@@ -17983,7 +18017,7 @@ var Km = class extends lt {
17983
18017
  if (!e) return;
17984
18018
  this._pendingReservedRenderSize = null;
17985
18019
  let t = this.setReservedRenderResolution(e.requestedPx, { allowLower: e.allowLower });
17986
- t < e.requestedPx && Wm.warn(`reserved render size ${Q.n(e.requestedPx)}px was capped to ${Q.n(t)}px by this device's limits — renders above ${Q.n(t)}px will be declined.`), this.dispatchEvent({
18020
+ t < e.requestedPx && Hm.warn(`reserved render size ${Q.n(e.requestedPx)}px was capped to ${Q.n(t)}px by this device's limits — renders above ${Q.n(t)}px will be declined.`), this.dispatchEvent({
17987
18021
  type: "reserved_render_size_changed",
17988
18022
  size: t
17989
18023
  });
@@ -17992,7 +18026,7 @@ var Km = class extends lt {
17992
18026
  return Or;
17993
18027
  }
17994
18028
  _isRenderSizeSupported(e, t) {
17995
- return e > Or || t > Or ? (Wm.warn(`render resolution ${e}×${t} exceeds the ${Or}px reserve (compute storage textures are pre-allocated at ${Or}px). Ignoring resize — raise the reserve with setReservedRenderResolution( ${Math.max(e, t)} ) first, or use a resolution ≤ ${Or}.`), !1) : !0;
18029
+ return e > Or || t > Or ? (Hm.warn(`render resolution ${e}×${t} exceeds the ${Or}px reserve (compute storage textures are pre-allocated at ${Or}px). Ignoring resize — raise the reserve with setReservedRenderResolution( ${Math.max(e, t)} ) first, or use a resolution ≤ ${Or}.`), !1) : !0;
17996
18030
  }
17997
18031
  onResize() {
17998
18032
  let e = this.canvas.clientWidth, t = this.canvas.clientHeight;
@@ -18109,6 +18143,16 @@ var Km = class extends lt {
18109
18143
  let t = this.renderer?.backend;
18110
18144
  return !t || e && t.hasFeature?.("timestamp-query") !== !0 ? !1 : (t.trackTimestamp = e, t.trackTimestamp === e);
18111
18145
  }
18146
+ profileNextDenoise() {
18147
+ return this.denoisingManager?.denoiser?.profileNextDenoise() ?? !1;
18148
+ }
18149
+ async getDenoiseProfile() {
18150
+ let e = this.denoisingManager?.denoiser;
18151
+ return e ? {
18152
+ profile: await e.getLastDenoiseProfile(),
18153
+ runtime: e.getRuntimeInfo()
18154
+ } : null;
18155
+ }
18112
18156
  async getGPUTimings() {
18113
18157
  let e = this.renderer;
18114
18158
  if (!e?.backend?.trackTimestamp) return null;
@@ -18176,7 +18220,7 @@ var Km = class extends lt {
18176
18220
  this._pathTracerEnabled = e, e || this.precompileRaster();
18177
18221
  }
18178
18222
  precompileRaster() {
18179
- return !this.renderer || !this.meshScene ? Promise.resolve() : (this._rasterPrecompile ??= this.renderer.compileAsync(this.meshScene, this.cameraManager.camera).catch((e) => Wm.warn("raster fallback precompile failed", e)), this._rasterPrecompile);
18223
+ return !this.renderer || !this.meshScene ? Promise.resolve() : (this._rasterPrecompile ??= this.renderer.compileAsync(this.meshScene, this.cameraManager.camera).catch((e) => Hm.warn("raster fallback precompile failed", e)), this._rasterPrecompile);
18180
18224
  }
18181
18225
  get isLoading() {
18182
18226
  return this._loadingInProgress;
@@ -18284,7 +18328,7 @@ var Km = class extends lt {
18284
18328
  }
18285
18329
  }), await this.renderer.init();
18286
18330
  let n = this.renderer.backend?.device;
18287
- n?.lost && (this._gpuDevice = n, this._deviceLostHolder = { app: this }, Gm(n, this._deviceLostHolder), n.onuncapturederror = (e) => Wm.error("WebGPU uncaptured error:", e.error)), r.setLTC(cn.init()), this.renderer.outputColorSpace = a, this.renderer.toneMapping = He, this.renderer.toneMappingExposure = 1, this.renderer.setPixelRatio(1);
18331
+ n?.lost && (this._gpuDevice = n, this._deviceLostHolder = { app: this }, Um(n, this._deviceLostHolder), n.onuncapturederror = (e) => Hm.error("WebGPU uncaptured error:", e.error)), r.setLTC(cn.init()), this.renderer.outputColorSpace = a, this.renderer.toneMapping = He, this.renderer.toneMappingExposure = 1, this.renderer.setPixelRatio(1);
18288
18332
  }
18289
18333
  _initCameraManager() {
18290
18334
  this.cameraManager = new Np(this.canvas);
@@ -18312,12 +18356,12 @@ var Km = class extends lt {
18312
18356
  assetLoader: this.assetLoader,
18313
18357
  pathTracer: null,
18314
18358
  floorPlane: this.assetLoader.floorPlane
18315
- }), this.interactionManager.wireAppEvents(this), this.cameraManager.setInteractionManager(this.interactionManager), this.lightManager = new Pp(this.scene, this._sceneHelpers, this.stages.pathTracer, { onReset: () => this.reset() }), this.goboManager = new Fp(this.stages.pathTracer, { onReset: () => this.reset() }), this.iesManager = new Kp(this.stages.pathTracer, { onReset: () => this.reset() }), this._setupDenoisingManager(), await this._setupOverlayManager(), this.transformManager = new Vm({
18359
+ }), this.interactionManager.wireAppEvents(this), this.cameraManager.setInteractionManager(this.interactionManager), this.lightManager = new Pp(this.scene, this._sceneHelpers, this.stages.pathTracer, { onReset: () => this.reset() }), this.goboManager = new Fp(this.stages.pathTracer, { onReset: () => this.reset() }), this.iesManager = new Kp(this.stages.pathTracer, { onReset: () => this.reset() }), this._setupDenoisingManager(), await this._setupOverlayManager(), this.transformManager = new zm({
18316
18360
  camera: this.cameraManager.camera,
18317
18361
  canvas: this.canvas,
18318
18362
  orbitControls: this.cameraManager.controls,
18319
18363
  app: this
18320
- }), this.overlayManager.register("transform", new Hm(this.transformManager)), this.interactionManager.setDependencies({
18364
+ }), this.overlayManager.register("transform", new Bm(this.transformManager)), this.interactionManager.setDependencies({
18321
18365
  overlayManager: this.overlayManager,
18322
18366
  transformManager: this.transformManager,
18323
18367
  appDispatch: (e) => this.dispatchEvent(e),
@@ -18395,7 +18439,7 @@ var Km = class extends lt {
18395
18439
  });
18396
18440
  }
18397
18441
  _setupDenoisingManager() {
18398
- this.denoisingManager = new km({
18442
+ this.denoisingManager = new Dm({
18399
18443
  renderer: this.renderer,
18400
18444
  mainCanvas: this.canvas,
18401
18445
  scene: this.scene,
@@ -18438,7 +18482,7 @@ var Km = class extends lt {
18438
18482
  this.scene.updateMatrixWorld(), this.overlayManager?.render();
18439
18483
  }
18440
18484
  async _setupOverlayManager() {
18441
- this.overlayManager = new Rm(this.cameraManager.camera), this.overlayManager.setupDefaultHelpers({
18485
+ this.overlayManager = new Im(this.cameraManager.camera), this.overlayManager.setupDefaultHelpers({
18442
18486
  helperScene: this._sceneHelpers,
18443
18487
  meshScene: this.meshScene,
18444
18488
  pipeline: this.pipeline,
@@ -18469,7 +18513,7 @@ var Km = class extends lt {
18469
18513
  _forwardEvents(e, t) {
18470
18514
  if (e) for (let n of t) this._addTrackedListener(e, n, (e) => this.dispatchEvent(e));
18471
18515
  }
18472
- }, qm = class {
18516
+ }, Gm = class {
18473
18517
  constructor(e) {
18474
18518
  this._app = e, this._cancelled = !1, this._rendering = !1;
18475
18519
  }
@@ -18567,4 +18611,4 @@ var Km = class extends lt {
18567
18611
  }
18568
18612
  };
18569
18613
  //#endregion
18570
- export { Fr as AF_DEFAULTS, Ar as ASVGF_QUALITY_PRESETS, Pr as AUTO_FOCUS_MODES, zm as AnimationManager, Lr as BVH_LEAF_MARKERS, Nr as CAMERA_PRESETS, jr as CAMERA_RANGES, Np as CameraManager, Hr as DEFAULT_TEXTURE_MATRIX, km as DenoisingManager, Y as ENGINE_DEFAULTS, ur as EngineEvents, Fp as GoboManager, Kp as IESManager, Wr as INTERACTIVE_RENDER_CONFIG, Jf as InteractionManager, Kr as LOG_LEVELS, Pp as LightManager, oi as Logger, Dr as MAX_RESERVABLE_RENDER_SIZE, Gr as MEMORY_CONSTANTS, Rm as OverlayManager, Ur as PRODUCTION_RENDER_CONFIG, Km as PathTracerApp, Pf as PipelineContext, Kf as RenderPipeline, Mp as RenderSettings, cr as RenderStage, Mr as SKY_PRESETS, sr as StageExecutionMode, Rr as TEXTURE_CONSTANTS, X as TRIANGLE_DATA_LAYOUT, Vm as TransformManager, hu as VRAMTracker, qm as VideoRenderManager, pu as bufferBytes, Vf as clearBindingAuditFindings, fl as configureAssets, si as createLogger, Q as fmt, pl as getAssetConfig, Bf as getBindingAuditFindings, zf as setBindingAudit, mu as textureBytes };
18614
+ export { Fr as AF_DEFAULTS, Ar as ASVGF_QUALITY_PRESETS, Pr as AUTO_FOCUS_MODES, Lm as AnimationManager, Lr as BVH_LEAF_MARKERS, Nr as CAMERA_PRESETS, jr as CAMERA_RANGES, Np as CameraManager, Hr as DEFAULT_TEXTURE_MATRIX, Dm as DenoisingManager, Y as ENGINE_DEFAULTS, ur as EngineEvents, Fp as GoboManager, Kp as IESManager, Wr as INTERACTIVE_RENDER_CONFIG, Jf as InteractionManager, Kr as LOG_LEVELS, Pp as LightManager, oi as Logger, Dr as MAX_RESERVABLE_RENDER_SIZE, Gr as MEMORY_CONSTANTS, Im as OverlayManager, Ur as PRODUCTION_RENDER_CONFIG, Wm as PathTracerApp, Pf as PipelineContext, Kf as RenderPipeline, Mp as RenderSettings, cr as RenderStage, Mr as SKY_PRESETS, sr as StageExecutionMode, Rr as TEXTURE_CONSTANTS, X as TRIANGLE_DATA_LAYOUT, zm as TransformManager, hu as VRAMTracker, Gm as VideoRenderManager, pu as bufferBytes, Vf as clearBindingAuditFindings, fl as configureAssets, si as createLogger, Q as fmt, pl as getAssetConfig, Bf as getBindingAuditFindings, zf as setBindingAudit, mu as textureBytes };