rayzee 11.9.0 → 11.11.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/dist/{ArchiveImporter-BJxszU_k.js → ArchiveImporter-D5XOC3tN.js} +27 -12
- package/dist/{BidirectionalIntegrator-DWg66vAd.js → BidirectionalIntegrator-DqG0BEIz.js} +295 -295
- package/dist/{BufferLayout-Bzgccg1o.js → BufferLayout-BROyMqO1.js} +3 -1
- package/dist/{NeuralRetouch-BD9E-Yht.js → NeuralRetouch-BkxZPOYq.js} +1 -1
- package/dist/{NeuralSuperRes-C8Mf3tJX.js → NeuralSuperRes-a8xDtvXM.js} +1 -1
- package/dist/{PathTracer-DeE9UJ1n.js → PathTracer-C_gliSWI.js} +3037 -3002
- package/dist/{PhysicalSky-cKy75-oR.js → PhysicalSky-DWK8pS0U.js} +45 -45
- package/dist/{RayzeeRenderer-CzLyBA3G.js → RayzeeRenderer-B4ZehMg_.js} +40 -40
- package/dist/{SceneMetadata-C17UfOEp.js → SceneMetadata-Bb3iwWhh.js} +1 -1
- package/dist/SolarLimb-ZYl-Pwl0.js +821 -0
- 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 +6 -6
- package/dist/rayzee.es.js +95 -95
- package/dist/rayzee.umd.js +110 -110
- package/dist/{sceneCachePolicy-ywbGKHD3.js → sceneCachePolicy-BHNKvrHR.js} +12 -5
- package/package.json +1 -1
- package/src/EngineDefaults.js +3 -0
- package/src/Processor/BufferLayout.js +7 -6
- package/src/Processor/GeometryExtractor.js +8 -1
- package/src/Processor/MaterialPacking.js +5 -8
- package/src/Processor/PBRT/PBRTMaterials.js +2 -0
- package/src/Processor/PBRT/PBRTSceneBuilder.js +4 -3
- package/src/Processor/SceneProcessor.js +6 -2
- package/src/Processor/USD/USDScene.js +17 -1
- package/src/Processor/utils.js +1 -156
- package/src/Stages/PathTracer.js +9 -0
- package/src/Storage/SceneGraphCodec.js +2 -0
- package/src/TSL/Clearcoat.js +4 -4
- package/src/TSL/Common.js +36 -25
- package/src/TSL/EmissiveSampling.js +1 -1
- package/src/TSL/LightsSampling.js +1 -1
- package/src/TSL/MaterialEvaluation.js +34 -14
- package/src/TSL/MaterialProperties.js +37 -1
- package/src/TSL/MaterialTransmission.js +3 -9
- package/src/TSL/PathTracerCore.js +3 -2
- package/src/TSL/SceneResources.js +12 -1
- package/src/TSL/ShadeKernel.js +63 -14
- package/src/TSL/Struct.js +6 -0
- package/src/TSL/TextureSampling.js +29 -23
- package/src/managers/MaterialDataManager.js +21 -1
- package/dist/SolarLimb-DRYy8tln.js +0 -774
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as e, t } from "../ZipReader-gDSWr0I5.js";
|
|
2
|
-
import { n, t as r } from "../ArchiveImporter-
|
|
2
|
+
import { n, t as r } from "../ArchiveImporter-D5XOC3tN.js";
|
|
3
3
|
export { r as ARCHIVE_ELEMENT_PROMPT_BYTES, n as ArchiveImporter, t as openZip, e as readZipDirectory };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../BidirectionalIntegrator-
|
|
1
|
+
import { t as e } from "../BidirectionalIntegrator-DqG0BEIz.js";
|
|
2
2
|
export { e as BidirectionalIntegrator };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../PhysicalSky-
|
|
1
|
+
import { t as e } from "../PhysicalSky-DWK8pS0U.js";
|
|
2
2
|
export { e as PhysicalSky };
|
package/dist/rayzee-core.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./SolarLimb-
|
|
2
|
-
import { a as e, n as t, o as n, r, t as i } from "./RayzeeRenderer-
|
|
3
|
-
import {
|
|
1
|
+
import "./SolarLimb-ZYl-Pwl0.js";
|
|
2
|
+
import { a as e, n as t, o as n, r, t as i } from "./RayzeeRenderer-B4ZehMg_.js";
|
|
3
|
+
import { Dt as a, mt as o } from "./PathTracer-C_gliSWI.js";
|
|
4
4
|
import { n as s, t as c } from "./EngineEvents-CLckhYbL.js";
|
|
5
|
-
import { G as l, q as u, r as d, x as f, y as p } from "./sceneCachePolicy-
|
|
5
|
+
import { G as l, q as u, r as d, x as f, y as p } from "./sceneCachePolicy-BHNKvrHR.js";
|
|
6
6
|
import { i as m, n as h, r as g, t as _ } from "./Logger-dDDGj9Av.js";
|
|
7
|
-
import { f as v } from "./BufferLayout-
|
|
7
|
+
import { f as v } from "./BufferLayout-BROyMqO1.js";
|
|
8
8
|
import { i as y, n as b, r as x, t as S } from "./EngineIssues-CfJiBaNj.js";
|
|
9
9
|
import { n as C, t as w } from "./AssetConfig-DSEntE65.js";
|
|
10
10
|
import { d as T, p as E, t as D, u as O } from "./ViewTransforms-CYN7bq2w.js";
|
|
11
|
-
import { l as k, s as A } from "./SceneMetadata-
|
|
11
|
+
import { l as k, s as A } from "./SceneMetadata-Bb3iwWhh.js";
|
|
12
12
|
export { A as ARCHIVE_FORMATS, D as DEFAULT_VIEW, l as ENGINE_DEFAULTS, c as EngineEvents, S as EngineIssueError, b as ISSUE_CODES, x as ISSUE_SEVERITY, y as IssueLog, s as LEGACY_EVENT_NAMES, _ as LOG_LEVELS, r as LightManager, h as Logger, u as MATERIAL_DEFAULTS, a as MAX_RESERVABLE_RENDER_SIZE, i as RayzeeRenderer, e as RenderSettings, n as SETTING_SOURCE, o as SKY_DEFAULTS, v as TRIANGLE_DATA_LAYOUT, d as VERSION, w as configureAssets, p as configurePlatform, g as createLogger, t as describeAdapter, m as fmt, C as getAssetConfig, f as getPlatform, O as getViewTransform, T as listViewTransforms, k as localFolder, E as onRegistryChange };
|
package/dist/rayzee.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as e } from "./BidirectionalIntegrator-
|
|
2
|
-
import { Ft as t,
|
|
3
|
-
import { _ as
|
|
4
|
-
import { $ as
|
|
1
|
+
import { t as e } from "./BidirectionalIntegrator-DqG0BEIz.js";
|
|
2
|
+
import { Ft as t, It as n, Tt as r, Zt as i, fn as a, in as o, nn as s, rt as c, tn as l } from "./SolarLimb-ZYl-Pwl0.js";
|
|
3
|
+
import { _ as u, a as d, c as f, d as p, f as m, g as h, h as g, i as _, l as v, m as y, n as b, o as x, p as S, r as C, s as w, t as T, u as E } from "./RayzeeRenderer-B4ZehMg_.js";
|
|
4
|
+
import { $ as D, B as O, Dt as k, F as ee, H as te, I as ne, J as re, Mt as A, Ot as j, Q as M, V as ie, W as ae, _t as oe, at as se, bt as ce, dt as le, et as N, gt as ue, ht as de, it as fe, jt as pe, kt as me, mt as he, nt as ge, pt as _e, rt as ve, tt as ye, yt as be, z as xe } from "./PathTracer-C_gliSWI.js";
|
|
5
5
|
import { n as Se, t as P } from "./EngineEvents-CLckhYbL.js";
|
|
6
|
-
import { D as Ce, G as we, J as Te, K as Ee, O as De, W as Oe, Y as ke, a as Ae, c as je, et as Me, i as Ne, m as Pe, ot as Fe, p as Ie, q as Le, r as Re, tt as ze, x as Be, y as Ve } from "./sceneCachePolicy-
|
|
6
|
+
import { D as Ce, G as we, J as Te, K as Ee, O as De, W as Oe, Y as ke, a as Ae, c as je, et as Me, i as Ne, m as Pe, ot as Fe, p as Ie, q as Le, r as Re, tt as ze, x as Be, y as Ve } from "./sceneCachePolicy-BHNKvrHR.js";
|
|
7
7
|
import { i as He, n as Ue, r as We, t as Ge } from "./Logger-dDDGj9Av.js";
|
|
8
|
-
import { f as Ke, r as qe } from "./BufferLayout-
|
|
8
|
+
import { f as Ke, r as qe } from "./BufferLayout-BROyMqO1.js";
|
|
9
9
|
import { i as Je, n as Ye, r as Xe, t as Ze } from "./EngineIssues-CfJiBaNj.js";
|
|
10
10
|
import { i as Qe, r as $e } from "./shared-BGBcSxBQ.js";
|
|
11
11
|
import { r as et } from "./WorkingMatrix-C6y233hT.js";
|
|
@@ -13,14 +13,14 @@ import { i as tt, r as nt, t as rt } from "./ActiveColor-YvuQq44O.js";
|
|
|
13
13
|
import { n as it, t as at } from "./AssetConfig-DSEntE65.js";
|
|
14
14
|
import { a as ot, d as st, g as ct, i as lt, l as ut, o as dt, p as ft, r as pt, s as mt, t as ht, u as gt } from "./ViewTransforms-CYN7bq2w.js";
|
|
15
15
|
import { a as _t, i as vt, n as yt, r as bt } from "./identity-C1cLD1C0.js";
|
|
16
|
-
import { l as xt, n as St, s as Ct, t as wt } from "./SceneMetadata-
|
|
16
|
+
import { l as xt, n as St, s as Ct, t as wt } from "./SceneMetadata-Bb3iwWhh.js";
|
|
17
17
|
import { t as Tt } from "./ToneMapGPU-4GPwoG_c.js";
|
|
18
18
|
import { t as Et } from "./FileFormats-sPGJeCRc.js";
|
|
19
19
|
import { A as Dt, C as Ot, D as kt, E as At, O as jt, S as Mt, T as Nt, _ as Pt, a as Ft, b as It, c as Lt, d as Rt, f as zt, g as Bt, h as Vt, i as Ht, k as Ut, l as Wt, m as Gt, n as Kt, o as qt, p as Jt, r as Yt, s as Xt, t as Zt, u as Qt, v as $t, w as en, x as tn, y as nn } from "./ColorManagement-B_HjAiy2.js";
|
|
20
20
|
import { c as rn, l as an, n as on, o as sn, t as cn } from "./openStorage-CdyVjmps.js";
|
|
21
21
|
import { n as ln, t as un } from "./ZipReader-gDSWr0I5.js";
|
|
22
|
-
import { i as dn, n as fn, r as pn } from "./NeuralSuperRes-
|
|
23
|
-
import { i as mn, n as hn, r as gn } from "./NeuralRetouch-
|
|
22
|
+
import { i as dn, n as fn, r as pn } from "./NeuralSuperRes-a8xDtvXM.js";
|
|
23
|
+
import { i as mn, n as hn, r as gn } from "./NeuralRetouch-BkxZPOYq.js";
|
|
24
24
|
import { ExternalTexture as _n, MeshBasicNodeMaterial as vn, QuadMesh as yn, ReadbackBuffer as bn, RenderTarget as xn, StorageTexture as Sn, TextureNode as Cn, WebGPURenderer as wn } from "three/webgpu";
|
|
25
25
|
import { Fn as Tn, If as F, Loop as En, Return as Dn, atan as On, atomicAdd as kn, atomicLoad as An, atomicStore as jn, attributeArray as Mn, dot as I, exp as Nn, exp2 as Pn, float as L, floatBitsToUint as Fn, floor as In, fract as Ln, int as R, ivec2 as Rn, localId as z, log2 as zn, max as B, min as Bn, mix as V, normalize as Vn, pow as Hn, round as Un, saturate as H, select as U, smoothstep as Wn, sqrt as Gn, storage as Kn, textureLoad as W, textureStore as G, toneMappingExposure as qn, uint as K, uniform as q, uvec2 as Jn, uvec4 as Yn, vec2 as J, vec3 as Xn, vec4 as Y, workgroupArray as Zn, workgroupBarrier as Qn, workgroupId as X } from "three/tsl";
|
|
26
26
|
import { ACESFilmicToneMapping as $n, AddEquation as er, AnimationMixer as tr, Box2 as nr, Box3 as rr, ClampToEdgeWrapping as ir, Color as ar, Controls as or, CustomBlending as sr, DataArrayTexture as cr, DataTexture as lr, EventDispatcher as ur, FloatType as dr, HalfFloatType as fr, InterpolateSmooth as pr, LinearFilter as mr, LoopOnce as hr, LoopRepeat as gr, MathUtils as _r, Matrix3 as vr, Matrix4 as yr, Mesh as br, MeshBasicMaterial as xr, NearestFilter as Z, NoColorSpace as Sr, NumberKeyframeTrack as Cr, OneFactor as wr, OrthographicCamera as Tr, PerspectiveCamera as Er, PropertyBinding as Dr, Quaternion as Or, RGBAFormat as kr, Raycaster as Ar, RedIntegerFormat as jr, SRGBColorSpace as Mr, Scene as Nr, SphereGeometry as Pr, Timer as Fr, UnsignedByteType as Ir, UnsignedIntType as Lr, Vector2 as Rr, Vector3 as Q, Vector4 as zr, VectorKeyframeTrack as Br } from "three";
|
|
@@ -95,14 +95,14 @@ var Wr = 65504, Gr = 6e4, Kr = Object.freeze([
|
|
|
95
95
|
upscalerHdr: !0,
|
|
96
96
|
nrdQualityPreset: "medium",
|
|
97
97
|
nrdDebugMode: 0
|
|
98
|
-
}, $r = class extends
|
|
98
|
+
}, $r = class extends pe {
|
|
99
99
|
constructor(e, t = {}) {
|
|
100
100
|
super("NormalDepth", {
|
|
101
101
|
...t,
|
|
102
|
-
executionMode:
|
|
103
|
-
}), this.renderer = e, this.pathTracer = t.pathTracer, this._dirty = !0, this.cameraWorldMatrix = q(new yr(), "mat4"), this.cameraProjectionMatrixInverse = q(new yr(), "mat4"), this.cameraRay =
|
|
102
|
+
executionMode: A.ALWAYS
|
|
103
|
+
}), this.renderer = e, this.pathTracer = t.pathTracer, this._dirty = !0, this.cameraWorldMatrix = q(new yr(), "mat4"), this.cameraProjectionMatrixInverse = q(new yr(), "mat4"), this.cameraRay = ye(), this.resolutionWidth = q(t.width || 1), this.resolutionHeight = q(t.height || 1);
|
|
104
104
|
let n = t.width || 1, r = t.height || 1;
|
|
105
|
-
this._outputStorageTex = new Sn(
|
|
105
|
+
this._outputStorageTex = new Sn(j, j), this._outputStorageTex.type = fr, this._outputStorageTex.format = kr, this._outputStorageTex.minFilter = Z, this._outputStorageTex.magFilter = Z, this._shadingStorageTex = new Sn(j, j), this._shadingStorageTex.type = fr, this._shadingStorageTex.format = kr, this._shadingStorageTex.minFilter = Z, this._shadingStorageTex.magFilter = Z, this._shadingRT = new xn(n, r, {
|
|
106
106
|
type: fr,
|
|
107
107
|
format: kr,
|
|
108
108
|
minFilter: Z,
|
|
@@ -135,42 +135,42 @@ var Wr = 65504, Gr = 6e4, Kr = Object.freeze([
|
|
|
135
135
|
let t = e.sceneStorageNodes?.();
|
|
136
136
|
t && (this._triStorageNode = t.triangles, this._bvhStorageNode = t.bvh);
|
|
137
137
|
}
|
|
138
|
-
return t && !this._matStorageNode && (this._matStorageNode = Kn(t, "vec4", t.count).toReadOnly()), this._linearBuckets &&
|
|
138
|
+
return t && !this._matStorageNode && (this._matStorageNode = Kn(t, "vec4", t.count).toReadOnly()), this._linearBuckets && te(this._linearBuckets, e.materialData?.linearBuckets), this._lastTriAttr = e.triangleGeoAttr || this._lastTriAttr, this._lastBvhAttr = e.bvhStorageAttr || this._lastBvhAttr, this._lastMatAttr = t || this._lastMatAttr, !!(this._triStorageNode && this._bvhStorageNode && this._matStorageNode);
|
|
139
139
|
}
|
|
140
140
|
_buildCompute() {
|
|
141
141
|
let e = this._triStorageNode, t = this._bvhStorageNode, n = this._matStorageNode;
|
|
142
|
-
this._linearBuckets =
|
|
143
|
-
let
|
|
144
|
-
srgbBuckets:
|
|
142
|
+
this._linearBuckets = ee(this.pathTracer?.materialData?.linearBuckets);
|
|
143
|
+
let c = {
|
|
144
|
+
srgbBuckets: ee(null),
|
|
145
145
|
linearBuckets: this._linearBuckets,
|
|
146
146
|
shadowAlbedoMaps: null,
|
|
147
147
|
goboMaps: null,
|
|
148
148
|
iesProfiles: null,
|
|
149
149
|
alphaShadows: null
|
|
150
|
-
},
|
|
151
|
-
this._computeNode =
|
|
152
|
-
let u = R(X.x).mul(8).add(R(z.x)),
|
|
153
|
-
F(u.lessThan(R(
|
|
154
|
-
let _ =
|
|
150
|
+
}, u = this.cameraWorldMatrix, d = this.cameraProjectionMatrixInverse, f = this.resolutionWidth, p = this.resolutionHeight, m = this._outputStorageTex, h = this._shadingStorageTex, g = this._leafStorageTex;
|
|
151
|
+
this._computeNode = a(Tn(([a, c]) => {
|
|
152
|
+
let u = R(X.x).mul(8).add(R(z.x)), d = R(X.y).mul(8).add(R(z.y));
|
|
153
|
+
F(u.lessThan(R(f)).and(d.lessThan(R(p))), () => {
|
|
154
|
+
let _ = D(J(L(u).add(.5).div(f), L(d).add(.5).div(p)), a, c, this.cameraRay), v = _.direction.toVar(), y = M(v, this.cameraRay.clipStart, a, this.cameraRay.cameraProjection).toVar(), b = l({
|
|
155
155
|
origin: _.origin.add(v.mul(y)),
|
|
156
156
|
direction: v
|
|
157
|
-
}), x =
|
|
158
|
-
G(
|
|
159
|
-
let T = x.normal.toVar(),
|
|
157
|
+
}), x = i.wrap(re(b, t, e)), S = x.normal.mul(.5).add(.5), C = Bn(x.dst.add(y), L(65504)), w = x.didHit.select(Y(S, C), Y(0, 0, 0, L(Wr)));
|
|
158
|
+
G(m, Jn(K(u), K(d)), w).toWriteOnly(), g && G(g, Jn(K(u), K(d)), Yn(K(x.instanceLeaf.add(1)), 0, 0, 0)).toWriteOnly();
|
|
159
|
+
let T = x.normal.toVar(), E = L(1).toVar();
|
|
160
160
|
F(x.didHit, () => {
|
|
161
|
-
let
|
|
162
|
-
F(
|
|
163
|
-
|
|
161
|
+
let i = s.wrap(r(x.materialIndex, n)).toVar(), a = o.wrap(ne(x.uv, i)).toVar(), c = Y(0).toVar();
|
|
162
|
+
F(i.normalMapIndex.greaterThanEqual(R(0)), () => {
|
|
163
|
+
c.assign(ae(e, x.triangleIndex, x.normal, i.normalTransform, t, x.instanceLeaf));
|
|
164
164
|
});
|
|
165
|
-
let l = ie(x.normal,
|
|
166
|
-
T.assign(xe(l,
|
|
167
|
-
let u = B(
|
|
168
|
-
|
|
165
|
+
let l = ie(x.normal, i, a, c).toVar();
|
|
166
|
+
T.assign(xe(l, i, a)), E.assign(O(i, a).y.clamp(.05, 1));
|
|
167
|
+
let u = B(i.emissive.x, B(i.emissive.y, i.emissive.z)).mul(i.emissiveIntensity).greaterThan(0);
|
|
168
|
+
E.assign(U(u, E.negate(), E));
|
|
169
169
|
});
|
|
170
|
-
let k = x.didHit.select(Y(T.mul(.5).add(.5),
|
|
171
|
-
G(
|
|
170
|
+
let k = x.didHit.select(Y(T.mul(.5).add(.5), E), Y(0, 0, 0, 1));
|
|
171
|
+
G(h, Jn(K(u), K(d)), k).toWriteOnly();
|
|
172
172
|
});
|
|
173
|
-
})(
|
|
173
|
+
})(u, d), c).compute([
|
|
174
174
|
this._dispatchX,
|
|
175
175
|
this._dispatchY,
|
|
176
176
|
1
|
|
@@ -214,7 +214,7 @@ var Wr = 65504, Gr = 6e4, Kr = Object.freeze([
|
|
|
214
214
|
reallocateReservedStorage() {
|
|
215
215
|
this._computeNode?.dispose(), this._computeNode = null, this._outputStorageTex?.dispose(), this._shadingStorageTex?.dispose();
|
|
216
216
|
let e = () => {
|
|
217
|
-
let e = new Sn(
|
|
217
|
+
let e = new Sn(j, j);
|
|
218
218
|
return e.type = fr, e.format = kr, e.minFilter = Z, e.magFilter = Z, e;
|
|
219
219
|
};
|
|
220
220
|
this._outputStorageTex = e(), this._shadingStorageTex = e(), this._leafStorageTex &&= (this._leafStorageTex.dispose(), this._makeLeafStorage()), this._computeBuilt = !1;
|
|
@@ -233,20 +233,20 @@ var Wr = 65504, Gr = 6e4, Kr = Object.freeze([
|
|
|
233
233
|
this._leafRT ? e.setTexture("pathtracer:instanceLeaf", this._leafRT.texture) : e.getTexture("pathtracer:instanceLeaf") && e.removeTexture("pathtracer:instanceLeaf");
|
|
234
234
|
}
|
|
235
235
|
_makeLeafStorage() {
|
|
236
|
-
let e = new Sn(
|
|
236
|
+
let e = new Sn(j, j);
|
|
237
237
|
return e.type = Lr, e.format = jr, e.minFilter = Z, e.magFilter = Z, e;
|
|
238
238
|
}
|
|
239
239
|
dispose() {
|
|
240
240
|
this._computeNode?.dispose(), this._outputStorageTex?.dispose(), this._shadingStorageTex?.dispose(), this._shadingRT?.dispose(), this._leafStorageTex?.dispose(), this._leafRT?.dispose(), this._rtA?.dispose(), this._rtB?.dispose();
|
|
241
241
|
}
|
|
242
|
-
}, ei = class extends
|
|
242
|
+
}, ei = class extends pe {
|
|
243
243
|
constructor(e, t, n = {}) {
|
|
244
244
|
super("MotionVector", {
|
|
245
245
|
...n,
|
|
246
|
-
executionMode:
|
|
246
|
+
executionMode: A.ALWAYS
|
|
247
247
|
}), this.renderer = e, this.camera = t, this.pathTracer = n.pathTracer || null;
|
|
248
248
|
let r = n.width || 1, i = n.height || 1;
|
|
249
|
-
this.prevViewProjectionMatrix = new yr(), this.currentViewProjectionMatrix = new yr(), this.matricesInitialized = !1, this.cameraWorldMatrix = q(new yr(), "mat4"), this.cameraProjectionMatrixInverse = q(new yr(), "mat4"), this.cameraRay =
|
|
249
|
+
this.prevViewProjectionMatrix = new yr(), this.currentViewProjectionMatrix = new yr(), this.matricesInitialized = !1, this.cameraWorldMatrix = q(new yr(), "mat4"), this.cameraProjectionMatrixInverse = q(new yr(), "mat4"), this.cameraRay = ye(), this.prevVP = q(new yr(), "mat4"), this.resolutionWidth = q(r), this.resolutionHeight = q(i), this._normalDepthTexNode = new Cn(), this._screenSpaceStorageTex = new Sn(j, j), this._screenSpaceStorageTex.type = fr, this._screenSpaceStorageTex.format = kr, this._screenSpaceStorageTex.minFilter = Z, this._screenSpaceStorageTex.magFilter = Z, this._srcRegion = new nr(new Rr(0, 0), new Rr(0, 0)), this.screenSpaceTarget = new xn(r, i, {
|
|
250
250
|
type: fr,
|
|
251
251
|
format: kr,
|
|
252
252
|
minFilter: Z,
|
|
@@ -306,7 +306,7 @@ var Wr = 65504, Gr = 6e4, Kr = Object.freeze([
|
|
|
306
306
|
}
|
|
307
307
|
reallocateReservedStorage() {
|
|
308
308
|
this._screenSpaceComputeNode?.dispose(), this._screenSpaceStorageTex?.dispose();
|
|
309
|
-
let e = new Sn(
|
|
309
|
+
let e = new Sn(j, j);
|
|
310
310
|
e.type = fr, e.format = kr, e.minFilter = Z, e.magFilter = Z, this._screenSpaceStorageTex = e, this._buildScreenSpaceCompute();
|
|
311
311
|
}
|
|
312
312
|
dispose() {
|
|
@@ -392,17 +392,17 @@ function Gi(e) {
|
|
|
392
392
|
let t = Math.imul(e | 0, 2654435761) >>> 0;
|
|
393
393
|
return t ^= t >>> 15, t = Math.imul(t, 2246822507) >>> 0, t ^= t >>> 13, t = Math.imul(t, 3266489909) >>> 0, t ^= t >>> 16, t / 4294967296;
|
|
394
394
|
}
|
|
395
|
-
var Ki = class extends
|
|
395
|
+
var Ki = class extends pe {
|
|
396
396
|
constructor(e, t = {}) {
|
|
397
397
|
super("NRD", {
|
|
398
398
|
...t,
|
|
399
|
-
executionMode:
|
|
399
|
+
executionMode: A.PER_CYCLE
|
|
400
400
|
}), this.renderer = e, this.pathTracer = t.pathTracer || null, this.settings = {
|
|
401
401
|
...Yr,
|
|
402
402
|
...t.settings || {}
|
|
403
403
|
}, this._releaseHitDistance = this.pathTracer?.requestOutput?.("hitDistance", { encode: (e, t) => e.div(B(t.mul(.1).add(3), L(1e-4))).clamp(0, 1) }) ?? null;
|
|
404
404
|
let n = t.width || 1, r = t.height || 1;
|
|
405
|
-
this.resW = q(n), this.resH = q(r), this.minRectDimMulUnproject = q(1), this.inputFrames = q(0), this.resetU = q(0), this.debugMode = q(0, "int"), this.rotPre = q(new zr(1, 0, 0, 1), "vec4"), this.rotBlur = q(new zr(1, 0, 0, 1), "vec4"), this.rotPost = q(new zr(1, 0, 0, 1), "vec4"), this.camWorld = q(new yr(), "mat4"), this.camProjInv = q(new yr(), "mat4"), this.camView = q(new yr(), "mat4"), this.prevCamView = q(new yr(), "mat4"), this.camPos = q(new Q(), "vec3"), this.prevCamPos = q(new Q(), "vec3"), this.viewVector = q(new Q(), "vec3"), this.prevViewVector = q(new Q(), "vec3"), this.cameraRay =
|
|
405
|
+
this.resW = q(n), this.resH = q(r), this.minRectDimMulUnproject = q(1), this.inputFrames = q(0), this.resetU = q(0), this.debugMode = q(0, "int"), this.rotPre = q(new zr(1, 0, 0, 1), "vec4"), this.rotBlur = q(new zr(1, 0, 0, 1), "vec4"), this.rotPost = q(new zr(1, 0, 0, 1), "vec4"), this.camWorld = q(new yr(), "mat4"), this.camProjInv = q(new yr(), "mat4"), this.camView = q(new yr(), "mat4"), this.prevCamView = q(new yr(), "mat4"), this.camPos = q(new Q(), "vec3"), this.prevCamPos = q(new Q(), "vec3"), this.viewVector = q(new Q(), "vec3"), this.prevViewVector = q(new Q(), "vec3"), this.cameraRay = ye(), this.u = {};
|
|
406
406
|
for (let e of [
|
|
407
407
|
"maxAccum",
|
|
408
408
|
"maxFast",
|
|
@@ -440,7 +440,7 @@ var Ki = class extends A {
|
|
|
440
440
|
}), this._compiled = !1, this._needsReset = !0, this._stabPing = 0, this._camInitialized = !1, this._dispatchX = Math.ceil(n / _i), this._dispatchY = Math.ceil(r / _i), this._buildKernels();
|
|
441
441
|
}
|
|
442
442
|
_allocStorage() {
|
|
443
|
-
let e = () =>
|
|
443
|
+
let e = () => me(fr);
|
|
444
444
|
this._tmpA = e(), this._tmpB = e(), this._hist = e(), this._fastHist = e(), this._internal = e(), this._geomPrev = e(), this._stabA = e(), this._stabB = e(), this._dataT = e();
|
|
445
445
|
}
|
|
446
446
|
_disposeStorage() {
|
|
@@ -475,10 +475,10 @@ var Ki = class extends A {
|
|
|
475
475
|
return N(e, t, n, r, this.cameraRay);
|
|
476
476
|
}
|
|
477
477
|
_viewVector(e, t, n) {
|
|
478
|
-
return U(
|
|
478
|
+
return U(ge(this.cameraRay.cameraProjection), n, Vn(t.sub(e)));
|
|
479
479
|
}
|
|
480
480
|
_frustumSize(e) {
|
|
481
|
-
return this.minRectDimMulUnproject.mul(U(
|
|
481
|
+
return this.minRectDimMulUnproject.mul(U(ge(this.cameraRay.cameraProjection), L(1), e));
|
|
482
482
|
}
|
|
483
483
|
_pixelUv(e, t) {
|
|
484
484
|
return J(L(e).add(.5).div(this.resW), L(t).add(.5).div(this.resH));
|
|
@@ -575,19 +575,19 @@ var Ki = class extends A {
|
|
|
575
575
|
]);
|
|
576
576
|
}
|
|
577
577
|
_buildSpatial(e) {
|
|
578
|
-
let r = e === "pre", { radiusScale: i, fractionScale: a } = vi[e],
|
|
579
|
-
let
|
|
580
|
-
F(
|
|
581
|
-
let p = Rn(
|
|
578
|
+
let r = e === "pre", { radiusScale: i, fractionScale: a } = vi[e], o = this.u, s = this._colorTexNode, l = this._albedoTexNode, u = this._ndTexNode, d = this._snTexNode, f = this._nData, p = e === "blur" ? this._nTmpA : this._nTmpB, m = e === "blur" ? this._tmpB : r ? this._tmpA : this._hist, h = this._geomPrev, g = r ? this.rotPre : e === "blur" ? this.rotBlur : this.rotPost, _ = r ? o.prepassBlurRadius : o.maxBlurRadius, v = this.camView, y = this.camPos, b = this.resW, x = this.resH, S = this.inputFrames, C = r ? (e, r) => Y(Mi(n(W(s, e).xyz.div(zi(r.xyz)))), t(r.w, c).min(1)) : (e) => W(p, e), w = Tn(([t, n]) => {
|
|
579
|
+
let s = R(X.x).mul(_i).add(R(z.x)), c = R(X.y).mul(_i).add(R(z.y));
|
|
580
|
+
F(s.lessThan(R(b)).and(c.lessThan(R(x))), () => {
|
|
581
|
+
let p = Rn(s, c), w = Jn(K(s), K(c)), T = W(u, p).w.toVar(), E = T.greaterThanEqual(Gr), D = W(d, p).toVar(), O = Vn(D.xyz.mul(2).sub(1)).toVar(), k = Ui(D.w).toVar(), ee = L(Gr).toVar(), te = r ? W(l, p) : null, ne = (r ? Bi(te) : Vi(W(f, p))).toVar(), re = C(p, te).toVar();
|
|
582
582
|
F(E.not(), () => {
|
|
583
|
-
let e = this._pixelUv(
|
|
583
|
+
let e = this._pixelUv(s, c), m = this._worldPosAt(e, T, t, n).toVar();
|
|
584
584
|
ee.assign(v.mul(Y(m, 1)).z.abs()), F(_.greaterThan(0).and(Hi(D.w).not()), () => {
|
|
585
|
-
let
|
|
585
|
+
let s = I(O, this._viewVector(m, y, this.viewVector)).abs().toVar(), c = this._frustumSize(ee).toVar(), h = S.add(1), w = r ? B(S, L(10)) : W(f, p).y.add(S), T = (r ? L(1).div(w.add(1)) : this._advancedNonLinear(w)).toVar(), E = wi(k, .5).toVar(), D = ee.mul(Jr).add(3), te = re.w.toVar(), A = H(te.mul(D).div(c)), j = L(1).sub(this._handover(h)), M = (r ? A.div(h) : A.mul(T)).mul(j), ie = o.minBlurRadius.mul(H(L(2).sub(w.div(B(o.maxAccum, 1))))), ae = B(H(Gn(H(M)).mul(i)).mul(_).mul(E), ie.mul(E)).toVar(), oe = Ai(o.planeDistSensitivity, c, m, O).toVar(), se = Ei(T, o.lobeAngleFraction, k, o.lobeVolumePercent).div(a).toVar(), ce = Di(k, o.roughnessFraction.mul(a)).toVar(), le = ki(te, T).toVar(), N = o.minHitDistanceWeight.mul(a).mul(E);
|
|
586
586
|
r || (N = N.mul(T)), N = N.toVar();
|
|
587
587
|
let ue = J(1);
|
|
588
588
|
if (!r) {
|
|
589
589
|
let e = v.mul(Y(O, 0)).xy;
|
|
590
|
-
ue = V(J(1).sub(e.abs()), J(1),
|
|
590
|
+
ue = V(J(1).sub(e.abs()), J(1), s), ue = ue.div(B(ue.x, ue.y));
|
|
591
591
|
}
|
|
592
592
|
let de = ue.mul(J(L(1).div(b), L(1).div(x))).mul(ae).toVar(), fe = L(1).toVar();
|
|
593
593
|
for (let i = 0; i < bi.length; i++) {
|
|
@@ -596,11 +596,11 @@ var Ki = class extends A {
|
|
|
596
596
|
let y = r ? W(l, p) : null, b = r ? Bi(y) : Vi(W(f, p));
|
|
597
597
|
c.assign(U(this._excluded(m, _.w, b, ne), L(0), c));
|
|
598
598
|
let x = Wi(c, C(p, y));
|
|
599
|
-
c.mulAssign(N.add(Si(x.w, le.x, le.y))), fe.addAssign(c),
|
|
599
|
+
c.mulAssign(N.add(Si(x.w, le.x, le.y))), fe.addAssign(c), re.addAssign(x.mul(c));
|
|
600
600
|
}
|
|
601
|
-
|
|
601
|
+
re.divAssign(B(fe, 1e-6)), r || re.assign(Y(re.xyz, te));
|
|
602
602
|
});
|
|
603
|
-
}), G(m, w,
|
|
603
|
+
}), G(m, w, re).toWriteOnly(), e === "post" && G(h, w, Y(O, ee)).toWriteOnly();
|
|
604
604
|
});
|
|
605
605
|
});
|
|
606
606
|
return this._dispatchOf(w);
|
|
@@ -613,19 +613,19 @@ var Ki = class extends A {
|
|
|
613
613
|
F(w.greaterThanEqual(Gr), () => {
|
|
614
614
|
G(l, _, T).toWriteOnly(), G(u, _, Y(0)).toWriteOnly(), Dn();
|
|
615
615
|
});
|
|
616
|
-
let E = e.maxAccum.mul(L(1).sub(y)).toVar(), D = e.maxFast.mul(L(1).sub(y)).toVar(), O = W(n, g), k = Vn(O.xyz.mul(2).sub(1)).toVar(), ee = Ui(O.w).toVar(), te = this._pixelUv(S, C), ne = this._worldPosAt(te, w, b, x).toVar(),
|
|
616
|
+
let E = e.maxAccum.mul(L(1).sub(y)).toVar(), D = e.maxFast.mul(L(1).sub(y)).toVar(), O = W(n, g), k = Vn(O.xyz.mul(2).sub(1)).toVar(), ee = Ui(O.w).toVar(), te = this._pixelUv(S, C), ne = this._worldPosAt(te, w, b, x).toVar(), re = f.mul(Y(ne, 1)).z.abs().toVar(), A = I(k, this._viewVector(ne, m, this.viewVector)).abs().toVar(), j = this._frustumSize(re).toVar(), M = Xn(0).toVar();
|
|
617
617
|
M.addAssign(k.mul(.25));
|
|
618
618
|
for (let e = -1; e <= 0; e++) for (let r = -1; r <= 0; r++) {
|
|
619
619
|
if (r === 0 && e === 0) continue;
|
|
620
620
|
let i = this._clampCoord(S.add(r), C.add(e)), a = Vn(W(n, i).xyz.mul(2).sub(1)), o = W(t, i).w.lessThan(Gr);
|
|
621
621
|
M.addAssign(U(o, a, k).mul(.25));
|
|
622
622
|
}
|
|
623
|
-
let ie = W(r, g), ae = te.sub(ie.xy).toVar(), oe = p.mul(Y(ne, 1)).z.abs().toVar(), se = this._bilinear(ae), ce =
|
|
623
|
+
let ie = W(r, g), ae = te.sub(ie.xy).toVar(), oe = p.mul(Y(ne, 1)).z.abs().toVar(), se = this._bilinear(ae), ce = j.mul(H(e.disocclusionThreshold.div(B(A, .05)))).sub(ti).toVar(), le = L(1).sub(y), N = [], ue = [];
|
|
624
624
|
for (let e = 0; e < 4; e++) {
|
|
625
625
|
let t = W(c, se.taps[e]), n = U(I(t.xyz, M).greaterThan(fi), L(1), L(0)), r = U(t.w.sub(oe).abs().lessThanEqual(ce), L(1), L(0)), i = U(t.w.lessThan(Gr), L(1), L(0));
|
|
626
626
|
N.push(n.mul(r).mul(i).mul(se.inScreen[e]).mul(le).toVar()), ue.push(W(s, se.taps[e]).x);
|
|
627
627
|
}
|
|
628
|
-
let de = se.customWeights(N).map((e) => e.toVar()), fe = N[0].add(N[1]).add(N[2]).add(N[3]).greaterThan(3.5).toVar(), pe = N[0].add(N[1].mul(2)).add(N[2].mul(4)).add(N[3].mul(8)), me = this._applyCustomWeights(ue, de, L(0)).toVar(), he = I(k, this._viewVector(ne, h, this.prevViewVector)).abs().add(.001).div(
|
|
628
|
+
let de = se.customWeights(N).map((e) => e.toVar()), fe = N[0].add(N[1]).add(N[2]).add(N[3]).greaterThan(3.5).toVar(), pe = N[0].add(N[1].mul(2)).add(N[2].mul(4)).add(N[3].mul(8)), me = this._applyCustomWeights(ue, de, L(0)).toVar(), he = I(k, this._viewVector(ne, h, this.prevViewVector)).abs().add(.001).div(A.add(.001)).toVar();
|
|
629
629
|
he.assign(V(L(.1), L(1), H(he.mul(he))));
|
|
630
630
|
let ge = Gn(H(se.filter(N))).mul(he).toVar();
|
|
631
631
|
me.assign(me.mul(V(ge, L(1), L(1).div(me.add(1))))), me.assign(Bn(me, E));
|
|
@@ -652,13 +652,13 @@ var Ki = class extends A {
|
|
|
652
652
|
let e = W(r, h);
|
|
653
653
|
G(a, g, e).toWriteOnly(), G(o, g, Y(e.x, 0, 0, 0)).toWriteOnly(), Dn();
|
|
654
654
|
});
|
|
655
|
-
let v = W(i, h).toVar(), y = v.y.toVar(), b = y.add(u), x = this._handover(u.add(1)).toVar(), S = W(n, h), C = Vn(S.xyz.mul(2).sub(1)).toVar(), w = Ui(S.w).toVar(), T = this._pixelUv(p, m), E = this._worldPosAt(T, _, d, f).toVar(), D = s.mul(Y(E, 1)).z.abs(), O = this._frustumSize(D).toVar(), k = W(r, h).toVar(), ee = L(1).div(b.add(1)).toVar(), te = D.mul(Jr).add(3), ne = H(k.w.mul(te).div(O)),
|
|
656
|
-
F(
|
|
657
|
-
let a = Ei(ee, e.lobeAngleFraction, w, e.lobeVolumePercent).toVar(), o = Ai(e.planeDistSensitivity, O, E, C).toVar(), s = ki(
|
|
655
|
+
let v = W(i, h).toVar(), y = v.y.toVar(), b = y.add(u), x = this._handover(u.add(1)).toVar(), S = W(n, h), C = Vn(S.xyz.mul(2).sub(1)).toVar(), w = Ui(S.w).toVar(), T = this._pixelUv(p, m), E = this._worldPosAt(T, _, d, f).toVar(), D = s.mul(Y(E, 1)).z.abs(), O = this._frustumSize(D).toVar(), k = W(r, h).toVar(), ee = L(1).div(b.add(1)).toVar(), te = D.mul(Jr).add(3), ne = H(k.w.mul(te).div(O)), re = k.w.toVar(), A = Un(U(b.lessThan(e.historyFixFrameNum), L(1), L(0)).mul(.5).mul(2 / ai).mul(e.historyFixStride).mul(V(L(.25).add(Gn(ne).mul(.75)), L(1), ee))).toVar(), j = Hi(S.w).toVar();
|
|
656
|
+
F(A.notEqual(0).and(j.not()), () => {
|
|
657
|
+
let a = Ei(ee, e.lobeAngleFraction, w, e.lobeVolumePercent).toVar(), o = Ai(e.planeDistSensitivity, O, E, C).toVar(), s = ki(re, ee).toVar(), u = Oi(w.mul(w), Gn(e.roughnessFraction), ri).toVar(), p = Vi(v).toVar(), m = L(1).add(y).toVar();
|
|
658
658
|
k.mulAssign(m);
|
|
659
659
|
for (let e = -ai; e <= ai; e++) for (let h = -ai; h <= ai; h++) {
|
|
660
660
|
if (h === 0 && e === 0 || Math.abs(h) + Math.abs(e) === ai * 2) continue;
|
|
661
|
-
let g = ji(T.add(J(h, e).mul(
|
|
661
|
+
let g = ji(T.add(J(h, e).mul(A).mul(J(L(1).div(c), L(1).div(l))))), _ = this._uvToCoord(g), v = W(t, _).w, y = this._worldPosAt(g, v, d, f), b = W(n, _), x = Si(Ci(I(Vn(b.xyz.mul(2).sub(1)), C)), a, L(0)).toVar(), S = Ui(b.w);
|
|
662
662
|
x.mulAssign(Si(S.mul(S), u.x, u.y));
|
|
663
663
|
let w = W(i, _);
|
|
664
664
|
x.mulAssign(L(1).add(w.y)), x.mulAssign(xi(I(C, y), o.x, o.y)), x.assign(U(this._excluded(v, b.w, Vi(w), p), L(0), x));
|
|
@@ -684,7 +684,7 @@ var Ki = class extends A {
|
|
|
684
684
|
let t = 1 / (oi * 2 + 1) ** 2, n = oe.mul(t), r = Li(n, se.mul(t)).mul(e.fastClampSigmaScale), i = M.clamp(n.sub(r), n.add(r)), a = U(e.maxFast.lessThan(e.maxAccum), L(1), L(0)), o = V(L(1).div(L(1).add(a.mul(y).mul(2))), L(1), x);
|
|
685
685
|
M.assign(V(i, M, o));
|
|
686
686
|
}
|
|
687
|
-
G(a, g, U(
|
|
687
|
+
G(a, g, U(j, k, Fi(k, M))).toWriteOnly();
|
|
688
688
|
});
|
|
689
689
|
});
|
|
690
690
|
return this._dispatchOf(d);
|
|
@@ -703,29 +703,29 @@ var Ki = class extends A {
|
|
|
703
703
|
2,
|
|
704
704
|
4,
|
|
705
705
|
8
|
|
706
|
-
].map((e) => U(O.bitAnd(K(e)).notEqual(K(0)), L(1), L(0))), ne = ee.customWeights(te).map((e) => e.toVar()),
|
|
706
|
+
].map((e) => U(O.bitAnd(K(e)).notEqual(K(0)), L(1), L(0))), ne = ee.customWeights(te).map((e) => e.toVar()), re = Gn(H(ee.filter(te))).toVar(), A = W(s, f).toVar(), j = A.x.toVar(), M = j.toVar(), ie = j.mul(j).toVar();
|
|
707
707
|
for (let e = -1; e <= 1; e++) for (let t = -1; t <= 1; t++) {
|
|
708
708
|
if (t === 0 && e === 0) continue;
|
|
709
|
-
let n = this._clampCoord(_.add(t), v.add(e)), r = W(i, n).w, a = U(r.greaterThanEqual(Gr),
|
|
709
|
+
let n = this._clampCoord(_.add(t), v.add(e)), r = W(i, n).w, a = U(r.greaterThanEqual(Gr), j, W(s, n).x);
|
|
710
710
|
M.addAssign(a), ie.addAssign(a.mul(a));
|
|
711
711
|
}
|
|
712
712
|
M.divAssign(9), ie.divAssign(9);
|
|
713
713
|
let ae = Li(M, ie).toVar();
|
|
714
714
|
F(D.lessThan(t.historyFixFrameNum).and(Hi(x).not()), () => {
|
|
715
|
-
|
|
715
|
+
j.assign(Bn(j, M.mul(L(1.2).add(L(1).div(D.add(1))))));
|
|
716
716
|
});
|
|
717
|
-
let oe = B(this._sampleHistory((e) => W(l, e), T, ee, ne, k).x, 0).toVar(), se = ae.mul(t.antilag.x), ce = t.antilag.y.mul(4), le = oe.clamp(M.sub(se), M.add(se)), N = oe.sub(le).abs().div(B(oe, le).add(ti)), ue = L(1).div(L(1).add(N.mul(D.mul(
|
|
717
|
+
let oe = B(this._sampleHistory((e) => W(l, e), T, ee, ne, k).x, 0).toVar(), se = ae.mul(t.antilag.x), ce = t.antilag.y.mul(4), le = oe.clamp(M.sub(se), M.add(se)), N = oe.sub(le).abs().div(B(oe, le).add(ti)), ue = L(1).div(L(1).add(N.mul(D.mul(re)).div(ce))).toVar(), de = Bn(D, t.historyFixFrameNum);
|
|
718
718
|
D.assign(V(de, D, ue));
|
|
719
|
-
let fe = m.add(1), pe = this._handover(fe), me =
|
|
720
|
-
|
|
719
|
+
let fe = m.add(1), pe = this._handover(fe), me = re.mul(L(1).sub(this._advancedNonLinear(D.mul(L(1).sub(pe)).div(fe)))).mul(ue).toVar(), he = L(1).add(me.mul(6)), ge = t.stabilizationStrength.mul(L(1).sub(h)), _e = V(j, oe.clamp(M.sub(ae.mul(he)), M.add(ae.mul(he))), Bn(me, ge)).toVar();
|
|
720
|
+
A.assign(Fi(A, _e)), G(e, p, Y(_e, 0, 0, 0)).toWriteOnly();
|
|
721
721
|
let ve = t.maxAccum.mul(L(1).sub(h));
|
|
722
722
|
G(u, p, Y(Bn(D.add(1), ve), S, 0, 0)).toWriteOnly();
|
|
723
|
-
let ye = W(r, f), be = Y(Ni(
|
|
723
|
+
let ye = W(r, f), be = Y(Ni(A.xyz).mul(zi(ye.xyz)), b.w).toVar();
|
|
724
724
|
F(g.equal(R(1)), () => {
|
|
725
725
|
let e = H(D.div(B(t.maxAccum, 1)));
|
|
726
726
|
be.assign(Y(L(1).sub(e), e, .2, 1));
|
|
727
727
|
}).ElseIf(g.equal(R(2)), () => {
|
|
728
|
-
be.assign(Y(Xn(
|
|
728
|
+
be.assign(Y(Xn(A.w), 1));
|
|
729
729
|
}).ElseIf(g.equal(R(3)), () => {
|
|
730
730
|
be.assign(Y(Xn(S), 1));
|
|
731
731
|
}).ElseIf(g.equal(R(4)), () => {
|
|
@@ -856,11 +856,11 @@ function va(e, t) {
|
|
|
856
856
|
let n = new vr().set(...e).invert().elements;
|
|
857
857
|
return t.set(pa[0] * n[0] + pa[1] * n[1] + pa[2] * n[2], pa[0] * n[3] + pa[1] * n[4] + pa[2] * n[5], pa[0] * n[6] + pa[1] * n[7] + pa[2] * n[8]);
|
|
858
858
|
}
|
|
859
|
-
var ya = (e) => e < 16 ? 1 : e < 64 ? 4 : 16, ba = class extends
|
|
859
|
+
var ya = (e) => e < 16 ? 1 : e < 64 ? 4 : 16, ba = class extends pe {
|
|
860
860
|
constructor(e, t = {}) {
|
|
861
861
|
super("AutoExposure", {
|
|
862
862
|
...t,
|
|
863
|
-
executionMode:
|
|
863
|
+
executionMode: A.ALWAYS
|
|
864
864
|
}), this.renderer = e, this.metering = t.metering ?? qi.autoExposureMetering, this.meteringPoint = new Rr(.5, .5), this.keyValue = t.keyValue ?? qi.autoExposureKeyValue, this.minExposure = t.minExposure ?? qi.autoExposureMinExposure, this.maxExposure = t.maxExposure ?? qi.autoExposureMaxExposure, this.adaptSpeedBright = t.adaptSpeedBright ?? qi.autoExposureAdaptSpeedBright, this.adaptSpeedDark = t.adaptSpeedDark ?? qi.autoExposureAdaptSpeedDark, this.centerWeight = t.centerWeight ?? 8, this.strength = t.strength ?? qi.autoExposureStrength, this.instant = !1, this.holdSamples = 0, this.onChange = null, this._lowU = q(t.lowPercentile ?? .1), this._highU = q(t.highPercentile ?? .9), this._falloffU = q(new Rr()), this._pointU = q(new Rr(.5, .5)), this._lumWeightsU = q(new Q().fromArray(pa)), this._backdropModeU = q(ha.transparent, "int"), this._widthU = q(1, "int"), this._heightU = q(1, "int"), this._strideU = q(1, "int"), this._gridXU = q(Yi, "int"), this._gridYU = q(Yi, "int"), this._inputNode = new Cn(), this._workingMatrix = void 0, this._histogram = Mn(Qi, "uint").toAtomic(), this._result = Mn(1, "vec4"), this._readback = new bn(16), this._readback.name = "AutoExposure", this._kernels = [this._buildTileKernel(), this._buildResolveKernel()], this._compensation = 1, this._exposureEV = 0, this._targetEV = null, this._viewEV = null, this._roomEV = null, this._clock = 0, this._movingUntil = -1, this._viewMoves = 0, this._landed = null, this._meteredLog2 = null, this._snap = !0, this._lastUpdate = null, this._accumulating = !1, this._emittedEV = null, this._pending = null, this._generation = 0, this._restarts = 0, this._meteredAt = {
|
|
865
865
|
restarts: -1,
|
|
866
866
|
samples: -1
|
|
@@ -1090,7 +1090,7 @@ var ya = (e) => e < 16 ? 1 : e < 64 ? 4 : 16, ba = class extends A {
|
|
|
1090
1090
|
localExposureHighlightContrast: .6,
|
|
1091
1091
|
localExposureShadowContrast: 1,
|
|
1092
1092
|
localExposureDetailStrength: 1
|
|
1093
|
-
}, Sa = 128, Ca = (Sa / 2) ** 2, $ = 32, wa = -16, Ta = 16, Ea = -40, Da = 40, Oa = 256, ka = 32, Aa = .6, ja = 50, Ma = Math.log2(.18), Na = .999, Pa = 2 ** -24, Fa = Math.ceil(
|
|
1093
|
+
}, Sa = 128, Ca = (Sa / 2) ** 2, $ = 32, wa = -16, Ta = 16, Ea = -40, Da = 40, Oa = 256, ka = 32, Aa = .6, ja = 50, Ma = Math.log2(.18), Na = .999, Pa = 2 ** -24, Fa = Math.ceil(k / Sa), Ia = Math.ceil(k / ka), La = [
|
|
1094
1094
|
.2126,
|
|
1095
1095
|
.7152,
|
|
1096
1096
|
.0722
|
|
@@ -1101,8 +1101,8 @@ function Ba(e, t, n, r, i, a, o) {
|
|
|
1101
1101
|
let n = e & 1, r = e >> 1 & 1, i = e >> 2, a = (n ? O : 1 - O) * (r ? k : 1 - k) * (i ? ee : 1 - ee), o = ((Math.min(E + r, x - 1) * b + Math.min(T + n, b - 1)) * $ + Math.min(D + i, $ - 1)) * 2;
|
|
1102
1102
|
te += t[o] * a, ne += t[o + 1] * a;
|
|
1103
1103
|
}
|
|
1104
|
-
let
|
|
1105
|
-
return 2 ** (e[13] + (
|
|
1104
|
+
let re = ne * Ca < .001 ? y : te / ne, A = re + (y - re) * e[12] + o, j = s + o, M = A > e[13] ? e[9] : e[10];
|
|
1105
|
+
return 2 ** (e[13] + (A - e[13]) * M + (j - A) * e[11] - j);
|
|
1106
1106
|
}
|
|
1107
1107
|
var Va = `
|
|
1108
1108
|
@group(1) @binding(0) var<storage, read> leGrid: array<vec2<f32>>;
|
|
@@ -1141,11 +1141,11 @@ fn rayzee_gain( uv: vec2<f32>, linear: vec3<f32>, exposure: f32 ) -> f32 {
|
|
|
1141
1141
|
let contrast = select( le[ 2 ].z, le[ 2 ].y, base > le[ 3 ].y );
|
|
1142
1142
|
return exp2( le[ 3 ].y + ( base - le[ 3 ].y ) * contrast + ( y - base ) * le[ 2 ].w - y );
|
|
1143
1143
|
}
|
|
1144
|
-
`, Ha = class extends
|
|
1144
|
+
`, Ha = class extends pe {
|
|
1145
1145
|
constructor(e, t = {}) {
|
|
1146
1146
|
super("LocalExposure", {
|
|
1147
1147
|
...t,
|
|
1148
|
-
executionMode:
|
|
1148
|
+
executionMode: A.ALWAYS
|
|
1149
1149
|
}), this.renderer = e, this.highlightContrast = t.highlightContrast ?? xa.localExposureHighlightContrast, this.shadowContrast = t.shadowContrast ?? xa.localExposureShadowContrast, this.detailStrength = t.detailStrength ?? xa.localExposureDetailStrength, this.onChange = null, this._grid = Mn(Fa * Fa * $, "vec2"), this._blur = Mn(Ia * Ia, "float"), this._blurSource = Mn(Ia * Ia, "vec2"), this._blurTmp = Mn(Ia * Ia, "vec2"), this._inputNode = new Cn(), this._widthU = q(1, "int"), this._heightU = q(1, "int"), this._cellsXU = q(1, "int"), this._blurWU = q(1, "int"), this._blurHU = q(1, "int"), this._radiusU = q(1), this._logExposureU = q(0), this._sceneOnlyU = q(0, "int"), this._p = [
|
|
1150
1150
|
new zr(),
|
|
1151
1151
|
new zr(),
|
|
@@ -1812,7 +1812,7 @@ var qa = class extends ur {
|
|
|
1812
1812
|
constructor(e) {
|
|
1813
1813
|
super();
|
|
1814
1814
|
let t = e.clientWidth, n = e.clientHeight;
|
|
1815
|
-
this.camera = new
|
|
1815
|
+
this.camera = new _(60, t / n || 1, .01, 1e3), this.camera.position.set(0, 0, 5), this.controls = new Vr(this.camera, e), this.controls.screenSpacePanning = !0, this.controls.zoomToCursor = !0, this.controls.saveState(), this._reportedOrthoHeight = null, this._reportOrthoHeight = this._reportOrthoHeight.bind(this), this.controls.addEventListener("change", this._reportOrthoHeight), this.walkControls = new lo(this.camera, e, this.controls), this.interactionManager = null, this.cameras = [this.camera], this.currentCameraIndex = 0, this._userCameraCounter = 0, this.autoFocusMode = uo.autoFocusMode, this.afScreenPoint = { ...uo.afScreenPoint }, this.afSmoothingFactor = uo.afSmoothingFactor, this._lastValidFocusDistance = null, this._smoothedFocusDistance = null, this._afPointDirty = !1, this._afSuspended = !1, this._afPick = null, this._defaultCameraState = null, this._onResize = null, this._onReset = null, this._getSettings = null, this._applySettings = null;
|
|
1816
1816
|
}
|
|
1817
1817
|
setCameras(e) {
|
|
1818
1818
|
this.cameras = e, this._userCameraCounter = 0, this.camera.userData.clipStart = 0, this.resetAutoFocus();
|
|
@@ -2012,7 +2012,7 @@ var qa = class extends ur {
|
|
|
2012
2012
|
let n = {
|
|
2013
2013
|
index: t,
|
|
2014
2014
|
name: e.name ?? "",
|
|
2015
|
-
effects:
|
|
2015
|
+
effects: ce(e.userData?.__rayzeeEffects) ?? null
|
|
2016
2016
|
};
|
|
2017
2017
|
return t === 0 || !e.userData?.__rayzeeUserCamera ? n : {
|
|
2018
2018
|
...n,
|
|
@@ -2046,7 +2046,7 @@ var qa = class extends ur {
|
|
|
2046
2046
|
for (let r of e.cameras ?? []) {
|
|
2047
2047
|
if (r.user) {
|
|
2048
2048
|
let e = r.orthographic ? new Tr(...r.frustum, r.near, r.far) : new Er(r.fov, r.aspect, r.near, r.far);
|
|
2049
|
-
e.name = r.name, e.zoom = r.zoom ?? 1, e.position.fromArray(r.position), e.quaternion.fromArray(r.quaternion), e.scale.fromArray(r.scale), e.updateProjectionMatrix(), e.updateMatrixWorld(!0), e.userData.__rayzeeUserCamera = !0, e.userData.__rayzeeEffects =
|
|
2049
|
+
e.name = r.name, e.zoom = r.zoom ?? 1, e.position.fromArray(r.position), e.quaternion.fromArray(r.quaternion), e.scale.fromArray(r.scale), e.updateProjectionMatrix(), e.updateMatrixWorld(!0), e.userData.__rayzeeUserCamera = !0, e.userData.__rayzeeEffects = be(r.effects), r.clipStart > 0 && (e.userData.clipStart = r.clipStart), r.orbitTarget && (e.userData.__rayzeeOrbitTarget = new Q().fromArray(r.orbitTarget)), n.set(r.index, this.cameras.length), this.cameras.push(e);
|
|
2050
2050
|
continue;
|
|
2051
2051
|
}
|
|
2052
2052
|
let e = this.cameras[r.index];
|
|
@@ -2054,7 +2054,7 @@ var qa = class extends ur {
|
|
|
2054
2054
|
t.push(r.name);
|
|
2055
2055
|
continue;
|
|
2056
2056
|
}
|
|
2057
|
-
n.set(r.index, r.index), r.effects && (e.userData.__rayzeeEffects =
|
|
2057
|
+
n.set(r.index, r.index), r.effects && (e.userData.__rayzeeEffects = be(r.effects));
|
|
2058
2058
|
}
|
|
2059
2059
|
this._userCameraCounter = this.cameras.filter((e) => e.userData?.__rayzeeUserCamera).length, this.currentCameraIndex = n.get(e.current) ?? 0;
|
|
2060
2060
|
let r = e.defaultView;
|
|
@@ -2420,7 +2420,7 @@ var Co = class extends ur {
|
|
|
2420
2420
|
}
|
|
2421
2421
|
};
|
|
2422
2422
|
async function To(e) {
|
|
2423
|
-
let t = await
|
|
2423
|
+
let t = await v(e);
|
|
2424
2424
|
try {
|
|
2425
2425
|
return await new Promise((n, r) => {
|
|
2426
2426
|
let i = new Image();
|
|
@@ -2558,7 +2558,7 @@ var Io = class {
|
|
|
2558
2558
|
this._gridWidth = t, this._gridHeight = n;
|
|
2559
2559
|
let r = (await Promise.all(e.map(async (e) => {
|
|
2560
2560
|
try {
|
|
2561
|
-
let { file: r, release: i } = await
|
|
2561
|
+
let { file: r, release: i } = await m().fetch(e.url), a = Do(await r.text().finally(i), e.name);
|
|
2562
2562
|
return {
|
|
2563
2563
|
it: e,
|
|
2564
2564
|
profile: a,
|
|
@@ -2896,7 +2896,7 @@ fn main( @builtin(global_invocation_id) gid: vec3<u32> ) {
|
|
|
2896
2896
|
}
|
|
2897
2897
|
_fetchWeights(e) {
|
|
2898
2898
|
let t = this._weights.get(e);
|
|
2899
|
-
return t || (t =
|
|
2899
|
+
return t || (t = m().fetch(e, { policy: w.IMMUTABLE }).then(({ file: e, release: t }) => e.arrayBuffer().finally(t)), t.catch(() => this._weights.delete(e)), this._weights.set(e, t)), t;
|
|
2900
2900
|
}
|
|
2901
2901
|
_generateTzaUrl() {
|
|
2902
2902
|
let { oidnWeightsBaseUrl: e } = it(), { QUALITY_MODELS: t } = Wo;
|
|
@@ -4457,9 +4457,9 @@ var Ts = {
|
|
|
4457
4457
|
}
|
|
4458
4458
|
this._neuralPostBusy = !0, this.dispatchEvent({ type: P.UPSCALING_START });
|
|
4459
4459
|
try {
|
|
4460
|
-
let i = await import("./NeuralSuperRes-
|
|
4460
|
+
let i = await import("./NeuralSuperRes-a8xDtvXM.js").then((e) => e.t);
|
|
4461
4461
|
this._superResModule = i;
|
|
4462
|
-
let a = n ? await import("./NeuralRetouch-
|
|
4462
|
+
let a = n ? await import("./NeuralRetouch-BkxZPOYq.js").then((e) => e.t) : null, o = this.denoiser?._outTexSize, s = (o?.width ?? 0) * (o?.height ?? 0), c = n && s <= a.RETOUCH_MAX_PIXELS;
|
|
4463
4463
|
if (n && !c && (Ds.warn(`Neural rendering skipped: the render is ${(s / 1e6).toFixed(1)} MP, above the ${(a.RETOUCH_MAX_PIXELS / 1e6).toFixed(1)} MP the pass survives.` + (t ? " The upscale still ran." : "")), this._releaseNeuralRetouch()), !t && !c) {
|
|
4464
4464
|
r && !this._postCancelled && await this.upscaler.start();
|
|
4465
4465
|
return;
|
|
@@ -5403,7 +5403,7 @@ async function dc(e, t, { resolve: n = async () => null } = {}) {
|
|
|
5403
5403
|
continue;
|
|
5404
5404
|
}
|
|
5405
5405
|
for (let [n, i] of Object.entries(r.props)) {
|
|
5406
|
-
let a =
|
|
5406
|
+
let a = be(i);
|
|
5407
5407
|
cc(t, n, a), e.setMaterialProperty(r.index, n, a);
|
|
5408
5408
|
}
|
|
5409
5409
|
}
|
|
@@ -5435,7 +5435,7 @@ async function dc(e, t, { resolve: n = async () => null } = {}) {
|
|
|
5435
5435
|
}
|
|
5436
5436
|
//#endregion
|
|
5437
5437
|
//#region src/PathTracerApp.js
|
|
5438
|
-
var fc = We("engine"), pc = class extends
|
|
5438
|
+
var fc = We("engine"), pc = class extends T {
|
|
5439
5439
|
constructor(e, t = {}) {
|
|
5440
5440
|
super(e, t), this.setColorManagement(Zt), this.setStorageOpener(cn), this.settings.define("interactionRenderScale", {
|
|
5441
5441
|
default: .5,
|
|
@@ -5452,7 +5452,7 @@ var fc = We("engine"), pc = class extends w {
|
|
|
5452
5452
|
}), this.cameraManager.camera;
|
|
5453
5453
|
}
|
|
5454
5454
|
_initAssetPipeline() {
|
|
5455
|
-
super._initAssetPipeline(), this.assetLoader.controls = this.cameraManager.controls, this.assetLoader.registerFormat(...Et), this.assetLoader.setArchiveImporterLoader(() => import("./ArchiveImporter-
|
|
5455
|
+
super._initAssetPipeline(), this.assetLoader.controls = this.cameraManager.controls, this.assetLoader.registerFormat(...Et), this.assetLoader.setArchiveImporterLoader(() => import("./ArchiveImporter-D5XOC3tN.js").then((e) => e.r).then((e) => new e.ArchiveImporter(this.assetLoader)), Ct);
|
|
5456
5456
|
let e = () => {
|
|
5457
5457
|
this.needsReset = !0, this.stages.pathTracer?.enterInteractionMode(), this.wake();
|
|
5458
5458
|
};
|
|
@@ -5475,7 +5475,7 @@ var fc = We("engine"), pc = class extends w {
|
|
|
5475
5475
|
super._initPipeline(), this.pipeline.eventBus.on("pathtracer:interactionStart", () => this._requestRenderScale(this._interactionRenderScale())), this.pipeline.eventBus.on("pathtracer:interactionEnd", () => this._applyRenderScale(1));
|
|
5476
5476
|
}
|
|
5477
5477
|
async _initManagers() {
|
|
5478
|
-
await super._initManagers(), this.environmentManager.setProceduralSkyLoader(() => import("./PhysicalSky-
|
|
5478
|
+
await super._initManagers(), this.environmentManager.setProceduralSkyLoader(() => import("./PhysicalSky-DWK8pS0U.js").then((e) => e.n).then((e) => e.PhysicalSky)), this.stages.pathTracer.registerIntegrator(["bidirectional", "vcm"], (t) => new e(t)), this.stages.pathTracer.requestOutput("gBuffer"), this.interactionManager = new qa({
|
|
5479
5479
|
scene: this.meshScene,
|
|
5480
5480
|
camera: this.camera,
|
|
5481
5481
|
canvas: this.canvas,
|
|
@@ -5759,7 +5759,7 @@ var fc = We("engine"), pc = class extends w {
|
|
|
5759
5759
|
let n = e === "production", r = n ? Te : Ee;
|
|
5760
5760
|
this.denoisingManager?.setCadenceSuspended(n), this.timeline.stop(), this.cameraManager.controls.enabled = !n, this.stages.autoExposure && (this.stages.autoExposure.holdSamples = n ? 8 : 0), this.settings.setMany(ke(r), {
|
|
5761
5761
|
silent: !0,
|
|
5762
|
-
source:
|
|
5762
|
+
source: x.MODE_PRESET
|
|
5763
5763
|
}), this.stages.pathTracer?.setUniform("renderMode", parseInt(r.renderMode)), n && this._applyRenderScale(1), this.stages.pathTracer?.updateCompletionThreshold?.();
|
|
5764
5764
|
let i = this.denoisingManager?.denoiser;
|
|
5765
5765
|
if (i && (i.abort(), this.denoisingManager.applyOIDNEnabled(r.enableOIDN), this.denoisingManager.applyOIDNQuality(r.oidnQuality)), this.denoisingManager?._syncGBufferStages?.(), this.denoisingManager?.upscaler?.abort(), t.canvasWidth && t.canvasHeight && (this.setReservedRenderResolution(Math.max(t.canvasWidth, t.canvasHeight)), this.setCanvasSize(t.canvasWidth, t.canvasHeight)), this.needsReset = !1, this.pauseRendering = !1, n) {
|
|
@@ -6059,4 +6059,4 @@ var _c = class {
|
|
|
6059
6059
|
}
|
|
6060
6060
|
};
|
|
6061
6061
|
//#endregion
|
|
6062
|
-
export { Ct as ARCHIVE_FORMATS, qi as AUTO_EXPOSURE_DEFAULTS, uo as AUTO_FOCUS_DEFAULTS, Ys as AnimationManager, qe as BVH_LEAF_MARKERS, _o as CameraManager, xo as CameraTrack, Zt as ColorManagement, zt as DEFAULT_LUT_SIZE, Jt as DEFAULT_MAX_EV, Gt as DEFAULT_MIN_EV,
|
|
6062
|
+
export { Ct as ARCHIVE_FORMATS, qi as AUTO_EXPOSURE_DEFAULTS, uo as AUTO_FOCUS_DEFAULTS, Ys as AnimationManager, qe as BVH_LEAF_MARKERS, _o as CameraManager, xo as CameraTrack, Zt as ColorManagement, zt as DEFAULT_LUT_SIZE, Jt as DEFAULT_MAX_EV, Gt as DEFAULT_MIN_EV, _e as DEFAULT_SUN_PATH, ht as DEFAULT_VIEW, rt as DEFAULT_WORKING_SPACE, Qr as DENOISER_DEFAULTS, Kr as DENOISER_STRATEGIES, w as DOWNLOAD_POLICY, Rs as DenoisingManager, f as DownloadCache, $e as ENGINE_AREAS, we as ENGINE_DEFAULTS, P as EngineEvents, Ze as EngineIssueError, wo as GoboManager, Io as IESManager, Ee as INTERACTIVE_RENDER_CONFIG, Ye as ISSUE_CODES, Xe as ISSUE_SEVERITY, qa as InteractionManager, Je as IssueLog, Se as LEGACY_EVENT_NAMES, xa as LOCAL_EXPOSURE_DEFAULTS, Ge as LOG_LEVELS, C as LightManager, Ue as Logger, Le as MATERIAL_DEFAULTS, Ce as MATERIAL_VALUE_SOURCE, k as MAX_RESERVABLE_RENDER_SIZE, Ne as MAX_SCENE_BYTES, pt as MAX_TABLE_TRANSFORMS, Ae as MemoryLedger, Yr as NRD_DEFAULTS, qr as NRD_HIT_DIST_A, Jr as NRD_HIT_DIST_B, Xr as NRD_PRESET_KEYS, Zr as NRD_QUALITY_PRESETS, lt as OCIO_VIEW_BASE, qs as OverlayManager, Te as PRODUCTION_RENDER_CONFIG, pc as PathTracerApp, u as PipelineContext, hn as RETOUCH_DEFAULTS, gn as RETOUCH_MAX_PIXELS, mn as RETOUCH_RANGES, T as RayzeeRenderer, S as RenderPipeline, d as RenderSettings, pe as RenderStage, je as SAFE_SCENE_BYTES, ec as SCENE_STATE_VERSION, x as SETTING_SOURCE, he as SKY_DEFAULTS, fn as SR_MAX_INPUT, pn as SR_SCALE, Qe as STORAGE_KIND, A as StageExecutionMode, sn as StorageManager, Ke as TRIANGLE_DATA_LAYOUT, Co as TimelineManager, Qs as TransformManager, Re as VERSION, ot as VIEW_TRANSFORMS, ve as VRAMTracker, _c as VideoRenderManager, rn as acquireLock, Vt as addAllOcioViews, Bt as addOcioView, dt as addViewTransform, tn as applyMatrixRGBA8, $t as bakeLut, fe as bufferBytes, Pt as buildOcioView, mt as buildToneMapWGSL, v as cachedObjectURL, Kt as canvasColorSpaceFor, hc as captureHeadless, y as clearBindingAuditFindings, Ft as clearInputOverrides, at as configureAssets, Ve as configurePlatform, Mt as convertColor, Ot as convertEncodedRGBA8, en as convertPixelsF32, We as createLogger, de as dayOfYearForMonth, De as deriveAlphaMode, b as describeAdapter, Dt as displayCanvasFit, Ie as estimateSceneBytes, Nt as extractMatrix, wt as extractSceneMetadata, E as fetchFile, yt as fileIdentity, Yt as findNativeLinearSpace, He as fmt, bt as folderIdentity, be as fromPortable, nt as getActiveColorManagement, it as getAssetConfig, g as getBindingAuditFindings, Be as getPlatform, ut as getRegistryVersion, gt as getViewTransform, At as hasColorSpace, an as heldLockNames, vt as identityKey, Ht as isColorManaged, kt as isDataSpace, qt as isDataTexture, jt as linearToSrgb, Xt as listFileRules, Lt as listInputOverrides, st as listViewTransforms, xt as localFolder, nn as makeCpuSampler, It as measureBakeError, p as nameFromUrl, ft as onRegistryChange, gc as openHeadless, on as openStorage, un as openZip, St as parseSceneMetadata, Pe as probeAddressSpace, ln as readZipDirectory, ct as removeViewTransform, mc as renderHeadless, dn as renderUpscaled, Wt as resolveInputSpace, _t as sameIdentity, tt as setActiveColorManagement, h as setBindingAudit, Qt as setInputOverride, Ut as srgbToLinear, ue as sunPosition, se as textureBytes, Rt as textureInputSpace, oe as timeForSunElevation, ce as toPortable };
|