rayzee 11.16.0 → 11.17.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.
Files changed (107) hide show
  1. package/README.md +1 -1
  2. package/dist/ArchiveFormats-_WrBUn7t.js +2796 -0
  3. package/dist/{ArchiveImporter-CEv5EDgg.js → ArchiveImporter-CdtFzb0f.js} +1345 -1305
  4. package/dist/BidirectionalIntegrator-BH-c324Z.js +960 -0
  5. package/dist/{BufferLayout-ny3WneEc.js → BufferLayout-QzWWnb3A.js} +3 -0
  6. package/dist/{CameraRay-CdVb2LnS.js → CameraRay-gszl6gQ8.js} +20 -12
  7. package/dist/{ColorManagement-B6SgefNi.js → ColorManagement-D7Vcr71o.js} +36 -37
  8. package/dist/Common-jRX6P1vs.js +683 -0
  9. package/dist/CompactKernel-cuEVr6Jy.js +21025 -0
  10. package/dist/DepthPass-BAXPCPq-.js +69 -0
  11. package/dist/{LocalExposure-CMO6fd8G.js → LocalExposure-DUUpAbvu.js} +1 -1
  12. package/dist/{NeuralRetouch-CYRGwe9E.js → NeuralRetouch-RRRAJJZw.js} +3 -3
  13. package/dist/{NeuralSuperRes-p0A3_wjO.js → NeuralSuperRes-BXu9pHRi.js} +4 -4
  14. package/dist/{OpenStorage-CjlOYQyW.js → OpenStorage-PsDTuAHF.js} +2 -2
  15. package/dist/{PhysicalSky-qHATDBbB.js → PhysicalSky-Cbf04lJr.js} +310 -310
  16. package/dist/{PictureView-6y4XsUf0.js → PictureView-CqcqmjYy.js} +29 -29
  17. package/dist/{RayzeeRenderer-ClGfovbz.js → RayzeeRenderer-y85Ubgr_.js} +2539 -3702
  18. package/dist/{TextureBuckets-CcOI4Bdg.js → TextureBuckets-BfkUIWK6.js} +2 -0
  19. package/dist/{TextureSampling-CQMmzhCp.js → TextureSampling-Cmd2X04v.js} +129 -126
  20. package/dist/{ToneMapGPU-tJZo_-7S.js → ToneMapGPU-CVKz1Wun.js} +1 -1
  21. package/dist/{ViewTransforms-Bh7hSjSb.js → ViewTransforms-BjMXpgR2.js} +95 -66
  22. package/dist/addons/archives.es.js +2 -2
  23. package/dist/addons/bidirectional.es.js +1 -1
  24. package/dist/addons/color.es.js +1 -1
  25. package/dist/addons/physical-sky.es.js +1 -1
  26. package/dist/addons/storage.es.js +1 -1
  27. package/dist/rayzee-core.es.js +9 -10
  28. package/dist/rayzee.es.js +772 -788
  29. package/dist/rayzee.umd.js +110 -110
  30. package/package.json +2 -2
  31. package/src/EngineDefaults.js +2 -0
  32. package/src/RayzeeRenderer.js +92 -51
  33. package/src/RenderSettings.js +8 -0
  34. package/src/addons/archives/ArchiveImporter.js +67 -20
  35. package/src/addons/archives/ArchiveReader.js +4 -1
  36. package/src/addons/archives/pbrt/PBRTSceneBuilder.js +42 -12
  37. package/src/addons/archives/pbrt/index.js +12 -2
  38. package/src/addons/archives/usd/USDScene.js +25 -3
  39. package/src/addons/bidirectional/Bidirectional.js +1 -0
  40. package/src/addons/bidirectional/BidirectionalIntegrator.js +6 -6
  41. package/src/addons/color/ColorSpaces.js +2 -1
  42. package/src/addons/color/OcioViews.js +3 -3
  43. package/src/addons/physical-sky/PhysicalSky.js +2 -3
  44. package/src/addons/storage/OpenStorage.js +2 -0
  45. package/src/bvh/ReinsertionOptimizer.js +3 -2
  46. package/src/environment/EnvironmentManager.js +2 -2
  47. package/src/lights/LightManager.js +3 -2
  48. package/src/lights/LightSerializer.js +5 -4
  49. package/src/loaders/AssetLoader.js +3 -2
  50. package/src/loaders/PlatformImageLoader.js +180 -12
  51. package/src/loaders/SceneLoading.js +2 -0
  52. package/src/materials/MaterialDataManager.js +19 -7
  53. package/src/materials/MaterialPacking.js +5 -1
  54. package/src/materials/TextureCreator.js +137 -22
  55. package/src/output/Pictures.js +0 -1
  56. package/src/output/TextureReadback.js +2 -1
  57. package/src/pathtracer/KernelManager.js +21 -4
  58. package/src/pathtracer/PackedRayBuffer.js +3 -14
  59. package/src/pathtracer/PathTracer.js +24 -26
  60. package/src/pathtracer/PathTracerStage.js +5 -0
  61. package/src/pathtracer/QueueManager.js +9 -11
  62. package/src/pathtracer/StorageTexturePool.js +24 -35
  63. package/src/pathtracer/UniformManager.js +2 -0
  64. package/src/pipeline/Compositor.js +2 -2
  65. package/src/scene/BufferLayout.js +5 -3
  66. package/src/scene/GeometryExtractor.js +22 -2
  67. package/src/scene/SceneEdits.js +5 -1
  68. package/src/scene/SceneProcessor.js +2 -0
  69. package/src/scene/ViewCamera.js +2 -1
  70. package/src/shaders/Common.js +9 -1
  71. package/src/shaders/DFGTable.js +16 -16
  72. package/src/shaders/EmissiveSampling.js +56 -7
  73. package/src/shaders/Fog.js +238 -90
  74. package/src/shaders/LightBVHSampling.js +28 -9
  75. package/src/shaders/LightsDirect.js +32 -20
  76. package/src/shaders/LightsIndirect.js +6 -8
  77. package/src/shaders/LightsSampling.js +5 -4
  78. package/src/shaders/MaterialProperties.js +22 -3
  79. package/src/shaders/MaterialTransmission.js +125 -152
  80. package/src/shaders/Random.js +4 -1
  81. package/src/shaders/SceneResources.js +9 -1
  82. package/src/shaders/Struct.js +2 -0
  83. package/src/shaders/TextureSampling.js +18 -7
  84. package/src/shaders/ThreePatches.js +3 -33
  85. package/src/shaders/kernels/DepthPass.js +1 -2
  86. package/src/shaders/kernels/ShadeKernel.js +44 -19
  87. package/src/viewer/PathTracerApp.js +2 -1
  88. package/src/viewer/animation/VideoRenderManager.js +2 -0
  89. package/src/viewer/camera/CameraManager.js +1 -1
  90. package/src/viewer/denoise/DenoisingManager.js +2 -2
  91. package/src/viewer/denoise/MotionVector.js +6 -26
  92. package/src/viewer/denoise/NRD.js +25 -40
  93. package/src/viewer/denoise/NormalDepth.js +14 -46
  94. package/src/viewer/denoise/OIDNDenoiser.js +13 -15
  95. package/src/viewer/overlays/ViewOverlayRenderer.js +2 -1
  96. package/src/viewer/picture/AIUpscaler.js +8 -0
  97. package/src/viewer/picture/PictureView.js +5 -2
  98. package/dist/ArchiveFormats-CWi6IbSp.js +0 -1401
  99. package/dist/AssetConfig-C8BsprCp.js +0 -30
  100. package/dist/BidirectionalIntegrator-KWRQrMXX.js +0 -960
  101. package/dist/CompactKernel-C6TCBB6i.js +0 -19759
  102. package/dist/DepthPass-BMnBuepB.js +0 -69
  103. package/dist/PackedRayBuffer-BhqeNEaL.js +0 -802
  104. /package/dist/{EngineEvents-oQGofgRf.js → EngineEvents-Cdhzr9Bq.js} +0 -0
  105. /package/dist/{EngineIssues-DHAU18xh.js → EngineIssues-pnvWClTX.js} +0 -0
  106. /package/dist/{SolarLimb-IayvafJP.js → SolarLimb-BiVdxxmL.js} +0 -0
  107. /package/dist/{ZipReader-D6LbMsfZ.js → ZipReader-CEcslQJR.js} +0 -0
