rayzee 11.7.0 → 11.8.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 (59) hide show
  1. package/README.md +13 -0
  2. package/dist/{ArchiveImporter-DYcRXeKE.js → ArchiveImporter-_sJm5uaK.js} +1923 -1243
  3. package/dist/{BidirectionalIntegrator-BvjRpbTP.js → BidirectionalIntegrator-Dzt4Z97x.js} +290 -289
  4. package/dist/{ColorManagement-oeEk7oSu.js → ColorManagement-30MfpHwQ.js} +1 -1
  5. package/dist/{EngineIssues-CIZnXHsF.js → EngineIssues-xljoXM0E.js} +18 -8
  6. package/dist/{NeuralRetouch-ClaMiKYg.js → NeuralRetouch-BKQCsmEs.js} +2 -2
  7. package/dist/{NeuralSuperRes-WNEXun9s.js → NeuralSuperRes-C4ymq68e.js} +2 -2
  8. package/dist/{PathTracer-B9wZPPVL.js → PathTracer-C_to_i40.js} +3156 -3098
  9. package/dist/{PhysicalSky-DcjItqKi.js → PhysicalSky-bMHbm_7H.js} +1 -1
  10. package/dist/{RayzeeRenderer-p-NeE6E2.js → RayzeeRenderer-B_aB6VTJ.js} +370 -371
  11. package/dist/SceneMetadata-CSmlJW4c.js +183 -0
  12. package/dist/{ToneMapGPU-sAs8wdgI.js → ToneMapGPU-4GPwoG_c.js} +13 -6
  13. package/dist/addons/archives.es.js +1 -1
  14. package/dist/addons/bidirectional.es.js +1 -1
  15. package/dist/addons/color.es.js +1 -1
  16. package/dist/addons/physical-sky.es.js +1 -1
  17. package/dist/addons/storage.es.js +1 -1
  18. package/dist/{openStorage-Fe9BoS1_.js → openStorage-B085D9FR.js} +1 -1
  19. package/dist/rayzee-core.es.js +5 -5
  20. package/dist/rayzee.es.js +815 -796
  21. package/dist/rayzee.umd.js +106 -102
  22. package/dist/{sceneCachePolicy-B9w3BnaP.js → sceneCachePolicy-D_uBSbQF.js} +2 -2
  23. package/package.json +1 -1
  24. package/src/EngineIssues.js +20 -6
  25. package/src/Passes/AIUpscaler.js +4 -0
  26. package/src/Passes/OIDNDenoiser.js +8 -6
  27. package/src/PathTracerApp.js +10 -1
  28. package/src/Processor/ArchiveImporter.js +23 -6
  29. package/src/Processor/AssetLoader.js +15 -0
  30. package/src/Processor/LightSerializer.js +6 -2
  31. package/src/Processor/PBRT/PBRTMaterials.js +2 -1
  32. package/src/Processor/PBRT/PBRTSceneBuilder.js +1 -1
  33. package/src/Processor/PlatformImageLoader.js +9 -0
  34. package/src/Processor/TextureCreator.js +44 -4
  35. package/src/Processor/ToneMapCPU.js +34 -5
  36. package/src/Processor/ToneMapGPU.js +15 -9
  37. package/src/Processor/USD/USDScene.js +981 -17
  38. package/src/RayzeeRenderer.js +81 -26
  39. package/src/Stages/AutoExposure.js +21 -8
  40. package/src/Stages/Compositor.js +39 -1
  41. package/src/Stages/LocalExposure.js +44 -18
  42. package/src/Stages/NormalDepth.js +7 -3
  43. package/src/Stages/PathTracer.js +25 -1
  44. package/src/Stages/PathTracerStage.js +9 -1
  45. package/src/TSL/CameraRay.js +12 -1
  46. package/src/TSL/DebugKernel.js +3 -2
  47. package/src/TSL/FinalWriteKernel.js +4 -7
  48. package/src/TSL/GenerateKernel.js +6 -2
  49. package/src/TSL/LightSplatKernel.js +7 -4
  50. package/src/TSL/LightsCore.js +6 -2
  51. package/src/TSL/LightsSampling.js +45 -12
  52. package/src/TSL/SceneResources.js +11 -0
  53. package/src/TSL/ShadeKernel.js +1 -2
  54. package/src/integrators/BidirectionalIntegrator.js +1 -0
  55. package/src/managers/CameraManager.js +9 -0
  56. package/src/managers/DenoisingManager.js +1 -0
  57. package/src/managers/InteractionManager.js +6 -0
  58. package/src/managers/UniformManager.js +3 -1
  59. package/dist/SceneMetadata-D2Sh-0e-.js +0 -110
