rayzee 11.8.0 → 11.9.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 (53) hide show
  1. package/README.md +18 -6
  2. package/dist/{ArchiveImporter-_sJm5uaK.js → ArchiveImporter-BJxszU_k.js} +1549 -1232
  3. package/dist/{BidirectionalIntegrator-Dzt4Z97x.js → BidirectionalIntegrator-DWg66vAd.js} +240 -240
  4. package/dist/{BufferLayout-xPRH9jYD.js → BufferLayout-Bzgccg1o.js} +1 -0
  5. package/dist/{ColorManagement-30MfpHwQ.js → ColorManagement-B_HjAiy2.js} +1 -1
  6. package/dist/{EngineIssues-xljoXM0E.js → EngineIssues-CfJiBaNj.js} +1 -0
  7. package/dist/{NeuralRetouch-BKQCsmEs.js → NeuralRetouch-BD9E-Yht.js} +1 -1
  8. package/dist/{NeuralSuperRes-C4ymq68e.js → NeuralSuperRes-C8Mf3tJX.js} +1 -1
  9. package/dist/{PathTracer-C_to_i40.js → PathTracer-DeE9UJ1n.js} +3433 -3363
  10. package/dist/{PhysicalSky-bMHbm_7H.js → PhysicalSky-cKy75-oR.js} +45 -45
  11. package/dist/{RayzeeRenderer-B_aB6VTJ.js → RayzeeRenderer-CzLyBA3G.js} +13 -8
  12. package/dist/{SceneMetadata-CSmlJW4c.js → SceneMetadata-C17UfOEp.js} +1 -1
  13. package/dist/{SolarLimb-bZE6y63S.js → SolarLimb-DRYy8tln.js} +184 -172
  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/addons/storage.es.js +1 -1
  19. package/dist/{openStorage-B085D9FR.js → openStorage-CdyVjmps.js} +1 -1
  20. package/dist/rayzee-core.es.js +7 -7
  21. package/dist/rayzee.es.js +567 -559
  22. package/dist/rayzee.umd.js +106 -101
  23. package/dist/{sceneCachePolicy-D_uBSbQF.js → sceneCachePolicy-ywbGKHD3.js} +9 -6
  24. package/package.json +1 -1
  25. package/src/EngineDefaults.js +1 -0
  26. package/src/EngineIssues.js +1 -0
  27. package/src/Passes/OIDNTemporalHistory.js +1 -1
  28. package/src/Processor/ArchiveImporter.js +83 -21
  29. package/src/Processor/AssetLoader.js +7 -0
  30. package/src/Processor/BufferLayout.js +3 -3
  31. package/src/Processor/GeometryExtractor.js +12 -4
  32. package/src/Processor/MaterialPacking.js +2 -2
  33. package/src/Processor/PBRT/PBRTMaterials.js +47 -12
  34. package/src/Processor/PBRT/PBRTParser.js +144 -22
  35. package/src/Processor/PBRT/PBRTSceneBuilder.js +287 -67
  36. package/src/Processor/PBRT/PBRTTextureBake.js +191 -9
  37. package/src/Processor/PBRT/index.js +19 -4
  38. package/src/Processor/SceneProcessor.js +42 -26
  39. package/src/RayzeeRenderer.js +4 -2
  40. package/src/Stages/DenoiserSettings.js +0 -4
  41. package/src/Stages/NRD.js +53 -24
  42. package/src/Stages/NormalDepth.js +5 -3
  43. package/src/Stages/PathTracer.js +2 -0
  44. package/src/Stages/PathTracerStage.js +5 -1
  45. package/src/Storage/SceneGraphCodec.js +6 -3
  46. package/src/TSL/BVHTraversal.js +33 -20
  47. package/src/TSL/Common.js +25 -8
  48. package/src/TSL/Displacement.js +66 -113
  49. package/src/TSL/LightsDirect.js +33 -11
  50. package/src/TSL/SceneResources.js +8 -0
  51. package/src/TSL/ShadeKernel.js +2 -2
  52. package/src/TSL/Struct.js +1 -0
  53. package/src/managers/MaterialDataManager.js +11 -0