@@ -45,6 +45,7 @@ var a = {
45
45
  ALPHA_MODE: 12,
46
46
  DEPTH_WRITE: 13,
47
47
  NORMAL_SCALE: 14,
48
+ DIFFUSE_ROUGHNESS_MAP_INDEX: 15,
48
49
  COLOR: 16,
49
50
  METALNESS: 19,
50
51
  EMISSIVE: 20,
@@ -78,6 +79,8 @@ var a = {
78
79
  METALNESS_TRANSFORM: 76,
79
80
  EMISSIVE_TRANSFORM: 84,
80
81
  BUMP_TRANSFORM: 92,
82
+ BUMP_MAP_WIDTH: 94,
83
+ BUMP_MAP_HEIGHT: 97,
81
84
  DISPLACEMENT_TRANSFORM: 100,
82
85
  SUBSURFACE_COLOR: 108,
83
86
  SUBSURFACE: 111,
@@ -1,7 +1,7 @@
1
- import { en as e, xt as t } from "./PackedRayBuffer-BhqeNEaL.js";
1
+ import { rt as e, x as t } from "./Common-jRX6P1vs.js";
2
2
  import { i as n, r } from "./Logger-D7hic8LA.js";
3
- import { C as i } from "./TextureSampling-CQMmzhCp.js";
4
- import { o as a } from "./TextureBuckets-CcOI4Bdg.js";
3
+ import { C as i } from "./TextureSampling-Cmd2X04v.js";
4
+ import { o as a } from "./TextureBuckets-BfkUIWK6.js";
5
5
  import { Vector2 as o } from "three";
6
6
  import { Fn as s, If as c, cos as l, cross as u, dot as d, float as f, int as p, mat3 as m, max as h, mix as g, normalize as _, select as v, sin as y, uniform as b, vec3 as x, vec4 as S } from "three/tsl";
7
7
  //#region src/pathtracer/KernelManager.js
@@ -43,21 +43,29 @@ var C = r("wavefront"), w = class {
43
43
  dispatch(e) {
44
44
  let t = this.kernels.get(e);
45
45
  if (!t) throw Error(`KernelManager: Unknown kernel '${e}'`);
46
- let n = this.timing.get(e), r = this._indirect.get(e) ?? null;
46
+ let n = this.timing.get(e), r = this._indirect.get(e), i = t.dispatchSize;
47
+ r && (t.dispatchSize = r);
48
+ try {
49
+ this._compute(e, t, n);
50
+ } finally {
51
+ t.dispatchSize = i;
52
+ }
53
+ }
54
+ _compute(e, t, n) {
47
55
  if (n && !n.compiledOnce) {
56
+ let r = performance.now();
57
+ this.renderer.compute(t);
48
58
  let i = performance.now();
49
- this.renderer.compute(t, r);
50
- let a = performance.now();
51
- n.compiledOnce = !0, n.lastDispatchMs = a - i, this._recordFirstDispatch(e, a - i);
59
+ n.compiledOnce = !0, n.lastDispatchMs = i - r, this._recordFirstDispatch(e, i - r);
52
60
  } else if (this.profiling) {
53
61
  let n = performance.now();
54
- this.renderer.compute(t, r);
55
- let i = performance.now(), a = this.profile.get(e);
56
- a || (a = {
62
+ this.renderer.compute(t);
63
+ let r = performance.now(), i = this.profile.get(e);
64
+ i || (i = {
57
65
  calls: 0,
58
66
  totalMs: 0
59
- }, this.profile.set(e, a)), a.calls++, a.totalMs += i - n;
60
- } else this.renderer.compute(t, r);
67
+ }, this.profile.set(e, i)), i.calls++, i.totalMs += r - n;
68
+ } else this.renderer.compute(t);
61
69
  }
62
70
  setIndirect(e, t) {
63
71
  for (let n of e) t ? this._indirect.set(n, t) : this._indirect.delete(n);
@@ -1,9 +1,8 @@
1
1
  import { r as e } from "./Logger-D7hic8LA.js";
2
- import { n as t } from "./EngineIssues-DHAU18xh.js";
2
+ import { n as t } from "./EngineIssues-pnvWClTX.js";
3
3
  import { a as n, n as r, t as i } from "./WorkingMatrix-CDGicYGE.js";
4
4
  import { i as a, n as o, r as s, t as c } from "./ActiveColor-DakLCifA.js";
5
- import { n as l } from "./AssetConfig-C8BsprCp.js";
6
- import { _ as u, a as d, c as f, d as p, f as m, g as h, h as g, l as _, m as v, n as y, o as b, p as x, u as S } from "./ViewTransforms-Bh7hSjSb.js";
5
+ import { _ as l, a as u, c as d, d as f, f as p, g as m, h, l as g, m as _, n as v, o as y, p as b, u as x, y as S } from "./ViewTransforms-BjMXpgR2.js";
7
6
  import { ClampToEdgeWrapping as C, Data3DTexture as w, HalfFloatType as T, LinearSRGBColorSpace as E, NearestFilter as D, NoColorSpace as ee, NoToneMapping as te, RGBAFormat as ne, SRGBColorSpace as re } from "three";
8
7
  import { Fn as ie, If as ae, clamp as O, dot as oe, float as se, floor as ce, int as le, ivec3 as k, log2 as ue, max as de, min as fe, mix as pe, sign as me, step as he, texture3DLoad as ge, vec3 as A } from "three/tsl";
9
8
  //#region src/addons/color/Displays.js
@@ -117,7 +116,7 @@ function Pe(e) {
117
116
  }
118
117
  var Fe = null, I = null, L = null, Ie = null, R = null;
119
118
  async function Le() {
120
- let { ocioRuntimeFactory: e, ocioRuntimeUrl: t } = l();
119
+ let { ocioRuntimeFactory: e, ocioRuntimeUrl: t } = S();
121
120
  if (typeof e == "function") return await e();
122
121
  if (typeof t == "string" && t) return await import(
123
122
  /* @vite-ignore */
@@ -129,7 +128,7 @@ async function Re() {
129
128
  return I || (Fe ||= (async () => {
130
129
  let e = await Le();
131
130
  if (typeof e.createOcioRuntime != "function") throw Error("OCIO module has no createOcioRuntime() — wrong package or version");
132
- let { ocioWasmUrl: t } = l();
131
+ let { ocioWasmUrl: t } = S();
133
132
  return I = await e.createOcioRuntime({
134
133
  ...t ? { wasmUrl: t } : {},
135
134
  moduleOptions: {
@@ -269,7 +268,7 @@ function Je(e, t, n) {
269
268
  return `${e}\u0000${t}\u0000${n ? JSON.stringify(n) : ""}`;
270
269
  }
271
270
  function Ye() {
272
- for (let e of Ke.values()) e.dispose?.();
271
+ for (let e of Ke.values()) e?.dispose?.();
273
272
  Ke.clear(), W.clear(), G.clear();
274
273
  }
275
274
  function Xe(e, t, { context: n = null } = {}) {
@@ -1143,7 +1142,7 @@ function $t(e, t) {
1143
1142
  for (let e of n?.readdir(r) ?? []) {
1144
1143
  if (e[0] === ".") continue;
1145
1144
  let i = `${r}/${e}`;
1146
- if (n.readdir(i).some((e) => e.endsWith(".ocio") && new TextDecoder().decode(n.readFile(`${i}/${e}`)) === t)) return i;
1145
+ if (n.readdir(i).some((e) => /\.ocio$/i.test(e) && new TextDecoder().decode(n.readFile(`${i}/${e}`)) === t)) return i;
1147
1146
  }
1148
1147
  } catch {}
1149
1148
  return "";
@@ -1540,7 +1539,7 @@ function mn({ id: e, name: t, half: n, error: r, ocio: i }) {
1540
1539
  linear: l,
1541
1540
  clip: u,
1542
1541
  pre: d
1543
- }), p = e ?? m(), h = `TM_OCIO_${p}`, g = `tm_ocio_${p}`, _ = Y.get(p), v = _ && _.size === a && _.minEv === o && _.maxEv === s && JSON.stringify([
1542
+ }), m = e ?? p(), h = `TM_OCIO_${m}`, g = `tm_ocio_${m}`, _ = Y.get(m), v = _ && _.size === a && _.minEv === o && _.maxEv === s && JSON.stringify([
1544
1543
  _.curve,
1545
1544
  _.linear,
1546
1545
  _.clip,
@@ -1560,7 +1559,7 @@ function mn({ id: e, name: t, half: n, error: r, ocio: i }) {
1560
1559
  linear: l,
1561
1560
  clip: u,
1562
1561
  pre: d
1563
- })), Y.set(p, {
1562
+ })), Y.set(m, {
1564
1563
  texture: y,
1565
1564
  tsl: b,
1566
1565
  size: a,
@@ -1571,7 +1570,7 @@ function mn({ id: e, name: t, half: n, error: r, ocio: i }) {
1571
1570
  clip: u,
1572
1571
  pre: d
1573
1572
  }), {
1574
- id: p,
1573
+ id: m,
1575
1574
  name: t,
1576
1575
  wgslConst: h,
1577
1576
  source: "ocio",
@@ -1719,7 +1718,7 @@ function _n({ name: e, half: t, error: n, ocio: r }) {
1719
1718
  };
1720
1719
  }
1721
1720
  function vn(e) {
1722
- return b(dn(e));
1721
+ return y(dn(e));
1723
1722
  }
1724
1723
  function yn({ display: e = null, look: n = null, context: r = null, source: i = null, size: a = null } = {}) {
1725
1724
  let o = V();
@@ -1762,7 +1761,7 @@ function bn(e) {
1762
1761
  t && (t.texture.dispose(), Y.delete(e));
1763
1762
  }
1764
1763
  function xn(e = null) {
1765
- for (let t of d.values()) t.source === "ocio" && !e?.has(t.id) && t.table?.texture?.dispose?.();
1764
+ for (let t of u.values()) t.source === "ocio" && !e?.has(t.id) && t.table?.texture?.dispose?.();
1766
1765
  for (let [t, n] of Y) e?.has(t) || (n.texture.dispose(), Y.delete(t));
1767
1766
  }
1768
1767
  //#endregion
@@ -2001,8 +2000,8 @@ function Zn(e, t) {
2001
2000
  }
2002
2001
  var Qn = class {
2003
2002
  constructor({ issues: e = null, renderer: t = null } = {}) {
2004
- this._issues = e, this._renderer = t, this._listeners = /* @__PURE__ */ new Map(), this._workingSpace = null, this._activeView = null, this._exportSpace = null, this._context = null, this._lastUsed = /* @__PURE__ */ new Map(), this._useClock = 0, this._lastBuiltin = y, this._fingerprint = null, this._hdrOutput = !1, this._canvasView = null, this._canvasReason = null, this._bakedCanvasViews = /* @__PURE__ */ new Map(), this._recentCanvasViews = /* @__PURE__ */ new Map(), Bt(e), this._offRegistry = x(() => {
2005
- this._renderer && v(this._renderer), this._emit("transforms");
2003
+ this._issues = e, this._renderer = t, this._listeners = /* @__PURE__ */ new Map(), this._workingSpace = null, this._activeView = null, this._exportSpace = null, this._context = null, this._lastUsed = /* @__PURE__ */ new Map(), this._useClock = 0, this._lastBuiltin = v, this._fingerprint = null, this._hdrOutput = !1, this._canvasView = null, this._canvasReason = null, this._bakedCanvasViews = /* @__PURE__ */ new Map(), this._recentCanvasViews = /* @__PURE__ */ new Map(), Bt(e), this._offRegistry = b(() => {
2004
+ this._renderer && _(this._renderer), this._emit("transforms");
2006
2005
  }), o(this);
2007
2006
  }
2008
2007
  on(e, t) {
@@ -2053,12 +2052,12 @@ var Qn = class {
2053
2052
  this.workingSpaceAdopted && this._issues?.warn(t.COLOR_CONFIG_LOAD_FAILED, `unloaded while rendering in ${this._workingSpace}; the environment stays converted into it — use app.unloadColorConfig(), which reverts the scene first`, { workingSpace: this._workingSpace }), this._releaseViews(), Ve(), et(), Fn(), Nn(), this._fingerprint = null, this._workingSpace = null, this._activeView = null, this._exportSpace = null, this._context = null, n(null), this._applyRendererOutputColorSpace(), this._updateCanvasView(), this._emit("config", null), this._emit("workingSpace", this.workingSpace);
2054
2053
  }
2055
2054
  _releaseViews(e = null) {
2056
- xn(e), on(), g(e);
2055
+ xn(e), on(), h(e);
2057
2056
  for (let t of this._lastUsed.keys()) e?.has(t) || this._lastUsed.delete(t);
2058
- this._renderer && S(this._renderer.toneMapping) === null && (this._renderer.toneMapping = S(this._lastBuiltin) ? this._lastBuiltin : y, this._activeView = null, this._applyRendererOutputColorSpace(), this._updateCanvasView());
2057
+ this._renderer && x(this._renderer.toneMapping) === null && (this._renderer.toneMapping = x(this._lastBuiltin) ? this._lastBuiltin : v, this._activeView = null, this._applyRendererOutputColorSpace(), this._updateCanvasView());
2059
2058
  }
2060
2059
  async _bakedViewsFrom(e, t) {
2061
- let n = [...d.values()].filter((t) => t.ocio?.baked && e !== null && t.ocio.configId === e);
2060
+ let n = [...u.values()].filter((t) => t.ocio?.baked && e !== null && t.ocio.configId === e);
2062
2061
  if (n.length === 0) return [];
2063
2062
  let r = await t;
2064
2063
  return r ? n.filter((e) => e.ocio.baked.fingerprint === r) : [];
@@ -2073,13 +2072,13 @@ var Qn = class {
2073
2072
  ...n,
2074
2073
  ...n.for
2075
2074
  }, n.canvas ?? "srgb"), t = this._bakedCanvasViews.get(e);
2076
- return this._bakedCanvasViews.set(e, gn(n)), t && t !== this._canvasView?.table && t.dispose(), this._updateCanvasView(), [...d.values()].find((e) => e.source === "ocio" && e.ocio.display === n.for.display && e.ocio.view === n.for.view && (e.ocio.look ?? null) === (n.look ?? null)) ?? null;
2075
+ return this._bakedCanvasViews.set(e, gn(n)), t && t !== this._canvasView?.table && t.dispose(), this._updateCanvasView(), [...u.values()].find((e) => e.source === "ocio" && e.ocio.display === n.for.display && e.ocio.view === n.for.view && (e.ocio.look ?? null) === (n.look ?? null)) ?? null;
2077
2076
  }
2078
- let i = [...d.values()].find((e) => e.source === "ocio" && e.ocio.display === n.display && e.ocio.view === n.view && (e.ocio.look ?? null) === (n.look ?? null));
2079
- return i || this._makeRoomForTable(), b(fn(n, i?.id ?? null));
2077
+ let i = [...u.values()].find((e) => e.source === "ocio" && e.ocio.display === n.display && e.ocio.view === n.view && (e.ocio.look ?? null) === (n.look ?? null));
2078
+ return i || this._makeRoomForTable(), y(fn(n, i?.id ?? null));
2080
2079
  }
2081
2080
  async saveBakedView(e, { hdr: t = !1 } = {}) {
2082
- let n = S(e);
2081
+ let n = x(e);
2083
2082
  if (n?.source !== "ocio") throw Error(`no OCIO view with id ${e}`);
2084
2083
  let r = H(), i = {
2085
2084
  configId: r?.id ?? n.ocio.configId,
@@ -2119,13 +2118,13 @@ var Qn = class {
2119
2118
  return z() ? mt(e, this.workingSpace, { context: this._context }) : null;
2120
2119
  }
2121
2120
  listViews() {
2122
- return p();
2121
+ return f();
2123
2122
  }
2124
2123
  get activeView() {
2125
2124
  return this._activeView;
2126
2125
  }
2127
2126
  setActiveView(e) {
2128
- let t = S(e);
2127
+ let t = x(e);
2129
2128
  if (!t) throw Error(`no view transform with id ${e}`);
2130
2129
  return this._isStale(t) && (t = this._rebakeView(t) ?? t), this._activeView = t.source === "ocio" ? {
2131
2130
  ...t.ocio,
@@ -2135,7 +2134,7 @@ var Qn = class {
2135
2134
  }
2136
2135
  setView({ display: e, view: t, look: n = null, size: r } = {}) {
2137
2136
  if (!z()) throw Error("load an OCIO config first");
2138
- let i = [...d.values()].find((i) => i.source === "ocio" && i.ocio.display === e && i.ocio.view === t && (i.ocio.look ?? null) === (n ?? null) && (!r || i.ocio.size === r));
2137
+ let i = [...u.values()].find((i) => i.source === "ocio" && i.ocio.display === e && i.ocio.view === t && (i.ocio.look ?? null) === (n ?? null) && (!r || i.ocio.size === r));
2139
2138
  i || this._makeRoomForTable();
2140
2139
  let a = i ?? vn({
2141
2140
  display: e,
@@ -2145,12 +2144,12 @@ var Qn = class {
2145
2144
  source: this.workingSpace,
2146
2145
  ...r ? { size: r } : {}
2147
2146
  });
2148
- return this.setActiveView(a.id), S(a.id);
2147
+ return this.setActiveView(a.id), x(a.id);
2149
2148
  }
2150
2149
  _makeRoomForTable() {
2151
- if (f() < 12) return;
2152
- let e = this._renderer?.toneMapping ?? this._activeView?.id ?? null, t = [...d.values()].filter((t) => t.source === "ocio" && t.id !== e).sort((e, t) => (this._lastUsed.get(e.id) ?? 0) - (this._lastUsed.get(t.id) ?? 0))[0];
2153
- t && (bn(t.id), h(t.id), this._lastUsed.delete(t.id));
2150
+ if (d() < 12) return;
2151
+ let e = this._renderer?.toneMapping ?? this._activeView?.id ?? null, t = [...u.values()].filter((t) => t.source === "ocio" && t.id !== e).sort((e, t) => (this._lastUsed.get(e.id) ?? 0) - (this._lastUsed.get(t.id) ?? 0))[0];
2152
+ t && (bn(t.id), m(t.id), this._lastUsed.delete(t.id));
2154
2153
  }
2155
2154
  setLook(e) {
2156
2155
  if (!this._activeView) throw Error("no OCIO view is active");
@@ -2188,7 +2187,7 @@ var Qn = class {
2188
2187
  }
2189
2188
  }
2190
2189
  _rebakeViews() {
2191
- let e = this._renderer?.toneMapping ?? this._activeView?.id ?? null, t = e === null ? null : S(e);
2190
+ let e = this._renderer?.toneMapping ?? this._activeView?.id ?? null, t = e === null ? null : x(e);
2192
2191
  if (!t || !this._isStale(t)) return;
2193
2192
  let n = this._rebakeView(t);
2194
2193
  n && (this._activeView = {
@@ -2198,13 +2197,13 @@ var Qn = class {
2198
2197
  }), this._updateCanvasView();
2199
2198
  }
2200
2199
  attachRenderer(e) {
2201
- this._renderer = e, S(e.toneMapping)?.source === "builtin" && (this._lastBuiltin = e.toneMapping);
2202
- let t = v(e);
2200
+ this._renderer = e, x(e.toneMapping)?.source === "builtin" && (this._lastBuiltin = e.toneMapping);
2201
+ let t = _(e);
2203
2202
  return this._applyRendererOutputColorSpace(), this._updateCanvasView(), t;
2204
2203
  }
2205
2204
  _applyRendererOutputColorSpace() {
2206
2205
  if (!this._renderer) return;
2207
- let e = S(this._renderer.toneMapping);
2206
+ let e = x(this._renderer.toneMapping);
2208
2207
  this._renderer.outputColorSpace = e?.outputEncoded ? E : re, this._applyCanvasColorSpace(qn(e));
2209
2208
  }
2210
2209
  _applyCanvasColorSpace(e) {
@@ -2235,7 +2234,7 @@ var Qn = class {
2235
2234
  return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas;
2236
2235
  }
2237
2236
  _canvasPlan() {
2238
- let e = this._renderer ? S(this._renderer.toneMapping) : null;
2237
+ let e = this._renderer ? x(this._renderer.toneMapping) : null;
2239
2238
  if (!e || !this._hdrOutput) return { reason: null };
2240
2239
  if (e.source !== "ocio") return e.id === te ? {
2241
2240
  key: "none",
@@ -2492,7 +2491,7 @@ var Qn = class {
2492
2491
  return r;
2493
2492
  }
2494
2493
  status() {
2495
- let e = H(), t = this._renderer ? S(this._renderer.toneMapping) : null, n = !!this._canvasView?.hdr && this._canvasOnScreen();
2494
+ let e = H(), t = this._renderer ? x(this._renderer.toneMapping) : null, n = !!this._canvasView?.hdr && this._canvasOnScreen();
2496
2495
  return {
2497
2496
  config: e,
2498
2497
  workingSpace: this.workingSpace,
@@ -2505,8 +2504,8 @@ var Qn = class {
2505
2504
  activeView: this._activeView,
2506
2505
  context: this._context,
2507
2506
  exportSpace: this._exportSpace,
2508
- views: p(),
2509
- registryVersion: _(),
2507
+ views: f(),
2508
+ registryVersion: g(),
2510
2509
  bakeError: t?.error ?? null,
2511
2510
  canvasColorSpace: this.canvasColorSpace,
2512
2511
  hdr: {
@@ -2527,7 +2526,7 @@ var Qn = class {
2527
2526
  this._canvasView = null, this._bakedCanvasViews.clear(), this._recentCanvasViews.clear(), Bt(null), this._renderer = null, this._issues = null, s() === this && (n(null), a(null));
2528
2527
  }
2529
2528
  static resetAll() {
2530
- a(null), n(null), xn(), on(), u(), et(), Fn(), Ge();
2529
+ a(null), n(null), xn(), on(), l(), et(), Fn(), Ge();
2531
2530
  }
2532
2531
  };
2533
2532
  function $n() {