rayzee 9.5.0 → 11.0.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 (78) hide show
  1. package/README.md +22 -20
  2. package/dist/{ArchiveImporter-xuUJiklP.js → ArchiveImporter-BRQvLggb.js} +12 -13
  3. package/dist/{BidirectionalIntegrator-C5PKjJoT.js → BidirectionalIntegrator-9lZQxFVH.js} +87 -87
  4. package/dist/BufferLayout-D_IBo2ci.js +150 -0
  5. package/dist/{ColorManagement-CheBCPaW.js → ColorManagement-oeEk7oSu.js} +171 -171
  6. package/dist/{NeuralRetouch-CW11yLZ_.js → NeuralRetouch-BCXylThH.js} +3 -3
  7. package/dist/{NeuralSuperRes-BekaecYg.js → NeuralSuperRes-sZAeS142.js} +3 -3
  8. package/dist/{PathTracer-Ccl9KOuF.js → PathTracer-CQPW06Mm.js} +2911 -2669
  9. package/dist/{PhysicalSky-Dv2PMFGW.js → PhysicalSky-BvqCw_dy.js} +2 -2
  10. package/dist/{RayzeeRenderer-BQxnzCTD.js → RayzeeRenderer-COpwotpU.js} +338 -329
  11. package/dist/{SolarLimb-ken-JbDK.js → SolarLimb-CPaeZVwz.js} +10 -10
  12. package/dist/{ToneMapGPU-BHi5JzIq.js → ToneMapGPU-CjU3osDd.js} +1 -1
  13. package/dist/{ViewTransforms-D0rTLBsX.js → ViewTransforms-CYN7bq2w.js} +2 -2
  14. package/dist/addons/archives.es.js +1 -1
  15. package/dist/addons/bidirectional.es.js +1 -1
  16. package/dist/addons/color.es.js +1 -1
  17. package/dist/addons/physical-sky.es.js +1 -1
  18. package/dist/rayzee-core.es.js +11 -11
  19. package/dist/rayzee.es.js +734 -599
  20. package/dist/rayzee.umd.js +102 -102
  21. package/dist/sceneCachePolicy-BSSsKY98.js +443 -0
  22. package/package.json +1 -1
  23. package/src/Color/ViewTransforms.js +5 -1
  24. package/src/EngineDefaults.js +59 -1032
  25. package/src/Headless.js +6 -5
  26. package/src/Passes/OIDNTemporalHistory.js +1 -1
  27. package/src/PathTracerApp.js +5 -3
  28. package/src/Processor/AssetLoader.js +6 -5
  29. package/src/Processor/BVHBuilder.js +10 -31
  30. package/src/Processor/BVHLeafFold.js +4 -6
  31. package/src/Processor/BVHRefitter.js +3 -46
  32. package/src/Processor/BufferLayout.js +291 -0
  33. package/src/Processor/EmissiveTriangleBuilder.js +1 -1
  34. package/src/Processor/GeometryExtractor.js +3 -3
  35. package/src/Processor/HostMemory.js +7 -1
  36. package/src/Processor/InstanceTable.js +1 -1
  37. package/src/Processor/MaterialPacking.js +2 -1
  38. package/src/Processor/PBRT/PBRTSceneBuilder.js +1 -1
  39. package/src/Processor/QueueManager.js +28 -3
  40. package/src/Processor/SceneProcessor.js +4 -2
  41. package/src/Processor/SplitBLAS.js +1 -1
  42. package/src/Processor/StorageTexturePool.js +22 -1
  43. package/src/Processor/TLASBuilder.js +1 -3
  44. package/src/Processor/TextureBuckets.js +237 -0
  45. package/src/Processor/TextureCreator.js +10 -1
  46. package/src/Processor/Workers/TexturesWorker.js +5 -6
  47. package/src/RayzeeRenderer.js +29 -32
  48. package/src/RenderSettings.js +26 -28
  49. package/src/Stages/ASVGF.js +8 -7
  50. package/src/Stages/AutoExposure.js +14 -5
  51. package/src/Stages/BilateralFilter.js +2 -1
  52. package/src/Stages/DenoiserSettings.js +182 -0
  53. package/src/Stages/EdgeFilter.js +2 -1
  54. package/src/Stages/MotionVector.js +1 -1
  55. package/src/Stages/NRD.js +2 -3
  56. package/src/Stages/NormalDepth.js +3 -2
  57. package/src/Stages/PathTracer.js +72 -4
  58. package/src/Stages/PathTracerStage.js +2 -1
  59. package/src/Stages/Variance.js +1 -1
  60. package/src/TSL/BVHTraversal.js +4 -1
  61. package/src/TSL/Common.js +1 -1
  62. package/src/TSL/EmissiveSampling.js +1 -1
  63. package/src/TSL/LightVisibility.js +111 -0
  64. package/src/TSL/LightsSampling.js +151 -15
  65. package/src/TSL/Random.js +1 -1
  66. package/src/TSL/ShadeKernel.js +88 -3
  67. package/src/TSL/TextureSampling.js +1 -1
  68. package/src/core.js +5 -9
  69. package/src/index.js +10 -21
  70. package/src/integrators/BidirectionalIntegrator.js +2 -1
  71. package/src/managers/CameraManager.js +17 -7
  72. package/src/managers/DenoisingManager.js +14 -10
  73. package/src/managers/EnvironmentManager.js +32 -13
  74. package/src/managers/MaterialDataManager.js +3 -3
  75. package/src/managers/UniformManager.js +2 -2
  76. package/dist/EngineDefaults-DH3bI5t-.js +0 -844
  77. package/dist/sceneCachePolicy-BmwYOYDu.js +0 -183
  78. /package/dist/{Logger-BnHghprG.js → Logger-dDDGj9Av.js} +0 -0
@@ -1,25 +1,25 @@
1
- import { r as e } from "./Logger-BnHghprG.js";
1
+ import { r as e } from "./Logger-dDDGj9Av.js";
2
2
  import { n as t } from "./EngineIssues-CIZnXHsF.js";
3
3
  import { a as n, n as r, t as i } from "./WorkingMatrix-C6y233hT.js";
4
4
  import { i as a, n as o, r as s, t as c } from "./ActiveColor-YvuQq44O.js";
5
5
  import { n as l } from "./AssetConfig-DSEntE65.js";
6
- import { a as u, c as d, d as f, f as p, g as m, h, i as g, l as _, m as v, p as ee, s as te, t as ne, u as re } from "./ViewTransforms-D0rTLBsX.js";
7
- import { Fn as ie, If as y, clamp as b, float as x, floor as ae, ivec3 as S, log2 as oe, max as se, texture3DLoad as ce, vec3 as C } from "three/tsl";
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 ee, o as te, p as ne, u as y } from "./ViewTransforms-CYN7bq2w.js";
7
+ import { Fn as re, If as b, clamp as x, float as ie, floor as ae, ivec3 as S, log2 as oe, max as se, texture3DLoad as ce, vec3 as C } from "three/tsl";
8
8
  import { ClampToEdgeWrapping as le, Data3DTexture as ue, HalfFloatType as de, LinearSRGBColorSpace as fe, NearestFilter as pe, NoColorSpace as me, RGBAFormat as he, SRGBColorSpace as ge } from "three";
