iflow-engine-base 4.0.0 → 4.0.10
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/bim-engine-sdk.es.js +3 -3
- package/dist/bim-engine-sdk.umd.js +875 -875
- package/dist/chunks/{EngineKernel-BN8tMHPw.js → EngineKernel-Kg-SdrzV.js} +3477 -4763
- package/dist/chunks/{engine-2d-DNl3JeLt.js → engine-2d-BsdGqViB.js} +4 -4
- package/dist/chunks/{engine-3d-CEP_oxL3.js → engine-3d-DouCKYY-.js} +10215 -10179
- package/dist/chunks/{engine-720-50HCftiR.js → engine-720-DvQtPJ60.js} +8 -8
- package/dist/chunks/{engine-gaussian-FZvEweZh.js → engine-gaussian-BqR-uPbs.js} +2 -2
- package/dist/chunks/{engine-gis-ClS_rnhI.js → engine-gis-CgZIsySE.js} +3 -3
- package/dist/chunks/{index-B0U7tpVx.js → index-DwsjDyNp.js} +140 -131
- package/dist/chunks/{sdk-assets-CMjpGLbQ.js → sdk-assets-Cf6dJkM2.js} +2 -2
- package/dist/chunks/{sdk-runtime-fnXycr6Y.js → sdk-runtime-DJ9E8kq3.js} +17 -17
- package/dist/chunks/{sdk-vendor-DKP0f5lz.js → sdk-vendor-CPnf2j9F.js} +1 -1
- package/dist/chunks/{three-vendor-XSz124jq.js → three-vendor-DolVXUca.js} +12214 -12156
- package/dist/index.d.ts +301 -182
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as R,
|
|
2
|
-
import { C as L, W as w, E as T, c as z, r as _ } from "./sdk-runtime-
|
|
1
|
+
import { n as R, az as S, h as E, w as b, j as x, K as A, E as k, Q as F, p as I, W as y, a as v, T as f, i as P, a6 as m, V as p, b as D } from "./three-vendor-DolVXUca.js";
|
|
2
|
+
import { C as L, W as w, E as T, c as z, r as _ } from "./sdk-runtime-DJ9E8kq3.js";
|
|
3
3
|
class V {
|
|
4
4
|
scene;
|
|
5
5
|
panoramaSphere = null;
|
|
@@ -101,7 +101,7 @@ class V {
|
|
|
101
101
|
this.scene.clear();
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
class
|
|
104
|
+
class K {
|
|
105
105
|
camera;
|
|
106
106
|
minFov;
|
|
107
107
|
maxFov;
|
|
@@ -199,7 +199,7 @@ class H {
|
|
|
199
199
|
this.camera = null;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
class
|
|
202
|
+
class O {
|
|
203
203
|
renderer;
|
|
204
204
|
container;
|
|
205
205
|
animationId = null;
|
|
@@ -328,7 +328,7 @@ class K {
|
|
|
328
328
|
this.pauseRendering(), this.container.contains(this.renderer.domElement) && this.container.removeChild(this.renderer.domElement), this.watermark.dispose(), this.renderer.dispose(), this.renderer.forceContextLoss(), this.onBeforeRenderCallback = void 0, this.onAfterRenderCallback = void 0;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
class
|
|
331
|
+
class H {
|
|
332
332
|
camera;
|
|
333
333
|
domElement;
|
|
334
334
|
cameraModule;
|
|
@@ -547,7 +547,7 @@ class X {
|
|
|
547
547
|
domElement;
|
|
548
548
|
cameraModule;
|
|
549
549
|
constructor(e, t) {
|
|
550
|
-
this.cameraModule = e, this.domElement = t, this.controls = new
|
|
550
|
+
this.cameraModule = e, this.domElement = t, this.controls = new H(e, t);
|
|
551
551
|
}
|
|
552
552
|
/**
|
|
553
553
|
* 初始化控制模块
|
|
@@ -1273,12 +1273,12 @@ class N {
|
|
|
1273
1273
|
if (!n)
|
|
1274
1274
|
throw new Error(`Container with id "${t.containerId}" not found`);
|
|
1275
1275
|
try {
|
|
1276
|
-
this.eventModule = new Y(), this.sceneModule = new V(t.sphereRadius), this.cameraModule = new
|
|
1276
|
+
this.eventModule = new Y(), this.sceneModule = new V(t.sphereRadius), this.cameraModule = new K(
|
|
1277
1277
|
n,
|
|
1278
1278
|
t.fov,
|
|
1279
1279
|
t.minFov,
|
|
1280
1280
|
t.maxFov
|
|
1281
|
-
), this.renderModule = new
|
|
1281
|
+
), this.renderModule = new O(n, !0), this.controlModule = new X(
|
|
1282
1282
|
this.cameraModule,
|
|
1283
1283
|
this.renderModule.getDomElement()
|
|
1284
1284
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as Js, C as st,
|
|
2
|
-
import { C as Un, c as zn, E as _n, r as Qn } from "./sdk-runtime-
|
|
1
|
+
import { n as Js, C as st, K as Zs, V as v, b as N, O as $s, W as en, M as J, Q as ge, a as tn, f as qt, j as be, B as sn, h as ft, r as it, aW as ze, aX as Pt, aY as at, a5 as Bt, aZ as ms, a_ as yn, a$ as xn, b0 as In, b1 as Tn, a4 as wn, b2 as En, b3 as Bn, l as lt, b4 as As, b5 as gs, b6 as vn, k as Cs, b7 as Fn, t as Je, az as Ss, D as Kt, ap as bn, w as ys, q as Dn, $ as We, b8 as qe, aF as xs, s as Mn, b9 as Rn, aj as Pn, ba as On, bb as nn, aN as Is, bc as kn, H as Ln, bd as Ne, be as mt, p as Hn } from "./three-vendor-DolVXUca.js";
|
|
2
|
+
import { C as Un, c as zn, E as _n, r as Qn } from "./sdk-runtime-DJ9E8kq3.js";
|
|
3
3
|
var De = /* @__PURE__ */ ((m) => (m.LoadStart = "gaussian-load-start", m.LoadProgress = "gaussian-load-progress", m.Loaded = "gaussian-loaded", m.LoadError = "gaussian-load-error", m.SceneRemoved = "gaussian-scene-removed", m.FpsUpdated = "gaussian-fps-updated", m.ViewChanged = "gaussian-view-changed", m))(De || {});
|
|
4
4
|
class Nn {
|
|
5
5
|
listeners = /* @__PURE__ */ new Map();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as xX, J as KN } from "./sdk-vendor-
|
|
2
|
-
import { bf as Ii, bg as TX } from "./three-vendor-
|
|
3
|
-
import { l as vX, L as EX, E as CX, d as JN, e as wX, c as $C, a as SX, f as IX, r as DX, h as XC } from "./sdk-runtime-
|
|
1
|
+
import { g as xX, J as KN } from "./sdk-vendor-CPnf2j9F.js";
|
|
2
|
+
import { bf as Ii, bg as TX } from "./three-vendor-DolVXUca.js";
|
|
3
|
+
import { l as vX, L as EX, E as CX, d as JN, e as wX, c as $C, a as SX, f as IX, r as DX, h as XC } from "./sdk-runtime-DJ9E8kq3.js";
|
|
4
4
|
var QN = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
5
5
|
function Fb(e) {
|
|
6
6
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -1,64 +1,76 @@
|
|
|
1
|
-
import { s as
|
|
2
|
-
import "./engine-3d-
|
|
3
|
-
import {
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { s as A, a as G, b as U } from "./sdk-assets-Cf6dJkM2.js";
|
|
2
|
+
import "./engine-3d-DouCKYY-.js";
|
|
3
|
+
import { bj as v, G as m, M as N, C as B, bk as j, a$ as k, y as W } from "./three-vendor-DolVXUca.js";
|
|
4
|
+
var b = /* @__PURE__ */ ((s) => (s.ModelLoadStart = "model-load-start", s.ModelLoadProgress = "model-load-progress", s.ModelLoaded = "model-loaded", s.ModelError = "model-error", s.SelectionChanged = "selection-changed", s.HoverChanged = "hover-changed", s.Click = "click", s.MouseMove = "mouse-move", s.ModelPlaceSelected = "model-place-selected", s.ModelCalibrationChanged = "model-calibration-changed", s.CameraChanged = "camera-changed", s.CameraIdle = "camera-idle", s.EngineFree = "engine-free", s.EngineBusy = "engine-busy", s.MeasureChanged = "measure-changed", s.MeasureClick = "measure-click", s.SectionMove = "section-move", s.LoadingCompleted = "loading_completed", s))(b || {});
|
|
5
|
+
function q() {
|
|
6
|
+
return O(new v());
|
|
7
|
+
}
|
|
8
|
+
function O(s, e = []) {
|
|
9
|
+
const t = s;
|
|
10
|
+
return t.isClippingGroup !== !0 && Object.defineProperty(t, "isClippingGroup", {
|
|
11
|
+
value: !0,
|
|
12
|
+
enumerable: !0
|
|
13
|
+
}), t.clippingPlanes = e, t.enabled = !0, t.clipIntersection = !1, t.clipShadows = !1, t;
|
|
14
|
+
}
|
|
15
|
+
const M = "__isModelUrlGroup", h = "__modelDepthBias", _ = 4, H = 5e5;
|
|
16
|
+
function R(s) {
|
|
7
17
|
return s.__modelGroupMap instanceof Map || (s.__modelGroupMap = /* @__PURE__ */ new Map()), s.__modelGroupMap;
|
|
8
18
|
}
|
|
9
|
-
function
|
|
19
|
+
function T(s) {
|
|
10
20
|
return s.__modelObjectIndexMap instanceof Map || (s.__modelObjectIndexMap = /* @__PURE__ */ new Map()), s.__modelObjectIndexMap;
|
|
11
21
|
}
|
|
12
22
|
function E(s, e) {
|
|
13
|
-
s.url = e, s.name = e, s.userData = s.userData ?? {}, s.userData[
|
|
23
|
+
s.url = e, s.name = e, s.userData = s.userData ?? {}, s.userData[M] = !0;
|
|
14
24
|
}
|
|
15
25
|
function x(s, e) {
|
|
16
|
-
return s instanceof
|
|
26
|
+
return s instanceof m ? e == null ? s.userData?.[M] === !0 : s.userData?.[M] === !0 && s.url === e : !1;
|
|
17
27
|
}
|
|
18
28
|
function y(s, e) {
|
|
19
29
|
return s?.models?.find?.((t) => t?.url === e);
|
|
20
30
|
}
|
|
21
|
-
function
|
|
31
|
+
function te(s, e, t) {
|
|
22
32
|
if (typeof t != "string" || t.length === 0)
|
|
23
33
|
return;
|
|
24
34
|
const r = y(s, e);
|
|
25
35
|
r != null && (Array.isArray(r.urls) || (r.urls = []), r.urls.includes(t) || r.urls.push(t));
|
|
26
36
|
}
|
|
27
|
-
function
|
|
28
|
-
const t =
|
|
37
|
+
function f(s, e) {
|
|
38
|
+
const t = R(s), r = t.get(e);
|
|
29
39
|
if (r && r.parent != null)
|
|
30
40
|
return r;
|
|
31
41
|
const n = y(s, e);
|
|
32
|
-
if (n?.group instanceof
|
|
42
|
+
if (n?.group instanceof m && n.group.parent != null)
|
|
33
43
|
return E(n.group, e), t.set(e, n.group), n.group;
|
|
34
|
-
const a = s?.scene?.children?.find?.((i) => i instanceof
|
|
44
|
+
const a = s?.scene?.children?.find?.((i) => i instanceof m ? x(i, e) ? !0 : i.name === e && i.url === e : !1);
|
|
35
45
|
return a != null ? (E(a, e), t.set(e, a), n != null && (n.group = a), a) : null;
|
|
36
46
|
}
|
|
37
|
-
function te(s, e) {
|
|
38
|
-
const t = m(s, e);
|
|
39
|
-
return t == null ? new G() : (t.updateWorldMatrix(!0, !1), t.matrixWorld.clone());
|
|
40
|
-
}
|
|
41
47
|
function se(s, e) {
|
|
42
|
-
const t =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
const t = f(s, e);
|
|
49
|
+
return t == null ? new N() : (t.updateWorldMatrix(!0, !1), t.matrixWorld.clone());
|
|
50
|
+
}
|
|
51
|
+
function re(s, e) {
|
|
52
|
+
const t = typeof s.__getActiveWebGPUClippingPlanes == "function" ? s.__getActiveWebGPUClippingPlanes() : s.sectionPlane, r = f(s, e);
|
|
53
|
+
if (r != null) {
|
|
54
|
+
const o = O(r, t);
|
|
55
|
+
return o.clipShadows = !0, o;
|
|
56
|
+
}
|
|
57
|
+
const n = q();
|
|
58
|
+
n.clippingPlanes = Array.isArray(t) ? t : [], n.clipIntersection = !1, n.clipShadows = !0, E(n, e), s.scene.add(n), R(s).set(e, n);
|
|
59
|
+
const i = y(s, e);
|
|
60
|
+
return i != null && (i.group = n), n;
|
|
49
61
|
}
|
|
50
62
|
function V(s) {
|
|
51
63
|
const e = [], t = /* @__PURE__ */ new Set();
|
|
52
64
|
return (Array.isArray(s?.models) ? s.models : []).forEach((n) => {
|
|
53
65
|
if (n?.url == null)
|
|
54
66
|
return;
|
|
55
|
-
const a =
|
|
67
|
+
const a = f(s, n.url);
|
|
56
68
|
a == null || t.has(a.uuid) || (t.add(a.uuid), e.push(a));
|
|
57
69
|
}), s?.scene?.children?.forEach?.((n) => {
|
|
58
70
|
!x(n) || t.has(n.uuid) || (t.add(n.uuid), e.push(n));
|
|
59
71
|
}), e;
|
|
60
72
|
}
|
|
61
|
-
function
|
|
73
|
+
function w(s, e) {
|
|
62
74
|
const t = [], r = /* @__PURE__ */ new Set();
|
|
63
75
|
return V(s).forEach((a) => {
|
|
64
76
|
a.traverse((i) => {
|
|
@@ -74,10 +86,7 @@ function I(s, e) {
|
|
|
74
86
|
}
|
|
75
87
|
}), t;
|
|
76
88
|
}
|
|
77
|
-
function
|
|
78
|
-
return I(s, (e) => e instanceof v && !(e instanceof N));
|
|
79
|
-
}
|
|
80
|
-
function W(s) {
|
|
89
|
+
function z(s) {
|
|
81
90
|
if (typeof s.__modelObjectIndexSeed == "number")
|
|
82
91
|
return;
|
|
83
92
|
let e = -1;
|
|
@@ -85,64 +94,64 @@ function W(s) {
|
|
|
85
94
|
typeof t?.index == "number" && Number.isFinite(t.index) && (e = Math.max(e, t.index));
|
|
86
95
|
}), s.__modelObjectIndexSeed = e + 1;
|
|
87
96
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
97
|
+
function Q(s) {
|
|
98
|
+
z(s);
|
|
90
99
|
const e = s.__modelObjectIndexSeed;
|
|
91
100
|
return s.__modelObjectIndexSeed += 1, e;
|
|
92
101
|
}
|
|
93
102
|
function ne(s, e, t) {
|
|
94
|
-
const r = typeof t == "number" ? t :
|
|
95
|
-
return e.index = r,
|
|
103
|
+
const r = typeof t == "number" ? t : Q(s);
|
|
104
|
+
return e.index = r, T(s).set(r, e), r;
|
|
96
105
|
}
|
|
97
106
|
function ae(s) {
|
|
98
107
|
s.updateMatrix(), s.matrixAutoUpdate = !1;
|
|
99
108
|
}
|
|
100
|
-
function
|
|
109
|
+
function K(s) {
|
|
101
110
|
return Number.isFinite(s) && s >= 3;
|
|
102
111
|
}
|
|
103
112
|
function ie(s, e) {
|
|
104
|
-
return e <= H &&
|
|
113
|
+
return e <= H && K(s);
|
|
105
114
|
}
|
|
106
115
|
function L(s) {
|
|
107
116
|
return Array.isArray(s) ? s : s != null ? [s] : [];
|
|
108
117
|
}
|
|
109
|
-
function
|
|
118
|
+
function X(s) {
|
|
110
119
|
return 1 + (Number.isFinite(s) ? Math.abs(Math.floor(s)) : 0) % 16 * 0.125;
|
|
111
120
|
}
|
|
112
121
|
function oe(s, e) {
|
|
113
|
-
const t = typeof e == "number" ? e : s?.index, r =
|
|
122
|
+
const t = typeof e == "number" ? e : s?.index, r = X(t);
|
|
114
123
|
L(s?.material).forEach((n) => {
|
|
115
124
|
n.userData = n.userData ?? {};
|
|
116
|
-
const a = n.userData[
|
|
117
|
-
n.userData[
|
|
125
|
+
const a = n.userData[h] ?? {};
|
|
126
|
+
n.userData[h] = {
|
|
118
127
|
...a,
|
|
119
128
|
enabled: !0,
|
|
120
129
|
factor: 1,
|
|
121
130
|
units: r
|
|
122
|
-
}, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = r + (a.edgeActive ?
|
|
131
|
+
}, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = r + (a.edgeActive ? _ : 0), n.needsUpdate = !0;
|
|
123
132
|
});
|
|
124
133
|
}
|
|
125
134
|
function le(s, e) {
|
|
126
135
|
L(s?.material).forEach((t) => {
|
|
127
136
|
t.userData = t.userData ?? {};
|
|
128
|
-
const r = t.userData[
|
|
129
|
-
t.userData[
|
|
137
|
+
const r = t.userData[h] ?? {}, n = r.enabled ? r.units : t.polygonOffsetUnits ?? 0, a = r.enabled ? r.factor : t.polygonOffsetFactor ?? 1;
|
|
138
|
+
t.userData[h] = {
|
|
130
139
|
...r,
|
|
131
140
|
edgeActive: e
|
|
132
|
-
}, r.enabled || e ? (t.polygonOffset = !0, t.polygonOffsetFactor = a, t.polygonOffsetUnits = n + (e ?
|
|
141
|
+
}, r.enabled || e ? (t.polygonOffset = !0, t.polygonOffsetFactor = a, t.polygonOffsetUnits = n + (e ? _ : 0)) : t.polygonOffset = !1, t.needsUpdate = !0;
|
|
133
142
|
});
|
|
134
143
|
}
|
|
135
144
|
function ue(s, e) {
|
|
136
145
|
if (!Number.isFinite(e))
|
|
137
146
|
return;
|
|
138
|
-
const t =
|
|
147
|
+
const t = T(s), r = t.get(e);
|
|
139
148
|
if (r && r.parent != null)
|
|
140
149
|
return r;
|
|
141
150
|
r && r.parent == null && t.delete(e);
|
|
142
|
-
const n =
|
|
151
|
+
const n = w(s, (a) => a.index === e)[0];
|
|
143
152
|
return n != null ? (t.set(e, n), n) : s?.scene?.children?.find?.((a) => a?.index === e);
|
|
144
153
|
}
|
|
145
|
-
class
|
|
154
|
+
class ce {
|
|
146
155
|
options;
|
|
147
156
|
snapshots = /* @__PURE__ */ new Map();
|
|
148
157
|
isDisposed = !1;
|
|
@@ -161,7 +170,7 @@ class de {
|
|
|
161
170
|
}
|
|
162
171
|
/** 注册模型加载事件并立即处理当前已有模型。 */
|
|
163
172
|
init(e = {}) {
|
|
164
|
-
this.isDisposed || (Object.keys(e).length > 0 && (this.options.enabled = e.enabled ?? this.options.enabled, (e.rules != null || e.materialName != null || e.materialParams != null) && (this.options.rules = this.normalizeRules(e))), this.eventsBound || (this.engine.events?.on?.(
|
|
173
|
+
this.isDisposed || (Object.keys(e).length > 0 && (this.options.enabled = e.enabled ?? this.options.enabled, (e.rules != null || e.materialName != null || e.materialParams != null) && (this.options.rules = this.normalizeRules(e))), this.eventsBound || (this.engine.events?.on?.(b.LoadingCompleted, this.handleLoadingCompleted), this.eventsBound = !0), this.options.enabled && this.replaceAll());
|
|
165
174
|
}
|
|
166
175
|
isEnabled() {
|
|
167
176
|
return this.options.enabled;
|
|
@@ -209,13 +218,13 @@ class de {
|
|
|
209
218
|
if (this.isDisposed || !this.options.enabled)
|
|
210
219
|
return 0;
|
|
211
220
|
const e = /* @__PURE__ */ new Set();
|
|
212
|
-
return
|
|
221
|
+
return w(this.engine, (t) => (this.collectObjectMaterials(t, e), !1)), this.applyMaterials(e);
|
|
213
222
|
}
|
|
214
223
|
/** 替换指定模型 URL 或模型对象中的材质。 */
|
|
215
224
|
replaceModel(e) {
|
|
216
225
|
if (this.isDisposed || !this.options.enabled)
|
|
217
226
|
return 0;
|
|
218
|
-
const t = typeof e == "string" ?
|
|
227
|
+
const t = typeof e == "string" ? f(this.engine, e) : e;
|
|
219
228
|
if (t == null)
|
|
220
229
|
return 0;
|
|
221
230
|
const r = /* @__PURE__ */ new Set();
|
|
@@ -249,7 +258,7 @@ class de {
|
|
|
249
258
|
}), this.snapshots.clear(), this.engine.requestComposerRender?.();
|
|
250
259
|
}
|
|
251
260
|
dispose() {
|
|
252
|
-
this.isDisposed || (this.eventsBound && (this.engine.events?.off?.(
|
|
261
|
+
this.isDisposed || (this.eventsBound && (this.engine.events?.off?.(b.LoadingCompleted, this.handleLoadingCompleted), this.eventsBound = !1), this.restoreAll(), this.isDisposed = !0);
|
|
253
262
|
}
|
|
254
263
|
normalizeRules(e) {
|
|
255
264
|
return Array.isArray(e.rules) ? e.rules.map((t) => ({
|
|
@@ -296,7 +305,7 @@ class de {
|
|
|
296
305
|
r !== void 0 && (t in e || t === "envMapIntensity") && (e[t] = r);
|
|
297
306
|
}
|
|
298
307
|
}
|
|
299
|
-
const
|
|
308
|
+
const Y = {
|
|
300
309
|
vxgi: {
|
|
301
310
|
// VXGI 需要体素化整套场景,默认关闭以避免影响现有项目的初始化性能。
|
|
302
311
|
enabled: !1,
|
|
@@ -556,7 +565,7 @@ const X = {
|
|
|
556
565
|
* GTAO 渲染分辨率倍率;1 为全分辨率,0.5 的像素数约为全分辨率的四分之一。
|
|
557
566
|
* 性能:按宽高平方影响采样、带宽和显存,是 GTAO 最有效的性能调优项。
|
|
558
567
|
*/
|
|
559
|
-
resolutionScale:
|
|
568
|
+
resolutionScale: 1,
|
|
560
569
|
/**
|
|
561
570
|
* 遮蔽半径,单位为场景单位。
|
|
562
571
|
* 性能:主要影响搜索范围和结果,不直接增加固定采样数;过大可能增加有效纹理访问。
|
|
@@ -594,18 +603,18 @@ const X = {
|
|
|
594
603
|
*/
|
|
595
604
|
useTemporalFiltering: !0
|
|
596
605
|
}
|
|
597
|
-
},
|
|
598
|
-
function
|
|
606
|
+
}, I = ["vxgi", "ssgi", "gtao", "ssr", "traa"];
|
|
607
|
+
function $() {
|
|
599
608
|
const s = {};
|
|
600
|
-
return
|
|
601
|
-
const { enabled: t, ...r } =
|
|
609
|
+
return I.forEach((e) => {
|
|
610
|
+
const { enabled: t, ...r } = Y[e];
|
|
602
611
|
s[e] = { ...r };
|
|
603
612
|
}), s;
|
|
604
613
|
}
|
|
605
|
-
function
|
|
606
|
-
const i =
|
|
607
|
-
return
|
|
608
|
-
Object.assign(i[
|
|
614
|
+
function l(s, e, t, r, n, a = {}) {
|
|
615
|
+
const i = $();
|
|
616
|
+
return I.forEach((o) => {
|
|
617
|
+
Object.assign(i[o], a[o] ?? {});
|
|
609
618
|
}), {
|
|
610
619
|
level: s,
|
|
611
620
|
name: e,
|
|
@@ -621,35 +630,35 @@ function o(s, e, t, r, n, a = {}) {
|
|
|
621
630
|
parameters: i
|
|
622
631
|
};
|
|
623
632
|
}
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
633
|
+
const de = [
|
|
634
|
+
l(1, "L1", !1, 512, {}),
|
|
635
|
+
l(2, "L2", !1, 512, { gtao: !0 }, { gtao: { resolutionScale: 0.5, samples: 4, scale: 0.25, useTemporalFiltering: !1 } }),
|
|
636
|
+
l(3, "L3", !0, 512, { gtao: !0 }, { gtao: { resolutionScale: 0.5, samples: 4, scale: 0.3, useTemporalFiltering: !1 } }),
|
|
637
|
+
l(4, "L4", !0, 1024, { gtao: !0 }, { gtao: { resolutionScale: 0.5, samples: 6, scale: 0.35, useTemporalFiltering: !1 } }),
|
|
638
|
+
l(5, "L5", !0, 1024, { gtao: !0, traa: !0 }, { gtao: { resolutionScale: 0.5, samples: 6, scale: 0.4 } }),
|
|
639
|
+
l(6, "L6", !0, 2048, { gtao: !0, traa: !0 }, { gtao: { resolutionScale: 0.75, samples: 8, scale: 0.45 } }),
|
|
640
|
+
l(7, "L7", !0, 2048, { gtao: !0, ssgi: !0, traa: !0 }, { gtao: { resolutionScale: 1, samples: 6, scale: 0.25 }, ssgi: { sliceCount: 1, stepCount: 2, aoIntensity: 0.45, giIntensity: 1 } }),
|
|
632
641
|
// Level 8 完整继承 defaults.ts 的参数,作为十二档画质的中间基准。
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
],
|
|
642
|
+
l(8, "L8", !0, 2048, { gtao: !0, ssgi: !0, traa: !0, ssr: !0 }),
|
|
643
|
+
l(9, "L9", !0, 2048, { gtao: !0, ssgi: !0, traa: !0, ssr: !0 }, { gtao: { resolutionScale: 1, samples: 12, scale: 0.55 }, ssgi: { sliceCount: 1, stepCount: 3, aoIntensity: 1.05, giIntensity: 2.1 }, ssr: { resolutionScale: 0.6, quality: 0.6, blurQuality: 2 } }),
|
|
644
|
+
l(10, "L10", !0, 2048, { gtao: !0, ssgi: !0, traa: !0, ssr: !0 }, { gtao: { resolutionScale: 1, samples: 12, scale: 0.6 }, ssgi: { sliceCount: 2, stepCount: 4, aoIntensity: 1.1, giIntensity: 2.2 }, ssr: { resolutionScale: 0.75, quality: 0.7, binaryRefine: !0, blurQuality: 2 } }),
|
|
645
|
+
l(11, "L11", !0, 4096, { gtao: !0, ssgi: !0, traa: !0, ssr: !0 }, { gtao: { resolutionScale: 1, samples: 16, scale: 0.7 }, ssgi: { sliceCount: 2, stepCount: 6, aoIntensity: 1.2, giIntensity: 2.4 }, ssr: { resolutionScale: 1, quality: 0.8, binaryRefine: !0, blurQuality: 3 } }),
|
|
646
|
+
l(12, "L12", !0, 4096, { vxgi: !0, gtao: !0, ssgi: !0, traa: !0, ssr: !0 }, { vxgi: { resolution: 128, coneCount: 4, bounces: 1 }, gtao: { resolutionScale: 1, samples: 20, scale: 0.8 }, ssgi: { sliceCount: 3, stepCount: 8, aoIntensity: 1.3, giIntensity: 2.6 }, ssr: { resolutionScale: 1, quality: 0.9, binaryRefine: !0, blurQuality: 3 } })
|
|
647
|
+
], pe = [
|
|
639
648
|
{ id: "indoor", name: "Indoor", category: "indoor", hdrId: "11", hdrIntensity: 0.45, ambientIntensity: 0.5, directionalIntensity: 2 },
|
|
640
649
|
{ id: "outdoor", name: "Outdoor", category: "outdoor", hdrId: "1", hdrIntensity: 0.5, ambientIntensity: 0.2, directionalIntensity: 3 }
|
|
641
650
|
];
|
|
642
|
-
function
|
|
651
|
+
function he(s) {
|
|
643
652
|
return {
|
|
644
653
|
...s,
|
|
645
654
|
shadow: { ...s.shadow },
|
|
646
655
|
effects: { ...s.effects },
|
|
647
656
|
parameters: Object.fromEntries(
|
|
648
|
-
|
|
657
|
+
I.map((e) => [e, { ...s.parameters[e] }])
|
|
649
658
|
)
|
|
650
659
|
};
|
|
651
660
|
}
|
|
652
|
-
const
|
|
661
|
+
const P = {
|
|
653
662
|
enabled: !1,
|
|
654
663
|
// 默认关闭,避免改变现有渲染结果;需要时传入 enabled: true。
|
|
655
664
|
targetLuminance: 0.45,
|
|
@@ -672,7 +681,7 @@ const R = {
|
|
|
672
681
|
// 忽略最暗的 10% 像素,降低黑色背景的影响。
|
|
673
682
|
highPercentile: 0.8
|
|
674
683
|
// 忽略最亮的 10% 像素,降低灯光/窗户的影响。
|
|
675
|
-
}, u = "v3-auto-exposure",
|
|
684
|
+
}, u = "v3-auto-exposure", C = 1e-4, g = 2e-3;
|
|
676
685
|
class fe {
|
|
677
686
|
engine;
|
|
678
687
|
renderer;
|
|
@@ -724,8 +733,8 @@ class fe {
|
|
|
724
733
|
this.disposed || (this.disposed = !0, this.engine.setIdleFrameRateExempt?.(u, !1), this.probeTarget?.dispose(), this.probeTarget = null);
|
|
725
734
|
}
|
|
726
735
|
resolveOptions(e) {
|
|
727
|
-
const t = typeof e == "boolean" ? { ...
|
|
728
|
-
return t.targetLuminance = Math.max(t.targetLuminance,
|
|
736
|
+
const t = typeof e == "boolean" ? { ...P, enabled: e } : { ...P, ...e ?? {} };
|
|
737
|
+
return t.targetLuminance = Math.max(t.targetLuminance, C), t.minExposure = Math.max(t.minExposure, 0.01), t.maxExposure = Math.max(t.maxExposure, t.minExposure), t.lowPercentile = Math.min(Math.max(t.lowPercentile, 0), 0.45), t.highPercentile = Math.min(Math.max(t.highPercentile, t.lowPercentile + 0.1), 1), t.measurementInterval = Math.max(t.measurementInterval, 50), t.probeWidth = Math.max(4, Math.floor(t.probeWidth)), t.probeHeight = Math.max(4, Math.floor(t.probeHeight)), t;
|
|
729
738
|
}
|
|
730
739
|
ensureProbeTarget() {
|
|
731
740
|
this.probeTarget && this.probeTarget.width === this.options.probeWidth && this.probeTarget.height === this.options.probeHeight || (this.probeTarget?.dispose(), this.probeTarget = new j(this.options.probeWidth, this.options.probeHeight, {
|
|
@@ -733,7 +742,7 @@ class fe {
|
|
|
733
742
|
depthBuffer: !0,
|
|
734
743
|
stencilBuffer: !1,
|
|
735
744
|
samples: 0
|
|
736
|
-
}), this.probeTarget.texture.colorSpace =
|
|
745
|
+
}), this.probeTarget.texture.colorSpace = W, this.probeTarget.texture.generateMipmaps = !1);
|
|
737
746
|
}
|
|
738
747
|
async measureScene() {
|
|
739
748
|
if (this.disposed || !this.renderer?.readRenderTargetPixelsAsync) return;
|
|
@@ -743,13 +752,13 @@ class fe {
|
|
|
743
752
|
const t = this.renderer.getRenderTarget?.() ?? null, r = [];
|
|
744
753
|
let n = !1;
|
|
745
754
|
const a = () => {
|
|
746
|
-
n || (n = !0, r.forEach(({ object: i, visible:
|
|
747
|
-
i.visible =
|
|
755
|
+
n || (n = !0, r.forEach(({ object: i, visible: o }) => {
|
|
756
|
+
i.visible = o;
|
|
748
757
|
}));
|
|
749
758
|
};
|
|
750
759
|
try {
|
|
751
|
-
this.scene.traverse((
|
|
752
|
-
|
|
760
|
+
this.scene.traverse((c) => {
|
|
761
|
+
c.userData?.excludeFromAutoExposure === !0 && (r.push({ object: c, visible: c.visible }), c.visible = !1);
|
|
753
762
|
}), this.renderer.setRenderTarget(e), this.renderer.render(this.scene, this.engine.camera), a(), this.restoreRenderTarget(t);
|
|
754
763
|
const i = await this.renderer.readRenderTargetPixelsAsync(
|
|
755
764
|
e,
|
|
@@ -759,9 +768,9 @@ class fe {
|
|
|
759
768
|
e.height
|
|
760
769
|
);
|
|
761
770
|
if (this.disposed) return;
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
764
|
-
this.targetExposure = this.clampExposure(this.options.targetLuminance /
|
|
771
|
+
const o = this.calculateTrimmedLuminance(i);
|
|
772
|
+
if (o === null) return;
|
|
773
|
+
this.targetExposure = this.clampExposure(this.options.targetLuminance / o), this.engine.requestComposerRender?.();
|
|
765
774
|
} catch (i) {
|
|
766
775
|
console.warn("v3 自动曝光测光失败,将继续使用当前曝光。", i);
|
|
767
776
|
} finally {
|
|
@@ -777,26 +786,26 @@ class fe {
|
|
|
777
786
|
calculateTrimmedLuminance(e) {
|
|
778
787
|
const t = [];
|
|
779
788
|
for (let i = 0; i + 3 < e.length; i += 4) {
|
|
780
|
-
if (
|
|
781
|
-
const
|
|
782
|
-
Number.isFinite(
|
|
789
|
+
if (p(e[i + 3]) <= 0.01) continue;
|
|
790
|
+
const c = Math.max(0, p(e[i])), F = Math.max(0, p(e[i + 1])), D = Math.max(0, p(e[i + 2])), S = 0.2126 * c + 0.7152 * F + 0.0722 * D;
|
|
791
|
+
Number.isFinite(S) && t.push(S);
|
|
783
792
|
}
|
|
784
793
|
if (t.length === 0) return null;
|
|
785
|
-
t.sort((i,
|
|
794
|
+
t.sort((i, o) => i - o);
|
|
786
795
|
const r = Math.floor(t.length * this.options.lowPercentile), n = Math.max(r + 1, Math.ceil(t.length * this.options.highPercentile));
|
|
787
796
|
let a = 0;
|
|
788
797
|
for (let i = r; i < n; i += 1) a += t[i];
|
|
789
|
-
return Math.max(a / (n - r),
|
|
798
|
+
return Math.max(a / (n - r), C);
|
|
790
799
|
}
|
|
791
800
|
clampExposure(e) {
|
|
792
801
|
return Math.min(Math.max(e, this.options.minExposure), this.options.maxExposure);
|
|
793
802
|
}
|
|
794
803
|
}
|
|
795
|
-
function
|
|
804
|
+
function p(s) {
|
|
796
805
|
const e = s & 32768 ? -1 : 1, t = s >> 10 & 31, r = s & 1023;
|
|
797
806
|
return t === 0 ? e * (r / 1024) * 2 ** -14 : t === 31 ? r === 0 ? e * (1 / 0) : NaN : e * (1 + r / 1024) * 2 ** (t - 15);
|
|
798
807
|
}
|
|
799
|
-
const
|
|
808
|
+
const ge = {
|
|
800
809
|
Initialized: "gis:initialized",
|
|
801
810
|
CameraChanged: "gis:camera-changed",
|
|
802
811
|
ModelLoadStart: "gis:model-load-start",
|
|
@@ -807,62 +816,62 @@ const me = {
|
|
|
807
816
|
ViewerError: "gis:viewer-error",
|
|
808
817
|
Destroyed: "gis:destroyed"
|
|
809
818
|
};
|
|
810
|
-
async function
|
|
811
|
-
s?.assetFiles ? await
|
|
819
|
+
async function d(s) {
|
|
820
|
+
s?.assetFiles ? await A(s.assetFiles) : s?.assetFile ? await G(s.assetFile) : s?.assetBaseUrl && await A(null), s?.assetBaseUrl && U(s.assetBaseUrl);
|
|
812
821
|
}
|
|
813
|
-
async function
|
|
814
|
-
if (await
|
|
815
|
-
const { EngineKernelV3: n } = await import("./EngineKernel-
|
|
822
|
+
async function me(s, e) {
|
|
823
|
+
if (await d(s), (e ?? (typeof navigator < "u" && "gpu" in navigator ? "webgpu" : "webgl")) === "webgpu") {
|
|
824
|
+
const { EngineKernelV3: n } = await import("./EngineKernel-Kg-SdrzV.js"), a = new n(s);
|
|
816
825
|
return await a.ready, a;
|
|
817
826
|
}
|
|
818
|
-
const { EngineKernelV2: r } = await import("./engine-3d-
|
|
827
|
+
const { EngineKernelV2: r } = await import("./engine-3d-DouCKYY-.js").then((n) => n.e);
|
|
819
828
|
return new r(s);
|
|
820
829
|
}
|
|
821
|
-
async function
|
|
822
|
-
await
|
|
823
|
-
const { EngineKernel2d: e } = await import("./engine-2d-
|
|
830
|
+
async function be(s) {
|
|
831
|
+
await d(s);
|
|
832
|
+
const { EngineKernel2d: e } = await import("./engine-2d-BsdGqViB.js").then((t) => t.E);
|
|
824
833
|
return new e(s);
|
|
825
834
|
}
|
|
826
|
-
async function
|
|
827
|
-
await
|
|
828
|
-
const { EngineKernel720: e } = await import("./engine-720-
|
|
835
|
+
async function Me(s) {
|
|
836
|
+
await d(s);
|
|
837
|
+
const { EngineKernel720: e } = await import("./engine-720-DvQtPJ60.js");
|
|
829
838
|
return new e(s);
|
|
830
839
|
}
|
|
831
840
|
async function Ee(s) {
|
|
832
|
-
await
|
|
833
|
-
const { EngineKernelGaussian: e } = await import("./engine-gaussian-
|
|
841
|
+
await d(s);
|
|
842
|
+
const { EngineKernelGaussian: e } = await import("./engine-gaussian-BqR-uPbs.js");
|
|
834
843
|
return new e(s);
|
|
835
844
|
}
|
|
836
845
|
async function xe(s) {
|
|
837
|
-
await
|
|
838
|
-
const { EngineKernelGIS: e } = await import("./engine-gis-
|
|
846
|
+
await d(s);
|
|
847
|
+
const { EngineKernelGIS: e } = await import("./engine-gis-CgZIsySE.js").then((t) => t.E);
|
|
839
848
|
return new e(s);
|
|
840
849
|
}
|
|
841
850
|
export {
|
|
842
851
|
fe as A,
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
852
|
+
Y as D,
|
|
853
|
+
b as E,
|
|
854
|
+
ce as M,
|
|
846
855
|
ue as a,
|
|
847
|
-
|
|
856
|
+
re as b,
|
|
848
857
|
ne as c,
|
|
849
858
|
oe as d,
|
|
850
|
-
|
|
859
|
+
te as e,
|
|
851
860
|
ae as f,
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
861
|
+
se as g,
|
|
862
|
+
f as h,
|
|
863
|
+
w as i,
|
|
864
|
+
de as j,
|
|
865
|
+
he as k,
|
|
866
|
+
pe as l,
|
|
867
|
+
O as m,
|
|
868
|
+
le as n,
|
|
869
|
+
ge as o,
|
|
870
|
+
me as p,
|
|
871
|
+
be as q,
|
|
872
|
+
Me as r,
|
|
864
873
|
ie as s,
|
|
865
874
|
Ee as t,
|
|
866
875
|
xe as u,
|
|
867
|
-
|
|
876
|
+
P as v
|
|
868
877
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { bh as w } from "./three-vendor-
|
|
1
|
+
import { bh as w } from "./three-vendor-DolVXUca.js";
|
|
2
2
|
const S = "__BIM_ENGINE_SDK_ASSET_BASE__", b = "__BIM_ENGINE_SDK_ASSET_FILE_MAP__", g = "__BIM_ENGINE_SDK_ASSET_FILE_URLS__", A = "__BIM_ENGINE_SDK_ASSET_FILE_SESSION__", j = "https://unpkg.com/iflow-engine-base-3d@3.12.21/dist/", L = "https://__bim_engine_sdk_asset__/", M = ["assets/", "fonts/", "draco/", "basis/", "texture/", "prompt/"];
|
|
3
3
|
let _ = null;
|
|
4
4
|
async function R() {
|
|
5
|
-
return _ || (_ = import("./sdk-vendor-
|
|
5
|
+
return _ || (_ = import("./sdk-vendor-CPnf2j9F.js").then((t) => t.j).then((t) => t.default ?? t)), _;
|
|
6
6
|
}
|
|
7
7
|
function a() {
|
|
8
8
|
return typeof globalThis < "u" ? globalThis : null;
|