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,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./BidirectionalIntegrator-
|
|
2
|
-
import {
|
|
1
|
+
import { n as e } from "./BidirectionalIntegrator-DqG0BEIz.js";
|
|
2
|
+
import { dt as t, i as n, mn as r } from "./SolarLimb-ZYl-Pwl0.js";
|
|
3
3
|
import { r as i } from "./WorkingMatrix-C6y233hT.js";
|
|
4
4
|
import { StorageInstancedBufferAttribute as a } from "three/webgpu";
|
|
5
5
|
import { Fn as o, If as s, Loop as c, Return as l, abs as u, acos as d, asin as f, atan as p, clamp as m, cos as h, dot as g, exp as _, float as v, floor as y, instanceIndex as b, int as x, log as S, max as C, min as w, mix as T, select as E, sin as D, smoothstep as O, sqrt as k, step as A, storage as j, tan as M, uint as N, uniform as P, vec2 as ee, vec3 as F, vec4 as I } from "three/tsl";
|
|
@@ -895,23 +895,23 @@ function xt(e, t, n) {
|
|
|
895
895
|
});
|
|
896
896
|
}), r;
|
|
897
897
|
}
|
|
898
|
-
function St({ pixels: e, rows:
|
|
899
|
-
let f = $(u), p = (e, t, n) => N(t).mul(N(f)).add(N(e).mul(N(4))).add(N(n)), m = (e) => D(v(e).add(.5).mul(Math.PI / d)), h = (
|
|
898
|
+
function St({ pixels: e, rows: n, prefix: r, stats: i, cdf: a, width: u, height: d }) {
|
|
899
|
+
let f = $(u), p = (e, t, n) => N(t).mul(N(f)).add(N(e).mul(N(4))).add(N(n)), m = (e) => D(v(e).add(.5).mul(Math.PI / d)), h = (n, r, i) => g(e.element(n.mul(u).add(r)).xyz, t).mul(i), _ = () => s(b.greaterThan(N(0)), () => {
|
|
900
900
|
l();
|
|
901
901
|
}), y = o(() => {
|
|
902
902
|
let e = b;
|
|
903
903
|
s(e.greaterThanEqual(N(d)), () => {
|
|
904
904
|
l();
|
|
905
905
|
});
|
|
906
|
-
let
|
|
906
|
+
let t = m(e).toVar(), r = v(0).toVar();
|
|
907
907
|
c({
|
|
908
908
|
start: x(0),
|
|
909
909
|
end: x(u),
|
|
910
910
|
type: "int",
|
|
911
911
|
condition: "<"
|
|
912
|
-
}, ({ i:
|
|
913
|
-
r.addAssign(h(e, N(
|
|
914
|
-
}),
|
|
912
|
+
}, ({ i: n }) => {
|
|
913
|
+
r.addAssign(h(e, N(n), t));
|
|
914
|
+
}), n.element(e).assign(I(r, 0, 0, 0));
|
|
915
915
|
})().compute(d, [64]), S = o(() => {
|
|
916
916
|
_();
|
|
917
917
|
let e = v(0).toVar();
|
|
@@ -920,24 +920,24 @@ function St({ pixels: e, rows: t, prefix: r, stats: i, cdf: a, width: u, height:
|
|
|
920
920
|
end: x(d),
|
|
921
921
|
type: "int",
|
|
922
922
|
condition: "<"
|
|
923
|
-
}, ({ i:
|
|
924
|
-
e.addAssign(
|
|
923
|
+
}, ({ i: t }) => {
|
|
924
|
+
e.addAssign(n.element(t).x);
|
|
925
925
|
}), i.element(0).assign(I(e, e.div(u * d), 0, 0));
|
|
926
926
|
})().compute(1, [1]), w = o(() => {
|
|
927
927
|
let e = b;
|
|
928
928
|
s(e.greaterThanEqual(N(d)), () => {
|
|
929
929
|
l();
|
|
930
930
|
});
|
|
931
|
-
let
|
|
931
|
+
let t = m(e).toVar(), a = i.element(0).y.toVar(), o = v(0).toVar(), f = v(0).toVar();
|
|
932
932
|
c({
|
|
933
933
|
start: x(0),
|
|
934
934
|
end: x(u),
|
|
935
935
|
type: "int",
|
|
936
936
|
condition: "<"
|
|
937
|
-
}, ({ i:
|
|
938
|
-
let i = h(e, N(
|
|
939
|
-
o.addAssign(i), f.addAssign(C(i.sub(a), 0)), r.element(e.mul(u).add(N(
|
|
940
|
-
}),
|
|
937
|
+
}, ({ i: n }) => {
|
|
938
|
+
let i = h(e, N(n), t).toVar();
|
|
939
|
+
o.addAssign(i), f.addAssign(C(i.sub(a), 0)), r.element(e.mul(u).add(N(n))).assign(ee(o, f));
|
|
940
|
+
}), n.element(e).assign(I(o, f, 0, 0));
|
|
941
941
|
})().compute(d, [64]), T = o(() => {
|
|
942
942
|
_();
|
|
943
943
|
let e = v(0).toVar();
|
|
@@ -946,31 +946,31 @@ function St({ pixels: e, rows: t, prefix: r, stats: i, cdf: a, width: u, height:
|
|
|
946
946
|
end: x(d),
|
|
947
947
|
type: "int",
|
|
948
948
|
condition: "<"
|
|
949
|
-
}, ({ i:
|
|
950
|
-
e.addAssign(
|
|
949
|
+
}, ({ i: t }) => {
|
|
950
|
+
e.addAssign(n.element(t).y);
|
|
951
951
|
});
|
|
952
|
-
let
|
|
953
|
-
i.element(1).assign(E(e.greaterThan(0), I(e,
|
|
952
|
+
let t = i.element(0).toVar();
|
|
953
|
+
i.element(1).assign(E(e.greaterThan(0), I(e, t.y, 1, 0), I(t.x, 0, 0, 0)));
|
|
954
954
|
})().compute(1, [1]), O = () => i.element(0).x.mul(1e-4 / (u * d)), k = o(() => {
|
|
955
955
|
let e = b;
|
|
956
956
|
s(e.greaterThanEqual(N(d)), () => {
|
|
957
957
|
l();
|
|
958
958
|
});
|
|
959
|
-
let
|
|
959
|
+
let t = O().toVar(), o = i.element(1).z.greaterThan(0).toVar(), f = n.element(e).toVar(), m = E(o, f.y, f.x).add(t.mul(u)).toVar(), h = v(0).toVar();
|
|
960
960
|
c({
|
|
961
961
|
start: x(0),
|
|
962
962
|
end: x(u),
|
|
963
963
|
type: "int",
|
|
964
964
|
condition: "<"
|
|
965
|
-
}, ({ i:
|
|
966
|
-
let i = r.element(e.mul(u).add(N(
|
|
967
|
-
a.element(p(
|
|
965
|
+
}, ({ i: n }) => {
|
|
966
|
+
let i = r.element(e.mul(u).add(N(n))).toVar(), s = E(o, i.y, i.x).add(t.mul(v(n).add(1))).div(C(m, 1e-30)), c = E(m.greaterThan(0), E(n.equal(x(u - 1)), v(1), s), v(0)).toVar();
|
|
967
|
+
a.element(p(n, e, 0)).assign(c), a.element(p(n, e, 1)).assign(h), h.assign(c);
|
|
968
968
|
});
|
|
969
969
|
})().compute(d, [64]), A = o(() => {
|
|
970
970
|
_();
|
|
971
|
-
let e = O().mul(u).toVar(),
|
|
972
|
-
let i =
|
|
973
|
-
return E(
|
|
971
|
+
let e = O().mul(u).toVar(), t = i.element(1).z.greaterThan(0).toVar(), r = (r) => {
|
|
972
|
+
let i = n.element(r);
|
|
973
|
+
return E(t, i.y, i.x).add(e);
|
|
974
974
|
}, o = v(0).toVar();
|
|
975
975
|
c({
|
|
976
976
|
start: x(0),
|
|
@@ -1025,33 +1025,33 @@ var Tt = class {
|
|
|
1025
1025
|
this.width = e, this.height = t, this._quality = n, this.lastRenderTime = 0, this._texture = wt(e, t, se), this._texture.mapping = re, this._texture.colorSpace = oe, this._texture.minFilter = ae, this._texture.magFilter = ae, this._texture.wrapS = ce, this._texture.wrapT = te, this._texture.generateMipmaps = !1, this._cdfTexture = wt(e + 1, t, se), this._rec709Weights = ke(ge), this._attrs = null, this._kernels = null, this._airKey = null, this._transmittanceBuilt = !1;
|
|
1026
1026
|
}
|
|
1027
1027
|
_init() {
|
|
1028
|
-
let e = (e) => Array.from({ length: e }, () => P(new ue())),
|
|
1028
|
+
let e = (e) => Array.from({ length: e }, () => P(new ue())), t = e(24);
|
|
1029
1029
|
this._uniforms = {
|
|
1030
|
-
coefficient:
|
|
1030
|
+
coefficient: t,
|
|
1031
1031
|
rgb: e(12),
|
|
1032
1032
|
sunDirection: P(new le(0, 1, 0)),
|
|
1033
1033
|
altitude: P(.05),
|
|
1034
1034
|
sunSinRadius: P(.0046)
|
|
1035
1035
|
};
|
|
1036
|
-
let
|
|
1036
|
+
let n = (e) => r(e, 4);
|
|
1037
1037
|
this._attrs = {
|
|
1038
|
-
transmittance:
|
|
1039
|
-
incomingA:
|
|
1040
|
-
incomingB:
|
|
1041
|
-
transfer:
|
|
1042
|
-
multipleScattering:
|
|
1043
|
-
psiSum:
|
|
1044
|
-
groundE:
|
|
1045
|
-
irradiance:
|
|
1046
|
-
sky:
|
|
1047
|
-
skyRows:
|
|
1048
|
-
cdfRows:
|
|
1049
|
-
cdfPrefix:
|
|
1050
|
-
cdfStats:
|
|
1051
|
-
cdf:
|
|
1038
|
+
transmittance: n(256 * 64),
|
|
1039
|
+
incomingA: n(1024 * 128 * 4),
|
|
1040
|
+
incomingB: n(1024 * 128 * 4),
|
|
1041
|
+
transfer: n(1024 * 128 * 4),
|
|
1042
|
+
multipleScattering: n(1024 * 128 * 8),
|
|
1043
|
+
psiSum: n(1024 * 128 * 8),
|
|
1044
|
+
groundE: n(256),
|
|
1045
|
+
irradiance: n(512),
|
|
1046
|
+
sky: n(this.width * this.height),
|
|
1047
|
+
skyRows: n(256 * this.height),
|
|
1048
|
+
cdfRows: n(this.height),
|
|
1049
|
+
cdfPrefix: r(this.width * this.height, 2),
|
|
1050
|
+
cdfStats: n(2),
|
|
1051
|
+
cdf: r($(this.width) * this.height, 1),
|
|
1052
1052
|
phaseCells: new a(Ge(16, 8, 16, 8), 4)
|
|
1053
1053
|
};
|
|
1054
|
-
let i = (e, t = "vec4") => j(this._attrs[e], t, this._attrs[e].count), o = (e) =>
|
|
1054
|
+
let i = (e, t = "vec4") => j(this._attrs[e], t, this._attrs[e].count), o = (e) => t.slice(e * 4, e * 4 + 4), s = {
|
|
1055
1055
|
transmittance: i("transmittance"),
|
|
1056
1056
|
transfer: i("transfer"),
|
|
1057
1057
|
psiSum: i("psiSum"),
|
|
@@ -1211,7 +1211,7 @@ var Tt = class {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
dispose(e = null) {
|
|
1213
1213
|
for (let e of Object.values(this._kernels ?? {}).flat()) e.dispose();
|
|
1214
|
-
for (let t of Object.values(this._attrs ?? {}))
|
|
1214
|
+
for (let t of Object.values(this._attrs ?? {})) n(e, t);
|
|
1215
1215
|
this._kernels = null, this._attrs = null, this._texture.dispose(), this._cdfTexture.dispose();
|
|
1216
1216
|
}
|
|
1217
1217
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { dt as e } from "./SolarLimb-
|
|
2
|
-
import {
|
|
1
|
+
import { dt as e } from "./SolarLimb-ZYl-Pwl0.js";
|
|
2
|
+
import { At as t, Dt as n, Mt as r, Ot as i, bt as a, dt as o, ft as s, i as c, jt as l, lt as u, n as d, r as f, ut as p, vt as ee, yt as m } from "./PathTracer-C_gliSWI.js";
|
|
3
3
|
import { n as h, t as g } from "./EngineEvents-CLckhYbL.js";
|
|
4
|
-
import { $ as te, C as ne, G as _, M as re, Q as ie, T as v, W as ae, at as y, d as oe, et as se, f as ce, l as le, nt as b, ot as ue, r as de, rt as fe, tt as pe, u as me, v as he, x as ge } from "./sceneCachePolicy-
|
|
4
|
+
import { $ as te, C as ne, G as _, M as re, Q as ie, T as v, W as ae, at as y, d as oe, et as se, f as ce, l as le, nt as b, ot as ue, r as de, rt as fe, tt as pe, u as me, v as he, x as ge } from "./sceneCachePolicy-BHNKvrHR.js";
|
|
5
5
|
import { i as x, r as S } from "./Logger-dDDGj9Av.js";
|
|
6
|
-
import { f as _e, r as ve } from "./BufferLayout-
|
|
6
|
+
import { f as _e, r as ve } from "./BufferLayout-BROyMqO1.js";
|
|
7
7
|
import { i as ye, n as C, t as be } from "./EngineIssues-CfJiBaNj.js";
|
|
8
8
|
import { n as xe, r as Se } from "./shared-BGBcSxBQ.js";
|
|
9
9
|
import { a as Ce } from "./WorkingMatrix-C6y233hT.js";
|
|
@@ -11,7 +11,7 @@ import { i as w, r as we, t as T } from "./ActiveColor-YvuQq44O.js";
|
|
|
11
11
|
import { n as E, r as Te } from "./AssetConfig-DSEntE65.js";
|
|
12
12
|
import { d as Ee, l as De, m as Oe, p as ke, t as Ae, u as D } from "./ViewTransforms-CYN7bq2w.js";
|
|
13
13
|
import { i as O, n as je, r as Me } from "./identity-C1cLD1C0.js";
|
|
14
|
-
import { c as Ne, i as Pe, l as Fe, o as Ie, r as Le, t as Re } from "./SceneMetadata-
|
|
14
|
+
import { c as Ne, i as Pe, l as Fe, o as Ie, r as Le, t as Re } from "./SceneMetadata-Bb3iwWhh.js";
|
|
15
15
|
import { t as ze } from "./ToneMapGPU-4GPwoG_c.js";
|
|
16
16
|
import { LinearSRGBColorSpace as Be, MeshBasicNodeMaterial as Ve, QuadMesh as He, RectAreaLightNode as Ue, SRGBColorSpace as We, TextureNode as Ge, WebGPURenderer as Ke } from "three/webgpu";
|
|
17
17
|
import { Fn as qe, If as Je, cubeTexture as Ye, dot as Xe, float as k, int as A, mix as j, screenUV as Ze, select as M, storage as Qe, texture as $e, uint as et, uniform as N, uv as P, vec3 as F, vec4 as tt } from "three/tsl";
|
|
@@ -65,11 +65,11 @@ var Mt = class {
|
|
|
65
65
|
_createHelper(e) {
|
|
66
66
|
return e.isRectAreaLight ? new Dt(e) : e.isPointLight ? new bt(e, .5) : e.isSpotLight ? new Ct(e) : e.isDirectionalLight ? new ot(e, .5) : null;
|
|
67
67
|
}
|
|
68
|
-
}, Nt = class extends
|
|
68
|
+
}, Nt = class extends l {
|
|
69
69
|
constructor(e, t = {}) {
|
|
70
70
|
super("Compositor", {
|
|
71
71
|
...t,
|
|
72
|
-
executionMode:
|
|
72
|
+
executionMode: r.ALWAYS
|
|
73
73
|
}), this.renderer = e, this._lightSources = [...t.displaySources ?? [], "pathtracer:color"], this.saturation = N(t.saturation ?? 1), this._transparentBackground = N(0, "int"), this._pathTracer = t.pathTracer ?? null, this._convergenceOverlay = !1, this._debugMaterial = null, this._debugQuad = null, this._debugTexNode = null, this._debugM2Attr = null, this._debugMaskAttr = null, this._debugExposureComp = N(1), this._sourceTexNode = new Ge(), this._displayGain = null, this._backdropExposure = null, this._holdBackdrop = N(0, "int"), this._backdropGain = N(1), this.compositorMaterial = new Ve(), this.compositorMaterial.blending = ht, this._buildColorNode(), this.compositorQuad = new He(this.compositorMaterial);
|
|
74
74
|
}
|
|
75
75
|
_buildColorNode() {
|
|
@@ -132,7 +132,7 @@ var Mt = class {
|
|
|
132
132
|
if (t) {
|
|
133
133
|
if (this._backdropExposure !== null) {
|
|
134
134
|
let t = e.getState("pathtracer:backdrop") === "color";
|
|
135
|
-
this._holdBackdrop.value = +!!t, t && (this._backdropGain.value =
|
|
135
|
+
this._holdBackdrop.value = +!!t, t && (this._backdropGain.value = o(this._backdropExposure, this.renderer.toneMappingExposure, this.renderer.toneMapping));
|
|
136
136
|
}
|
|
137
137
|
this._sourceTexNode.value = t, this.renderer.setRenderTarget(null), this.compositorQuad.render(this.renderer);
|
|
138
138
|
}
|
|
@@ -1049,14 +1049,14 @@ var rn = {
|
|
|
1049
1049
|
let e = {};
|
|
1050
1050
|
for (let [t, n] of this._values) {
|
|
1051
1051
|
if (this._sources.get(t) !== Y.HOST || !this._routes.has(t)) continue;
|
|
1052
|
-
let r =
|
|
1052
|
+
let r = a(n);
|
|
1053
1053
|
r !== void 0 && (e[t] = r);
|
|
1054
1054
|
}
|
|
1055
1055
|
return e;
|
|
1056
1056
|
}
|
|
1057
1057
|
restore(e) {
|
|
1058
1058
|
let t = {}, n = [];
|
|
1059
|
-
for (let [r,
|
|
1059
|
+
for (let [r, i] of Object.entries(e ?? {})) this._routes.has(r) ? t[r] = m(i) : n.push(r);
|
|
1060
1060
|
return this.setMany(t), n;
|
|
1061
1061
|
}
|
|
1062
1062
|
applyAll() {
|
|
@@ -2117,7 +2117,7 @@ var On = class extends vt {
|
|
|
2117
2117
|
position: e.position.toArray(),
|
|
2118
2118
|
quaternion: e.quaternion.toArray(),
|
|
2119
2119
|
scale: e.scale.toArray(),
|
|
2120
|
-
userData:
|
|
2120
|
+
userData: a(e.userData) ?? {}
|
|
2121
2121
|
};
|
|
2122
2122
|
return e.isSpotLight && Object.assign(t, {
|
|
2123
2123
|
angle: e.angle,
|
|
@@ -2144,7 +2144,7 @@ var On = class extends vt {
|
|
|
2144
2144
|
1,
|
|
2145
2145
|
1,
|
|
2146
2146
|
1
|
|
2147
|
-
]), r.userData =
|
|
2147
|
+
]), r.userData = m(n.userData) ?? {};
|
|
2148
2148
|
for (let e of [
|
|
2149
2149
|
"angle",
|
|
2150
2150
|
"penumbra",
|
|
@@ -2894,35 +2894,35 @@ var Hn = class extends L {
|
|
|
2894
2894
|
let t = this._sdf.updateMeshTransforms(e);
|
|
2895
2895
|
return this.stages.pathTracer.updateBufferRanges([], this._sdf.takeMoveRanges()), this.reset(!1, { motion: !0 }), this._scheduleRespill(), t;
|
|
2896
2896
|
}
|
|
2897
|
-
setReservedRenderResolution(e, { allowLower:
|
|
2898
|
-
let
|
|
2897
|
+
setReservedRenderResolution(e, { allowLower: r = !1 } = {}) {
|
|
2898
|
+
let a = r ? e : Math.max(e, i);
|
|
2899
2899
|
if (!this.renderer) return this._pendingReservedRenderSize = {
|
|
2900
2900
|
requestedPx: e,
|
|
2901
|
-
allowLower:
|
|
2902
|
-
}, Math.max(256, Math.min(
|
|
2903
|
-
let
|
|
2904
|
-
if (
|
|
2901
|
+
allowLower: r
|
|
2902
|
+
}, Math.max(256, Math.min(n, Math.floor(a) || 256));
|
|
2903
|
+
let o = this.renderer.backend?.device?.limits?.maxStorageBufferBindingSize || 128 * 1024 * 1024, s = ce(this._hostMemoryGB), c = s.gb >= 8 && o >= 1024 * 1024 * 1024 ? n : 2048, l = t(Math.min(a, c));
|
|
2904
|
+
if (l < Math.floor(e) && this._issues.warn(C.RENDER_RESERVE_CAPPED, `reserved render size ${x.n(e)}px was capped to ${x.n(l)}px by this device's limits — renders above ${x.n(l)}px will be declined` + (s.assumed && s.gb < 8 ? " (host memory unknown, 4 GB assumed: pass hostMemoryGB)" : ""), {
|
|
2905
2905
|
requested: e,
|
|
2906
|
-
applied:
|
|
2907
|
-
deviceMemoryGB:
|
|
2908
|
-
assumed:
|
|
2909
|
-
maxStorageBufferBindingSize:
|
|
2910
|
-
}), (this.stages?.pathTracer?.storageTextures?.writeColor?.image?.width ??
|
|
2906
|
+
applied: l,
|
|
2907
|
+
deviceMemoryGB: s.gb,
|
|
2908
|
+
assumed: s.assumed,
|
|
2909
|
+
maxStorageBufferBindingSize: o
|
|
2910
|
+
}), (this.stages?.pathTracer?.storageTextures?.writeColor?.image?.width ?? l) !== l) {
|
|
2911
2911
|
let e = this.pauseRendering;
|
|
2912
2912
|
this.pauseRendering = !0;
|
|
2913
2913
|
try {
|
|
2914
2914
|
let e = this.renderer.domElement;
|
|
2915
|
-
(e.width >
|
|
2915
|
+
(e.width > l || e.height > l) && this.renderer.setSize(Math.min(e.width, l), Math.min(e.height, l), !1);
|
|
2916
2916
|
for (let e of Object.values(this.stages)) e?.reallocateReservedStorage?.();
|
|
2917
2917
|
} finally {
|
|
2918
2918
|
this.pauseRendering = e;
|
|
2919
2919
|
}
|
|
2920
2920
|
this.reset(), this.dispatchEvent({
|
|
2921
2921
|
type: g.RESERVED_RENDER_SIZE_CHANGED,
|
|
2922
|
-
size:
|
|
2922
|
+
size: l
|
|
2923
2923
|
});
|
|
2924
2924
|
}
|
|
2925
|
-
return
|
|
2925
|
+
return l;
|
|
2926
2926
|
}
|
|
2927
2927
|
_applyPendingReservedRenderSize() {
|
|
2928
2928
|
let e = this._pendingReservedRenderSize;
|
|
@@ -2935,13 +2935,13 @@ var Hn = class extends L {
|
|
|
2935
2935
|
});
|
|
2936
2936
|
}
|
|
2937
2937
|
getReservedRenderResolution() {
|
|
2938
|
-
return
|
|
2938
|
+
return i;
|
|
2939
2939
|
}
|
|
2940
2940
|
_isRenderSizeSupported(e, t) {
|
|
2941
|
-
return e >
|
|
2941
|
+
return e > i || t > i ? (this._issues.record(C.RENDER_SIZE_DECLINED, `render resolution ${e}×${t} exceeds the ${i}px storage reserve — resize ignored, so output stays at the previous size. Raise it with setReservedRenderResolution( ${Math.max(e, t)} ) before init().`, {
|
|
2942
2942
|
width: e,
|
|
2943
2943
|
height: t,
|
|
2944
|
-
reserve:
|
|
2944
|
+
reserve: i
|
|
2945
2945
|
}), !1) : !0;
|
|
2946
2946
|
}
|
|
2947
2947
|
onResize() {
|
|
@@ -3091,7 +3091,7 @@ var Hn = class extends L {
|
|
|
3091
3091
|
}
|
|
3092
3092
|
getProvenance() {
|
|
3093
3093
|
let e = this.stages.pathTracer, t = this.color?.status();
|
|
3094
|
-
return
|
|
3094
|
+
return a({
|
|
3095
3095
|
engine: de,
|
|
3096
3096
|
three: xt,
|
|
3097
3097
|
adapter: this.adapterInfo ?? null,
|
|
@@ -3154,7 +3154,7 @@ var Hn = class extends L {
|
|
|
3154
3154
|
if (e !== "linear" && e !== "srgb" && !this.color?.hasConfig) throw Error(`renderToBuffer: colorSpace must be 'linear' or 'srgb' without a colour config loaded, got "${e}"`);
|
|
3155
3155
|
let r = this.stages?.pathTracer, i = r?.storageTextures?.readTarget;
|
|
3156
3156
|
if (!i) throw Error("renderToBuffer: no render target — call init() and render at least one sample");
|
|
3157
|
-
let { width: a, height:
|
|
3157
|
+
let { width: a, height: o } = r, l = !!this.settings.get("transparentBackground");
|
|
3158
3158
|
if (e === "srgb") {
|
|
3159
3159
|
let r = n === "display" ? this._displaySource(i) : null, u = {
|
|
3160
3160
|
exposure: this.renderer.toneMappingExposure,
|
|
@@ -3162,26 +3162,26 @@ var Hn = class extends L {
|
|
|
3162
3162
|
saturation: this.settings.get("saturation") ?? 1,
|
|
3163
3163
|
preserveAlpha: t && l,
|
|
3164
3164
|
gain: this._displayGain()
|
|
3165
|
-
}, d = await this._toneMapOnGPU(r?.texture ?? null, i, a,
|
|
3165
|
+
}, d = await this._toneMapOnGPU(r?.texture ?? null, i, a, o, u), f = !d && u.gain?.cpu ? await u.gain.cpu() : null, p = u.gain?.backdrop ?? 0;
|
|
3166
3166
|
return {
|
|
3167
|
-
data: d ??
|
|
3167
|
+
data: d ?? s(r ? await this._readTexture(r.texture, a, o) : await c(this.renderer, i, a, o), {
|
|
3168
3168
|
...u,
|
|
3169
3169
|
pixelGain: f || p ? {
|
|
3170
3170
|
fn: f,
|
|
3171
3171
|
width: a,
|
|
3172
|
-
height:
|
|
3172
|
+
height: o,
|
|
3173
3173
|
backdrop: p
|
|
3174
3174
|
} : null
|
|
3175
3175
|
}),
|
|
3176
3176
|
width: a,
|
|
3177
|
-
height:
|
|
3177
|
+
height: o,
|
|
3178
3178
|
colorSpace: e,
|
|
3179
3179
|
source: r?.source ?? "accumulation",
|
|
3180
3180
|
toneMappedOn: d ? "gpu" : "cpu"
|
|
3181
3181
|
};
|
|
3182
3182
|
}
|
|
3183
|
-
let { data: u, source: d } = n === "display" ? await this._readDisplaySource(i, a,
|
|
3184
|
-
data: await
|
|
3183
|
+
let { data: u, source: d } = n === "display" ? await this._readDisplaySource(i, a, o) : {
|
|
3184
|
+
data: await c(this.renderer, i, a, o),
|
|
3185
3185
|
source: "accumulation"
|
|
3186
3186
|
};
|
|
3187
3187
|
if (!l) {
|
|
@@ -3191,7 +3191,7 @@ var Hn = class extends L {
|
|
|
3191
3191
|
if (e === "linear") return {
|
|
3192
3192
|
data: u,
|
|
3193
3193
|
width: a,
|
|
3194
|
-
height:
|
|
3194
|
+
height: o,
|
|
3195
3195
|
colorSpace: e,
|
|
3196
3196
|
workingSpace: this.color?.workingSpace ?? null,
|
|
3197
3197
|
source: d
|
|
@@ -3200,7 +3200,7 @@ var Hn = class extends L {
|
|
|
3200
3200
|
return {
|
|
3201
3201
|
data: f,
|
|
3202
3202
|
width: a,
|
|
3203
|
-
height:
|
|
3203
|
+
height: o,
|
|
3204
3204
|
colorSpace: p,
|
|
3205
3205
|
source: d
|
|
3206
3206
|
};
|
|
@@ -3423,7 +3423,7 @@ var Hn = class extends L {
|
|
|
3423
3423
|
data: await this._readTexture(r.texture, t, n),
|
|
3424
3424
|
source: r.source
|
|
3425
3425
|
} : {
|
|
3426
|
-
data: await
|
|
3426
|
+
data: await c(this.renderer, e, t, n),
|
|
3427
3427
|
source: "accumulation"
|
|
3428
3428
|
};
|
|
3429
3429
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as e } from "./sceneCachePolicy-
|
|
1
|
+
import { x as e } from "./sceneCachePolicy-BHNKvrHR.js";
|
|
2
2
|
import { DataTexture as t, LoaderUtils as n, RGBAFormat as r, UnsignedByteType as i } from "three";
|
|
3
3
|
//#region src/Processor/archiveFormats.js
|
|
4
4
|
var a = Object.freeze({
|