rayzee 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rayzee.es.js CHANGED
@@ -4814,19 +4814,11 @@ var ns = /* @__PURE__ */ X("\n fn computeNDCDepth( worldPos: vec3f, cameraProjec
4814
4814
  return this.entries.get(e)?.duration ?? 0;
4815
4815
  }
4816
4816
  print() {
4817
- let e = performance.now() - this.totalStart, t = this.order.map((t) => {
4818
- let n = this.entries.get(t)?.duration ?? 0, r = e > 0 ? (n / e * 100).toFixed(1) : "0.0";
4819
- return {
4820
- Step: t,
4821
- "Time (ms)": Math.round(n),
4822
- "%": r + "%"
4823
- };
4824
- });
4825
- return t.push({
4826
- Step: "TOTAL",
4827
- "Time (ms)": Math.round(e),
4828
- "%": "100%"
4829
- }), console.groupCollapsed(`⏱ ${this.label} Timing (${Math.round(e)}ms)`), console.table(t), console.groupEnd(), {
4817
+ let e = performance.now() - this.totalStart, t = this.order.map((e) => {
4818
+ let t = this.entries.get(e)?.duration ?? 0;
4819
+ return t >= 1 ? `${e} ${Math.round(t)}ms` : null;
4820
+ }).filter(Boolean);
4821
+ return console.log(`[${this.label}] ${Math.round(e)}ms` + (t.length ? ` | ${t.join(" · ")}` : "")), {
4830
4822
  steps: Object.fromEntries(this.order.map((e) => [e, Math.round(this.entries.get(e)?.duration ?? 0)])),
4831
4823
  total: Math.round(e)
4832
4824
  };
@@ -5505,7 +5497,7 @@ var ns = /* @__PURE__ */ X("\n fn computeNDCDepth( worldPos: vec3f, cameraProjec
5505
5497
  try {
5506
5498
  let a = new Worker(new URL(
5507
5499
  /* @vite-ignore */
5508
- "" + new URL("assets/BVHWorker-DobVXMda.js", import.meta.url).href,
5500
+ "" + new URL("assets/BVHWorker-BqQTDljT.js", import.meta.url).href,
5509
5501
  "" + import.meta.url
5510
5502
  ), { type: "module" }), o = this.totalTriangles, s = typeof SharedArrayBuffer < "u";
5511
5503
  console.log(`[BVHBuilder] SharedArrayBuffer: ${s ? "enabled" : "unavailable (using transfer fallback)"}`);
@@ -5639,61 +5631,8 @@ var ns = /* @__PURE__ */ X("\n fn computeNDCDepth( worldPos: vec3f, cameraProjec
5639
5631
  let p = new Uint32Array(a);
5640
5632
  for (let e = 0; e < a; e++) p[this.indices[e]] = e;
5641
5633
  this.originalToBvhMap = p, this.splitStats.reorderTime = performance.now() - u, this.splitStats.totalBuildTime = performance.now() - i;
5642
- let m = this.splitStats.totalBuildTime, h = (e) => m > 0 ? (e / m * 100).toFixed(1) + "%" : "0%", g = [
5643
- {
5644
- Phase: "Init + bounds",
5645
- "Time (ms)": Math.round(this.splitStats.initTime),
5646
- "%": h(this.splitStats.initTime)
5647
- },
5648
- {
5649
- Phase: "Morton sort",
5650
- "Time (ms)": Math.round(this.splitStats.mortonSortTime),
5651
- "%": h(this.splitStats.mortonSortTime)
5652
- },
5653
- {
5654
- Phase: "SAH recursive build",
5655
- "Time (ms)": Math.round(this.splitStats.sahBuildTime),
5656
- "%": h(this.splitStats.sahBuildTime)
5657
- },
5658
- {
5659
- Phase: "Treelet optimization",
5660
- "Time (ms)": Math.round(this.splitStats.treeletOptimizationTime),
5661
- "%": h(this.splitStats.treeletOptimizationTime)
5662
- },
5663
- {
5664
- Phase: "Reinsertion optimization",
5665
- "Time (ms)": Math.round(this.splitStats.reinsertionOptimizationTime),
5666
- "%": h(this.splitStats.reinsertionOptimizationTime)
5667
- },
5668
- {
5669
- Phase: "SA ordering",
5670
- "Time (ms)": Math.round(this.splitStats.saOrderTime),
5671
- "%": h(this.splitStats.saOrderTime)
5672
- },
5673
- {
5674
- Phase: "Triangle reorder",
5675
- "Time (ms)": Math.round(this.splitStats.reorderTime),
5676
- "%": h(this.splitStats.reorderTime)
5677
- },
5678
- {
5679
- Phase: "TOTAL",
5680
- "Time (ms)": Math.round(m),
5681
- "%": "100%"
5682
- }
5683
- ];
5684
- return console.groupCollapsed(`⏱ BVH Build (${a.toLocaleString()} triangles, ${Math.round(m)}ms)`), console.table(g), console.table({
5685
- "Total Nodes": this.totalNodes,
5686
- "Max Leaf Size": this.maxLeafSize,
5687
- "SAH Splits": this.splitStats.sahSplits,
5688
- "Object Median Splits": this.splitStats.objectMedianSplits,
5689
- "Spatial Median Splits": this.splitStats.spatialMedianSplits,
5690
- "Failed Splits": this.splitStats.failedSplits,
5691
- "Treelets Processed": this.splitStats.treeletsProcessed,
5692
- "Treelets Improved": this.splitStats.treeletsImproved,
5693
- "Avg SAH Improvement": (this.splitStats.averageSAHImprovement * 100).toFixed(2) + "%",
5694
- "Reinsertions Applied": this.splitStats.reinsertionsApplied,
5695
- "Reinsertion Iterations": this.splitStats.reinsertionIterations
5696
- }), console.groupEnd(), n && n(100), this.centroids = null, this.bMin = null, this.bMax = null, this.mortonCodes = null, c;
5634
+ let m = this.splitStats.totalBuildTime, h = this.splitStats;
5635
+ return console.log(`[BVH] ${a.toLocaleString()} tris → ${this.totalNodes} nodes in ${Math.round(m)}ms | SAH ${h.sahSplits} objMed ${h.objectMedianSplits} spatMed ${h.spatialMedianSplits} failed ${h.failedSplits}` + (h.treeletsProcessed ? ` | treelets ${h.treeletsImproved}/${h.treeletsProcessed} improved` : "") + (h.reinsertionsApplied ? ` | reinsertions ${h.reinsertionsApplied}` : "")), n && n(100), this.centroids = null, this.bMin = null, this.bMax = null, this.mortonCodes = null, c;
5697
5636
  }
5698
5637
  updateProgress(e, t) {
5699
5638
  if (!t) return;
@@ -6110,7 +6049,7 @@ function ws(e, t, n, r) {
6110
6049
  new Float32Array(c).set(e);
6111
6050
  let l = new SharedArrayBuffer(i * 3 * 4), u = new SharedArrayBuffer(i * 3 * 4), d = new SharedArrayBuffer(i * 3 * 4), f = new SharedArrayBuffer(i * 4), p = new SharedArrayBuffer(i * 4), m = new SharedArrayBuffer(i * xs * 4), h = new Worker(new URL(
6112
6051
  /* @vite-ignore */
6113
- "" + new URL("assets/BVHWorker-DobVXMda.js", import.meta.url).href,
6052
+ "" + new URL("assets/BVHWorker-BqQTDljT.js", import.meta.url).href,
6114
6053
  "" + import.meta.url
6115
6054
  ), { type: "module" }), g = null, _ = [h], v = { id: null }, y = !1, b = () => {
6116
6055
  v.id &&= (clearTimeout(v.id), null);
@@ -6219,7 +6158,7 @@ function Ts(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
6219
6158
  if (t.length === 0) continue;
6220
6159
  let s = new Worker(new URL(
6221
6160
  /* @vite-ignore */
6222
- "" + new URL("assets/BVHSubtreeWorker-C02ZWVeG.js", import.meta.url).href,
6161
+ "" + new URL("assets/BVHSubtreeWorker-BoG4D6dP.js", import.meta.url).href,
6223
6162
  "" + import.meta.url
6224
6163
  ), { type: "module" });
6225
6164
  d.push(s), s.onerror = (e) => {
@@ -6276,7 +6215,7 @@ function Es(e, t, n, r) {
6276
6215
  try {
6277
6216
  let o = new Worker(new URL(
6278
6217
  /* @vite-ignore */
6279
- "" + new URL("assets/BVHWorker-DobVXMda.js", import.meta.url).href,
6218
+ "" + new URL("assets/BVHWorker-BqQTDljT.js", import.meta.url).href,
6280
6219
  "" + import.meta.url
6281
6220
  ), { type: "module" }), s = e.byteLength / (xs * 4), c = typeof SharedArrayBuffer < "u" ? new SharedArrayBuffer(s * xs * 4) : null;
6282
6221
  o.onmessage = (e) => {
@@ -7825,7 +7764,7 @@ var Os = 16, ks = class {
7825
7764
  for (let e = 0; e < i; e++) {
7826
7765
  let e = new Worker(new URL(
7827
7766
  /* @vite-ignore */
7828
- "" + new URL("assets/BVHWorker-DobVXMda.js", import.meta.url).href,
7767
+ "" + new URL("assets/BVHWorker-BqQTDljT.js", import.meta.url).href,
7829
7768
  "" + import.meta.url
7830
7769
  ), { type: "module" });
7831
7770
  e.onmessage = (t) => f(e, t), e.onerror = (e) => {
@@ -8130,7 +8069,7 @@ var Os = 16, ks = class {
8130
8069
  a && a.terminate();
8131
8070
  let o = this.triangleData.slice(e.triOffset * n, (e.triOffset + e.triCount) * n), s = new Worker(new URL(
8132
8071
  /* @vite-ignore */
8133
- "" + new URL("assets/BVHWorker-DobVXMda.js", import.meta.url).href,
8072
+ "" + new URL("assets/BVHWorker-BqQTDljT.js", import.meta.url).href,
8134
8073
  "" + import.meta.url
8135
8074
  ), { type: "module" });
8136
8075
  this._pendingRebuilds.set(i, s), s.onmessage = (n) => {