@@ -1,5 +1,5 @@
1
- import { n as e } from "./BidirectionalIntegrator-Dzt4Z97x.js";
2
- import { dt as t, i as n, in as r } from "./SolarLimb-bZE6y63S.js";
1
+ import { n as e } from "./BidirectionalIntegrator-DWg66vAd.js";
2
+ import { an as t, dt as n, i as r } from "./SolarLimb-DRYy8tln.js";
3
3
  import { r as i } from "./WorkingMatrix-C6y233hT.js";
4
4
  import { StorageInstancedBufferAttribute as a } from "three/webgpu";
5
5
  import { Fn as o, If as s, Loop as c, Return as l, abs as u, acos as d, asin as f, atan as p, clamp as m, cos as h, dot as g, exp as _, float as v, floor as y, instanceIndex as b, int as x, log as S, max as C, min as w, mix as T, select as E, sin as D, smoothstep as O, sqrt as k, step as A, storage as j, tan as M, uint as N, uniform as P, vec2 as ee, vec3 as F, vec4 as I } from "three/tsl";
@@ -895,23 +895,23 @@ function xt(e, t, n) {
895
895
  });
896
896
  }), r;
897
897
  }
898
- function St({ pixels: e, rows: n, prefix: r, stats: i, cdf: a, width: u, height: d }) {
899
- let f = $(u), p = (e, t, n) => N(t).mul(N(f)).add(N(e).mul(N(4))).add(N(n)), m = (e) => D(v(e).add(.5).mul(Math.PI / d)), h = (n, r, i) => g(e.element(n.mul(u).add(r)).xyz, t).mul(i), _ = () => s(b.greaterThan(N(0)), () => {
898
+ function St({ pixels: e, rows: t, prefix: r, stats: i, cdf: a, width: u, height: d }) {
899
+ let f = $(u), p = (e, t, n) => N(t).mul(N(f)).add(N(e).mul(N(4))).add(N(n)), m = (e) => D(v(e).add(.5).mul(Math.PI / d)), h = (t, r, i) => g(e.element(t.mul(u).add(r)).xyz, n).mul(i), _ = () => s(b.greaterThan(N(0)), () => {
900
900
  l();
901
901
  }), y = o(() => {
902
902
  let e = b;
903
903
  s(e.greaterThanEqual(N(d)), () => {
904
904
  l();
905
905
  });
906
- let t = m(e).toVar(), r = v(0).toVar();
906
+ let n = m(e).toVar(), r = v(0).toVar();
907
907
  c({
908
908
  start: x(0),
909
909
  end: x(u),
910
910
  type: "int",
911
911
  condition: "<"
912
- }, ({ i: n }) => {
913
- r.addAssign(h(e, N(n), t));
914
- }), n.element(e).assign(I(r, 0, 0, 0));
912
+ }, ({ i: t }) => {
913
+ r.addAssign(h(e, N(t), n));
914
+ }), t.element(e).assign(I(r, 0, 0, 0));
915
915
  })().compute(d, [64]), S = o(() => {
916
916
  _();
917
917
  let e = v(0).toVar();
@@ -920,24 +920,24 @@ function St({ pixels: e, rows: n, prefix: r, stats: i, cdf: a, width: u, height:
920
920
  end: x(d),
921
921
  type: "int",
922
922
  condition: "<"
923
- }, ({ i: t }) => {
924
- e.addAssign(n.element(t).x);
923
+ }, ({ i: n }) => {
924
+ e.addAssign(t.element(n).x);
925
925
  }), i.element(0).assign(I(e, e.div(u * d), 0, 0));
926
926
  })().compute(1, [1]), w = o(() => {
927
927
  let e = b;
928
928
  s(e.greaterThanEqual(N(d)), () => {
929
929
  l();
930
930
  });
931
- let t = m(e).toVar(), a = i.element(0).y.toVar(), o = v(0).toVar(), f = v(0).toVar();
931
+ let n = m(e).toVar(), a = i.element(0).y.toVar(), o = v(0).toVar(), f = v(0).toVar();
932
932
  c({
933
933
  start: x(0),
934
934
  end: x(u),
935
935
  type: "int",
936
936
  condition: "<"
937
- }, ({ i: n }) => {
938
- let i = h(e, N(n), t).toVar();
939
- o.addAssign(i), f.addAssign(C(i.sub(a), 0)), r.element(e.mul(u).add(N(n))).assign(ee(o, f));
940
- }), n.element(e).assign(I(o, f, 0, 0));
937
+ }, ({ i: t }) => {
938
+ let i = h(e, N(t), n).toVar();
939
+ o.addAssign(i), f.addAssign(C(i.sub(a), 0)), r.element(e.mul(u).add(N(t))).assign(ee(o, f));
940
+ }), t.element(e).assign(I(o, f, 0, 0));
941
941
  })().compute(d, [64]), T = o(() => {
942
942
  _();
943
943
  let e = v(0).toVar();
@@ -946,31 +946,31 @@ function St({ pixels: e, rows: n, prefix: r, stats: i, cdf: a, width: u, height:
946
946
  end: x(d),
947
947
  type: "int",
948
948
  condition: "<"
949
- }, ({ i: t }) => {
950
- e.addAssign(n.element(t).y);
949
+ }, ({ i: n }) => {
950
+ e.addAssign(t.element(n).y);
951
951
  });
952
- let t = i.element(0).toVar();
953
- i.element(1).assign(E(e.greaterThan(0), I(e, t.y, 1, 0), I(t.x, 0, 0, 0)));
952
+ let n = i.element(0).toVar();
953
+ i.element(1).assign(E(e.greaterThan(0), I(e, n.y, 1, 0), I(n.x, 0, 0, 0)));
954
954
  })().compute(1, [1]), O = () => i.element(0).x.mul(1e-4 / (u * d)), k = o(() => {
955
955
  let e = b;
956
956
  s(e.greaterThanEqual(N(d)), () => {
957
957
  l();
958
958
  });
959
- let t = O().toVar(), o = i.element(1).z.greaterThan(0).toVar(), f = n.element(e).toVar(), m = E(o, f.y, f.x).add(t.mul(u)).toVar(), h = v(0).toVar();
959
+ let n = O().toVar(), o = i.element(1).z.greaterThan(0).toVar(), f = t.element(e).toVar(), m = E(o, f.y, f.x).add(n.mul(u)).toVar(), h = v(0).toVar();
960
960
  c({
961
961
  start: x(0),
962
962
  end: x(u),
963
963
  type: "int",
964
964
  condition: "<"
965
- }, ({ i: n }) => {
966
- let i = r.element(e.mul(u).add(N(n))).toVar(), s = E(o, i.y, i.x).add(t.mul(v(n).add(1))).div(C(m, 1e-30)), c = E(m.greaterThan(0), E(n.equal(x(u - 1)), v(1), s), v(0)).toVar();
967
- a.element(p(n, e, 0)).assign(c), a.element(p(n, e, 1)).assign(h), h.assign(c);
965
+ }, ({ i: t }) => {
966
+ let i = r.element(e.mul(u).add(N(t))).toVar(), s = E(o, i.y, i.x).add(n.mul(v(t).add(1))).div(C(m, 1e-30)), c = E(m.greaterThan(0), E(t.equal(x(u - 1)), v(1), s), v(0)).toVar();
967
+ a.element(p(t, e, 0)).assign(c), a.element(p(t, e, 1)).assign(h), h.assign(c);
968
968
  });
969
969
  })().compute(d, [64]), A = o(() => {
970
970
  _();
971
- let e = O().mul(u).toVar(), t = i.element(1).z.greaterThan(0).toVar(), r = (r) => {
972
- let i = n.element(r);
973
- return E(t, i.y, i.x).add(e);
971
+ let e = O().mul(u).toVar(), n = i.element(1).z.greaterThan(0).toVar(), r = (r) => {
972
+ let i = t.element(r);
973
+ return E(n, i.y, i.x).add(e);
974
974
  }, o = v(0).toVar();
975
975
  c({
976
976
  start: x(0),
@@ -1025,33 +1025,33 @@ var Tt = class {
1025
1025
  this.width = e, this.height = t, this._quality = n, this.lastRenderTime = 0, this._texture = wt(e, t, se), this._texture.mapping = re, this._texture.colorSpace = oe, this._texture.minFilter = ae, this._texture.magFilter = ae, this._texture.wrapS = ce, this._texture.wrapT = te, this._texture.generateMipmaps = !1, this._cdfTexture = wt(e + 1, t, se), this._rec709Weights = ke(ge), this._attrs = null, this._kernels = null, this._airKey = null, this._transmittanceBuilt = !1;
1026
1026
  }
1027
1027
  _init() {
1028
- let e = (e) => Array.from({ length: e }, () => P(new ue())), t = e(24);
1028
+ let e = (e) => Array.from({ length: e }, () => P(new ue())), n = e(24);
1029
1029
  this._uniforms = {
1030
- coefficient: t,
1030
+ coefficient: n,
1031
1031
  rgb: e(12),
1032
1032
  sunDirection: P(new le(0, 1, 0)),
1033
1033
  altitude: P(.05),
1034
1034
  sunSinRadius: P(.0046)
1035
1035
  };
1036
- let n = (e) => r(e, 4);
1036
+ let r = (e) => t(e, 4);
1037
1037
  this._attrs = {
1038
- transmittance: n(256 * 64),
1039
- incomingA: n(1024 * 128 * 4),
1040
- incomingB: n(1024 * 128 * 4),
1041
- transfer: n(1024 * 128 * 4),
1042
- multipleScattering: n(1024 * 128 * 8),
1043
- psiSum: n(1024 * 128 * 8),
1044
- groundE: n(256),
1045
- irradiance: n(512),
1046
- sky: n(this.width * this.height),
1047
- skyRows: n(256 * this.height),
1048
- cdfRows: n(this.height),
1049
- cdfPrefix: r(this.width * this.height, 2),
1050
- cdfStats: n(2),
1051
- cdf: r($(this.width) * this.height, 1),
1038
+ transmittance: r(256 * 64),
1039
+ incomingA: r(1024 * 128 * 4),
1040
+ incomingB: r(1024 * 128 * 4),
1041
+ transfer: r(1024 * 128 * 4),
1042
+ multipleScattering: r(1024 * 128 * 8),
1043
+ psiSum: r(1024 * 128 * 8),
1044
+ groundE: r(256),
1045
+ irradiance: r(512),
1046
+ sky: r(this.width * this.height),
1047
+ skyRows: r(256 * this.height),
1048
+ cdfRows: r(this.height),
1049
+ cdfPrefix: t(this.width * this.height, 2),
1050
+ cdfStats: r(2),
1051
+ cdf: t($(this.width) * this.height, 1),
1052
1052
  phaseCells: new a(Ge(16, 8, 16, 8), 4)
1053
1053
  };
1054
- let i = (e, t = "vec4") => j(this._attrs[e], t, this._attrs[e].count), o = (e) => t.slice(e * 4, e * 4 + 4), s = {
1054
+ let i = (e, t = "vec4") => j(this._attrs[e], t, this._attrs[e].count), o = (e) => n.slice(e * 4, e * 4 + 4), s = {
1055
1055
  transmittance: i("transmittance"),
1056
1056
  transfer: i("transfer"),
1057
1057
  psiSum: i("psiSum"),
@@ -1211,7 +1211,7 @@ var Tt = class {
1211
1211
  }
1212
1212
  dispose(e = null) {
1213
1213
  for (let e of Object.values(this._kernels ?? {}).flat()) e.dispose();
1214
- for (let t of Object.values(this._attrs ?? {})) n(e, t);
1214
+ for (let t of Object.values(this._attrs ?? {})) r(e, t);
1215
1215
  this._kernels = null, this._attrs = null, this._texture.dispose(), this._cdfTexture.dispose();
1216
1216
  }
1217
1217
  };
@@ -1,17 +1,17 @@
1
- import { dt as e } from "./SolarLimb-bZE6y63S.js";
2
- import { Mt as t, Nt as n, Ot as r, bt as i, dt as a, ft as o, i as s, jt as c, kt as l, lt as u, n as d, r as f, ut as p, vt as ee, xt as m } from "./PathTracer-C_to_i40.js";
1
+ import { dt as e } from "./SolarLimb-DRYy8tln.js";
2
+ import { Mt as t, Nt as n, Ot as r, bt as i, dt as a, ft as o, i as s, jt as c, kt as l, lt as u, n as d, r as f, ut as p, vt as ee, xt as m } from "./PathTracer-DeE9UJ1n.js";
3
3
  import { n as h, t as g } from "./EngineEvents-CLckhYbL.js";
4
- import { $ as te, C as ne, G as _, M as re, Q as ie, T as v, W as ae, at as y, d as oe, et as se, f as ce, l as le, nt as b, ot as ue, r as de, rt as fe, tt as pe, u as me, v as he, x as ge } from "./sceneCachePolicy-D_uBSbQF.js";
4
+ import { $ as te, C as ne, G as _, M as re, Q as ie, T as v, W as ae, at as y, d as oe, et as se, f as ce, l as le, nt as b, ot as ue, r as de, rt as fe, tt as pe, u as me, v as he, x as ge } from "./sceneCachePolicy-ywbGKHD3.js";
5
5
  import { i as x, r as S } from "./Logger-dDDGj9Av.js";
6
- import { f as _e, r as ve } from "./BufferLayout-xPRH9jYD.js";
7
- import { i as ye, n as C, t as be } from "./EngineIssues-xljoXM0E.js";
6
+ import { f as _e, r as ve } from "./BufferLayout-Bzgccg1o.js";
7
+ import { i as ye, n as C, t as be } from "./EngineIssues-CfJiBaNj.js";
8
8
  import { n as xe, r as Se } from "./shared-BGBcSxBQ.js";
9
9
  import { a as Ce } from "./WorkingMatrix-C6y233hT.js";
10
10
  import { i as w, r as we, t as T } from "./ActiveColor-YvuQq44O.js";
11
11
  import { n as E, r as Te } from "./AssetConfig-DSEntE65.js";
12
12
  import { d as Ee, l as De, m as Oe, p as ke, t as Ae, u as D } from "./ViewTransforms-CYN7bq2w.js";
13
13
  import { i as O, n as je, r as Me } from "./identity-C1cLD1C0.js";
14
- import { c as Ne, i as Pe, l as Fe, o as Ie, r as Le, t as Re } from "./SceneMetadata-CSmlJW4c.js";
14
+ import { c as Ne, i as Pe, l as Fe, o as Ie, r as Le, t as Re } from "./SceneMetadata-C17UfOEp.js";
15
15
  import { t as ze } from "./ToneMapGPU-4GPwoG_c.js";
16
16
  import { LinearSRGBColorSpace as Be, MeshBasicNodeMaterial as Ve, QuadMesh as He, RectAreaLightNode as Ue, SRGBColorSpace as We, TextureNode as Ge, WebGPURenderer as Ke } from "three/webgpu";
17
17
  import { Fn as qe, If as Je, cubeTexture as Ye, dot as Xe, float as k, int as A, mix as j, screenUV as Ze, select as M, storage as Qe, texture as $e, uint as et, uniform as N, uv as P, vec3 as F, vec4 as tt } from "three/tsl";
@@ -1413,6 +1413,9 @@ var Cn = class e extends L {
1413
1413
  flushPendingGraph(e) {
1414
1414
  this.archives?.flushPendingGraph(e);
1415
1415
  }
1416
+ commitPendingGraph(e) {
1417
+ this.archives?.commitPendingGraph(e);
1418
+ }
1416
1419
  readFileAsArrayBuffer(e) {
1417
1420
  return e.arrayBuffer();
1418
1421
  }
@@ -2627,7 +2630,9 @@ var Hn = class extends L {
2627
2630
  if (this._loadingInProgress) throw this._busyError("PathTracerApp");
2628
2631
  this._loadingInProgress = !0, this.assetLoader && (this.assetLoader.maxEnvironmentWidth = this._memorySpill === !0 ? le : 0);
2629
2632
  try {
2630
- await e(), this._sceneSource = typeof n == "function" ? await n() : n, this._sceneSourceInput = null, this._emissiveSamplingUserSet = !1, this._clearAppendedModels(), this._modelReplaced(), this._planSpill(), await this.loadSceneData({ pendingEnvironment: this._beginSceneMetadataEnvironment() }), this._maybeSpill(), this.pipeline?.eventBus.emit("pipeline:lightingChanged"), this._dropDisplay(), this.reset(), this.dispatchEvent(t), this._modelAnnounced();
2633
+ await e(), this._sceneSource = typeof n == "function" ? await n() : n, this._sceneSourceInput = null, this._emissiveSamplingUserSet = !1, this._clearAppendedModels(), this._modelReplaced(), this._planSpill();
2634
+ let r = await this.loadSceneData({ pendingEnvironment: this._beginSceneMetadataEnvironment() });
2635
+ this._maybeSpill(), this.pipeline?.eventBus.emit("pipeline:lightingChanged"), this._dropDisplay(), this.reset(), this.dispatchEvent(t), this._modelAnnounced(), r && this.assetLoader?.commitPendingGraph(this.sceneModel);
2631
2636
  } catch (e) {
2632
2637
  throw (!e || e.code !== "LOAD_IN_PROGRESS") && this._discardFailedLoad(), e?.code === "ARCHIVE_NEEDS_ELEMENT" ? b() : e?.code !== "LOAD_IN_PROGRESS" && y({
2633
2638
  status: `Error: ${e?.message ?? e}`,
@@ -3547,7 +3552,7 @@ var Hn = class extends L {
3547
3552
  _wireEvents() {
3548
3553
  this.settings.bind(this._settingsBindings()), this.renderer.toneMappingExposure = this.settings.get("exposure") ?? 1, this.onResize(), this.resizeHandler = () => this.onResize(), this._autoResize && this._addTrackedListener(window, "resize", this.resizeHandler), this._onAssetLoaded = async (e) => {
3549
3554
  if (!this._loadingInProgress && !(this._applyingSceneMetadata && e.texture)) {
3550
- if (e.model) this._clearAppendedModels(), await this.loadSceneData({ pendingEnvironment: this._beginSceneMetadataEnvironment() });
3555
+ if (e.model) this._clearAppendedModels(), await this.loadSceneData({ pendingEnvironment: this._beginSceneMetadataEnvironment() }) && this.assetLoader?.commitPendingGraph(e.model);
3551
3556
  else if (e.texture) {
3552
3557
  let e = this.meshScene.environment;
3553
3558
  e && this.stages.pathTracer && await this.stages.pathTracer.environment.setEnvironmentMap(e), b();
@@ -1,4 +1,4 @@
1
- import { x as e } from "./sceneCachePolicy-D_uBSbQF.js";
1
+ import { x as e } from "./sceneCachePolicy-ywbGKHD3.js";
2
2
  import { DataTexture as t, LoaderUtils as n, RGBAFormat as r, UnsignedByteType as i } from "three";
3
3
  //#region src/Processor/archiveFormats.js
4
4
  var a = Object.freeze({