9
9
  //#region src/Color/Displays.js
10
- function _e(e) {
10
+ function w(e) {
11
11
  let t = String(e ?? "");
12
12
  return /(hdr|pq|hlg|2100|st2084)/i.test(t) ? null : /^display\s*p3\b/i.test(t) ? "display-p3" : /^(srgb|rec\.?\s*1886|bt\.?\s*1886|gamma\s*2\.2\s*rec\.?\s*709)\b(?!.*(p3|2020))/i.test(t) ? "srgb" : null;
13
13
  }
14
14
  //#endregion
15
15
  //#region src/Color/OcioRuntime.js
16
- var w = e("ocio");
17
- function ve(e) {
16
+ var T = e("ocio");
17
+ function _e(e) {
18
18
  let t = String(e);
19
- /\[OpenColorIO Error\]/.test(t) ? w.error(t) : /\[OpenColorIO Warning\]/.test(t) ? w.warn(t) : w.debug(t);
19
+ /\[OpenColorIO Error\]/.test(t) ? T.error(t) : /\[OpenColorIO Warning\]/.test(t) ? T.warn(t) : T.debug(t);
20
20
  }
21
- var T = null, E = null, D = null, O = null, k = null;
22
- async function ye() {
21
+ var E = null, D = null, O = null, k = null, A = null;
22
+ async function ve() {
23
23
  let { ocioRuntimeFactory: e, ocioRuntimeUrl: t } = l();
24
24
  if (typeof e == "function") return await e();
25
25
  if (typeof t == "string" && t) return await import(
@@ -28,28 +28,28 @@ async function ye() {
28
28
  );
29
29
  throw Error("OpenColorIO runtime not configured. Call configureAssets({ ocioRuntimeFactory: () => import('@bb-studio/ocio') }) before loading a config.");
30
30
  }
31
- async function be() {
32
- return E || (T ||= (async () => {
33
- let e = await ye();
31
+ async function ye() {
32
+ return D || (E ||= (async () => {
33
+ let e = await ve();
34
34
  if (typeof e.createOcioRuntime != "function") throw Error("OCIO module has no createOcioRuntime() — wrong package or version");
35
35
  let { ocioWasmUrl: t } = l();
36
- return E = await e.createOcioRuntime({
36
+ return D = await e.createOcioRuntime({
37
37
  ...t ? { wasmUrl: t } : {},
38
38
  moduleOptions: {
39
- print: ve,
40
- printErr: ve
39
+ print: _e,
40
+ printErr: _e
41
41
  }
42
- }), E;
42
+ }), D;
43
43
  })().catch((e) => {
44
- throw T = null, e;
45
- }), await T);
44
+ throw E = null, e;
45
+ }), await E);
46
46
  }
47
- async function xe() {
48
- return (await be()).ocio.listBuiltinConfigs();
47
+ async function be() {
48
+ return (await ye()).ocio.listBuiltinConfigs();
49
49
  }
50
- async function Se({ builtin: e, text: t, files: n = [], configPath: r = "config.ocio", id: i } = {}) {
51
- let a = await be();
52
- if (e) D = a.loadBuiltinConfig(e), O = e, k = we(a, e);
50
+ async function xe({ builtin: e, text: t, files: n = [], configPath: r = "config.ocio", id: i } = {}) {
51
+ let a = await ye();
52
+ if (e) O = a.loadBuiltinConfig(e), k = e, A = Ce(a, e);
53
53
  else {
54
54
  let e = n.map((e) => ({
55
55
  relativePath: e.relativePath ?? e.path ?? e.name,
@@ -59,42 +59,42 @@ async function Se({ builtin: e, text: t, files: n = [], configPath: r = "config.
59
59
  relativePath: r,
60
60
  data: new TextEncoder().encode(t)
61
61
  }), !e.some((e) => e.relativePath === r)) throw Error(`config package has no "${r}" — pass configPath to name the .ocio file`);
62
- D = a.loadConfigPackage({
62
+ O = a.loadConfigPackage({
63
63
  configRelativePath: r,
64
64
  files: e
65
- }, i ? { id: i } : void 0), O = i ?? D.id;
65
+ }, i ? { id: i } : void 0), k = i ?? O.id;
66
66
  let o = e.find((e) => e.relativePath === r);
67
- k = o ? new TextDecoder().decode(o.data) : null;
67
+ A = o ? new TextDecoder().decode(o.data) : null;
68
68
  }
69
- return N();
69
+ return P();
70
70
  }
71
- function Ce() {
72
- D = null, O = null, k = null;
73
- }
74
- function A() {
75
- return D !== null;
71
+ function Se() {
72
+ O = null, k = null, A = null;
76
73
  }
77
74
  function j() {
78
- return D ? E : null;
75
+ return O !== null;
79
76
  }
80
77
  function M() {
81
- return D;
78
+ return O ? D : null;
82
79
  }
83
80
  function N() {
84
- if (!D) return null;
85
- let e = Object.fromEntries(D.roles.map((e) => [e.name, e.colorSpace]));
81
+ return O;
82
+ }
83
+ function P() {
84
+ if (!O) return null;
85
+ let e = Object.fromEntries(O.roles.map((e) => [e.name, e.colorSpace]));
86
86
  return {
87
- id: O,
88
- name: k?.match(/^name:\s*(\S.*?)\s*$/m)?.[1] ?? null,
89
- ocioVersion: D.ocioVersion,
90
- version: D.version,
87
+ id: k,
88
+ name: A?.match(/^name:\s*(\S.*?)\s*$/m)?.[1] ?? null,
89
+ ocioVersion: O.ocioVersion,
90
+ version: O.version,
91
91
  roles: e,
92
92
  sceneLinear: e.scene_linear ?? null,
93
93
  colorPicking: e.color_picking ?? e.texture_paint ?? null,
94
94
  texturePaint: e.texture_paint ?? e.color_picking ?? null,
95
95
  data: e.data ?? null,
96
96
  compositingLog: e.compositing_log ?? e.color_timing ?? null,
97
- colorSpaces: D.colorSpaces.map((e) => ({
97
+ colorSpaces: O.colorSpaces.map((e) => ({
98
98
  name: e.name,
99
99
  family: e.family,
100
100
  categories: e.categories ?? [],
@@ -103,25 +103,25 @@ function N() {
103
103
  aliases: e.aliases,
104
104
  description: e.description
105
105
  })),
106
- displays: D.displays.slice(),
107
- defaultDisplay: D.defaultDisplay,
108
- views: Object.fromEntries(Object.entries(D.viewsByDisplay).map(([e, t]) => [e, t.map((e) => ({
106
+ displays: O.displays.slice(),
107
+ defaultDisplay: O.defaultDisplay,
108
+ views: Object.fromEntries(Object.entries(O.viewsByDisplay).map(([e, t]) => [e, t.map((e) => ({
109
109
  name: e.name,
110
110
  transform: e.transform,
111
111
  colorSpace: e.colorSpace,
112
112
  looks: e.looks,
113
113
  description: e.description
114
114
  }))])),
115
- defaultViews: { ...D.defaultViewsByDisplay },
116
- looks: D.looks.map((e) => ({
115
+ defaultViews: { ...O.defaultViewsByDisplay },
116
+ looks: O.looks.map((e) => ({
117
117
  name: e.name,
118
118
  processSpace: e.processSpace,
119
119
  description: e.description,
120
120
  forward: e.hasForwardTransform,
121
121
  inverse: e.hasInverseTransform
122
122
  })),
123
- namedTransforms: D.namedTransforms.map((e) => e.name),
124
- fileRules: D.fileRules.map((e) => ({
123
+ namedTransforms: O.namedTransforms.map((e) => e.name),
124
+ fileRules: O.fileRules.map((e) => ({
125
125
  index: e.index,
126
126
  name: e.name,
127
127
  colorSpace: e.colorSpace,
@@ -129,19 +129,19 @@ function N() {
129
129
  extension: e.extension,
130
130
  regex: e.regex
131
131
  })),
132
- contextVariables: Te()
132
+ contextVariables: we()
133
133
  };
134
134
  }
135
- function we(e, t) {
135
+ function Ce(e, t) {
136
136
  try {
137
137
  return e.ocio.getBuiltinConfigYaml(t);
138
138
  } catch {
139
139
  return null;
140
140
  }
141
141
  }
142
- function Te() {
143
- if (!k) return [];
144
- let e = /* @__PURE__ */ new Map(), t = k.split(/\r?\n/), n = t.findIndex((e) => /^environment:\s*(\{\s*\})?\s*$/.test(e));
142
+ function we() {
143
+ if (!A) return [];
144
+ let e = /* @__PURE__ */ new Map(), t = A.split(/\r?\n/), n = t.findIndex((e) => /^environment:\s*(\{\s*\})?\s*$/.test(e));
145
145
  if (n >= 0 && !/\{\s*\}/.test(t[n])) for (let r = n + 1; r < t.length; r++) {
146
146
  let n = t[r];
147
147
  if (/^\S/.test(n)) break;
@@ -152,74 +152,74 @@ function Te() {
152
152
  declared: !0
153
153
  });
154
154
  }
155
- for (let t of k.matchAll(/\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?/g)) e.has(t[1]) || e.set(t[1], {
155
+ for (let t of A.matchAll(/\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?/g)) e.has(t[1]) || e.set(t[1], {
156
156
  name: t[1],
157
157
  default: null,
158
158
  declared: !1
159
159
  });
160
160
  return [...e.values()].sort((e, t) => e.name.localeCompare(t.name));
161
161
  }
162
- function Ee() {
163
- Ce(), E?.dispose?.(), E = null, T = null;
162
+ function Te() {
163
+ Se(), D?.dispose?.(), D = null, E = null;
164
164
  }
165
165
  //#endregion
166
166
  //#region src/Color/ColorSpaces.js
167
- var P = 1 << 20, F = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), De = 4096, L = /* @__PURE__ */ new Map();
168
- function R(e, t, n) {
167
+ var F = 1 << 20, I = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map(), Ee = 4096, R = /* @__PURE__ */ new Map();
168
+ function z(e, t, n) {
169
169
  return `${e}\u0000${t}\u0000${n ? JSON.stringify(n) : ""}`;
170
170
  }
171
- function z() {
172
- for (let e of F.values()) e.dispose?.();
173
- F.clear(), I.clear(), L.clear();
171
+ function B() {
172
+ for (let e of I.values()) e.dispose?.();
173
+ I.clear(), L.clear(), R.clear();
174
174
  }
175
- function B(e, t, { context: n = null } = {}) {
176
- if (!j() || e === t) return null;
177
- let r = R(e, t, n), i = F.get(r);
175
+ function V(e, t, { context: n = null } = {}) {
176
+ if (!M() || e === t) return null;
177
+ let r = z(e, t, n), i = I.get(r);
178
178
  if (i !== void 0) return i;
179
179
  try {
180
- i = Oe().createColorSpaceProcessor(e, t, n ? { context: n } : void 0), i.isNoOp && (i.dispose(), i = null);
180
+ i = De().createColorSpaceProcessor(e, t, n ? { context: n } : void 0), i.isNoOp && (i.dispose(), i = null);
181
181
  } catch (n) {
182
182
  throw Error(`no OCIO transform from "${e}" to "${t}": ${n.message}`);
183
183
  }
184
- return F.set(r, i), i;
184
+ return I.set(r, i), i;
185
185
  }
186
- var V = null, H = null, U = !1;
187
- function Oe() {
188
- let e = j();
186
+ var H = null, U = null, W = !1;
187
+ function De() {
188
+ let e = M();
189
189
  if (!e) throw Error("no OCIO config loaded");
190
190
  if (e.config) return e.config;
191
- let t = M();
192
- if (V && H === t.id) return V;
193
- if (U && V?.dispose?.(), !t.id?.startsWith("ocio://")) throw Error("OCIO runtime exposes no Config handle for this config");
194
- return V = e.ocio.createBuiltinConfig(t.id), U = !0, H = t.id, V;
191
+ let t = N();
192
+ if (H && U === t.id) return H;
193
+ if (W && H?.dispose?.(), !t.id?.startsWith("ocio://")) throw Error("OCIO runtime exposes no Config handle for this config");
194
+ return H = e.ocio.createBuiltinConfig(t.id), W = !0, U = t.id, H;
195
195
  }
196
- function W() {
197
- U && V?.dispose?.(), V = null, H = null, U = !1, z();
196
+ function G() {
197
+ W && H?.dispose?.(), H = null, U = null, W = !1, B();
198
198
  }
199
- function G(e, t, n, { context: r = null } = {}) {
200
- let i = j();
199
+ function Oe(e, t, n, { context: r = null } = {}) {
200
+ let i = M();
201
201
  if (!i || t === n) return [
202
202
  e[0],
203
203
  e[1],
204
204
  e[2]
205
205
  ];
206
- let a = `${R(t, n, r)}\u0000${e[0]},${e[1]},${e[2]}`, o = I.get(a);
206
+ let a = `${z(t, n, r)}\u0000${e[0]},${e[1]},${e[2]}`, o = L.get(a);
207
207
  if (o) return o.slice();
208
208
  let s = i.transformRgb(t, n, [
209
209
  e[0],
210
210
  e[1],
211
211
  e[2]
212
212
  ], r ? { context: r } : void 0);
213
- return I.size >= De && I.clear(), I.set(a, s), s.slice();
213
+ return L.size >= Ee && L.clear(), L.set(a, s), s.slice();
214
214
  }
215
215
  function K(e, t, n, { context: r = null } = {}) {
216
216
  if (e.length % 4 != 0) throw Error("convertPixelsF32 wants 4 floats per pixel");
217
- let i = B(t, n, { context: r });
217
+ let i = V(t, n, { context: r });
218
218
  if (!i) return e;
219
219
  let a = e.length / 4;
220
- if (a <= P) return i.applyRGBAF32(e), e;
221
- for (let t = 0; t < a; t += P) {
222
- let n = Math.min(P, a - t);
220
+ if (a <= F) return i.applyRGBAF32(e), e;
221
+ for (let t = 0; t < a; t += F) {
222
+ let n = Math.min(F, a - t);
223
223
  i.applyRGBAF32(e.subarray(t * 4, (t + n) * 4));
224
224
  }
225
225
  return e;
@@ -240,11 +240,11 @@ function Ne(e) {
240
240
  }
241
241
  function Pe(e, t, n, { context: r = null, inputEncoding: i = "raw", outputEncoding: a = "srgb" } = {}) {
242
242
  if (e.length % 4 != 0) throw Error("convertEncodedRGBA8 wants 4 bytes per pixel");
243
- let o = B(t, n, { context: r });
243
+ let o = V(t, n, { context: r });
244
244
  if (!o) return e;
245
- let s = e.length / 4, c = Ne(i), l = a === "srgb" ? Ie : Le, u = new Float32Array(Math.min(P, s) * 4);
246
- for (let t = 0; t < s; t += P) {
247
- let n = Math.min(P, s - t), r = n * 4 === u.length ? u : u.subarray(0, n * 4);
245
+ let s = e.length / 4, c = Ne(i), l = a === "srgb" ? Ie : Le, u = new Float32Array(Math.min(F, s) * 4);
246
+ for (let t = 0; t < s; t += F) {
247
+ let n = Math.min(F, s - t), r = n * 4 === u.length ? u : u.subarray(0, n * 4);
248
248
  for (let i = 0; i < n; i++) {
249
249
  let n = (t + i) * 4, a = i * 4;
250
250
  r[a] = c[e[n]], r[a + 1] = c[e[n + 1]], r[a + 2] = c[e[n + 2]], r[a + 3] = 1;
@@ -278,7 +278,7 @@ function Re(e, t, n = "srgb") {
278
278
  return e;
279
279
  }
280
280
  function ze(e, t, { context: n = null, tolerance: r = 1e-4 } = {}) {
281
- if (!j()) return null;
281
+ if (!M()) return null;
282
282
  if (e === t) return [
283
283
  1,
284
284
  0,
@@ -290,10 +290,10 @@ function ze(e, t, { context: n = null, tolerance: r = 1e-4 } = {}) {
290
290
  0,
291
291
  1
292
292
  ];
293
- let i = R(e, t, n);
294
- if (L.has(i)) return L.get(i);
295
- let a = B(e, t, { context: n });
296
- if (!a) return L.set(i, [
293
+ let i = z(e, t, n);
294
+ if (R.has(i)) return R.get(i);
295
+ let a = V(e, t, { context: n });
296
+ if (!a) return R.set(i, [
297
297
  1,
298
298
  0,
299
299
  0,
@@ -303,7 +303,7 @@ function ze(e, t, { context: n = null, tolerance: r = 1e-4 } = {}) {
303
303
  0,
304
304
  0,
305
305
  1
306
- ]), L.get(i);
306
+ ]), R.get(i);
307
307
  let o = (e) => {
308
308
  let t = new Float32Array([
309
309
  e[0],
@@ -384,16 +384,16 @@ function ze(e, t, { context: n = null, tolerance: r = 1e-4 } = {}) {
384
384
  if (!d) break;
385
385
  }
386
386
  let f = d ? c : null;
387
- return L.set(i, f), f;
387
+ return R.set(i, f), f;
388
388
  }
389
389
  function Be(e) {
390
- let t = M();
390
+ let t = N();
391
391
  if (!t) return !1;
392
392
  let n = t.colorSpaces.find((t) => t.name === e || t.aliases?.includes(e));
393
393
  return n ? n.isData : !1;
394
394
  }
395
395
  function Y(e) {
396
- let t = M();
396
+ let t = N();
397
397
  return !t || !e ? !1 : t.colorSpaces.some((t) => t.name === e || t.aliases?.includes(e));
398
398
  }
399
399
  //#endregion
@@ -694,7 +694,7 @@ function rt(e) {
694
694
  nt = e;
695
695
  }
696
696
  function it() {
697
- let e = j();
697
+ let e = M();
698
698
  if (!e) throw Error("load an OCIO config first");
699
699
  if (!e.config) throw Error("OCIO runtime exposes no Config handle");
700
700
  return e.config;
@@ -719,11 +719,11 @@ function at({ source: e, display: t, view: n, look: r, context: i }) {
719
719
  });
720
720
  }
721
721
  function ot({ texture: e, size: t, minEv: n, maxEv: r }) {
722
- let i = t - 1, a = r - n, o = (t) => ce(e, b(t, S(0), S(i))).rgb;
723
- return ie(([e, r]) => {
724
- let s = b(oe(se(se(e.mul(r), C(0)), C(1e-10))).sub(x(n)).div(x(a)), C(0), C(1)).mul(x(i)).toVar(), c = b(S(ae(s)), S(0), S(t - 2)).toVar(), l = b(s.sub(C(c)), C(0), C(1)).toVar(), u = C(0).toVar(), d = S(0).toVar(), f = S(0).toVar(), p = S(1).toVar();
725
- y(l.x.greaterThan(l.y), () => {
726
- y(l.y.greaterThan(l.z), () => {
722
+ let i = t - 1, a = r - n, o = (t) => ce(e, x(t, S(0), S(i))).rgb;
723
+ return re(([e, r]) => {
724
+ let s = x(oe(se(se(e.mul(r), C(0)), C(1e-10))).sub(ie(n)).div(ie(a)), C(0), C(1)).mul(ie(i)).toVar(), c = x(S(ae(s)), S(0), S(t - 2)).toVar(), l = x(s.sub(C(c)), C(0), C(1)).toVar(), u = C(0).toVar(), d = S(0).toVar(), f = S(0).toVar(), p = S(1).toVar();
725
+ b(l.x.greaterThan(l.y), () => {
726
+ b(l.y.greaterThan(l.z), () => {
727
727
  u.assign(C(l.x, l.y, l.z)), d.assign(S(1, 0, 0)), f.assign(S(1, 1, 0)), p.assign(S(1, 1, 1));
728
728
  }).ElseIf(l.x.greaterThan(l.z), () => {
729
729
  u.assign(C(l.x, l.z, l.y)), d.assign(S(1, 0, 0)), f.assign(S(1, 0, 1)), p.assign(S(1, 1, 1));
@@ -731,7 +731,7 @@ function ot({ texture: e, size: t, minEv: n, maxEv: r }) {
731
731
  u.assign(C(l.z, l.x, l.y)), d.assign(S(0, 0, 1)), f.assign(S(1, 0, 1)), p.assign(S(1, 1, 1));
732
732
  });
733
733
  }).Else(() => {
734
- y(l.z.greaterThan(l.y), () => {
734
+ b(l.z.greaterThan(l.y), () => {
735
735
  u.assign(C(l.z, l.y, l.x)), d.assign(S(0, 0, 1)), f.assign(S(0, 1, 1)), p.assign(S(1, 1, 1));
736
736
  }).ElseIf(l.z.greaterThan(l.x), () => {
737
737
  u.assign(C(l.y, l.z, l.x)), d.assign(S(0, 1, 0)), f.assign(S(0, 1, 1)), p.assign(S(1, 1, 1));
@@ -744,7 +744,7 @@ function ot({ texture: e, size: t, minEv: n, maxEv: r }) {
744
744
  });
745
745
  }
746
746
  function st({ display: e, view: n, look: r = null, context: i = null, source: a = null, size: o = 65, minEv: s = $e, maxEv: c = et, id: l = null, name: u = null } = {}) {
747
- let d = M();
747
+ let d = N();
748
748
  if (!d) throw Error("load an OCIO config first");
749
749
  let f = d.roles.find((e) => e.name === "scene_linear")?.colorSpace, p = a ?? f;
750
750
  if (!p) throw Error("config has no scene_linear role — pass an explicit source space");
@@ -752,7 +752,7 @@ function st({ display: e, view: n, look: r = null, context: i = null, source: a
752
752
  let m = (d.viewsByDisplay[e] ?? []).map((e) => e.name);
753
753
  if (!m.includes(n)) throw Error(`display "${e}" has no view "${n}" — has ${m.join(", ")}`);
754
754
  if (r && !d.looks.some((e) => e.name === r)) throw Error(`config has no look "${r}" — has ${d.looks.map((e) => e.name).join(", ")}`);
755
- _e(e) === null && nt?.warn(t.VIEW_TRANSFORM_DISPLAY_MISMATCH, `"${e}" is not an sRGB-class SDR display, which is all the canvas is configured for — its view will be shown clipped or in the wrong gamut on screen, though a saved buffer is right`, {
755
+ w(e) === null && nt?.warn(t.VIEW_TRANSFORM_DISPLAY_MISMATCH, `"${e}" is not an sRGB-class SDR display, which is all the canvas is configured for — its view will be shown clipped or in the wrong gamut on screen, though a saved buffer is right`, {
756
756
  display: e,
757
757
  view: n
758
758
  });
@@ -829,8 +829,8 @@ function lt({ id: e, name: t, half: n, error: r, ocio: i }) {
829
829
  size: a,
830
830
  minEv: o,
831
831
  maxEv: s
832
- }), l = e ?? f(), u = `TM_OCIO_${l}`, d = `tm_ocio_${l}`, p = X.get(l), m = p && p.size === a && p.minEv === o && p.maxEv === s, h, g;
833
- return m ? (h = p.texture, h.image.data = n, h.needsUpdate = !0, g = p.tsl) : (p?.texture.dispose(), h = new ue(n, a, a, a), h.format = he, h.type = de, h.minFilter = pe, h.magFilter = pe, h.wrapS = h.wrapT = h.wrapR = le, h.needsUpdate = !0, g = ot({
832
+ }), l = e ?? m(), u = `TM_OCIO_${l}`, d = `tm_ocio_${l}`, f = X.get(l), p = f && f.size === a && f.minEv === o && f.maxEv === s, h, g;
833
+ return p ? (h = f.texture, h.image.data = n, h.needsUpdate = !0, g = f.tsl) : (f?.texture.dispose(), h = new ue(n, a, a, a), h.format = he, h.type = de, h.minFilter = pe, h.magFilter = pe, h.wrapS = h.wrapT = h.wrapR = le, h.needsUpdate = !0, g = ot({
834
834
  texture: h,
835
835
  size: a,
836
836
  minEv: o,
@@ -868,10 +868,10 @@ function lt({ id: e, name: t, half: n, error: r, ocio: i }) {
868
868
  };
869
869
  }
870
870
  function Z(e) {
871
- return u(st(e));
871
+ return te(st(e));
872
872
  }
873
873
  function ut({ display: e = null, look: n = null, context: r = null, source: i = null, size: a = 65 } = {}) {
874
- let o = M();
874
+ let o = N();
875
875
  if (!o) throw Error("load an OCIO config first");
876
876
  let s = e ?? o.defaultDisplay, c = o.viewsByDisplay[s] ?? [], l = [], u = [];
877
877
  for (let e of c) {
@@ -911,7 +911,7 @@ function dt(e) {
911
911
  t && (t.texture.dispose(), X.delete(e));
912
912
  }
913
913
  function ft(e = null) {
914
- for (let t of g.values()) t.source === "ocio" && !e?.has(t.id) && t.table?.texture?.dispose?.();
914
+ for (let t of d.values()) t.source === "ocio" && !e?.has(t.id) && t.table?.texture?.dispose?.();
915
915
  for (let [t, n] of X) e?.has(t) || (n.texture.dispose(), X.delete(t));
916
916
  }
917
917
  //#endregion
@@ -1011,7 +1011,7 @@ function Tt(e) {
1011
1011
  return null;
1012
1012
  }
1013
1013
  function Et() {
1014
- return M()?.fileRules.map((e) => ({
1014
+ return N()?.fileRules.map((e) => ({
1015
1015
  index: e.index,
1016
1016
  name: e.name,
1017
1017
  colorSpace: e.colorSpace,
@@ -1021,20 +1021,20 @@ function Et() {
1021
1021
  })) ?? [];
1022
1022
  }
1023
1023
  function Dt(e) {
1024
- let t = M();
1024
+ let t = N();
1025
1025
  if (!t) return null;
1026
1026
  let n = (e) => t.roles.find((t) => t.name === e)?.colorSpace ?? null;
1027
1027
  return e === me ? n("data") : e === ge ? n("texture_paint") ?? n("color_picking") ?? t.colorSpaces.find((e) => /^srgb\b/i.test(e.name) && !/display/i.test(e.name))?.name ?? null : e === fe ? t.colorSpaces.find((e) => /^lin(ear)?[\s_-]*(rec\.?\s*)?709/i.test(e.name))?.name ?? t.colorSpaces.find((e) => /^linear.*srgb/i.test(e.name))?.name ?? n("scene_linear") : null;
1028
1028
  }
1029
1029
  function Ot(e, { threeColorSpace: t = null } = {}) {
1030
- if (!M()) return null;
1030
+ if (!N()) return null;
1031
1031
  let n = Tt(e);
1032
1032
  if (n) return {
1033
1033
  colorSpace: n,
1034
1034
  via: "override",
1035
1035
  rule: null
1036
1036
  };
1037
- let r = j();
1037
+ let r = M();
1038
1038
  if (r && e) {
1039
1039
  let t = r.matchFileRule(e);
1040
1040
  if (t && !t.isDefaultRule && Y(t.colorSpace)) return {
@@ -1052,7 +1052,7 @@ function Ot(e, { threeColorSpace: t = null } = {}) {
1052
1052
  via: "three",
1053
1053
  rule: null
1054
1054
  };
1055
- let a = j();
1055
+ let a = M();
1056
1056
  if (a && e) {
1057
1057
  let t = a.matchFileRule(e);
1058
1058
  if (t && Y(t.colorSpace)) return {
@@ -1077,7 +1077,7 @@ function At(e, t) {
1077
1077
  return t ?? e.userData?.sourcePath ?? (e.name || null) ?? e.image?.src ?? null;
1078
1078
  }
1079
1079
  function jt(e, t = null) {
1080
- if (!M() || !e) return null;
1080
+ if (!N() || !e) return null;
1081
1081
  let n = e.userData?.ocioColorSpace;
1082
1082
  return n ? Y(n) ? {
1083
1083
  colorSpace: n,
@@ -1091,7 +1091,7 @@ function Mt(e, t = null) {
1091
1091
  //#endregion
1092
1092
  //#region src/Color/ColorManagement.js
1093
1093
  function Nt(e) {
1094
- return _e(e) ?? "srgb";
1094
+ return w(e) ?? "srgb";
1095
1095
  }
1096
1096
  var Pt = [
1097
1097
  "Linear Rec.709 (sRGB)",
@@ -1115,8 +1115,8 @@ function It(e) {
1115
1115
  }
1116
1116
  var Lt = class {
1117
1117
  constructor({ issues: e = null, renderer: t = null } = {}) {
1118
- 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 = ne, this._fingerprint = null, rt(e), this._offRegistry = p(() => {
1119
- this._renderer && ee(this._renderer), this._emit("transforms");
1118
+ 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 = ee, this._fingerprint = null, rt(e), this._offRegistry = ne(() => {
1119
+ this._renderer && v(this._renderer), this._emit("transforms");
1120
1120
  }), o(this);
1121
1121
  }
1122
1122
  on(e, t) {
@@ -1130,22 +1130,22 @@ var Lt = class {
1130
1130
  });
1131
1131
  }
1132
1132
  static async listBuiltinConfigs() {
1133
- return await xe();
1133
+ return await be();
1134
1134
  }
1135
1135
  async loadConfig({ adoptWorkingSpace: e = !1, registerViews: n = !0, display: r = null, lutSize: i, ...a } = {}) {
1136
- await be();
1136
+ await ye();
1137
1137
  let o = yt(a).catch(() => null), s = await this._bakedViewsFrom(a.builtin ?? a.id ?? null, o), c;
1138
1138
  try {
1139
- c = await Se(a);
1139
+ c = await xe(a);
1140
1140
  } catch (e) {
1141
1141
  throw this._issues?.warn(t.COLOR_CONFIG_LOAD_FAILED, `colour config failed to load; the previous one stays in effect: ${e.message}`, {
1142
1142
  builtin: a.builtin ?? null,
1143
1143
  configPath: a.configPath ?? null
1144
1144
  }), e;
1145
1145
  }
1146
- this._releaseViews(new Set(s.filter((e) => e.ocio.baked.ocioVersion === c.ocioVersion).map((e) => e.id))), this._fingerprint = o, xt(), W(), this._context = null;
1146
+ this._releaseViews(new Set(s.filter((e) => e.ocio.baked.ocioVersion === c.ocioVersion).map((e) => e.id))), this._fingerprint = o, xt(), G(), this._context = null;
1147
1147
  let l = this._workingSpace;
1148
- if (e ? this._workingSpace = c.sceneLinear : l && !Y(l) && (this._workingSpace = null), It(M()) || this._issues?.warn(t.COLOR_CONFIG_LOAD_FAILED, `"${c.id}" names no linear Rec.709 space, so until a working space is adopted its views treat the render as ${c.sceneLinear} — colours will be off by that primaries change`, { sceneLinear: c.sceneLinear }), this._publishWorkingMatrix(), this._emit("config", c), n) {
1148
+ if (e ? this._workingSpace = c.sceneLinear : l && !Y(l) && (this._workingSpace = null), It(N()) || this._issues?.warn(t.COLOR_CONFIG_LOAD_FAILED, `"${c.id}" names no linear Rec.709 space, so until a working space is adopted its views treat the render as ${c.sceneLinear} — colours will be off by that primaries change`, { sceneLinear: c.sceneLinear }), this._publishWorkingMatrix(), this._emit("config", c), n) {
1149
1149
  let e = r ?? c.defaultDisplay, { added: t, skipped: n } = ut({
1150
1150
  display: e,
1151
1151
  context: this._context,
@@ -1164,15 +1164,15 @@ var Lt = class {
1164
1164
  return (this._workingSpace ?? null) !== (l ?? null) && this._emit("workingSpace", this.workingSpace), c;
1165
1165
  }
1166
1166
  unloadConfig() {
1167
- 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(), Ce(), W(), Ct(), xt(), this._fingerprint = null, this._workingSpace = null, this._activeView = null, this._exportSpace = null, this._context = null, n(null), this._applyRendererOutputColorSpace(), this._emit("config", null), this._emit("workingSpace", this.workingSpace);
1167
+ 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(), Se(), G(), Ct(), xt(), this._fingerprint = null, this._workingSpace = null, this._activeView = null, this._exportSpace = null, this._context = null, n(null), this._applyRendererOutputColorSpace(), this._emit("config", null), this._emit("workingSpace", this.workingSpace);
1168
1168
  }
1169
1169
  _releaseViews(e = null) {
1170
- ft(e), v(e);
1170
+ ft(e), g(e);
1171
1171
  for (let t of this._lastUsed.keys()) e?.has(t) || this._lastUsed.delete(t);
1172
- this._renderer && _(this._renderer.toneMapping) === null && (this._renderer.toneMapping = _(this._lastBuiltin) ? this._lastBuiltin : ne, this._activeView = null, this._applyRendererOutputColorSpace());
1172
+ this._renderer && y(this._renderer.toneMapping) === null && (this._renderer.toneMapping = y(this._lastBuiltin) ? this._lastBuiltin : ee, this._activeView = null, this._applyRendererOutputColorSpace());
1173
1173
  }
1174
1174
  async _bakedViewsFrom(e, t) {
1175
- let n = [...g.values()].filter((t) => t.ocio?.baked && e !== null && t.ocio.configId === e);
1175
+ let n = [...d.values()].filter((t) => t.ocio?.baked && e !== null && t.ocio.configId === e);
1176
1176
  if (n.length === 0) return [];
1177
1177
  let r = await t;
1178
1178
  return r ? n.filter((e) => e.ocio.baked.fingerprint === r) : [];
@@ -1180,15 +1180,15 @@ var Lt = class {
1180
1180
  async loadBakedView(e, { expect: t = null } = {}) {
1181
1181
  let n = await vt(e);
1182
1182
  for (let [e, r] of Object.entries(t ?? {})) if ((n[e] ?? null) !== (r ?? null)) throw Error(`baked view has ${e} "${n[e]}", expected "${r}"`);
1183
- let r = N();
1183
+ let r = P();
1184
1184
  if (r && (r.id !== n.configId || await this._fingerprint !== n.fingerprint)) throw Error(`baked view is from "${n.configId}", not the loaded "${r.id}"`);
1185
- let i = [...g.values()].find((e) => e.source === "ocio" && e.ocio.display === n.display && e.ocio.view === n.view && (e.ocio.look ?? null) === (n.look ?? null));
1186
- return i || this._makeRoomForTable(), u(ct(n, i?.id ?? null));
1185
+ 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));
1186
+ return i || this._makeRoomForTable(), te(ct(n, i?.id ?? null));
1187
1187
  }
1188
1188
  async saveBakedView(e) {
1189
- let t = _(e);
1189
+ let t = y(e);
1190
1190
  if (t?.source !== "ocio") throw Error(`no OCIO view with id ${e}`);
1191
- let n = N();
1191
+ let n = P();
1192
1192
  return await _t(t, {
1193
1193
  configId: n?.id ?? t.ocio.configId,
1194
1194
  fingerprint: (n ? await this._fingerprint : null) ?? t.ocio.baked?.fingerprint ?? null,
@@ -1196,35 +1196,35 @@ var Lt = class {
1196
1196
  });
1197
1197
  }
1198
1198
  get hasConfig() {
1199
- return A();
1199
+ return j();
1200
1200
  }
1201
1201
  describe() {
1202
- return N();
1202
+ return P();
1203
1203
  }
1204
1204
  get workingSpace() {
1205
- return this._workingSpace ? this._workingSpace : A() ? this.nativeLinearSpace ?? N()?.sceneLinear ?? "Linear Rec.709 (sRGB)" : c;
1205
+ return this._workingSpace ? this._workingSpace : j() ? this.nativeLinearSpace ?? P()?.sceneLinear ?? "Linear Rec.709 (sRGB)" : c;
1206
1206
  }
1207
1207
  get workingSpaceAdopted() {
1208
1208
  return this._workingSpace !== null;
1209
1209
  }
1210
1210
  setWorkingSpace(e) {
1211
1211
  if (e !== null) {
1212
- if (!A()) throw Error("load an OCIO config before choosing a working space");
1212
+ if (!j()) throw Error("load an OCIO config before choosing a working space");
1213
1213
  if (!Y(e)) throw Error(`config has no colour space "${e}"`);
1214
1214
  }
1215
- (this._workingSpace ?? null) !== (e ?? null) && (this._workingSpace = e, z(), this._publishWorkingMatrix(), this._rebakeViews(), this._emit("workingSpace", this.workingSpace));
1215
+ (this._workingSpace ?? null) !== (e ?? null) && (this._workingSpace = e, B(), this._publishWorkingMatrix(), this._rebakeViews(), this._emit("workingSpace", this.workingSpace));
1216
1216
  }
1217
1217
  matrixToWorking(e) {
1218
- return A() ? ze(e, this.workingSpace, { context: this._context }) : null;
1218
+ return j() ? ze(e, this.workingSpace, { context: this._context }) : null;
1219
1219
  }
1220
1220
  listViews() {
1221
- return re();
1221
+ return p();
1222
1222
  }
1223
1223
  get activeView() {
1224
1224
  return this._activeView;
1225
1225
  }
1226
1226
  setActiveView(e) {
1227
- let t = _(e);
1227
+ let t = y(e);
1228
1228
  if (!t) throw Error(`no view transform with id ${e}`);
1229
1229
  return this._isStale(t) && (t = this._rebakeView(t) ?? t), this._activeView = t.source === "ocio" ? {
1230
1230
  ...t.ocio,
@@ -1233,8 +1233,8 @@ var Lt = class {
1233
1233
  } : null, this._lastUsed.set(e, ++this._useClock), t.source === "builtin" && (this._lastBuiltin = e), this._renderer && (this._renderer.toneMapping = e), this._applyRendererOutputColorSpace(), this._emit("view", t), t;
1234
1234
  }
1235
1235
  setView({ display: e, view: t, look: n = null, size: r } = {}) {
1236
- if (!A()) throw Error("load an OCIO config first");
1237
- let i = [...g.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));
1236
+ if (!j()) throw Error("load an OCIO config first");
1237
+ 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));
1238
1238
  i || this._makeRoomForTable();
1239
1239
  let a = i ?? Z({
1240
1240
  display: e,
@@ -1244,11 +1244,11 @@ var Lt = class {
1244
1244
  source: this.workingSpace,
1245
1245
  ...r ? { size: r } : {}
1246
1246
  });
1247
- return this.setActiveView(a.id), _(a.id);
1247
+ return this.setActiveView(a.id), y(a.id);
1248
1248
  }
1249
1249
  _makeRoomForTable() {
1250
- if (te() < 12) return;
1251
- let e = this._renderer?.toneMapping ?? this._activeView?.id ?? null, t = [...g.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];
1250
+ if (f() < 12) return;
1251
+ 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];
1252
1252
  t && (dt(t.id), h(t.id), this._lastUsed.delete(t.id));
1253
1253
  }
1254
1254
  setLook(e) {
@@ -1260,13 +1260,13 @@ var Lt = class {
1260
1260
  }
1261
1261
  setContext(e) {
1262
1262
  let t = e && Object.keys(e).length ? { ...e } : null;
1263
- JSON.stringify(t) !== JSON.stringify(this._context) && (this._context = t, A() && (this._context && j()?.invalidateContext(this._context), z(), this._rebakeViews()), this._emit("context", this._context));
1263
+ JSON.stringify(t) !== JSON.stringify(this._context) && (this._context = t, j() && (this._context && M()?.invalidateContext(this._context), B(), this._rebakeViews()), this._emit("context", this._context));
1264
1264
  }
1265
1265
  get context() {
1266
1266
  return this._context;
1267
1267
  }
1268
1268
  _isStale(e) {
1269
- return e.source !== "ocio" || !A() ? !1 : e.ocio.source !== this.workingSpace || JSON.stringify(e.ocio.context ?? null) !== JSON.stringify(this._context ?? null);
1269
+ return e.source !== "ocio" || !j() ? !1 : e.ocio.source !== this.workingSpace || JSON.stringify(e.ocio.context ?? null) !== JSON.stringify(this._context ?? null);
1270
1270
  }
1271
1271
  _rebakeView(e) {
1272
1272
  try {
@@ -1287,7 +1287,7 @@ var Lt = class {
1287
1287
  }
1288
1288
  }
1289
1289
  _rebakeViews() {
1290
- let e = this._renderer?.toneMapping ?? this._activeView?.id ?? null, t = e === null ? null : _(e);
1290
+ let e = this._renderer?.toneMapping ?? this._activeView?.id ?? null, t = e === null ? null : y(e);
1291
1291
  if (!t || !this._isStale(t)) return;
1292
1292
  let n = this._rebakeView(t);
1293
1293
  n && (this._activeView = {
@@ -1297,13 +1297,13 @@ var Lt = class {
1297
1297
  });
1298
1298
  }
1299
1299
  attachRenderer(e) {
1300
- this._renderer = e, _(e.toneMapping)?.source === "builtin" && (this._lastBuiltin = e.toneMapping);
1301
- let t = ee(e);
1300
+ this._renderer = e, y(e.toneMapping)?.source === "builtin" && (this._lastBuiltin = e.toneMapping);
1301
+ let t = v(e);
1302
1302
  return this._applyRendererOutputColorSpace(), t;
1303
1303
  }
1304
1304
  _applyRendererOutputColorSpace() {
1305
1305
  if (!this._renderer) return;
1306
- let e = _(this._renderer.toneMapping);
1306
+ let e = y(this._renderer.toneMapping);
1307
1307
  this._renderer.outputColorSpace = e?.outputEncoded ? fe : ge, this._applyCanvasColorSpace(e?.source === "ocio" ? Nt(e.ocio.display) : "srgb");
1308
1308
  }
1309
1309
  _applyCanvasColorSpace(e) {
@@ -1337,7 +1337,7 @@ var Lt = class {
1337
1337
  }
1338
1338
  describeTextureSpace(e) {
1339
1339
  let t = e?.userData ?? {}, n = t.ocioColorSpace ?? t.__rayzeeColorSpaceChoice ?? null, r = null, i = t.__rayzeeOriginalColorSpace ?? e?.colorSpace;
1340
- return A() && (r = jt({
1340
+ return j() && (r = jt({
1341
1341
  ...e,
1342
1342
  name: e?.name,
1343
1343
  image: e?.image,
@@ -1352,7 +1352,7 @@ var Lt = class {
1352
1352
  };
1353
1353
  }
1354
1354
  get inputKey() {
1355
- return A() ? `${N()?.id}|${this.workingSpace}|${bt()}|${JSON.stringify(this._context)}` : "-";
1355
+ return j() ? `${P()?.id}|${this.workingSpace}|${bt()}|${JSON.stringify(this._context)}` : "-";
1356
1356
  }
1357
1357
  overrideInput(e, t) {
1358
1358
  St(e, t);
@@ -1361,17 +1361,17 @@ var Lt = class {
1361
1361
  return Et();
1362
1362
  }
1363
1363
  toWorkingPixels(e, t) {
1364
- return !A() || !t ? e : K(e, t, this.workingSpace, { context: this._context });
1364
+ return !j() || !t ? e : K(e, t, this.workingSpace, { context: this._context });
1365
1365
  }
1366
1366
  get nativeLinearSpace() {
1367
- return It(M());
1367
+ return It(N());
1368
1368
  }
1369
1369
  _publishWorkingMatrix() {
1370
1370
  let e = s();
1371
- e !== null && e !== this || n(A() ? this.primariesMatrixToWorking() : null, this.workingSpace);
1371
+ e !== null && e !== this || n(j() ? this.primariesMatrixToWorking() : null, this.workingSpace);
1372
1372
  }
1373
1373
  primariesMatrixToWorking() {
1374
- if (!A() || !this.workingSpaceAdopted) return null;
1374
+ if (!j() || !this.workingSpaceAdopted) return null;
1375
1375
  let e = this.nativeLinearSpace;
1376
1376
  if (!e || e === this.workingSpace) return null;
1377
1377
  let t = ze(e, this.workingSpace, { context: this._context });
@@ -1394,7 +1394,7 @@ var Lt = class {
1394
1394
  return r(e, t, n);
1395
1395
  }
1396
1396
  convertTexturePixels(e, { space: n = null } = {}) {
1397
- if (!A()) return !1;
1397
+ if (!j()) return !1;
1398
1398
  let r = e?.image?.data;
1399
1399
  if (!r) return !1;
1400
1400
  let i = this.nativeLinearSpace, a = e.userData?.__rayzeeColorSpace ?? n ?? i, o = this.workingSpaceAdopted ? this.workingSpace : i;
@@ -1416,7 +1416,7 @@ var Lt = class {
1416
1416
  return e.userData = e.userData ?? {}, e.userData.__rayzeeColorSpace = o, e.needsUpdate = !0, s;
1417
1417
  }
1418
1418
  convertTextureBytes(e, { space: t = null, encoding: n = "srgb" } = {}) {
1419
- if (!A()) return !1;
1419
+ if (!j()) return !1;
1420
1420
  if (t) return t === this.workingSpace ? !1 : (Pe(e, t, this.workingSpace, {
1421
1421
  context: this._context,
1422
1422
  inputEncoding: "raw",
@@ -1426,28 +1426,28 @@ var Lt = class {
1426
1426
  return r ? (Re(e, r, n), !0) : !1;
1427
1427
  }
1428
1428
  toWorkingColor(e, t) {
1429
- return !A() || !t ? [
1429
+ return !j() || !t ? [
1430
1430
  e[0],
1431
1431
  e[1],
1432
1432
  e[2]
1433
- ] : G(e, t, this.workingSpace, { context: this._context });
1433
+ ] : Oe(e, t, this.workingSpace, { context: this._context });
1434
1434
  }
1435
1435
  convert(e, t, n) {
1436
- return G(e, t, n, { context: this._context });
1436
+ return Oe(e, t, n, { context: this._context });
1437
1437
  }
1438
1438
  get exportSpace() {
1439
1439
  return this._exportSpace;
1440
1440
  }
1441
1441
  setExportSpace(e) {
1442
1442
  if (e != null) {
1443
- if (!A()) throw Error("load an OCIO config before choosing an export space");
1443
+ if (!j()) throw Error("load an OCIO config before choosing an export space");
1444
1444
  if (!Y(e)) throw Error(`config has no colour space "${e}"`);
1445
1445
  }
1446
1446
  this._exportSpace = e ?? null, this._emit("export", this._exportSpace);
1447
1447
  }
1448
1448
  exportPixels(e, t = void 0) {
1449
1449
  let n = t === void 0 ? this._exportSpace : t;
1450
- return !n || !A() ? {
1450
+ return !n || !j() ? {
1451
1451
  rgba: e,
1452
1452
  colorSpace: this.workingSpace
1453
1453
  } : (K(e, this.workingSpace, n, { context: this._context }), {
@@ -1456,7 +1456,7 @@ var Lt = class {
1456
1456
  });
1457
1457
  }
1458
1458
  status() {
1459
- let e = N(), t = this._renderer ? _(this._renderer.toneMapping) : null;
1459
+ let e = P(), t = this._renderer ? y(this._renderer.toneMapping) : null;
1460
1460
  return {
1461
1461
  config: e,
1462
1462
  workingSpace: this.workingSpace,
@@ -1469,8 +1469,8 @@ var Lt = class {
1469
1469
  activeView: this._activeView,
1470
1470
  context: this._context,
1471
1471
  exportSpace: this._exportSpace,
1472
- views: re(),
1473
- registryVersion: d(),
1472
+ views: p(),
1473
+ registryVersion: _(),
1474
1474
  bakeError: t?.error ?? null
1475
1475
  };
1476
1476
  }
@@ -1478,11 +1478,11 @@ var Lt = class {
1478
1478
  this._offRegistry?.(), this._listeners.clear(), this._releaseViews(), rt(null), this._renderer = null, this._issues = null, s() === this && (n(null), a(null));
1479
1479
  }
1480
1480
  static resetAll() {
1481
- a(null), n(null), ft(), m(), W(), Ct(), Ee();
1481
+ a(null), n(null), ft(), u(), G(), Ct(), Te();
1482
1482
  }
1483
1483
  };
1484
1484
  function Rt() {
1485
- return A();
1485
+ return j();
1486
1486
  }
1487
1487
  //#endregion
1488
- export { _e as A, Pe as C, Be as D, Y as E, Ae as O, G as S, ze as T, st as _, Ct as a, Qe as b, wt as c, Mt as d, tt as f, Z as g, ut as h, Rt as i, ke as k, Ot as l, $e as m, Nt as n, kt as o, et as p, It as r, Et as s, Lt as t, St as u, We as v, K as w, Re as x, Xe as y };
1488
+ export { w as A, Pe as C, Be as D, Y as E, Ae as O, Oe as S, ze as T, st as _, Ct as a, Qe as b, wt as c, Mt as d, tt as f, Z as g, ut as h, Rt as i, ke as k, Ot as l, $e as m, Nt as n, kt as o, et as p, It as r, Et as s, Lt as t, St as u, We as v, K as w, Re as x, Xe as y };