@@ -0,0 +1,183 @@
1
+ import { x as e } from "./sceneCachePolicy-D_uBSbQF.js";
2
+ import { DataTexture as t, LoaderUtils as n, RGBAFormat as r, UnsignedByteType as i } from "three";
3
+ //#region src/Processor/archiveFormats.js
4
+ var a = Object.freeze({
5
+ zip: {
6
+ type: "archive",
7
+ name: "ZIP Archive"
8
+ },
9
+ gz: {
10
+ type: "archive",
11
+ name: "Gzipped TAR Archive"
12
+ },
13
+ tgz: {
14
+ type: "archive",
15
+ name: "Gzipped TAR Archive"
16
+ },
17
+ tar: {
18
+ type: "archive",
19
+ name: "TAR Archive"
20
+ }
21
+ }), o = (e) => typeof Blob < "u" && e instanceof Blob, s = (e) => !!e && typeof e == "object" && !o(e) && e.files != null, c = (e) => e.startsWith(".") || e === "__MACOSX";
22
+ function l({ name: e = null, files: t }, { isModel: n = () => !1 } = {}) {
23
+ let r = /* @__PURE__ */ new Map();
24
+ for (let e of t) {
25
+ let t = o(e) ? e : e.file, n = o(e) ? e.webkitRelativePath || e.name : e.path, i = String(n ?? "").replace(/\\/g, "/").split("/").filter((e) => e && e !== ".").join("/");
26
+ !i || !t || i.split("/").some(c) || r.set(i, {
27
+ path: i,
28
+ file: t
29
+ });
30
+ }
31
+ let i = [...r.values()].sort((e, t) => e.path < t.path ? -1 : +(e.path > t.path)), a = i[0]?.path.split("/")[0], s = i.length > 0 && i.every((e) => e.path.startsWith(a + "/")) ? a : null;
32
+ return {
33
+ name: e ?? s ?? (i.find((e) => n(e.path)) ?? i[0])?.path.split("/").pop() ?? "Folder",
34
+ files: i,
35
+ flat: s === null && i.every((e) => !e.path.includes("/"))
36
+ };
37
+ }
38
+ //#endregion
39
+ //#region src/Processor/PlatformImageLoader.js
40
+ var u = [
41
+ [/\.jpe?g(\?|#|$)/i, "image/jpeg"],
42
+ [/\.webp(\?|#|$)/i, "image/webp"],
43
+ [/\.avif(\?|#|$)/i, "image/avif"]
44
+ ];
45
+ function d(e) {
46
+ return e.mimeType ? e.mimeType : e.uri?.startsWith("data:") ? e.uri.slice(5, e.uri.indexOf(";")) : u.find(([t]) => t.test(e.uri ?? ""))?.[1] ?? "image/png";
47
+ }
48
+ function f(e) {
49
+ for (let t = 8; t + 12 <= e.length;) {
50
+ let n = (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0, r = t + 12 + n;
51
+ if (e[t + 4] === 73 && e[t + 5] === 69 && e[t + 6] === 78 && e[t + 7] === 68) return e.subarray(0, r);
52
+ t = r;
53
+ }
54
+ return e;
55
+ }
56
+ function p({ data: e, width: n, height: a }, { shared: o = !1 } = {}) {
57
+ let s = new Uint8Array(e.buffer, e.byteOffset, n * a * 4), c = s;
58
+ o && typeof SharedArrayBuffer < "u" && !(s.buffer instanceof SharedArrayBuffer) && (c = new Uint8Array(new SharedArrayBuffer(s.byteLength)), c.set(s));
59
+ let l = new t(c, n, a, r, i);
60
+ return l.needsUpdate = !0, l;
61
+ }
62
+ function m(t, n) {
63
+ return e().decodeImage(n === "image/png" ? f(t) : t, n);
64
+ }
65
+ async function h(e) {
66
+ let t = await fetch(e);
67
+ if (!t.ok) throw Error(`HTTP ${t.status}`);
68
+ return new Uint8Array(await t.arrayBuffer());
69
+ }
70
+ function g(e, t) {
71
+ return t.bufferView === void 0 ? h(e.options.manager.resolveURL(n.resolveURL(t.uri, e.options.path))) : e.getDependency("bufferView", t.bufferView).then((e) => new Uint8Array(e));
72
+ }
73
+ var _ = (e, t) => !!t && t !== e.textureLoader && typeof t.parse == "function";
74
+ function v(e, t, n) {
75
+ if (e.sourceCache[t] !== void 0) return e.sourceCache[t].then((e) => e.clone());
76
+ let r = g(e, e.json.images[t]).then((e) => new Promise((t, r) => {
77
+ n.parse(e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength), t, r);
78
+ }));
79
+ return e.sourceCache[t] = r, r;
80
+ }
81
+ async function y(e, t = d({ uri: e })) {
82
+ let n = p(await m(await h(e), t));
83
+ return n.flipY = !0, n;
84
+ }
85
+ async function b(e, t) {
86
+ let n = p(await m(e, d({ uri: t })), { shared: !0 });
87
+ return n.flipY = !0, n;
88
+ }
89
+ function x(e, t = null) {
90
+ return e.loadImageSource = function(e, n) {
91
+ if (_(this, n)) return v(this, e, n);
92
+ let r = this.json.images[e], i = /* @__PURE__ */ Error("no image decoder in this runtime: configurePlatform( nodePlatform( { decodeImage } ) ) — see \"Running in Node\"");
93
+ return t?.(r.uri ?? `bufferView ${r.bufferView}`, i), Promise.reject(i);
94
+ }, { name: "RAYZEE_missing_image_decoder" };
95
+ }
96
+ function S(e, t = null) {
97
+ return e.loadImageSource = function(e, n) {
98
+ if (_(this, n)) return v(this, e, n);
99
+ if (this.sourceCache[e] !== void 0) return this.sourceCache[e].then((e) => e.clone());
100
+ let r = this.json.images[e], i = d(r), a = r.uri ?? `bufferView ${r.bufferView}`, o = g(this, r).then((e) => m(e, i)).then((e) => {
101
+ let t = p(e, { shared: !0 });
102
+ return r.extras && typeof r.extras == "object" && Object.assign(t.userData, r.extras), t.userData.mimeType = i, t;
103
+ }).catch((e) => {
104
+ throw t?.(a, e), e;
105
+ });
106
+ return this.sourceCache[e] = o, o;
107
+ }, { name: "RAYZEE_platform_images" };
108
+ }
109
+ //#endregion
110
+ //#region src/Processor/SceneMetadata.js
111
+ var C = [
112
+ "sourceFile",
113
+ "url",
114
+ "file"
115
+ ];
116
+ function w(e) {
117
+ if (typeof e == "string") try {
118
+ let t = JSON.parse(e);
119
+ return t && typeof t == "object" ? t : null;
120
+ } catch {
121
+ return null;
122
+ }
123
+ return e && typeof e == "object" ? e : null;
124
+ }
125
+ function T(e) {
126
+ let t = typeof e == "string" ? parseFloat(e) : e;
127
+ return Number.isFinite(t) ? t : void 0;
128
+ }
129
+ function E(e) {
130
+ let t = w(e);
131
+ if (!t) return null;
132
+ let n = (e) => e && (e.environment !== void 0 || e.render !== void 0), r = w(t.rayzee);
133
+ return n(r) ? r : n(t) ? t : null;
134
+ }
135
+ function D(e) {
136
+ let t = w(e);
137
+ if (!t) return null;
138
+ let n = C.map((e) => t[e]).find((e) => typeof e == "string" && e.trim());
139
+ if (!n) return null;
140
+ let r = T(t.rotation), i = T(t.intensity), a = { sourceFile: n.trim() };
141
+ return r !== void 0 && (a.rotation = r), i !== void 0 && (a.intensity = Math.max(0, i)), a;
142
+ }
143
+ var O = [
144
+ "maxBounces",
145
+ "samples",
146
+ "width",
147
+ "height"
148
+ ];
149
+ function k(e) {
150
+ let t = w(e);
151
+ if (!t) return null;
152
+ let n = {};
153
+ for (let e of O) {
154
+ let r = T(t[e]);
155
+ r !== void 0 && r > 0 && (n[e] = Math.round(r));
156
+ }
157
+ return Object.keys(n).length ? n : null;
158
+ }
159
+ function A(e) {
160
+ let t = E(e);
161
+ if (!t) return null;
162
+ let n = D(t.environment), r = k(t.render);
163
+ return !n && !r ? null : {
164
+ ...n ? { environment: n } : {},
165
+ ...r ? { render: r } : {}
166
+ };
167
+ }
168
+ function j(e) {
169
+ if (!e) return null;
170
+ let t = [
171
+ e.userData,
172
+ e.asset?.extras,
173
+ e.scene?.userData
174
+ ];
175
+ Array.isArray(e.scenes) && t.push(...e.scenes.map((e) => e?.userData));
176
+ for (let e of t) {
177
+ let t = A(e);
178
+ if (t) return t;
179
+ }
180
+ return null;
181
+ }
182
+ //#endregion
183
+ export { b as a, s as c, x as i, l, A as n, S as o, y as r, a as s, j as t };
@@ -31,6 +31,7 @@ struct Params {
31
31
  exposure: f32,
32
32
  saturation: f32,
33
33
  alpha: u32,
34
+ backdrop: f32,
34
35
  };
35
36
 
36
37
  @group(0) @binding(2) var<uniform> params: Params;
@@ -49,7 +50,10 @@ fn main( @builtin(global_invocation_id) gid: vec3<u32> ) {
49
50
 
50
51
  let linear = rayzee_source( gid.x, srcY );
51
52
  let uv = vec2<f32>( ( f32( gid.x ) + 0.5 ) / f32( params.width ), ( f32( gid.y ) + 0.5 ) / f32( params.height ) );
52
- let rgb = linear.rgb${r ? " * rayzee_gain( uv, linear.rgb, params.exposure )" : ""};
53
+ var g = ${r ? "rayzee_gain( uv, linear.rgb, params.exposure )" : "1.0"};
54
+ // A solid backdrop is held at its own gain, blended by the coverage in alpha (ToneMapCPU's heldGain).
55
+ if ( params.backdrop > 0.0 ) { g = g + ( params.backdrop - g ) * ( 1.0 - clamp( linear.a, 0.0, 1.0 ) ); }
56
+ let rgb = linear.rgb * g;
53
57
  rayzee_store( gid.y * params.width + gid.x, linear, rayzee_tone_map( rgb, params.mode, params.exposure, params.saturation ) );
54
58
  }
55
59
  `, l = 32, u = class {
@@ -59,7 +63,7 @@ fn main( @builtin(global_invocation_id) gid: vec3<u32> ) {
59
63
  _ensurePipeline(e = null) {
60
64
  let { wgsl: t, bindings: n, version: r } = i();
61
65
  this._shaderVersion !== r && (this._pipelines.clear(), this._bindings = n, this._shaderVersion = r);
62
- let a = e?.key ?? "", o = this._pipelines.get(a);
66
+ let a = e?.wgsl ? e.key : "", o = this._pipelines.get(a);
63
67
  return o || (o = this.device.createComputePipeline({
64
68
  label: this.label,
65
69
  layout: "auto",
@@ -132,12 +136,15 @@ fn main( @builtin(global_invocation_id) gid: vec3<u32> ) {
132
136
  }
133
137
  async _run(e, t = {}) {
134
138
  let n = t.gain;
135
- if (!n?.device || n.device === this.device) return this._dispatch(e, t);
139
+ if (!n?.wgsl || !n.device || n.device === this.device) return this._dispatch(e, t);
136
140
  let r = await n.copyTo(this.device);
137
141
  try {
138
142
  return await this._dispatch(e, {
139
143
  ...t,
140
- gain: r
144
+ gain: {
145
+ ...r,
146
+ backdrop: n.backdrop
147
+ }
141
148
  });
142
149
  } finally {
143
150
  r.destroy();
@@ -149,7 +156,7 @@ fn main( @builtin(global_invocation_id) gid: vec3<u32> ) {
149
156
  let c = this._ensurePipeline(o);
150
157
  this._ensureTables();
151
158
  let { width: l, height: u } = this, d = l * u * s[this.output];
152
- this._paramU32[0] = l, this._paramU32[1] = u, this._paramU32[2] = n >>> 0, this._paramU32[3] = +!!i, this._paramF32[4] = t, this._paramF32[5] = r, this._paramU32[6] = +!!a, this.device.queue.writeBuffer(this._params, 0, this._paramData);
159
+ this._paramU32[0] = l, this._paramU32[1] = u, this._paramU32[2] = n >>> 0, this._paramU32[3] = +!!i, this._paramF32[4] = t, this._paramF32[5] = r, this._paramU32[6] = +!!a, this._paramF32[7] = o?.backdrop > 0 ? o.backdrop : 0, this.device.queue.writeBuffer(this._params, 0, this._paramData);
153
160
  let f = [...this._tables.entries()].map(([e, t]) => ({
154
161
  binding: e,
155
162
  resource: t.view
@@ -174,7 +181,7 @@ fn main( @builtin(global_invocation_id) gid: vec3<u32> ) {
174
181
  }
175
182
  ]
176
183
  }), m = this.device.createCommandEncoder({ label: this.label }), h = m.beginComputePass();
177
- h.setPipeline(c), h.setBindGroup(0, p), o && h.setBindGroup(1, this.device.createBindGroup({
184
+ h.setPipeline(c), h.setBindGroup(0, p), o?.wgsl && h.setBindGroup(1, this.device.createBindGroup({
178
185
  layout: c.getBindGroupLayout(1),
179
186
  entries: o.entries
180
187
  })), h.dispatchWorkgroups(Math.ceil(l / 8), Math.ceil(u / 8)), h.end(), m.copyBufferToBuffer(this._storage, 0, this._map, 0, d), this.device.queue.submit([m.finish()]), await this._map.mapAsync(GPUMapMode.READ);
@@ -1,3 +1,3 @@
1
1
  import { n as e, t } from "../ZipReader-gDSWr0I5.js";
2
- import { n, t as r } from "../ArchiveImporter-DYcRXeKE.js";
2
+ import { n, t as r } from "../ArchiveImporter-_sJm5uaK.js";
3
3
  export { r as ARCHIVE_ELEMENT_PROMPT_BYTES, n as ArchiveImporter, t as openZip, e as readZipDirectory };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../BidirectionalIntegrator-BvjRpbTP.js";
1
+ import { t as e } from "../BidirectionalIntegrator-Dzt4Z97x.js";
2
2
  export { e as BidirectionalIntegrator };
@@ -1,3 +1,3 @@
1
1
  import { i as e, r as t, t as n } from "../ActiveColor-YvuQq44O.js";
2
- import { A as r, C as i, D as a, E as o, O as s, S as c, T as l, _ as u, a as d, b as f, c as p, d as m, f as h, g, h as _, i as v, k as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "../ColorManagement-oeEk7oSu.js";
2
+ import { A as r, C as i, D as a, E as o, O as s, S as c, T as l, _ as u, a as d, b as f, c as p, d as m, f as h, g, h as _, i as v, k as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "../ColorManagement-30MfpHwQ.js";
3
3
  export { D as ColorManagement, h as DEFAULT_LUT_SIZE, w as DEFAULT_MAX_EV, x as DEFAULT_MIN_EV, n as DEFAULT_WORKING_SPACE, _ as addAllOcioViews, g as addOcioView, j as applyMatrixRGBA8, k as bakeLut, u as buildOcioView, S as canvasColorSpaceFor, d as clearInputOverrides, c as convertColor, i as convertEncodedRGBA8, A as convertPixelsF32, r as displayCanvasFit, l as extractMatrix, T as findNativeLinearSpace, t as getActiveColorManagement, o as hasColorSpace, v as isColorManaged, a as isDataSpace, C as isDataTexture, s as linearToSrgb, E as listFileRules, p as listInputOverrides, M as makeCpuSampler, f as measureBakeError, b as resolveInputSpace, e as setActiveColorManagement, O as setInputOverride, y as srgbToLinear, m as textureInputSpace };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../PhysicalSky-DcjItqKi.js";
1
+ import { t as e } from "../PhysicalSky-bMHbm_7H.js";
2
2
  export { e as PhysicalSky };
@@ -1,3 +1,3 @@
1
1
  import { i as e, r as t } from "../shared-BGBcSxBQ.js";
2
- import { a as n, c as r, i, l as a, n as o, o as s, r as c, s as l, t as u } from "../openStorage-Fe9BoS1_.js";
2
+ import { a as n, c as r, i, l as a, n as o, o as s, r as c, s as l, t as u } from "../openStorage-B085D9FR.js";
3
3
  export { t as ENGINE_AREAS, c as EntryWriter, e as STORAGE_KIND, i as StorageArea, n as StorageEntry, s as StorageManager, r as acquireLock, u as acquireSharedStorage, a as heldLockNames, l as openInlineStorage, o as openStorage };
@@ -1,4 +1,4 @@
1
- import { n as e } from "./EngineIssues-CIZnXHsF.js";
1
+ import { n as e } from "./EngineIssues-xljoXM0E.js";
2
2
  import { i as t, r as n, t as r } from "./shared-BGBcSxBQ.js";
3
3
  import { t as i } from "./identity-C1cLD1C0.js";
4
4
  //#region src/Storage/locks.js
@@ -1,12 +1,12 @@
1
1
  import "./SolarLimb-bZE6y63S.js";
2
- import { a as e, n as t, o as n, r, t as i } from "./RayzeeRenderer-p-NeE6E2.js";
3
- import { Et as a, ft as o } from "./PathTracer-B9wZPPVL.js";
2
+ import { a as e, n as t, o as n, r, t as i } from "./RayzeeRenderer-B_aB6VTJ.js";
3
+ import { Ot as a, mt as o } from "./PathTracer-C_to_i40.js";
4
4
  import { n as s, t as c } from "./EngineEvents-CLckhYbL.js";
5
- import { G as l, q as u, r as d, x as f, y as p } from "./sceneCachePolicy-B9w3BnaP.js";
5
+ import { G as l, q as u, r as d, x as f, y as p } from "./sceneCachePolicy-D_uBSbQF.js";
6
6
  import { i as m, n as h, r as g, t as _ } from "./Logger-dDDGj9Av.js";
7
7
  import { f as v } from "./BufferLayout-xPRH9jYD.js";
8
- import { i as y, n as b, r as x, t as S } from "./EngineIssues-CIZnXHsF.js";
8
+ import { i as y, n as b, r as x, t as S } from "./EngineIssues-xljoXM0E.js";
9
9
  import { n as C, t as w } from "./AssetConfig-DSEntE65.js";
10
10
  import { d as T, p as E, t as D, u as O } from "./ViewTransforms-CYN7bq2w.js";
11
- import { a as k, r as A } from "./SceneMetadata-D2Sh-0e-.js";
11
+ import { l as k, s as A } from "./SceneMetadata-CSmlJW4c.js";
12
12
  export { A as ARCHIVE_FORMATS, D as DEFAULT_VIEW, l as ENGINE_DEFAULTS, c as EngineEvents, S as EngineIssueError, b as ISSUE_CODES, x as ISSUE_SEVERITY, y as IssueLog, s as LEGACY_EVENT_NAMES, _ as LOG_LEVELS, r as LightManager, h as Logger, u as MATERIAL_DEFAULTS, a as MAX_RESERVABLE_RENDER_SIZE, i as RayzeeRenderer, e as RenderSettings, n as SETTING_SOURCE, o as SKY_DEFAULTS, v as TRIANGLE_DATA_LAYOUT, d as VERSION, w as configureAssets, p as configurePlatform, g as createLogger, t as describeAdapter, m as fmt, C as getAssetConfig, f as getPlatform, O as getViewTransform, T as listViewTransforms, k as localFolder, E as onRegistryChange };