rayzee 5.9.1 → 5.9.3

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
@@ -1054,9 +1054,9 @@ var Vn = class {
1054
1054
  renderMode: 1,
1055
1055
  enableAlphaShadows: !0,
1056
1056
  tiles: 3,
1057
- tilesHelper: !1,
1057
+ tilesHelper: !0,
1058
1058
  enableOIDN: !0,
1059
- oidnQuality: "balance",
1059
+ oidnQuality: "high",
1060
1060
  interactionModeEnabled: !1
1061
1061
  }, Qn = {
1062
1062
  maxSamples: X.maxSamples,
@@ -12205,12 +12205,6 @@ var hl = new Float32Array(3), gl = {
12205
12205
  },
12206
12206
  progress: (e, t, n) => {
12207
12207
  if (!e?.data || !n) return;
12208
- this.dispatchEvent({
12209
- type: "tileProgress",
12210
- tile: n,
12211
- imageWidth: e.width,
12212
- imageHeight: e.height
12213
- });
12214
12208
  let r = this.gpuDevice, i = e.width, a = e.height, o = Math.min(n.width, i - n.x), s = Math.min(n.height, a - n.y);
12215
12209
  if (o <= 0 || s <= 0) return;
12216
12210
  let c = o * 16, l = o * s * 16, u = r.createBuffer({
@@ -12224,15 +12218,25 @@ var hl = new Float32Array(3), gl = {
12224
12218
  d.copyBufferToBuffer(e.data, r, u, a, c);
12225
12219
  }
12226
12220
  r.queue.submit([d.finish()]), u.mapAsync(GPUMapMode.READ).then(() => {
12227
- let e = new Float32Array(u.getMappedRange()), t = new ImageData(o, s), r = this.getExposure(), i = this.getSaturation(), a = ol.get(this.getToneMapping()) || ol.get(Oe), c = this._cachedAlpha, l = this._cachedAlphaWidth;
12228
- for (let s = 0, u = e.length; s < u; s += 4) {
12229
- let u = e[s] * r, d = e[s + 1] * r, f = e[s + 2] * r;
12230
- if (i !== 1 && (hl[0] = u, hl[1] = d, hl[2] = f, fl(hl, i), u = hl[0], d = hl[1], f = hl[2]), a(u, d, f, 1, hl), t.data[s] = cl(hl[0]) * 255 + .5 | 0, t.data[s + 1] = cl(hl[1]) * 255 + .5 | 0, t.data[s + 2] = cl(hl[2]) * 255 + .5 | 0, c) {
12231
- let e = (s >> 2) % o, r = (s >> 2) / o | 0;
12232
- t.data[s + 3] = c[(n.y + r) * l + n.x + e];
12233
- } else t.data[s + 3] = 255;
12221
+ let e = new Float32Array(u.getMappedRange()), t = new ImageData(o, s), r = this.getExposure(), c = this.getSaturation(), l = ol.get(this.getToneMapping()) || ol.get(Oe), d = this._cachedAlpha, f = this._cachedAlphaWidth;
12222
+ for (let i = 0, a = e.length; i < a; i += 4) {
12223
+ let a = e[i] * r, s = e[i + 1] * r, u = e[i + 2] * r;
12224
+ if (c !== 1 && (hl[0] = a, hl[1] = s, hl[2] = u, fl(hl, c), a = hl[0], s = hl[1], u = hl[2]), l(a, s, u, 1, hl), t.data[i] = cl(hl[0]) * 255 + .5 | 0, t.data[i + 1] = cl(hl[1]) * 255 + .5 | 0, t.data[i + 2] = cl(hl[2]) * 255 + .5 | 0, d) {
12225
+ let e = (i >> 2) % o, r = (i >> 2) / o | 0;
12226
+ t.data[i + 3] = d[(n.y + r) * f + n.x + e];
12227
+ } else t.data[i + 3] = 255;
12234
12228
  }
12235
- u.unmap(), u.destroy(), this._pendingStagingBuffers.delete(u), this.ctx.putImageData(t, n.x, n.y);
12229
+ u.unmap(), u.destroy(), this._pendingStagingBuffers.delete(u), this.ctx.putImageData(t, n.x, n.y), this.dispatchEvent({
12230
+ type: "tileProgress",
12231
+ tile: {
12232
+ x: n.x,
12233
+ y: n.y,
12234
+ width: o,
12235
+ height: s
12236
+ },
12237
+ imageWidth: i,
12238
+ imageHeight: a
12239
+ });
12236
12240
  }).catch(() => {
12237
12241
  u.destroy(), this._pendingStagingBuffers.delete(u);
12238
12242
  });
@@ -12812,7 +12816,7 @@ var hl = new Float32Array(3), gl = {
12812
12816
  }
12813
12817
  }, Cl = class {
12814
12818
  constructor() {
12815
- this.layer = "hud", this.visible = !1, this._tileBounds = null, this._imageWidth = 1, this._imageHeight = 1, this.enabled = !0, this._borderColor = "rgba(255, 0, 0, 0.6)", this._borderWidth = 2;
12819
+ this.layer = "hud", this.visible = !1, this._tileBounds = null, this._imageWidth = 1, this._imageHeight = 1, this.enabled = !0, this._borderColor = "rgba(255, 0, 0, 0.6)", this._borderWidthRatio = 1 / 540, this._borderWidthMin = 1.5, this._borderWidthMax = 4;
12816
12820
  }
12817
12821
  setActiveTile(e) {
12818
12822
  this._tileBounds = e;
@@ -12822,8 +12826,8 @@ var hl = new Float32Array(3), gl = {
12822
12826
  }
12823
12827
  render(e, t, n) {
12824
12828
  if (!this._tileBounds) return;
12825
- let r = this._tileBounds, i = t / this._imageWidth, a = n / this._imageHeight, o = r.x * i, s = r.y * a, c = r.width * i, l = r.height * a;
12826
- e.strokeStyle = this._borderColor, e.lineWidth = this._borderWidth, e.strokeRect(o, s, c, l);
12829
+ let r = this._tileBounds, i = t / this._imageWidth, a = n / this._imageHeight, o = r.x * i, s = r.y * a, c = r.width * i, l = r.height * a, u = Math.min(this._borderWidthMax, Math.max(this._borderWidthMin, Math.min(t, n) * this._borderWidthRatio));
12830
+ e.strokeStyle = this._borderColor, e.lineWidth = u, e.strokeRect(o, s, c, l);
12827
12831
  }
12828
12832
  show() {
12829
12833
  this.enabled && (this.visible = !0);