rayzee 11.3.0 → 11.4.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.
- package/README.md +33 -5
- package/dist/{ArchiveImporter-D735xX-4.js → ArchiveImporter-Cgyx5AF7.js} +2 -2
- package/dist/{BidirectionalIntegrator-M89c0AlP.js → BidirectionalIntegrator-BKF-cwH2.js} +2 -2
- package/dist/{NeuralRetouch-DiBH63kz.js → NeuralRetouch-C3Q2XqbF.js} +4 -3
- package/dist/{NeuralSuperRes-CZNQP13W.js → NeuralSuperRes-DV5TtURP.js} +11 -5
- package/dist/{PathTracer-BXCCVrPK.js → PathTracer-D3MvEaZK.js} +19 -12
- package/dist/{PhysicalSky-DqmaS0lb.js → PhysicalSky-CY4jiz6a.js} +1 -1
- package/dist/{RayzeeRenderer-DUSMFhmc.js → RayzeeRenderer-D23m6NqG.js} +313 -281
- package/dist/{ToneMapGPU-BOjpul7A.js → ToneMapGPU-CTDBvmmS.js} +31 -22
- package/dist/addons/archives.es.js +1 -1
- package/dist/addons/bidirectional.es.js +1 -1
- package/dist/addons/physical-sky.es.js +1 -1
- package/dist/rayzee-core.es.js +3 -3
- package/dist/rayzee.es.js +1343 -858
- package/dist/rayzee.umd.js +124 -113
- package/dist/{sceneCachePolicy-BAib5fCp.js → sceneCachePolicy-AKOEu2lf.js} +1 -1
- package/package.json +1 -1
- package/src/EngineDefaults.js +2 -2
- package/src/Passes/AIUpscaler.js +2 -0
- package/src/PathTracerApp.js +122 -16
- package/src/Pipeline/CompletionTracker.js +7 -3
- package/src/Processor/ToneMapCPU.js +16 -4
- package/src/Processor/ToneMapGPU.js +30 -14
- package/src/RayzeeRenderer.js +54 -7
- package/src/RenderSettings.js +4 -2
- package/src/Stages/AutoExposure.js +484 -494
- package/src/Stages/Compositor.js +27 -6
- package/src/Stages/LocalExposure.js +546 -0
- package/src/Stages/PathTracer.js +6 -4
- package/src/Stages/PathTracerStage.js +9 -7
- package/src/index.js +1 -0
- package/src/managers/DenoisingManager.js +11 -15
- package/src/managers/VideoRenderManager.js +30 -4
- package/src/neural/NeuralRetouch.js +1 -0
- package/src/neural/NeuralSuperRes.js +6 -1
package/README.md
CHANGED
|
@@ -472,6 +472,8 @@ Key settings:
|
|
|
472
472
|
|---|---|---|---|
|
|
473
473
|
| `maxBounces` | `number` | 3 | Max ray bounce depth |
|
|
474
474
|
| `maxSamples` | `number` | 60 | Max accumulated samples before stopping |
|
|
475
|
+
| `renderLimitMode` | `string` | 'frames' | What else can stop the render: `'frames'` only `maxSamples`; `'time'` `maxSamples` or `renderTimeLimit`, whichever comes first; `'timeOnly'` only `renderTimeLimit` (`maxSamples` is ignored while the limit is above 0). Convergence (`useAdaptiveSampling`) can stop it in every mode |
|
|
476
|
+
| `renderTimeLimit` | `number` | 30 | Seconds of rendering before the time limit stops it, in `'time'` and `'timeOnly'`; `0` turns the limit off. Raising it after it stopped a render continues that render, unless another limit has been reached |
|
|
475
477
|
| `exposure` | `number` | 1.0 | Exposure value |
|
|
476
478
|
| `saturation` | `number` | 1.0 | Color saturation (1 = no grade) |
|
|
477
479
|
| `enableEnvironment` | `boolean` | true | Use environment lighting |
|
|
@@ -916,7 +918,11 @@ await engine.environmentManager.generateProcedural();
|
|
|
916
918
|
|
|
917
919
|
### engine.denoisingManager
|
|
918
920
|
|
|
919
|
-
Denoiser strategy, ASVGF, OIDN, upscaler, and auto-exposure.
|
|
921
|
+
Denoiser strategy, ASVGF, OIDN, upscaler, and auto-exposure. Auto exposure meters the accumulated image on the GPU
|
|
922
|
+
and moves in stops; it follows a room level learned as the camera moves plus a damped share of each view, so a scene lit
|
|
923
|
+
for its manual exposure stays near it while one lit far off is corrected in full. It eases while the image restarts
|
|
924
|
+
every frame (a moving camera, playback) and lands within about a third of a second once the image builds up, so a
|
|
925
|
+
finished render shows its own exposure at any sample count. While it is on, `exposure` is its compensation.
|
|
920
926
|
|
|
921
927
|
```js
|
|
922
928
|
// Strategy
|
|
@@ -929,7 +935,13 @@ engine.denoisingManager.setAutoExposure(true)
|
|
|
929
935
|
// Fine-grained parameters
|
|
930
936
|
engine.denoisingManager.setASVGFParams({ temporalAlpha: 0.1, maxAccumFrames: 16 })
|
|
931
937
|
engine.denoisingManager.setEdgeAwareParams({ phiLuminance: 4.0, atrousIterations: 5 })
|
|
932
|
-
engine.denoisingManager.setAutoExposureParams({
|
|
938
|
+
engine.denoisingManager.setAutoExposureParams({
|
|
939
|
+
strength: 0.3, // 0..1, how far it follows each view; 1 averages every view to middle grey
|
|
940
|
+
metering: 'center', // 'average' | 'center' | 'spot' (at the auto-focus point)
|
|
941
|
+
minExposure: 2 ** -8, // how far it may go from the manual exposure (default ±8 stops)
|
|
942
|
+
maxExposure: 2 ** 8,
|
|
943
|
+
keyValue: 0.18, // the grey it aims the average at
|
|
944
|
+
})
|
|
933
945
|
|
|
934
946
|
// OIDN & Upscaler
|
|
935
947
|
engine.denoisingManager.setOIDNEnabled(true)
|
|
@@ -942,6 +954,21 @@ engine.denoisingManager.setUpscalerScaleFactor(2) // 2 or 4
|
|
|
942
954
|
engine.denoisingManager.setUpscalerQuality('quality') // 'fast' | 'balanced' | 'quality'
|
|
943
955
|
```
|
|
944
956
|
|
|
957
|
+
### Local exposure
|
|
958
|
+
|
|
959
|
+
Unreal Engine 5's local exposure: brings large bright (and, if asked, dark) areas toward middle grey while keeping their
|
|
960
|
+
detail. It changes only what is shown — the canvas, `renderToBuffer( { colorSpace: 'srgb' } )`, the AI upscaler and the
|
|
961
|
+
neural passes apply the same per-pixel gain; EXR and `'linear'` reads stay scene-referred. Off by default.
|
|
962
|
+
|
|
963
|
+
```js
|
|
964
|
+
engine.setLocalExposure(true)
|
|
965
|
+
engine.setLocalExposureParams({
|
|
966
|
+
highlightContrast: 0.6, // contrast of the base layer above middle grey; 1 = unchanged
|
|
967
|
+
shadowContrast: 1, // below middle grey; < 1 lifts shadows
|
|
968
|
+
detailStrength: 1, // contrast of detail within the base layer
|
|
969
|
+
})
|
|
970
|
+
```
|
|
971
|
+
|
|
945
972
|
### engine.interactionManager
|
|
946
973
|
|
|
947
974
|
Object picking and interaction modes.
|
|
@@ -1233,8 +1260,8 @@ duration `renderUntilComplete` runs those readbacks in **lockstep**: one issued
|
|
|
1233
1260
|
at frame N + 4 exactly, and the render waits if it has not landed; every reset also starts from seed
|
|
1234
1261
|
0 and from nothing the previous render measured. It turns interaction mode off meanwhile (a
|
|
1235
1262
|
wall-clock mode for camera drags), and keeps submissions at most 2 × `drainEvery` frames ahead of
|
|
1236
|
-
the GPU. A time limit is wall-clock by nature, so that one stop is not reproducible
|
|
1237
|
-
|
|
1263
|
+
the GPU. A time limit is wall-clock by nature, so that one stop is not reproducible. Auto exposure, if you turn it
|
|
1264
|
+
on, lands on a metering of the finished image before the closing denoise.
|
|
1238
1265
|
|
|
1239
1266
|
`engine.setLockstepReadbacks(true)` applies the same lockstep to the rAF loop and to `renderFrames`.
|
|
1240
1267
|
|
|
@@ -1502,7 +1529,7 @@ engine.addEventListener(EngineEvents.RENDER_COMPLETE, (e) => {
|
|
|
1502
1529
|
| `SETTING_CHANGED` | A render setting is modified |
|
|
1503
1530
|
| `AUTO_FOCUS_UPDATED` | Auto-focus recalculated — `worldDistance` in scene units, `distance` divided by the model's size |
|
|
1504
1531
|
| `ORTHO_HEIGHT_UPDATED` | An orthographic view's height changed — `height` in scene units |
|
|
1505
|
-
| `AUTO_EXPOSURE_UPDATED` | Auto
|
|
1532
|
+
| `AUTO_EXPOSURE_UPDATED` | Auto exposure moved — `exposure` (applied, with the manual exposure), `autoExposure` (its own part), `targetExposure`, `luminance` (metered) |
|
|
1506
1533
|
| `AF_POINT_PLACED` | Focus point placed on screen |
|
|
1507
1534
|
| `ANIMATION_STARTED` / `ANIMATION_PAUSED` / `ANIMATION_STOPPED` / `ANIMATION_FINISHED` | Animation lifecycle |
|
|
1508
1535
|
| `VIDEO_RENDER_PROGRESS` / `VIDEO_RENDER_COMPLETE` | Video export progress |
|
|
@@ -1574,6 +1601,7 @@ import {
|
|
|
1574
1601
|
ENGINE_DEFAULTS,
|
|
1575
1602
|
DENOISER_DEFAULTS,
|
|
1576
1603
|
AUTO_EXPOSURE_DEFAULTS,
|
|
1604
|
+
LOCAL_EXPOSURE_DEFAULTS,
|
|
1577
1605
|
AUTO_FOCUS_DEFAULTS,
|
|
1578
1606
|
ASVGF_QUALITY_PRESETS,
|
|
1579
1607
|
SKY_DEFAULTS,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./BidirectionalIntegrator-
|
|
2
|
-
import { A as t, T as n, at as r, n as i, r as a, v as o } from "./sceneCachePolicy-
|
|
1
|
+
import { n as e } from "./BidirectionalIntegrator-BKF-cwH2.js";
|
|
2
|
+
import { A as t, T as n, at as r, n as i, r as a, v as o } from "./sceneCachePolicy-AKOEu2lf.js";
|
|
3
3
|
import { n as s, r as c } from "./EngineIssues-CIZnXHsF.js";
|
|
4
4
|
import { r as l } from "./shared-BGBcSxBQ.js";
|
|
5
5
|
import { i as u, n as d, o as f, r as p } from "./identity-C1cLD1C0.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { F as e, Ft as t, I as n, J as r, Jt as i, K as a, L as o, Mt as s, Qt as c, R as l, U as u, X as d, Y as f, Z as p, an as m, c as ee, ct as te, dt as ne, en as re, et as h, ft as g, i as _, in as ie, j as ae, jt as oe, k as se, lt as v, q as y, r as ce, wt as le, y as ue, zt as de } from "./SolarLimb-bZE6y63S.js";
|
|
2
|
-
import { A as b, C as x, Ct as fe, D as S, E as C, F as w, G as T, I as E, J as D, M as pe, O as me, S as he, St as O, T as ge, U as _e, V as ve, W as ye, Y as be, _ as k, a as xe, at as A, b as Se, bt as Ce, c as we, d as Te, f as Ee, g as j, h as De, i as Oe, it as M, j as N, k as ke, l as Ae, m as P, o as je, p as Me, q as Ne, r as Pe, rt as Fe, s as Ie, t as Le, u as F, v as Re, vt as ze, w as Be, x as Ve, xt as He, y as Ue, yt as I } from "./PathTracer-
|
|
3
|
-
import { W as We } from "./sceneCachePolicy-
|
|
2
|
+
import { A as b, C as x, Ct as fe, D as S, E as C, F as w, G as T, I as E, J as D, M as pe, O as me, S as he, St as O, T as ge, U as _e, V as ve, W as ye, Y as be, _ as k, a as xe, at as A, b as Se, bt as Ce, c as we, d as Te, f as Ee, g as j, h as De, i as Oe, it as M, j as N, k as ke, l as Ae, m as P, o as je, p as Me, q as Ne, r as Pe, rt as Fe, s as Ie, t as Le, u as F, v as Re, vt as ze, w as Be, x as Ve, xt as He, y as Ue, yt as I } from "./PathTracer-D3MvEaZK.js";
|
|
3
|
+
import { W as We } from "./sceneCachePolicy-AKOEu2lf.js";
|
|
4
4
|
import { r as Ge } from "./BufferLayout-xPRH9jYD.js";
|
|
5
5
|
import { Break as Ke, Fn as L, If as R, Loop as qe, Return as z, abs as B, atomicAdd as Je, atomicFunc as Ye, atomicLoad as V, atomicStore as Xe, bool as Ze, cos as Qe, cross as $e, dot as H, exp2 as et, float as U, floor as tt, instanceIndex as nt, int as W, ivec2 as rt, ivec3 as it, length as at, localId as ot, log2 as st, max as G, min as ct, mix as lt, normalize as ut, sampler as dt, select as K, sin as ft, sqrt as pt, storage as mt, texture as ht, uint as q, uniform as J, uniformArray as gt, vec2 as _t, vec3 as Y, vec4 as vt, workgroupId as yt } from "three/tsl";
|
|
6
6
|
import { DataTexture as bt, FloatType as xt, RedFormat as St, Vector3 as Ct } from "three";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as e } from "./BidirectionalIntegrator-
|
|
1
|
+
import { n as e } from "./BidirectionalIntegrator-BKF-cwH2.js";
|
|
2
2
|
import { r as t } from "./Logger-dDDGj9Av.js";
|
|
3
3
|
import { n } from "./AssetConfig-DSEntE65.js";
|
|
4
|
-
import { t as r } from "./ToneMapGPU-
|
|
4
|
+
import { t as r } from "./ToneMapGPU-CTDBvmmS.js";
|
|
5
5
|
//#region src/neural/NeuralRetouch.js
|
|
6
6
|
var i = /* @__PURE__ */ e({
|
|
7
7
|
NeuralRetouch: () => m,
|
|
@@ -146,7 +146,8 @@ var f = "\n@group(0) @binding(0) var src: texture_2d<f32>;\n@group(0) @binding(1
|
|
|
146
146
|
rgba8: await this._toneMapper.toRGBA8(this._hdrStorage, {
|
|
147
147
|
exposure: e.exposure ?? 1,
|
|
148
148
|
toneMapping: e.toneMapping ?? 0,
|
|
149
|
-
saturation: e.saturation ?? 1
|
|
149
|
+
saturation: e.saturation ?? 1,
|
|
150
|
+
gain: e.gain
|
|
150
151
|
}),
|
|
151
152
|
width: t,
|
|
152
153
|
height: n
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as e } from "./BidirectionalIntegrator-
|
|
1
|
+
import { n as e } from "./BidirectionalIntegrator-BKF-cwH2.js";
|
|
2
2
|
import { t } from "./EngineEvents-Ci8dVWCP.js";
|
|
3
3
|
import { r as n } from "./Logger-dDDGj9Av.js";
|
|
4
4
|
import { n as r } from "./AssetConfig-DSEntE65.js";
|
|
5
|
-
import { t as i } from "./ToneMapGPU-
|
|
5
|
+
import { t as i } from "./ToneMapGPU-CTDBvmmS.js";
|
|
6
6
|
//#region src/neural/NeuralSuperRes.js
|
|
7
7
|
var a = /* @__PURE__ */ e({
|
|
8
8
|
NeuralSuperRes: () => g,
|
|
@@ -152,6 +152,7 @@ var g = class e {
|
|
|
152
152
|
exposure: t.exposure ?? 1,
|
|
153
153
|
toneMapping: t.toneMapping ?? 0,
|
|
154
154
|
saturation: t.saturation ?? 1,
|
|
155
|
+
gain: t.gain,
|
|
155
156
|
flipY: !0
|
|
156
157
|
}),
|
|
157
158
|
width: a,
|
|
@@ -190,6 +191,7 @@ async function v(e, { outputWidth: t, outputHeight: n, samples: r = 64, upscaler
|
|
|
190
191
|
width: u?.width,
|
|
191
192
|
height: u?.height,
|
|
192
193
|
maxSamples: e.settings?.get?.("maxSamples"),
|
|
194
|
+
renderLimitMode: e.settings?.get?.("renderLimitMode"),
|
|
193
195
|
finalDenoise: e.denoisingManager?.finalDenoise,
|
|
194
196
|
paused: e.pauseRendering
|
|
195
197
|
}, f = !i, p = i, m = {};
|
|
@@ -203,7 +205,10 @@ async function v(e, { outputWidth: t, outputHeight: n, samples: r = 64, upscaler
|
|
|
203
205
|
}), m.load = performance.now() - e;
|
|
204
206
|
} else if (p.inputWidth !== c || p.inputHeight !== l) throw Error(`renderUpscaled: upscaler is ${p.inputWidth}x${p.inputHeight}, need ${c}x${l}`);
|
|
205
207
|
let i = performance.now();
|
|
206
|
-
s(`Tracing ${c}x${l} at ${r} spp`), e.pauseRendering = !1, e.setCanvasSize(c, l), await new Promise((e) => setTimeout(e, 300)), e.denoisingManager.applyOIDNEnabled(!0), e.settings.
|
|
208
|
+
s(`Tracing ${c}x${l} at ${r} spp`), e.pauseRendering = !1, e.setCanvasSize(c, l), await new Promise((e) => setTimeout(e, 300)), e.denoisingManager.applyOIDNEnabled(!0), e.settings.setMany({
|
|
209
|
+
maxSamples: r,
|
|
210
|
+
renderLimitMode: "frames"
|
|
211
|
+
}, { reset: !1 });
|
|
207
212
|
let u = _(e, r, a);
|
|
208
213
|
e.reset(), await u, e.pauseRendering = !0, m.render = performance.now() - i, s("Reading the denoised frame");
|
|
209
214
|
let d = performance.now(), f = await h(e.denoisingManager?.denoiser);
|
|
@@ -211,7 +216,8 @@ async function v(e, { outputWidth: t, outputHeight: n, samples: r = 64, upscaler
|
|
|
211
216
|
let v = {
|
|
212
217
|
exposure: e.renderer.toneMappingExposure,
|
|
213
218
|
toneMapping: e.renderer.toneMapping,
|
|
214
|
-
saturation: e.settings.get("saturation") ?? 1
|
|
219
|
+
saturation: e.settings.get("saturation") ?? 1,
|
|
220
|
+
gain: e._displayGain?.() ?? null
|
|
215
221
|
}, { rgba8: b, width: x, height: S, ms: C, toneMs: w } = await p.upscaleToRGBA8(f, v);
|
|
216
222
|
return m.upscale = C, m.tonemap = w, o && y(e.denoisingManager?.upscalerCanvas, b, x, S), {
|
|
217
223
|
rgba8: b,
|
|
@@ -223,7 +229,7 @@ async function v(e, { outputWidth: t, outputHeight: n, samples: r = 64, upscaler
|
|
|
223
229
|
} catch (e) {
|
|
224
230
|
throw f && p?.dispose(), e;
|
|
225
231
|
} finally {
|
|
226
|
-
d.width && d.height && e.setCanvasSize(d.width, d.height), d.maxSamples !== void 0 && e.settings?.set?.("maxSamples", d.maxSamples), d.finalDenoise !== void 0 && e.denoisingManager?.applyOIDNEnabled(d.finalDenoise), e.pauseRendering = d.paused;
|
|
232
|
+
d.width && d.height && e.setCanvasSize(d.width, d.height), d.maxSamples !== void 0 && e.settings?.set?.("maxSamples", d.maxSamples), d.renderLimitMode !== void 0 && e.settings?.set?.("renderLimitMode", d.renderLimitMode, { reset: !1 }), d.finalDenoise !== void 0 && e.denoisingManager?.applyOIDNEnabled(d.finalDenoise), e.pauseRendering = d.paused;
|
|
227
233
|
}
|
|
228
234
|
}
|
|
229
235
|
function y(e, t, n, r) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, C as o, Ct as s, D as c, Dt as l, E as u, Et as d, G as f, Gt as p, H as m, Ht as h, It as g, J as _, Jt as v, K as y, Kt as b, Lt as x, M as S, Mt as C, N as w, Nt as T, O as E, Ot as D, P as O, Q as ee, Qt as k, Rt as A, S as te, St as ne, T as re, Tt as j, Ut as ie, V as ae, Vt as oe, W as se, Wt as ce, X as le, Xt as ue, Y as de, Yt as fe, Z as pe, Zt as me, _ as he, _t as ge, a as _e, an as ve, at as ye, b as be, bt as xe, c as Se, ct as Ce, d as we, dt as Te, en as Ee, f as De, ft as Oe, g as ke, gt as Ae, h as je, ht as Me, i as Ne, in as Pe, it as Fe, j as Ie, jt as Le, k as Re, kt as ze, l as Be, lt as Ve, m as He, mt as Ue, n as We, nn as Ge, nt as Ke, o as qe, ot as Je, p as Ye, pt as Xe, q as Ze, qt as Qe, r as $e, rn as et, s as tt, st as nt, t as rt, tn as it, tt as at, u as ot, ut as st, v as ct, vt as lt, w as ut, wt as dt, x as ft, xt as pt, yt as mt, z as ht, zt as gt } from "./SolarLimb-bZE6y63S.js";
|
|
2
|
-
import { B as _t, D as vt, E as yt, F as bt, G as M, H as xt, L as St, M as Ct, N as wt, P as Tt, R as Et, S as Dt, U as Ot, V as kt, W as At, X as jt, Z as Mt, _ as Nt, a as Pt, at as Ft, b as It, c as Lt, f as Rt, g as N, h as zt, i as Bt, it as Vt, j as Ht, k as P, m as Ut, p as Wt, q as Gt, r as Kt, s as qt, t as Jt, w as Yt, z as Xt } from "./sceneCachePolicy-
|
|
2
|
+
import { B as _t, D as vt, E as yt, F as bt, G as M, H as xt, L as St, M as Ct, N as wt, P as Tt, R as Et, S as Dt, U as Ot, V as kt, W as At, X as jt, Z as Mt, _ as Nt, a as Pt, at as Ft, b as It, c as Lt, f as Rt, g as N, h as zt, i as Bt, it as Vt, j as Ht, k as P, m as Ut, p as Wt, q as Gt, r as Kt, s as qt, t as Jt, w as Yt, z as Xt } from "./sceneCachePolicy-AKOEu2lf.js";
|
|
3
3
|
import { i as F, o as Zt, r as Qt } from "./Logger-dDDGj9Av.js";
|
|
4
4
|
import { _ as $t, a as en, b as tn, c as nn, d as rn, f as an, g as on, h as sn, i as cn, l as I, m as ln, n as un, o as dn, p as fn, r as pn, s as mn, t as hn, u as gn, v as _n } from "./BufferLayout-xPRH9jYD.js";
|
|
5
5
|
import { n as vn, t as yn } from "./EngineIssues-CIZnXHsF.js";
|
|
@@ -3429,14 +3429,21 @@ function Hs(e, t) {
|
|
|
3429
3429
|
let n = e[0] * zs + e[1] * Bs + e[2] * Vs;
|
|
3430
3430
|
e[0] = n + (e[0] - n) * t, e[1] = n + (e[1] - n) * t, e[2] = n + (e[2] - n) * t;
|
|
3431
3431
|
}
|
|
3432
|
-
function Us(e, { exposure: t, toneMapping: n, saturation: r = 1, preserveAlpha: i = !1 }) {
|
|
3433
|
-
let
|
|
3432
|
+
function Us(e, { exposure: t, toneMapping: n, saturation: r = 1, preserveAlpha: i = !1, pixelGain: a = null }) {
|
|
3433
|
+
let o = Ps.get(n) ?? Ps.get(Qr), s = Rs(t, n), c = Is(n), l = new Uint8ClampedArray(e.length), u = [
|
|
3434
3434
|
0,
|
|
3435
3435
|
0,
|
|
3436
3436
|
0
|
|
3437
|
-
];
|
|
3438
|
-
for (let t = 0; t < e.length; t += 4)
|
|
3439
|
-
|
|
3437
|
+
], d = Math.log2(t);
|
|
3438
|
+
for (let t = 0; t < e.length; t += 4) {
|
|
3439
|
+
let n = s;
|
|
3440
|
+
if (a) {
|
|
3441
|
+
let r = t >> 2, i = r % a.width, o = (r - i) / a.width, s = e[t] * .2126 + e[t + 1] * .7152 + e[t + 2] * .0722;
|
|
3442
|
+
n *= a.fn((i + .5) / a.width, (o + .5) / a.height, s, d);
|
|
3443
|
+
}
|
|
3444
|
+
u[0] = e[t] * n, u[1] = e[t + 1] * n, u[2] = e[t + 2] * n, Hs(u, r), o(u[0], u[1], u[2], 1, u), c ? (l[t] = u[0] * 255 + .5, l[t + 1] = u[1] * 255 + .5, l[t + 2] = u[2] * 255 + .5) : (l[t] = Ls(u[0]) * 255 + .5, l[t + 1] = Ls(u[1]) * 255 + .5, l[t + 2] = Ls(u[2]) * 255 + .5), l[t + 3] = i ? e[t + 3] * 255 + .5 : 255;
|
|
3445
|
+
}
|
|
3446
|
+
return l;
|
|
3440
3447
|
}
|
|
3441
3448
|
//#endregion
|
|
3442
3449
|
//#region src/Processor/TextureCreator.js
|
|
@@ -6869,7 +6876,7 @@ var _l = 100, vl = 4, yl = class extends hi {
|
|
|
6869
6876
|
executionMode: mi.ALWAYS
|
|
6870
6877
|
});
|
|
6871
6878
|
let i = r.width || 1920, a = r.height || 1080;
|
|
6872
|
-
this.camera = n, this.width = i, this.height = a, this.renderer = e, this.scene = t, this.sdfs = new il(), this.lightSerializer = new dl(), this.accumulationEnabled = !0, this.isComplete = !1, this.cameras = [], this.performanceMonitor = Mt(), this.completionThreshold = 0, this.renderLimitMode = "frames", this._initDataTextures(), this.storageTextures = new Ci(0, 0), this.uniforms = new qi(i, a), this._defineUniformGetters(), this.materialData = new va(this.sdfs), this.materialData.callbacks.onReset = () => this.reset(), this.materialData.callbacks.adoptMaterials = (e) => this._adoptMaterials(e), this.materialData.callbacks.onMaterialFeaturesChanged = () => {
|
|
6879
|
+
this.camera = n, this.width = i, this.height = a, this.renderer = e, this.scene = t, this.sdfs = new il(), this.lightSerializer = new dl(), this.accumulationEnabled = !0, this.isComplete = !1, this.cameras = [], this.performanceMonitor = Mt(), this.completionThreshold = 0, this.renderLimitMode = "frames", this.renderTimeLimit = 0, this._initDataTextures(), this.storageTextures = new Ci(0, 0), this.uniforms = new qi(i, a), this._defineUniformGetters(), this.materialData = new va(this.sdfs), this.materialData.callbacks.onReset = () => this.reset(), this.materialData.callbacks.adoptMaterials = (e) => this._adoptMaterials(e), this.materialData.callbacks.onMaterialFeaturesChanged = () => {
|
|
6873
6880
|
this._materialFeaturesChanged = !0;
|
|
6874
6881
|
}, this.materialData.callbacks.getTriangleData = () => ({
|
|
6875
6882
|
array: this._triangleFlat,
|
|
@@ -7268,10 +7275,10 @@ var _l = 100, vl = 4, yl = class extends hi {
|
|
|
7268
7275
|
}), this.cameraChanged &&= (this.emit("camera:moved"), !1);
|
|
7269
7276
|
}
|
|
7270
7277
|
updateCompletionThreshold() {
|
|
7271
|
-
this.completionThreshold = Vt(this.renderMode.value, this.maxSamples.value);
|
|
7278
|
+
this.completionThreshold = this.renderLimitMode === "timeOnly" && this.renderTimeLimit > 0 ? Infinity : Vt(this.renderMode.value, this.maxSamples.value);
|
|
7272
7279
|
}
|
|
7273
|
-
setRenderLimitMode(e) {
|
|
7274
|
-
this.renderLimitMode = e, this.updateCompletionThreshold();
|
|
7280
|
+
setRenderLimitMode(e, t = this.renderTimeLimit) {
|
|
7281
|
+
this.renderLimitMode = e, this.renderTimeLimit = t, this.updateCompletionThreshold();
|
|
7275
7282
|
}
|
|
7276
7283
|
resetHistoryOnRenderModeChange(e) {
|
|
7277
7284
|
e !== this.lastRenderMode && (this.renderModeChangeTimeout && clearTimeout(this.renderModeChangeTimeout), this.pendingRenderMode = e, this.renderModeChangeTimeout = setTimeout(() => {
|
|
@@ -29021,7 +29028,7 @@ var Gm = Qt("wavefront"), Km = ["two", "one"], qm = ["all", ...Km], Jm = [
|
|
|
29021
29028
|
super.setSize(e, t), this._rebuildKernelsIfResized(n, r);
|
|
29022
29029
|
}
|
|
29023
29030
|
_willReadCountersThisFrame() {
|
|
29024
|
-
return this.
|
|
29031
|
+
return this.cameraOptimizer?.isInInteractionMode() ? !1 : this._lockstep ? !this._lockstepRead && this.frameCount % this._readbackEveryNFrames === 0 : this.cameraChanged || this._readbackPending || this._convergedReadbackPending ? !1 : this._readbackFrameCounter + 1 >= this._readbackEveryNFrames;
|
|
29025
29032
|
}
|
|
29026
29033
|
_bounceLoopBound() {
|
|
29027
29034
|
return this.maxBounces.value + this.transmissiveBounces.value + this.maxSubsurfaceSteps.value + 1;
|
|
@@ -29059,7 +29066,7 @@ var Gm = Qt("wavefront"), Km = ["two", "one"], qm = ["all", ...Km], Jm = [
|
|
|
29059
29066
|
}
|
|
29060
29067
|
}
|
|
29061
29068
|
_issueLockstepReadback() {
|
|
29062
|
-
if (this._lockstepRead || this.frameCount % this._readbackEveryNFrames !== 0 || this.
|
|
29069
|
+
if (this._lockstepRead || this.frameCount % this._readbackEveryNFrames !== 0 || this.cameraOptimizer?.isInInteractionMode()) return;
|
|
29063
29070
|
let e = this._queueManager?.getBounceCountsAttribute(), t = this._queueManager?.getCountersAttribute();
|
|
29064
29071
|
if (!e || !t) return;
|
|
29065
29072
|
let n = this._readbackGeneration, r = this.maxBounces.value, i = this._bounceLoopBound(), a = this._queueManager.MAX_BOUNCE_SNAPSHOTS, o = this._wfRenderWidth.value * this._wfRenderHeight.value, s = this._integrator?.curveKey ?? null, c = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e } from "./BidirectionalIntegrator-
|
|
1
|
+
import { n as e } from "./BidirectionalIntegrator-BKF-cwH2.js";
|
|
2
2
|
import { dt as t, i as n, in as r } from "./SolarLimb-bZE6y63S.js";
|
|
3
3
|
import { r as i } from "./WorkingMatrix-C6y233hT.js";
|
|
4
4
|
import { StorageInstancedBufferAttribute as a } from "three/webgpu";
|