rayzee 5.9.0 → 5.9.2
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 +27 -23
- package/dist/rayzee.es.js.map +1 -1
- package/dist/rayzee.umd.js +2 -2
- package/dist/rayzee.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/EngineDefaults.js +2 -2
- package/src/Passes/OIDNDenoiser.js +18 -20
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: !
|
|
1057
|
+
tilesHelper: !0,
|
|
1058
1058
|
enableOIDN: !0,
|
|
1059
|
-
oidnQuality: "
|
|
1059
|
+
oidnQuality: "high",
|
|
1060
1060
|
interactionModeEnabled: !1
|
|
1061
1061
|
}, Qn = {
|
|
1062
1062
|
maxSamples: X.maxSamples,
|
|
@@ -11937,10 +11937,10 @@ async function ml() {
|
|
|
11937
11937
|
}
|
|
11938
11938
|
var hl = new Float32Array(3), gl = {
|
|
11939
11939
|
BASE_URL: "https://cdn.jsdelivr.net/npm/denoiser/tzas/",
|
|
11940
|
-
|
|
11941
|
-
fast: "
|
|
11942
|
-
balance: "",
|
|
11943
|
-
high: "
|
|
11940
|
+
QUALITY_MODELS: {
|
|
11941
|
+
fast: "rt_hdr_calb_cnrm_small",
|
|
11942
|
+
balance: "rt_hdr_calb_cnrm",
|
|
11943
|
+
high: "rt_hdr_calb_cnrm_large"
|
|
11944
11944
|
},
|
|
11945
11945
|
DEFAULT_OPTIONS: {
|
|
11946
11946
|
enableOIDN: !0,
|
|
@@ -12030,14 +12030,14 @@ var hl = new Float32Array(3), gl = {
|
|
|
12030
12030
|
}
|
|
12031
12031
|
}
|
|
12032
12032
|
_generateTzaUrl() {
|
|
12033
|
-
let { BASE_URL: e,
|
|
12034
|
-
return `${e}
|
|
12033
|
+
let { BASE_URL: e, QUALITY_MODELS: t } = gl;
|
|
12034
|
+
return `${e}${t[this.quality] || t.balance}.tza`;
|
|
12035
12035
|
}
|
|
12036
12036
|
async updateConfiguration(e) {
|
|
12037
12037
|
Object.keys(e).some((t) => this.config[t] !== e[t]) && (Object.assign(this.config, e), this.quality = this.config.oidnQuality, this.debugGbufferMaps = this.config.debugGbufferMaps, this.tileSize = this.config.tileSize, await this._setupUNetDenoiser());
|
|
12038
12038
|
}
|
|
12039
12039
|
async updateQuality(e) {
|
|
12040
|
-
if (!Object.prototype.hasOwnProperty.call(gl.
|
|
12040
|
+
if (!Object.prototype.hasOwnProperty.call(gl.QUALITY_MODELS, e)) throw Error(`Invalid quality setting: ${e}. Must be one of: ${Object.keys(gl.QUALITY_MODELS).join(", ")}`);
|
|
12041
12041
|
await this.updateConfiguration({ oidnQuality: e });
|
|
12042
12042
|
}
|
|
12043
12043
|
async start() {
|
|
@@ -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(),
|
|
12228
|
-
for (let
|
|
12229
|
-
let
|
|
12230
|
-
if (
|
|
12231
|
-
let e = (
|
|
12232
|
-
t.data[
|
|
12233
|
-
} else t.data[
|
|
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
|
});
|