@roomle/web-sdk 4.3.0-alpha.4 → 5.0.0-alpha.1
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/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GaussianBlurNode-Bjszve7N.mjs → GaussianBlurNode-BMH03PYf.mjs} +11 -11
- package/lib/{GaussianBlurNode-Bjszve7N.mjs.map → GaussianBlurNode-BMH03PYf.mjs.map} +1 -1
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{api-C-enDIJZ.mjs → api-hQ0uOklW.mjs} +2 -2
- package/lib/{api-C-enDIJZ.mjs.map → api-hQ0uOklW.mjs.map} +1 -1
- package/lib/asset-loader.worker-eqHzNAwa.mjs.map +1 -1
- package/lib/budgeteer.sw-BUMElkO1.mjs.map +1 -1
- package/lib/configurator-BM0nny5l.mjs +2 -0
- package/lib/{configurator-D8Bfu2_w.mjs → configurator-CVg8_f9w.mjs} +3 -3
- package/lib/{configurator-D8Bfu2_w.mjs.map → configurator-CVg8_f9w.mjs.map} +1 -1
- package/lib/{glb-viewer-DMg1tKfk.mjs → glb-viewer-Csx9GwVi.mjs} +3 -3
- package/lib/{glb-viewer-DMg1tKfk.mjs.map → glb-viewer-Csx9GwVi.mjs.map} +1 -1
- package/lib/glb-viewer-gEdln_PJ.mjs +2 -0
- package/lib/{highlight-coordinator-JwAVkMeS.mjs → highlight-coordinator-C-PxNb40.mjs} +12 -12
- package/lib/highlight-coordinator-C-PxNb40.mjs.map +1 -0
- package/lib/{homag-intelligence-CbzWp4pY.mjs → homag-intelligence-Dh4VWYH6.mjs} +3 -3
- package/lib/{homag-intelligence-CbzWp4pY.mjs.map → homag-intelligence-Dh4VWYH6.mjs.map} +1 -1
- package/lib/{material-viewer-C4oV4F7e.mjs → material-viewer-DqUJzRXN.mjs} +3 -3
- package/lib/{material-viewer-C4oV4F7e.mjs.map → material-viewer-DqUJzRXN.mjs.map} +1 -1
- package/lib/{packages-Pc3dsyed.mjs → packages-Bz8iWtUY.mjs} +5 -5
- package/lib/{packages-Pc3dsyed.mjs.map → packages-Bz8iWtUY.mjs.map} +1 -1
- package/lib/{planner-B3IWgziF.mjs → planner-CpcR6z07.mjs} +3 -3
- package/lib/{planner-B3IWgziF.mjs.map → planner-CpcR6z07.mjs.map} +1 -1
- package/lib/planner-g06Phdjc.mjs +2 -0
- package/lib/roomle-headless.d.ts +4 -0
- package/lib/roomle-headless.js +9 -9
- package/lib/{roomle-sdk-Be4K-H8u.mjs → roomle-sdk-BCmaueGp.mjs} +1218 -1162
- package/lib/roomle-sdk-BCmaueGp.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +4 -0
- package/lib/roomle-sdk.js +6 -6
- package/lib/{roomle-webgpu-renderer-Lt55gNj5.mjs → roomle-webgpu-renderer-CS0lYZJ4.mjs} +351 -348
- package/lib/{roomle-webgpu-renderer-Lt55gNj5.mjs.map → roomle-webgpu-renderer-CS0lYZJ4.mjs.map} +1 -1
- package/lib/{scene-renderer-C8Lh-lff.mjs → scene-renderer--WNt8myk.mjs} +27 -23
- package/lib/scene-renderer--WNt8myk.mjs.map +1 -0
- package/lib/{script-loader-CzikXnNg.mjs → script-loader-Dmcvx-Qu.mjs} +2 -2
- package/lib/{script-loader-CzikXnNg.mjs.map → script-loader-Dmcvx-Qu.mjs.map} +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-Ddg1O4fO.mjs → stats-helper-B1_lK1E8.mjs} +2 -2
- package/lib/{stats-helper-Ddg1O4fO.mjs.map → stats-helper-B1_lK1E8.mjs.map} +1 -1
- package/lib/three.tsl-BZfU6fFt.mjs +2 -0
- package/lib/{three.tsl-Dew9p5yF.mjs → three.tsl-DO_HZZuJ.mjs} +58 -56
- package/lib/{three.tsl-Dew9p5yF.mjs.map → three.tsl-DO_HZZuJ.mjs.map} +1 -1
- package/lib/{tools-core-CVdBXX3L.mjs → tools-core-CRWZtE-S.mjs} +3 -3
- package/lib/{tools-core-CVdBXX3L.mjs.map → tools-core-CRWZtE-S.mjs.map} +1 -1
- package/lib/{webgpu-B0rxiqW-.mjs → webgpu-C14yfIYy.mjs} +86 -86
- package/lib/{webgpu-B0rxiqW-.mjs.map → webgpu-C14yfIYy.mjs.map} +1 -1
- package/package.json +2 -2
- package/lib/configurator-BfdyDYqe.mjs +0 -2
- package/lib/glb-viewer-BFYG-bD2.mjs +0 -2
- package/lib/highlight-coordinator-JwAVkMeS.mjs.map +0 -1
- package/lib/planner-BhnBEaPV.mjs +0 -2
- package/lib/roomle-sdk-Be4K-H8u.mjs.map +0 -1
- package/lib/scene-renderer-C8Lh-lff.mjs.map +0 -1
- package/lib/three.tsl-BnL9nfJa.mjs +0 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Ar as e, Br as t, Ci as n, Cr as r, En as i, Gi as a, Gn as o, J as s, Jr as c, Kn as l, Mr as u, On as d, Qt as f, Si as p, Tt as m, Ui as h, V as g, Y as _, _i as v, bi as y, ct as b, g as ee, gi as
|
|
2
|
-
import { h as
|
|
3
|
-
import { n as
|
|
4
|
-
import { a as
|
|
5
|
-
import { An as
|
|
6
|
-
import { $ as
|
|
1
|
+
import { Ar as e, Br as t, Ci as n, Cr as r, En as i, Gi as a, Gn as o, J as s, Jr as c, Kn as l, Mr as u, On as d, Qt as f, Si as p, Tt as m, Ui as h, V as g, Y as _, _i as v, bi as y, ct as b, g as ee, gi as te, hi as x, hr as S, ht as C, in as ne, jr as w, kr as re, li as ie, ln as T, mi as ae, mr as oe, q as se, rt as ce, sn as E, t as le, vi as ue, w as de, wr as fe, xi as pe, yi as me } from "./three.core-0KaTx8dm.mjs";
|
|
2
|
+
import { h as he, t as ge } from "./shading-settings-CRNmMpcn.mjs";
|
|
3
|
+
import { n as _e, r as ve, t as ye } from "./decorate-CjaqqbUP.mjs";
|
|
4
|
+
import { a as D, n as be, r as xe } from "./roomle-renderer-FUqNfNIf.mjs";
|
|
5
|
+
import { An as Se, Dt as Ce, It as O, Kn as we, Q as Te, Vt as Ee, _n as De, bn as k, fr as Oe, hr as ke, ln as Ae, vt as je, x as Me } from "./three.webgpu-ylONY593.mjs";
|
|
6
|
+
import { $ as Ne, B as Pe, C as A, Ct as Fe, D as Ie, Dt as j, E as Le, Et as M, F as N, Ft as P, G as Re, H as ze, I as Be, It as Ve, J as He, K as Ue, Lt as We, M as Ge, N as Ke, Nt as F, O as qe, Ot as Je, P as Ye, Pt as I, Q as Xe, Rt as Ze, S as Qe, St as L, T as R, U as $e, V as et, W as tt, X as nt, Y as rt, Z as it, _ as at, _t as ot, a as st, at as ct, b as lt, bt as ut, c as dt, ct as ft, d as pt, dt as mt, et as ht, f as gt, ft as _t, g as vt, h as yt, ht as bt, i as z, it as xt, j as St, jt as Ct, k as wt, kt as Tt, l as B, lt as Et, m as Dt, mt as Ot, n as V, nt as kt, o as At, ot as jt, p as Mt, pt as Nt, q as Pt, r as Ft, s as It, t as Lt, tt as Rt, u as zt, v as Bt, vt as Vt, w as Ht, x as Ut, xt as Wt, y as Gt, z as H } from "./three.tsl-DO_HZZuJ.mjs";
|
|
7
7
|
//#region ../../node_modules/three/examples/jsm/tsl/display/OutlineNode.js
|
|
8
|
-
var
|
|
8
|
+
var U = /* @__PURE__ */ new Ae(), Kt = /* @__PURE__ */ new p(), qt = /* @__PURE__ */ new p(1, 0), Jt = /* @__PURE__ */ new p(0, 1), W, Yt = class extends we {
|
|
9
9
|
static get type() {
|
|
10
10
|
return "OutlineNode";
|
|
11
11
|
}
|
|
12
12
|
constructor(e, t, n = {}) {
|
|
13
13
|
super("vec4");
|
|
14
|
-
let { selectedObjects: r = [], edgeThickness: i =
|
|
15
|
-
this.scene = e, this.camera = t, this.selectedObjects = r, this.edgeThicknessNode = tt(i), this.edgeGlowNode = tt(a), this.downSampleRatio = o, this.updateBeforeType =
|
|
14
|
+
let { selectedObjects: r = [], edgeThickness: i = R(1), edgeGlow: a = R(0), downSampleRatio: o = 2 } = n;
|
|
15
|
+
this.scene = e, this.camera = t, this.selectedObjects = r, this.edgeThicknessNode = tt(i), this.edgeGlowNode = tt(a), this.downSampleRatio = o, this.updateBeforeType = Ee.FRAME, this._renderTargetDepthBuffer = new w(), this._renderTargetDepthBuffer.depthTexture = new _(), this._renderTargetDepthBuffer.depthTexture.type = b, this._renderTargetMaskBuffer = new w(), this._renderTargetMaskDownSampleBuffer = new w(1, 1, { depthBuffer: !1 }), this._renderTargetEdgeBuffer1 = new w(1, 1, { depthBuffer: !1 }), this._renderTargetEdgeBuffer2 = new w(1, 1, { depthBuffer: !1 }), this._renderTargetBlurBuffer1 = new w(1, 1, { depthBuffer: !1 }), this._renderTargetBlurBuffer2 = new w(1, 1, { depthBuffer: !1 }), this._renderTargetComposite = new w(1, 1, { depthBuffer: !1 }), this._cameraNear = jt("near", "float", t), this._cameraFar = jt("far", "float", t), this._blurDirection = j(new p()), this._depthTextureUniform = L(this._renderTargetDepthBuffer.depthTexture), this._maskTextureUniform = L(this._renderTargetMaskBuffer.texture), this._maskTextureDownsSampleUniform = L(this._renderTargetMaskDownSampleBuffer.texture), this._edge1TextureUniform = L(this._renderTargetEdgeBuffer1.texture), this._edge2TextureUniform = L(this._renderTargetEdgeBuffer2.texture), this._blurColorTextureUniform = L(this._renderTargetEdgeBuffer1.texture), this._visibleEdgeColor = I(1, 0, 0), this._hiddenEdgeColor = I(0, 1, 0), this._depthMaterial = new O(), this._depthMaterial.colorNode = yt(0, 0, 0), this._depthMaterial.name = "OutlineNode.depth", this._depthSpriteMaterial = new Se(), this._depthSpriteMaterial.colorNode = yt(0, 0, 0), this._depthSpriteMaterial.name = "OutlineNode.depthSprite", this._prepareMaskMaterial = new O(), this._prepareMaskMaterial.name = "OutlineNode.prepareMask", this._prepareMaskSpriteMaterial = new Se(), this._prepareMaskSpriteMaterial.name = "OutlineNode.prepareMaskSprite", this._materialCopy = new O(), this._materialCopy.name = "OutlineNode.copy", this._edgeDetectionMaterial = new O(), this._edgeDetectionMaterial.name = "OutlineNode.edgeDetection", this._separableBlurMaterial = new O(), this._separableBlurMaterial.name = "OutlineNode.separableBlur", this._separableBlurMaterial2 = new O(), this._separableBlurMaterial2.name = "OutlineNode.separableBlur2", this._compositeMaterial = new O(), this._compositeMaterial.name = "OutlineNode.composite", this._selectionCache = /* @__PURE__ */ new Set(), this._lastSelectionCount = 0, this._textureNode = Xe(this, this._renderTargetComposite.texture);
|
|
16
16
|
}
|
|
17
17
|
get visibleEdge() {
|
|
18
18
|
return this.r;
|
|
@@ -31,11 +31,11 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
31
31
|
updateBefore(e) {
|
|
32
32
|
let { renderer: t } = e, { camera: n, scene: r } = this;
|
|
33
33
|
if (this._updateSelectionCache(), this._selectionCache.size === 0) {
|
|
34
|
-
this._lastSelectionCount > 0 && (
|
|
34
|
+
this._lastSelectionCount > 0 && (W = k.resetRendererState(t, W), t.setRenderTarget(this._renderTargetComposite), t.setClearColor(0, 0), t.clear(), k.restoreRendererState(t, W), this._lastSelectionCount = 0);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
this._lastSelectionCount = this._selectionCache.size,
|
|
38
|
-
let i = t.getDrawingBufferSize(
|
|
37
|
+
this._lastSelectionCount = this._selectionCache.size, W = k.resetRendererAndSceneState(t, r, W);
|
|
38
|
+
let i = t.getDrawingBufferSize(Kt);
|
|
39
39
|
this.setSize(i.width, i.height), t.setClearColor(16777215, 1);
|
|
40
40
|
let a = r.name;
|
|
41
41
|
t.setRenderTarget(this._renderTargetDepthBuffer), t.setRenderObjectFunction((e, n, r, i, a, o, s, c) => {
|
|
@@ -48,28 +48,28 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
48
48
|
let a = e.isSprite ? this._prepareMaskSpriteMaterial : this._prepareMaskMaterial;
|
|
49
49
|
t.renderObject(e, n, r, i, a, o, s, c);
|
|
50
50
|
}
|
|
51
|
-
}), r.name = "Outline [ Selected Objects Pass ]", t.render(r, n), t.setRenderObjectFunction(
|
|
51
|
+
}), r.name = "Outline [ Selected Objects Pass ]", t.render(r, n), t.setRenderObjectFunction(W.renderObjectFunction), this._selectionCache.clear(), r.name = a, U.material = this._materialCopy, U.name = "Outline [ Downsample ]", t.setRenderTarget(this._renderTargetMaskDownSampleBuffer), U.render(t), U.material = this._edgeDetectionMaterial, U.name = "Outline [ Edge Detection ]", t.setRenderTarget(this._renderTargetEdgeBuffer1), U.render(t), this._blurColorTextureUniform.value = this._renderTargetEdgeBuffer1.texture, this._blurDirection.value.copy(qt), U.material = this._separableBlurMaterial, U.name = "Outline [ Blur Half Resolution ]", t.setRenderTarget(this._renderTargetBlurBuffer1), U.render(t), this._blurColorTextureUniform.value = this._renderTargetBlurBuffer1.texture, this._blurDirection.value.copy(Jt), t.setRenderTarget(this._renderTargetEdgeBuffer1), U.render(t), this._blurColorTextureUniform.value = this._renderTargetEdgeBuffer1.texture, this._blurDirection.value.copy(qt), U.material = this._separableBlurMaterial2, U.name = "Outline [ Blur Quarter Resolution ]", t.setRenderTarget(this._renderTargetBlurBuffer2), U.render(t), this._blurColorTextureUniform.value = this._renderTargetBlurBuffer2.texture, this._blurDirection.value.copy(Jt), t.setRenderTarget(this._renderTargetEdgeBuffer2), U.render(t), U.material = this._compositeMaterial, U.name = "Outline [ Blur Quarter Resolution ]", t.setRenderTarget(this._renderTargetComposite), U.render(t), k.restoreRendererAndSceneState(t, r, W);
|
|
52
52
|
}
|
|
53
53
|
setup() {
|
|
54
54
|
let e = () => {
|
|
55
|
-
let e = this._depthTextureUniform.sample(
|
|
56
|
-
return t = this.camera.isPerspectiveCamera ?
|
|
55
|
+
let e = this._depthTextureUniform.sample(_t), t;
|
|
56
|
+
return t = this.camera.isPerspectiveCamera ? Ne(e, this._cameraNear, this._cameraFar) : Pt(e, this._cameraNear, this._cameraFar), I(0, ht.z.lessThanEqual(t).select(1, 0), 1);
|
|
57
57
|
};
|
|
58
58
|
this._prepareMaskMaterial.colorNode = e(), this._prepareMaskMaterial.needsUpdate = !0, this._prepareMaskSpriteMaterial.colorNode = e(), this._prepareMaskSpriteMaterial.needsUpdate = !0, this._materialCopy.fragmentNode = this._maskTextureUniform, this._materialCopy.needsUpdate = !0;
|
|
59
59
|
let t = V(() => {
|
|
60
|
-
let e =
|
|
61
|
-
return P(
|
|
60
|
+
let e = Fe(this._maskTextureDownsSampleUniform), t = F(1).div(e).toVar(), n = P(1, 0, 0, 1).mul(P(t, t)), r = Ct(), i = this._maskTextureDownsSampleUniform.sample(r.add(n.xy)).toVar(), a = this._maskTextureDownsSampleUniform.sample(r.sub(n.xy)).toVar(), o = this._maskTextureDownsSampleUniform.sample(r.add(n.yw)).toVar(), s = this._maskTextureDownsSampleUniform.sample(r.sub(n.yw)).toVar(), c = F($e(i.r.sub(a.r), .5), $e(o.r.sub(s.r), .5)).length();
|
|
61
|
+
return P(Pe(Pe(i.g, a.g), Pe(o.g, s.g)).oneMinus().greaterThan(.001).select(this._visibleEdgeColor, this._hiddenEdgeColor), 1).mul(c);
|
|
62
62
|
});
|
|
63
63
|
this._edgeDetectionMaterial.fragmentNode = t(), this._edgeDetectionMaterial.needsUpdate = !0;
|
|
64
|
-
let n = V(([e, t]) =>
|
|
65
|
-
let t =
|
|
66
|
-
return
|
|
67
|
-
start:
|
|
68
|
-
end:
|
|
64
|
+
let n = V(([e, t]) => R(.39894).mul(Ht(R(-.5).mul(e).mul(e).div(t.mul(t))).div(t))), r = V(([e]) => {
|
|
65
|
+
let t = Fe(this._maskTextureDownsSampleUniform), r = F(1).div(t).toVar(), i = Ct(), a = e.div(2).toVar(), o = n(0, a).toVar(), s = this._blurColorTextureUniform.sample(i).mul(o).toVar(), c = this._blurDirection.mul(r).mul(e).div(4).toVar(), l = c.toVar();
|
|
66
|
+
return st({
|
|
67
|
+
start: St(1),
|
|
68
|
+
end: St(4),
|
|
69
69
|
type: "int",
|
|
70
70
|
condition: "<="
|
|
71
71
|
}, ({ i: t }) => {
|
|
72
|
-
let r = n(e.mul(
|
|
72
|
+
let r = n(e.mul(R(t)).div(4), a), u = this._blurColorTextureUniform.sample(i.add(l)), d = this._blurColorTextureUniform.sample(i.sub(l));
|
|
73
73
|
s.addAssign(u.add(d).mul(r)), o.addAssign(r.mul(2)), l.addAssign(c);
|
|
74
74
|
}), s.div(o);
|
|
75
75
|
});
|
|
@@ -88,21 +88,21 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
88
88
|
(e.isMesh || e.isSprite) && this._selectionCache.add(e);
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, Xt = (e, t, n) => new Yt(e, t, n), Zt = class {}, Qt = class e extends Zt {
|
|
92
92
|
static {
|
|
93
93
|
this.passId = "OutlineRenderPass";
|
|
94
94
|
}
|
|
95
95
|
constructor(t) {
|
|
96
|
-
super(), this.passId = e.passId, this.selectedObjects = t.selectedObjects, this.edgeStrength = j(t.edgeStrength), this.edgeGlow = j(t.edgeGlow), this.edgeThickness = j(t.edgeThickness), this.visibleEdgeColor = j(new
|
|
96
|
+
super(), this.passId = e.passId, this.selectedObjects = t.selectedObjects, this.edgeStrength = j(t.edgeStrength), this.edgeGlow = j(t.edgeGlow), this.edgeThickness = j(t.edgeThickness), this.visibleEdgeColor = j(new de(t.visibleEdgeColor)), this.hiddenEdgeColor = j(new de(t.hiddenEdgeColor));
|
|
97
97
|
}
|
|
98
98
|
highlightObjects(e) {
|
|
99
99
|
this.selectedObjects.splice(0, this.selectedObjects.length, ...e);
|
|
100
100
|
}
|
|
101
101
|
setOutlineColors(e, t) {
|
|
102
|
-
this.visibleEdgeColor.value = new
|
|
102
|
+
this.visibleEdgeColor.value = new de(e), this.hiddenEdgeColor.value = new de(t);
|
|
103
103
|
}
|
|
104
104
|
assemble(e, t, n, r, i) {
|
|
105
|
-
let { visibleEdge: a, hiddenEdge: o } =
|
|
105
|
+
let { visibleEdge: a, hiddenEdge: o } = Xt(n, r, {
|
|
106
106
|
selectedObjects: this.selectedObjects,
|
|
107
107
|
edgeThickness: this.edgeThickness,
|
|
108
108
|
edgeGlow: this.edgeGlow
|
|
@@ -117,20 +117,20 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
117
117
|
this.hiddenEdgeColor.value.set(e), n();
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
},
|
|
120
|
+
}, $t = class {
|
|
121
121
|
constructor(e, t) {
|
|
122
122
|
this.uid = e, this.cid = e.match(/^(.*):f(\d+)$/)[1], this.name = t, this.timestamp = 0, this.cpu = 0, this.gpu = 0, this.fps = 0, this.children = [], this.parent = null;
|
|
123
123
|
}
|
|
124
|
-
},
|
|
124
|
+
}, en = class extends $t {
|
|
125
125
|
constructor(e, t, n, r) {
|
|
126
126
|
let i = t.name;
|
|
127
127
|
i === "" && (t.isScene ? i = "Scene" : t.isQuadMesh && (i = "QuadMesh")), super(e, i), this.scene = t, this.camera = n, this.renderTarget = r, this.isRenderStats = !0;
|
|
128
128
|
}
|
|
129
|
-
},
|
|
129
|
+
}, tn = class extends $t {
|
|
130
130
|
constructor(e, t) {
|
|
131
131
|
super(e, t.name), this.computeNode = t, this.isComputeStats = !0;
|
|
132
132
|
}
|
|
133
|
-
},
|
|
133
|
+
}, nn = class extends Te {
|
|
134
134
|
constructor() {
|
|
135
135
|
super(), this.currentFrame = null, this.currentRender = null, this.currentNodes = null, this.lastFrame = null, this.frames = [], this.framesLib = {}, this.maxFrames = 512, this._lastFinishTime = 0, this._resolveTimestampPromise = null, this.overdraw = !1, this._overdrawMaterial = null, this.isRendererInspector = !0;
|
|
136
136
|
}
|
|
@@ -153,15 +153,15 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
153
153
|
break;
|
|
154
154
|
}
|
|
155
155
|
if (n === null) return;
|
|
156
|
-
this._overdrawMaterial === null && (this._overdrawMaterial = new
|
|
157
|
-
colorNode:
|
|
156
|
+
this._overdrawMaterial === null && (this._overdrawMaterial = new je({
|
|
157
|
+
colorNode: I(.25),
|
|
158
158
|
blending: 2,
|
|
159
159
|
depthTest: !0,
|
|
160
160
|
depthWrite: !0,
|
|
161
161
|
toneMapped: !1
|
|
162
162
|
}));
|
|
163
|
-
let { scene: r, camera: i } = n, a =
|
|
164
|
-
t.toneMapping = 0, t.outputColorSpace = f, r.overrideMaterial = this._overdrawMaterial, t.render(r, i),
|
|
163
|
+
let { scene: r, camera: i } = n, a = k.resetRendererAndSceneState(t, r);
|
|
164
|
+
t.toneMapping = 0, t.outputColorSpace = f, r.overrideMaterial = this._overdrawMaterial, t.render(r, i), k.restoreRendererAndSceneState(t, r, a);
|
|
165
165
|
}
|
|
166
166
|
_getFPS() {
|
|
167
167
|
let e = 0, t = 0;
|
|
@@ -198,8 +198,8 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
198
198
|
requestAnimationFrame(async () => {
|
|
199
199
|
let t = this.getRenderer();
|
|
200
200
|
if (t.backend.hasTimestamp) {
|
|
201
|
-
await t.resolveTimestampsAsync(
|
|
202
|
-
let e = t.backend.getTimestampFrames(
|
|
201
|
+
await t.resolveTimestampsAsync(ie.COMPUTE), await t.resolveTimestampsAsync(ie.RENDER);
|
|
202
|
+
let e = t.backend.getTimestampFrames(ie.COMPUTE), n = t.backend.getTimestampFrames(ie.RENDER), r = [...new Set([...e, ...n])];
|
|
203
203
|
for (let i of r) {
|
|
204
204
|
let r = this.getFrameById(i);
|
|
205
205
|
if (r !== null) {
|
|
@@ -250,7 +250,7 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
250
250
|
beginCompute(e, t) {
|
|
251
251
|
let n = this.getFrame();
|
|
252
252
|
if (!n) return;
|
|
253
|
-
let r = new
|
|
253
|
+
let r = new tn(e, t);
|
|
254
254
|
r.timestamp = performance.now(), r.parent = this.currentCompute || this.getParent(), n.computes.push(r), this.currentRender === null ? n.children.push(r) : this.currentRender.children.push(r), this.currentCompute = r;
|
|
255
255
|
}
|
|
256
256
|
finishCompute() {
|
|
@@ -261,7 +261,7 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
261
261
|
beginRender(e, t, n, r) {
|
|
262
262
|
let i = this.getFrame();
|
|
263
263
|
if (!i) return;
|
|
264
|
-
let a = new
|
|
264
|
+
let a = new en(e, t, n, r);
|
|
265
265
|
a.timestamp = performance.now(), a.parent = this.getParent(), i.renders.push(a), this.currentRender === null ? i.children.push(a) : this.currentRender.children.push(a), this.currentRender = a;
|
|
266
266
|
}
|
|
267
267
|
finishRender() {
|
|
@@ -269,12 +269,12 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
269
269
|
let e = this.currentRender;
|
|
270
270
|
e.cpu = performance.now() - e.timestamp, this.currentRender = e.parent;
|
|
271
271
|
}
|
|
272
|
-
},
|
|
272
|
+
}, rn = class {
|
|
273
273
|
static init(e) {
|
|
274
274
|
let t = document.createElement("style");
|
|
275
275
|
t.textContent = "\n@scope (.three-inspector) {\n\n :scope {\n --profiler-background: #1e1e24f5;\n --profiler-header-background: #2a2a33aa;\n --profiler-header: #2a2a33;\n --profiler-border: #4a4a5a;\n --text-primary: #e0e0e0;\n --text-secondary: #9a9aab;\n --color-accent: #00aaff;\n --color-green: #4caf50;\n --color-yellow: #ffc107;\n --color-red: #f44336;\n --color-fps: rgb(63, 81, 181);\n --color-call: rgba(255, 185, 34, 1);\n --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n --font-mono: 'Courier New', Courier, monospace;\n }\n\n .profiler-panel, .profiler-toggle, .detached-tab-panel,\n .profiler-panel *, .profiler-toggle *, .detached-tab-panel * {\n text-transform: initial;\n line-height: normal;\n box-sizing: border-box;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n }\n\n .profiler-toggle {\n position: fixed;\n top: 15px;\n right: 15px;\n background-color: rgba(30, 30, 36, 0.85);\n border: 1px solid #4a4a5a54;\n border-radius: 12px 6px 6px 12px;\n color: var(--text-primary);\n cursor: pointer;\n z-index: 1001;\n transition: all 0.2s ease-in-out;\n /*font-size: 14px;*/\n font-size: 15px;\n backdrop-filter: blur(8px);\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);\n display: flex;\n align-items: stretch;\n padding: 0;\n overflow: hidden;\n font-family: var(--font-family);\n }\n\n .profiler-toggle-graph {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 0;\n pointer-events: none;\n background: transparent;\n border: none;\n border-radius: inherit;\n opacity: 0.5;\n }\n\n .profiler-toggle.position-right.panel-open {\n right: auto;\n left: 15px;\n border-radius: 6px 12px 12px 6px;\n flex-direction: row-reverse;\n }\n\n .profiler-toggle.position-right.panel-open .builtin-tabs-container {\n border-right: none;\n border-left: 1px solid #262636;\n }\n\n .profiler-toggle:hover {\n border-color: var(--color-accent);\n }\n\n .profiler-toggle.panel-open .toggle-icon {\n background-color: rgba(0, 170, 255, 0.2);\n color: var(--color-accent);\n }\n\n .toggle-icon {\n position: relative;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n font-size: 20px;\n transition: background-color 0.2s;\n }\n\n .console-badge-container {\n position: absolute;\n top: 2px;\n right: 2px;\n display: flex;\n gap: 2px;\n pointer-events: none;\n }\n\n .console-badge,\n .tab-badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 14px;\n height: 14px;\n padding: 0 4px;\n border-radius: 7px;\n font-size: 9px;\n font-weight: bold;\n color: #ffffff;\n line-height: 1;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n\n .tab-badge-container {\n position: absolute;\n top: 1px;\n right: 3px;\n display: flex;\n gap: 2px;\n pointer-events: none;\n }\n\n .console-badge.error,\n .tab-badge.error {\n background-color: var(--color-red);\n }\n\n .console-badge.warn,\n .tab-badge.warn {\n background-color: var(--color-yellow);\n color: #111111;\n }\n\n .profiler-toggle:hover .toggle-icon {\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n .profiler-toggle.panel-open:hover .toggle-icon {\n background-color: rgba(0, 170, 255, 0.3);\n }\n\n .toggle-separator {\n width: 1px;\n background-color: var(--profiler-border);\n }\n\n .toggle-text {\n position: relative;\n z-index: 1;\n display: flex;\n align-items: baseline;\n padding: 8px 14px;\n min-width: 80px;\n justify-content: right;\n }\n\n .toggle-text .fps-label {\n font-size: 0.7em;\n margin-left: 10px;\n color: #999;\n }\n\n .builtin-tabs-container {\n position: relative;\n z-index: 1;\n display: flex;\n align-items: stretch;\n gap: 0;\n border-right: 1px solid #262636;\n order: -1;\n }\n\n .builtin-tab-btn {\n background: transparent;\n border: none;\n color: var(--text-secondary);\n cursor: pointer;\n padding: 8px 14px;\n font-family: var(--font-family);\n font-size: 13px;\n font-weight: 600;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 32px;\n position: relative;\n }\n\n .builtin-tab-btn svg {\n width: 20px;\n height: 20px;\n stroke: currentColor;\n }\n\n .builtin-tab-btn:hover {\n background-color: rgba(255, 255, 255, 0.08);\n color: var(--color-accent);\n }\n\n .builtin-tab-btn:active {\n background-color: rgba(255, 255, 255, 0.12);\n }\n\n .builtin-tab-btn.active {\n background-color: rgba(0, 170, 255, 0.2);\n color: var(--color-accent);\n }\n\n .builtin-tab-btn.active:hover {\n background-color: rgba(0, 170, 255, 0.3);\n }\n\n .profiler-mini-panel {\n position: fixed;\n top: 60px;\n right: 15px;\n background-color: rgba(30, 30, 36, 0.85);\n border: 1px solid #4a4a5a54;\n border-radius: 8px;\n color: var(--text-primary);\n z-index: 9999;\n backdrop-filter: blur(8px);\n box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);\n font-family: var(--font-family);\n font-size: 11px;\n width: 350px;\n max-width: calc(100vw - 30px);\n min-width: 170px;\n max-height: calc(100vh - 100px);\n overflow-y: auto;\n overflow-x: hidden;\n display: none;\n opacity: 0;\n transform: translateY(-10px) scale(0.98);\n transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), \n transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .profiler-mini-panel.position-right.panel-open {\n right: auto;\n left: 15px;\n }\n\n .profiler-mini-panel.visible {\n display: block;\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n\n /* Position toggle and mini-panel at the bottom when maximized */\n :scope:has(.profiler-panel.maximized) .profiler-toggle,\n :scope.maximized .profiler-toggle {\n top: auto !important;\n bottom: 15px !important;\n z-index: 10005 !important;\n }\n\n :scope:has(.profiler-panel.maximized) .profiler-mini-panel,\n :scope.maximized .profiler-mini-panel {\n top: auto !important;\n bottom: 60px !important;\n max-height: calc(100vh - 120px) !important;\n z-index: 10006 !important;\n }\n\n .profiler-mini-panel::-webkit-scrollbar {\n width: 6px;\n }\n\n .profiler-mini-panel::-webkit-scrollbar-track {\n background: transparent;\n }\n\n .profiler-mini-panel::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.15);\n border-radius: 3px;\n transition: background 0.2s;\n }\n\n .profiler-mini-panel::-webkit-scrollbar-thumb:hover {\n background: rgba(255, 255, 255, 0.25);\n }\n\n .mini-panel-content {\n padding: 0;\n font-size: 11px;\n line-height: 1.5;\n font-family: var(--font-mono);\n letter-spacing: 0.3px;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .mini-panel-content .profiler-content {\n display: block !important;\n background: transparent;\n }\n\n .mini-panel-content .list-scroll-wrapper {\n max-height: calc(100vh - 120px);\n overflow-y: auto;\n overflow-x: hidden;\n width: 100%;\n }\n\n .mini-panel-content .list-scroll-wrapper::-webkit-scrollbar {\n width: 4px;\n }\n\n .mini-panel-content .list-scroll-wrapper::-webkit-scrollbar-track {\n background: transparent;\n }\n\n .mini-panel-content .list-scroll-wrapper::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.1);\n border-radius: 2px;\n }\n\n .mini-panel-content .list-scroll-wrapper::-webkit-scrollbar-thumb:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n .mini-panel-content .parameters {\n background: transparent;\n border: none;\n box-shadow: none;\n padding: 4px;\n }\n\n @media screen and (max-width: 340px) {\n\n .mini-panel-content .parameters {\n min-width: 0 !important;\n }\n\n .mini-panel-content .list-container.parameters .list-item-row,\n .mini-panel-content .list-container.parameters .list-header {\n grid-template-columns: minmax(0, .5fr) minmax(0, 1fr) !important;\n }\n\n }\n\n .mini-panel-content .list-container.parameters {\n padding: 2px 6px 0px 6px !important;\n }\n\n .mini-panel-content .list-header {\n display: none;\n padding: 2px 4px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n }\n\n .mini-panel-content .list-item {\n border-bottom: 1px solid rgba(74, 74, 90, 0.2);\n transition: background-color 0.15s;\n }\n\n .mini-panel-content .list-item:last-child {\n border-bottom: none;\n }\n\n .mini-panel-content .list-item:hover {\n background-color: rgba(255, 255, 255, 0.04);\n }\n\n .mini-panel-content .list-item.actionable:hover {\n background-color: rgba(255, 255, 255, 0.06);\n cursor: pointer;\n }\n\n .info-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: rgba(255, 255, 255, 0.1);\n color: var(--text-secondary);\n font-size: 10px;\n font-style: italic;\n margin-left: 6px;\n cursor: help;\n position: relative;\n }\n\n .info-icon.active {\n background-color: var(--color-accent);\n color: white;\n }\n\n @media (hover: hover) {\n .info-icon:hover {\n background-color: var(--color-accent);\n color: white;\n }\n }\n\n .info-tooltip {\n position: fixed;\n transform: translate(-50%, -100%);\n background-color: rgba(30, 30, 36, 0.95);\n border: 1px solid var(--profiler-border);\n border-radius: 6px;\n padding: 10px 14px;\n color: var(--text-primary);\n font-size: 12px;\n width: max-content;\n max-width: 250px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s, visibility 0.2s;\n z-index: 999999;\n font-style: normal;\n font-family: var(--font-family);\n text-align: left;\n white-space: normal;\n }\n\n .info-tooltip h3 {\n margin: 0 0 6px 0;\n font-size: 13px;\n color: var(--color-accent);\n }\n\n .info-tooltip strong {\n font-weight: 600;\n color: white;\n }\n\n /* Style adjustments for lil-gui look */\n .mini-panel-content .item-row {\n padding: 3px 8px;\n min-height: 24px;\n }\n\n .mini-panel-content .list-item-row {\n padding: 1px 4px;\n gap: 8px;\n min-height: 21px;\n align-items: center;\n }\n\n .mini-panel-content input[type=\"checkbox\"] {\n width: 12px;\n height: 12px;\n }\n\n .mini-panel-content input[type=\"range\"] {\n height: 18px;\n }\n\n .mini-panel-content .value-number input,\n .mini-panel-content .value-slider input {\n background-color: rgba(0, 0, 0, 0.3);\n border: 1px solid rgba(74, 74, 90, 0.5);\n font-size: 10px;\n }\n\n .mini-panel-content .value-number input:focus,\n .mini-panel-content .value-slider input:focus {\n border-color: var(--color-accent);\n }\n\n .mini-panel-content .value-slider {\n gap: 6px;\n }\n\n /* Compact nested items */\n .mini-panel-content .list-item .list-item {\n margin-left: 8px;\n }\n\n .mini-panel-content .list-item .list-item .item-row,\n .mini-panel-content .list-item .list-item .list-item-row {\n padding: 2px 6px;\n min-height: 22px;\n }\n\n /* Compact collapsible headers */\n .mini-panel-content .collapsible .item-row,\n .mini-panel-content .list-item-row.collapsible {\n padding: 2px 8px;\n font-weight: 600;\n min-height: 16px;\n display: flex;\n align-items: center;\n line-height: 1;\n }\n\n .mini-panel-content .collapsible-icon {\n font-size: 10px;\n width: 14px;\n height: 14px;\n }\n\n .mini-panel-content .param-control input[type=\"range\"] {\n height: 12px;\n margin-top: 1px;\n padding-top: 5px;\n user-select: none;\n -webkit-user-select: none;\n outline: none;\n }\n\n .mini-panel-content .param-control input[type=\"range\"]::-webkit-slider-thumb {\n width: 14px;\n height: 14px;\n margin-top: -5px;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .mini-panel-content .param-control input[type=\"range\"]::-moz-range-thumb {\n width: 14px;\n height: 14px;\n user-select: none;\n -moz-user-select: none;\n }\n\n .mini-panel-content .list-children-container {\n padding-left: 0;\n }\n\n .mini-panel-content .param-control input[type=\"number\"] {\n flex-basis: 60px !important;\n }\n\n .mini-panel-content .param-control {\n align-items: center;\n }\n\n .mini-panel-content .param-control select {\n font-size: 11px;\n }\n\n .mini-panel-content .list-item-wrapper {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n .profiler-panel {\n position: fixed;\n z-index: 1001 !important;\n bottom: 0;\n left: 0;\n right: 0;\n height: 350px;\n background-color: var(--profiler-background);\n backdrop-filter: blur(8px);\n border-top: 2px solid var(--profiler-border);\n color: var(--text-primary);\n display: flex;\n flex-direction: column;\n z-index: 1000;\n /*box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);*/\n transform: translateY(100%);\n transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), height 0.3s ease-out, width 0.3s ease-out;\n font-family: var(--font-mono);\n }\n\n .profiler-panel.resizing,\n .profiler-panel.dragging {\n transition: none;\n }\n\n .profiler-panel.visible {\n transform: translateY(0);\n }\n\n .profiler-panel.maximized {\n height: 100vh;\n }\n\n /* Position-specific styles */\n .profiler-panel.position-top {\n bottom: auto;\n top: 0;\n border-top: none;\n border-bottom: 2px solid var(--profiler-border);\n transform: translateY(-100%);\n }\n\n .profiler-panel.position-top.visible {\n transform: translateY(0);\n }\n\n .profiler-panel.position-bottom {\n /* Default position - already defined above */\n }\n\n .profiler-panel.position-left {\n top: 0;\n bottom: 0;\n left: 0;\n right: auto;\n width: 350px;\n height: 100%;\n border-top: none;\n border-right: 2px solid var(--profiler-border);\n transform: translateX(-100%);\n }\n\n .profiler-panel.position-left.visible {\n transform: translateX(0);\n }\n\n .profiler-panel.position-right {\n top: 0;\n bottom: 0;\n left: auto;\n right: 0;\n width: 350px;\n height: 100%;\n border-top: none;\n border-left: 2px solid var(--profiler-border);\n transform: translateX(100%);\n }\n\n .profiler-panel.position-right.visible {\n transform: translateX(0);\n }\n\n .profiler-panel.position-floating {\n border: 2px solid var(--profiler-border);\n border-radius: 8px;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);\n transform: none !important;\n overflow: hidden;\n }\n\n .profiler-panel.position-floating.visible {\n transform: none !important;\n }\n\n .profiler-panel.position-floating .profiler-header {\n border-radius: 6px 6px 0 0;\n }\n\n .profiler-panel.position-floating .panel-resizer {\n bottom: 0;\n right: 0;\n top: auto;\n left: auto;\n width: 16px;\n height: 16px;\n cursor: nwse-resize;\n border-radius: 0 0 6px 0;\n }\n\n .profiler-panel.position-floating .panel-resizer::after {\n content: '';\n position: absolute;\n right: 2px;\n bottom: 2px;\n width: 10px;\n height: 10px;\n background: linear-gradient(135deg, transparent 0%, transparent 45%, var(--profiler-border) 45%, var(--profiler-border) 55%, transparent 55%);\n }\n\n\n .panel-resizer {\n position: absolute;\n top: -2px;\n left: 0;\n width: 100%;\n height: 5px;\n cursor: ns-resize;\n z-index: 1001;\n touch-action: none;\n }\n\n .profiler-panel.position-top .panel-resizer {\n top: auto;\n bottom: -2px;\n }\n\n .profiler-panel.position-left .panel-resizer {\n top: 0;\n left: auto;\n right: -2px;\n width: 5px;\n height: 100%;\n cursor: ew-resize;\n }\n\n .profiler-panel.position-right .panel-resizer {\n top: 0;\n left: -2px;\n right: auto;\n width: 5px;\n height: 100%;\n cursor: ew-resize;\n }\n\n .profiler-header {\n display: flex;\n background-color: var(--profiler-header-background);\n border-bottom: 1px solid var(--profiler-border);\n flex-shrink: 0;\n justify-content: space-between;\n align-items: stretch;\n\n overflow-x: auto;\n overflow-y: hidden;\n width: calc(100% - 120px);\n height: 32px;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .profiler-panel.has-horizontal-scroll .profiler-header {\n height: 38px;\n }\n\n /* Adjust header width based on panel position */\n .profiler-panel.position-right .profiler-header,\n .profiler-panel.position-left .profiler-header {\n width: calc(100% - 120px);\n }\n\n .profiler-panel.position-bottom .profiler-header,\n .profiler-panel.position-top .profiler-header {\n width: calc(100% - 120px);\n }\n\n /* Adjust header width when position toggle button is hidden (mobile) */\n .profiler-panel.hide-position-toggle .profiler-header {\n width: calc(100% - 80px);\n }\n\n /* Adjust header width when maximized (floating position toggle button is hidden) */\n .profiler-panel.maximized .profiler-header {\n width: calc(100% - 80px);\n }\n\n /* ===== RULES FOR WHEN THERE ARE NO TABS ===== */\n\n /* Horizontal mode (bottom/top) without tabs */\n .profiler-panel.position-bottom.no-tabs:not(.maximized),\n .profiler-panel.position-top.no-tabs:not(.maximized) {\n height: 32px !important;\n min-height: 32px !important;\n }\n\n .profiler-panel.position-bottom.no-tabs .profiler-header,\n .profiler-panel.position-top.no-tabs .profiler-header {\n width: 100%;\n height: 32px;\n border-bottom: none;\n }\n\n .profiler-panel.position-bottom.no-tabs .profiler-content-wrapper,\n .profiler-panel.position-top.no-tabs .profiler-content-wrapper {\n display: none;\n }\n\n .profiler-panel.position-bottom.no-tabs .panel-resizer,\n .profiler-panel.position-top.no-tabs .panel-resizer {\n display: none;\n }\n\n /* Vertical mode (right/left) without tabs */\n .profiler-panel.position-right.no-tabs:not(.maximized),\n .profiler-panel.position-left.no-tabs:not(.maximized) {\n width: 40px !important;\n min-width: 40px !important;\n }\n\n /* Vertical layout for header when no tabs */\n .profiler-panel.position-right.no-tabs .profiler-header,\n .profiler-panel.position-left.no-tabs .profiler-header {\n width: 100%;\n flex-direction: column;\n height: 100%;\n border-bottom: none;\n }\n\n /* Vertical layout for controls when no tabs */\n .profiler-panel.position-right.no-tabs .profiler-controls,\n .profiler-panel.position-left.no-tabs .profiler-controls {\n position: static;\n flex-direction: column-reverse;\n justify-content: flex-end;\n width: 100%;\n height: 100%;\n border-bottom: none;\n border-left: none;\n background: transparent;\n }\n\n .profiler-panel.position-right.no-tabs .profiler-controls button,\n .profiler-panel.position-left.no-tabs .profiler-controls button {\n width: 100%;\n height: 40px;\n border-left: none;\n border-top: none;\n border-bottom: 1px solid var(--profiler-border);\n }\n\n .profiler-panel.position-right.no-tabs .profiler-content-wrapper,\n .profiler-panel.position-left.no-tabs .profiler-content-wrapper {\n display: none;\n }\n\n .profiler-panel.position-right.no-tabs .profiler-tabs,\n .profiler-panel.position-left.no-tabs .profiler-tabs {\n display: none;\n padding-left: 2px;\n }\n\n .profiler-panel.position-right.no-tabs .panel-resizer,\n .profiler-panel.position-left.no-tabs .panel-resizer {\n display: none;\n }\n\n /* Hide position toggle on mobile without tabs */\n .profiler-panel.hide-position-toggle.position-right.no-tabs:not(.maximized),\n .profiler-panel.hide-position-toggle.position-left.no-tabs:not(.maximized) {\n width: 40px !important;\n min-width: 40px !important;\n }\n\n /* Hide drag indicator on mobile devices */\n .profiler-panel.is-mobile .tab-btn.active::before {\n display: none;\n }\n\n .profiler-header::-webkit-scrollbar,\n .profiler-tabs::-webkit-scrollbar,\n .profiler-content::-webkit-scrollbar,\n .detached-tab-content::-webkit-scrollbar,\n .console-log::-webkit-scrollbar,\n .timelineTrack::-webkit-scrollbar,\n .list-scroll-wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n }\n\n .profiler-header::-webkit-scrollbar-track,\n .profiler-tabs::-webkit-scrollbar-track,\n .profiler-content::-webkit-scrollbar-track,\n .detached-tab-content::-webkit-scrollbar-track,\n .console-log::-webkit-scrollbar-track,\n .timelineTrack::-webkit-scrollbar-track,\n .list-scroll-wrapper::-webkit-scrollbar-track {\n background: transparent;\n }\n\n .profiler-header::-webkit-scrollbar-thumb,\n .profiler-tabs::-webkit-scrollbar-thumb,\n .profiler-content::-webkit-scrollbar-thumb,\n .detached-tab-content::-webkit-scrollbar-thumb,\n .console-log::-webkit-scrollbar-thumb,\n .timelineTrack::-webkit-scrollbar-thumb,\n .list-scroll-wrapper::-webkit-scrollbar-thumb {\n background-color: rgba(255, 255, 255, 0.15);\n border-radius: 2px;\n }\n\n .profiler-header::-webkit-scrollbar-thumb:hover,\n .profiler-tabs::-webkit-scrollbar-thumb:hover,\n .profiler-content::-webkit-scrollbar-thumb:hover,\n .detached-tab-content::-webkit-scrollbar-thumb:hover,\n .console-log::-webkit-scrollbar-thumb:hover,\n .timelineTrack::-webkit-scrollbar-thumb:hover,\n .list-scroll-wrapper::-webkit-scrollbar-thumb:hover {\n background-color: rgba(255, 255, 255, 0.3);\n }\n\n .profiler-header::-webkit-scrollbar-corner,\n .profiler-tabs::-webkit-scrollbar-corner,\n .profiler-content::-webkit-scrollbar-corner,\n .detached-tab-content::-webkit-scrollbar-corner,\n .console-log::-webkit-scrollbar-corner,\n .timelineTrack::-webkit-scrollbar-corner,\n .list-scroll-wrapper::-webkit-scrollbar-corner {\n background: transparent;\n }\n\n .profiler-header,\n .profiler-tabs,\n .profiler-content,\n .detached-tab-content,\n .console-log,\n .timelineTrack,\n .list-scroll-wrapper {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.15) transparent;\n }\n\n .profiler-panel.dragging .profiler-header {\n cursor: grabbing !important;\n }\n\n .profiler-panel.dragging {\n opacity: 0.8;\n }\n\n .profiler-tabs {\n display: flex;\n cursor: grab;\n position: relative;\n margin-left: 2px;\n }\n\n .profiler-tabs:active {\n cursor: grabbing;\n }\n\n\n .profiler-controls {\n display: flex;\n position: absolute;\n right: 0;\n top: 0;\n height: 32px;\n background: var(--profiler-header-background);\n border-bottom: 1px solid var(--profiler-border);\n }\n\n .profiler-panel.has-horizontal-scroll .profiler-controls {\n height: 38px;\n }\n\n .tab-btn {\n position: relative;\n background: transparent;\n border: none;\n /*border-right: 1px solid var(--profiler-border);*/\n color: var(--text-secondary);\n padding: 0 15px 2px 15px;\n height: 100%;\n box-sizing: border-box;\n cursor: default;\n display: flex;\n align-items: center;\n font-family: var(--font-family);\n font-weight: 600;\n font-size: 13px;\n user-select: none;\n transition: opacity 0.2s, transform 0.2s;\n touch-action: pan-x;\n white-space: nowrap;\n }\n\n .tab-btn.active {\n border-bottom: 2px solid var(--color-accent);\n color: white;\n }\n\n .tab-btn.active::before {\n content: '';\n position: absolute;\n left: 2px;\n top: 50%;\n transform: translateY(-50%);\n width: 8px;\n height: 14px;\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='3' r='1' fill='%234a4a5a'/%3E%3Ccircle cx='2' cy='7' r='1' fill='%234a4a5a'/%3E%3Ccircle cx='2' cy='11' r='1' fill='%234a4a5a'/%3E%3Ccircle cx='6' cy='3' r='1' fill='%234a4a5a'/%3E%3Ccircle cx='6' cy='7' r='1' fill='%234a4a5a'/%3E%3Ccircle cx='6' cy='11' r='1' fill='%234a4a5a'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: center;\n opacity: 0.6;\n }\n\n .tab-btn.no-detach.active::before {\n display: none;\n }\n\n .floating-btn,\n .maximize-btn,\n .hide-panel-btn {\n background: transparent;\n border: none;\n border-left: 1px solid var(--profiler-border);\n color: var(--text-secondary);\n width: 40px;\n height: 100%;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n /* Disable transitions in vertical mode to avoid broken animations */\n .profiler-panel.position-right .floating-btn,\n .profiler-panel.position-right .maximize-btn,\n .profiler-panel.position-right .hide-panel-btn,\n .profiler-panel.position-left .floating-btn,\n .profiler-panel.position-left .maximize-btn,\n .profiler-panel.position-left .hide-panel-btn {\n transition: background-color 0.2s, color 0.2s;\n }\n\n .floating-btn:hover,\n .maximize-btn:hover,\n .hide-panel-btn:hover {\n background-color: rgba(255, 255, 255, 0.1);\n color: var(--text-primary);\n }\n\n /* Hide maximize button when there are no tabs */\n .profiler-panel.position-right.no-tabs .maximize-btn,\n .profiler-panel.position-left.no-tabs .maximize-btn,\n .profiler-panel.position-bottom.no-tabs .maximize-btn,\n .profiler-panel.position-top.no-tabs .maximize-btn {\n display: none !important;\n }\n\n /* Hide floating button when maximized */\n .profiler-panel.maximized .floating-btn {\n display: none !important;\n }\n\n .profiler-content-wrapper {\n flex-grow: 1;\n overflow: hidden;\n position: relative;\n }\n\n .profiler-content {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n font-size: 13px;\n visibility: hidden;\n opacity: 0;\n transition: opacity 0.2s, visibility 0.2s;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .profiler-content.active {\n visibility: visible;\n opacity: 1;\n }\n\n .profiler-content {\n overflow: auto; /* make sure scrollbars can appear */\n }\n\n\n .list-item-row {\n display: grid;\n align-items: center;\n padding: 4px 8px;\n border-radius: 3px;\n transition: background-color 0.2s;\n gap: 10px;\n border-bottom: none;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .parameters .list-item-row {\n min-height: 23px;\n }\n\n .mini-panel-content .parameters .list-item-row {\n min-height: 21px;\n }\n\n .list-item-wrapper {\n margin-top: 2px;\n margin-bottom: 2px;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .list-item-wrapper:has(> .list-item-row .graph-container) {\n margin-left: -1.5em;\n }\n\n .list-item-wrapper:first-child {\n /*margin-top: 0;*/\n }\n\n .list-item-wrapper:not(.header-wrapper):nth-child(odd) > .list-item-row {\n background-color: rgba(0,0,0,0.1);\n }\n\n .list-item-wrapper.header-wrapper>.list-item-row {\n color: var(--color-accent);\n background-color: rgba(0, 170, 255, 0.1);\n }\n\n .list-item-wrapper.header-wrapper>.list-item-row>.list-item-cell:first-child {\n font-weight: 600;\n }\n\n .list-item-row.collapsible,\n .list-item-row.actionable {\n cursor: pointer;\n }\n\n .list-item-row.collapsible {\n background-color: rgba(0, 170, 255, 0.15) !important;\n min-height: 23px;\n }\n\n .list-item-row.collapsible.alert,\n .list-item-row.alert {\n background-color: rgba(244, 67, 54, 0.1) !important;\n }\n\n @media (hover: hover) {\n\n .list-item-row:hover:not(.collapsible):not(.no-hover),\n .list-item-row:hover:not(.no-hover),\n .list-item-row.actionable:hover,\n .list-item-row.collapsible.actionable:hover {\n background-color: rgba(255, 255, 255, 0.05) !important;\n }\n\n .list-item-row.collapsible:hover {\n background-color: rgba(0, 170, 255, 0.25) !important;\n }\n\n }\n\n .list-item-cell {\n white-space: pre;\n display: flex;\n align-items: center;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .list-item-cell:not(:first-child) {\n justify-content: flex-end;\n font-weight: 600;\n }\n\n .list-header {\n display: grid;\n align-items: center;\n padding: 4px 8px;\n font-weight: 600;\n color: var(--text-secondary);\n padding-bottom: 6px;\n border-bottom: 1px solid var(--profiler-border);\n margin-bottom: 5px;\n gap: 10px;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .list-item-wrapper.section-start {\n margin-top: 5px;\n margin-bottom: 5px;\n }\n\n .list-header .list-header-cell:not(:first-child) {\n text-align: right;\n }\n\n .list-children-container {\n padding-left: 1.5em;\n overflow: hidden;\n transition: max-height 0.1s ease-out;\n margin-top: 2px;\n }\n\n .list-children-container.closed {\n max-height: 0;\n }\n\n .item-toggler {\n display: inline-block;\n margin-right: 0.8em;\n text-align: left;\n }\n\n .list-item-row.open .item-toggler::before {\n content: '-';\n }\n\n .list-item-row:not(.open) .item-toggler::before {\n content: '+';\n }\n\n .list-item-cell .value.good {\n color: var(--color-green);\n }\n\n .list-item-cell .value.warn {\n color: var(--color-yellow);\n }\n\n .list-item-cell .value.bad {\n color: var(--color-red);\n }\n\n .list-scroll-wrapper {\n width: max-content;\n min-width: 100%;\n display: flex;\n flex-direction: column;\n min-height: 100%;\n }\n\n .list-container.parameters .list-item-row:not(.collapsible) {\n }\n\n .graph-container {\n width: 100%;\n box-sizing: border-box;\n padding: 8px 0;\n position: relative;\n }\n\n .graph-svg, .graph-canvas {\n width: 0;\n min-width: 100%;\n height: 80px;\n background-color: var(--profiler-header);\n border: 1px solid var(--profiler-border);\n border-radius: 4px;\n display: block;\n }\n\n .graph-path {\n stroke-width: 2;\n fill-opacity: 0.4;\n }\n\n .console-buttons-group {\n display: flex;\n gap: 20px;\n }\n\n .console-filter-input {\n background-color: var(--profiler-background);\n border: 1px solid var(--profiler-border);\n color: var(--text-primary);\n border-radius: 4px;\n padding: 4px 10px 2px 10px;\n font-family: var(--font-mono);\n flex-grow: 1;\n max-width: 300px;\n border-radius: 15px;\n }\n\n .console-filter-input:focus {\n outline: none;\n border-color: var(--text-secondary);\n }\n\n .console-copy-button {\n background: transparent;\n border: none;\n color: var(--text-secondary);\n cursor: pointer;\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: color 0.2s, background-color 0.2s;\n }\n\n .console-copy-button:hover {\n color: var(--text-primary);\n background-color: var(--profiler-hover);\n }\n\n .console-copy-button.copied {\n color: var(--color-green);\n }\n\n .console-log {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 10px;\n overflow-y: auto;\n flex-grow: 1;\n user-select: text;\n -webkit-user-select: text;\n }\n\n .log-message {\n display: flex;\n align-items: flex-start;\n gap: 6px;\n padding: 3px 5px;\n border-radius: 3px;\n line-height: 1.5 !important;\n }\n\n .log-count-badge {\n display: inline-block;\n text-align: center;\n min-width: 14px;\n height: 14px;\n border-radius: 7px;\n padding: 0 3px;\n font-size: 9px;\n font-weight: bold;\n line-height: 14px;\n box-sizing: border-box;\n margin-top: 0;\n flex-shrink: 0;\n }\n\n .log-icon {\n display: inline-block;\n text-align: center;\n width: 14px;\n height: 14px;\n font-size: 11px;\n line-height: 14px;\n margin-top: 0;\n flex-shrink: 0;\n }\n\n .log-body {\n flex-grow: 1;\n white-space: pre-wrap;\n word-break: break-all;\n }\n\n .log-message.info .log-count-badge {\n background-color: rgba(255, 255, 255, 0.12);\n border: 1px solid rgba(255, 255, 255, 0.2);\n color: var(--text-secondary);\n }\n\n .log-message.warn .log-count-badge {\n background-color: rgba(255, 193, 7, 0.18);\n border: 1px solid rgba(255, 193, 7, 0.35);\n color: var(--color-yellow);\n }\n\n .log-message.error .log-count-badge {\n background-color: rgba(244, 67, 54, 0.18);\n border: 1px solid rgba(244, 67, 54, 0.35);\n color: #ff8a80;\n }\n\n .log-message.hidden {\n display: none;\n }\n\n .log-message.info {\n color: var(--text-primary);\n }\n\n .log-message.warn {\n color: var(--color-yellow);\n }\n\n .log-message.error {\n color: #f9dedc;\n background-color: rgba(244, 67, 54, 0.1);\n }\n\n .log-prefix {\n color: var(--text-secondary);\n margin-right: 8px;\n }\n\n .log-code {\n background-color: rgba(255, 255, 255, 0.1);\n border-radius: 3px;\n padding: 1px 4px;\n }\n\n .thumbnail-container {\n display: flex;\n align-items: center;\n }\n\n .thumbnail-svg {\n width: 40px;\n height: 22.5px;\n flex-shrink: 0;\n margin-right: 8px;\n }\n\n .param-control {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 10px;\n width: 100%;\n }\n\n .param-control input,\n .param-control select,\n .param-control button {\n background-color: var(--profiler-background);\n border: 1px solid var(--profiler-border);\n color: var(--text-primary);\n border-radius: 4px;\n padding: 4px 6px;\n padding-bottom: 2px;\n font-family: var(--font-mono);\n width: 100%;\n box-sizing: border-box;\n }\n\n .param-control input:focus {\n outline: none;\n border-color: var(--color-accent);\n }\n\n .param-control select {\n padding-top: 3px;\n padding-bottom: 1px;\n }\n\n .param-control input[type=\"number\"] {\n cursor: ns-resize;\n }\n\n .param-control input[type=\"color\"] {\n padding: 2px;\n }\n\n .param-control button {\n cursor: pointer;\n transition: background-color 0.2s;\n }\n\n .param-control button:hover {\n background-color: var(--profiler-header);\n }\n\n .param-control-vector {\n display: flex;\n gap: 5px;\n }\n\n .custom-checkbox {\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n gap: 8px;\n will-change: transform;\n font-size: 12px;\n }\n\n .custom-checkbox input {\n display: none;\n }\n\n .custom-checkbox .checkmark {\n width: 14px;\n height: 14px;\n border: 1px solid var(--color-accent);\n border-radius: 3px;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.2s, border-color 0.2s;\n }\n\n .custom-checkbox .checkbox-text {\n font-size: 12px;\n margin-top: 1px;\n color: inherit;\n }\n\n .custom-checkbox .checkmark::after {\n content: '';\n width: 6px;\n height: 6px;\n background-color: var(--color-accent);\n border-radius: 1px;\n display: block;\n transform: scale(0);\n transition: transform 0.2s;\n }\n\n .list-container .custom-checkbox .checkmark {\n width: 13px;\n height: 13px;\n }\n\n .list-container .custom-checkbox .checkmark::after {\n width: 7px;\n height: 7px;\n }\n\n .custom-checkbox input:checked+.checkmark {\n border-color: var(--color-accent);\n }\n\n .custom-checkbox input:checked+.checkmark::after {\n transform: scale(1);\n }\n\n .param-control input[type=\"range\"] {\n -webkit-appearance: none;\n appearance: none;\n width: 100%;\n height: 16px;\n background: var(--profiler-header);\n border-radius: 5px;\n border: 1px solid var(--profiler-border);\n outline: none;\n padding: 0px;\n padding-top: 8px;\n }\n\n .param-control input[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 18px;\n height: 18px;\n background: var(--profiler-background);\n border: 1px solid var(--color-accent);\n border-radius: 3px;\n cursor: pointer;\n margin-top: -8px;\n }\n\n .param-control input[type=\"range\"]::-moz-range-thumb {\n width: 18px;\n height: 18px;\n background: var(--profiler-background);\n border: 2px solid var(--color-accent);\n border-radius: 3px;\n cursor: pointer;\n }\n\n .param-control input[type=\"range\"]::-moz-range-track {\n width: 100%;\n height: 16px;\n background: var(--profiler-header);\n border-radius: 5px;\n border: 1px solid var(--profiler-border);\n }\n\n /* Override .param-control styles for mini-panel-content */\n .mini-panel-content input,\n .mini-panel-content select,\n .mini-panel-content button {\n padding: 2px 4px;\n height: 21px;\n line-height: 1.4;\n padding-top: 4px;\n }\n\n .mini-panel-content .param-control input,\n .mini-panel-content .param-control select,\n .mini-panel-content .param-control button {\n background-color: #1e1e24c2;\n line-height: 1.0;\n }\n\n .mini-panel-content .param-control select {\n padding: 2px 2px;\n padding-top: 3px;\n }\n\n .mini-panel-content .param-control input[type=\"number\"]::-webkit-outer-spin-button,\n .mini-panel-content .param-control input[type=\"number\"]::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n .mini-panel-content .param-control input[type=\"number\"] {\n -moz-appearance: textfield;\n }\n\n .mini-panel-content .list-item-cell span {\n position: relative;\n top: 1px;\n margin-left: 2px;\n }\n\n @media screen and (max-width: 340px) {\n\n .mini-panel-content .list-item-cell:first-child {\n display: flex;\n align-items: center;\n min-width: 0;\n overflow: hidden;\n width: 100%;\n }\n\n .mini-panel-content .list-item-cell:first-child .value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1 1 0%;\n min-width: 0;\n }\n\n .mini-panel-content .list-item-cell:first-child .info-icon {\n flex-shrink: 0;\n }\n\n }\n\n .mini-panel-content .custom-checkbox .checkmark {\n width: 12px;\n height: 12px;\n margin-bottom: 2px;\n will-change: transform;\n }\n\n .mini-panel-content .list-container.parameters .list-item-row:not(.collapsible) {\n margin-bottom: 2px;\n }\n\n .mini-panel-content .list-container.parameters .list-children-container > .list-item-wrapper:first-child:has(> .list-item-row:not(.collapsible)) {\n margin-top: 2px;\n }\n\n .mini-panel-content .list-container.parameters .list-children-container > .list-item-wrapper:last-child:has(> .list-item-row:not(.collapsible)) {\n margin-bottom: 4px;\n }\n\n @media screen and (max-width: 450px) and (orientation: portrait) {\n\n .console-filter-input {\n max-width: 100px;\n }\n\n }\n\n /* Touch device optimizations */\n @media (hover: none) and (pointer: coarse) {\n\n .panel-resizer {\n top: -10px !important;\n height: 20px !important;\n }\n\n .profiler-panel.position-top .panel-resizer {\n top: auto !important;\n bottom: -10px !important;\n height: 20px !important;\n }\n\n .profiler-panel.position-left .panel-resizer {\n right: -10px !important;\n width: 20px !important;\n height: 100% !important;\n }\n\n .profiler-panel.position-right .panel-resizer {\n left: -10px !important;\n width: 20px !important;\n height: 100% !important;\n }\n\n .detached-tab-resizer-top,\n .detached-tab-resizer-bottom {\n height: 10px !important;\n }\n\n .detached-tab-resizer-left,\n .detached-tab-resizer-right {\n width: 10px !important;\n }\n\n }\n\n .drag-preview-indicator {\n position: fixed;\n background-color: rgba(0, 170, 255, 0.2);\n border: 2px dashed var(--color-accent);\n z-index: 999;\n pointer-events: none;\n transition: all 0.2s ease-out;\n }\n\n /* Detached Tab Windows */\n .detached-tab-panel {\n position: fixed;\n width: 500px;\n height: 400px;\n background: var(--profiler-background);\n border: 1px solid var(--profiler-border);\n border-radius: 8px;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);\n z-index: 1002;\n display: flex;\n flex-direction: column;\n backdrop-filter: blur(10px);\n overflow: hidden;\n opacity: 1;\n visibility: visible;\n transition: opacity 0.2s, visibility 0.2s;\n font-family: var(--font-mono);\n font-size: 13px;\n }\n\n\n .detached-tab-header {\n background: var(--profiler-header-background);\n padding: 0 3px 0 10px;\n font-family: var(--font-family);\n font-size: 13px;\n color: var(--text-primary);\n font-weight: 600;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid var(--profiler-border);\n cursor: grab;\n user-select: none;\n height: 32px;\n flex-shrink: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n touch-action: none;\n }\n\n .detached-tab-header:active {\n cursor: grabbing;\n }\n\n .detached-header-controls {\n display: flex;\n gap: 5px;\n }\n\n .detached-reattach-btn {\n background: transparent;\n border: none;\n color: var(--text-secondary);\n font-family: var(--font-family);\n font-size: 18px;\n line-height: 1;\n cursor: pointer;\n padding: 4px 8px;\n border-radius: 4px;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n .detached-reattach-btn:hover {\n background: rgba(0, 170, 255, 0.2);\n color: var(--color-accent);\n }\n\n .detached-tab-content {\n flex: 1;\n overflow: hidden;\n position: relative;\n background: var(--profiler-background);\n }\n\n\n .detached-tab-content .profiler-content {\n display: flex !important;\n flex-direction: column !important;\n height: 100%;\n visibility: visible !important;\n opacity: 1 !important;\n position: relative !important;\n }\n\n .detached-tab-content .profiler-content > * {\n font-family: var(--font-mono);\n color: var(--text-primary);\n }\n\n .detached-tab-resizer {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 20px;\n height: 20px;\n cursor: nwse-resize;\n z-index: 10;\n touch-action: none;\n }\n\n .detached-tab-resizer::after {\n content: '';\n position: absolute;\n bottom: 2px;\n right: 2px;\n width: 12px;\n height: 12px;\n border-right: 2px solid var(--profiler-border);\n border-bottom: 2px solid var(--profiler-border);\n border-bottom-right-radius: 6px;\n opacity: 0.5;\n }\n\n .detached-tab-resizer:hover::after {\n opacity: 1;\n border-color: var(--color-accent);\n }\n\n /* Edge resizers */\n .detached-tab-resizer-top {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 5px;\n cursor: ns-resize;\n z-index: 10;\n touch-action: none;\n }\n\n .detached-tab-resizer-right {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: 5px;\n cursor: ew-resize;\n z-index: 10;\n touch-action: none;\n }\n\n .detached-tab-resizer-bottom {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 5px;\n cursor: ns-resize;\n z-index: 10;\n touch-action: none;\n }\n\n .detached-tab-resizer-left {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 5px;\n cursor: ew-resize;\n z-index: 10;\n touch-action: none;\n }\n\n /* Input number spin buttons - hide arrows */\n /* Chrome, Safari, Edge, Opera */\n .profiler-panel input[type=\"number\"]::-webkit-outer-spin-button,\n .profiler-panel input[type=\"number\"]::-webkit-inner-spin-button,\n .detached-tab-content input[type=\"number\"]::-webkit-outer-spin-button,\n .detached-tab-content input[type=\"number\"]::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n .profiler-panel input[type=\"number\"],\n .detached-tab-content input[type=\"number\"] {\n -moz-appearance: textfield;\n }\n\n .panel-action-btn {\n background: transparent;\n color: var(--text-primary);\n border: 1px solid var(--profiler-border);\n border-radius: 4px;\n padding: 6px 12px;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: 12px;\n transition: background-color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .panel-action-btn:hover {\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n .node-canvas-wrapper {\n touch-action: none;\n }\n\n .node-canvas-wrapper .node-canvas-detach-btn {\n position: absolute;\n top: 5px;\n right: 5px;\n background: rgba(30, 30, 36, 0.85);\n border: 1px solid var(--profiler-border);\n color: var(--text-primary);\n border-radius: 4px;\n padding: 4px;\n cursor: pointer;\n opacity: 1;\n transition: background-color 0.2s, border-color 0.2s, color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10;\n }\n\n .node-canvas-wrapper .node-canvas-detach-btn:hover {\n background-color: var(--color-accent);\n border-color: var(--color-accent);\n color: white;\n }\n\n .node-canvas-wrapper .node-canvas-fullscreen-btn {\n position: absolute;\n bottom: 5px;\n right: 5px;\n background: rgba(30, 30, 36, 0.85);\n border: 1px solid var(--profiler-border);\n color: var(--text-primary);\n border-radius: 4px;\n padding: 4px;\n cursor: pointer;\n opacity: 1;\n transition: background-color 0.2s, border-color 0.2s, color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10;\n }\n\n .node-canvas-wrapper .node-canvas-fullscreen-btn:hover {\n background-color: var(--color-accent);\n border-color: var(--color-accent);\n color: white;\n }\n\n .profiler-panel.maximized .node-canvas-fullscreen-btn {\n display: none;\n }\n\n .toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 32px;\n padding: 4px 6px;\n border-bottom: 1px solid var(--profiler-border);\n background: var(--profiler-header-background);\n flex-shrink: 0;\n box-sizing: border-box;\n gap: 16px;\n }\n\n .toolbar span {\n color: var(--text-secondary);\n font-size: 12px;\n font-weight: 600;\n }\n\n .toolbar .custom-checkbox .checkmark {\n width: 12px;\n height: 12px;\n border-radius: 4px;\n }\n\n .viewer-content .toolbar {\n justify-content: flex-end;\n }\n\n .viewer-back-btn {\n background: transparent;\n border: none;\n color: var(--text-secondary);\n cursor: pointer;\n font-size: 16px;\n line-height: 1;\n padding: 4px 8px;\n border-radius: 4px;\n margin-right: auto;\n transition: color 0.2s, background-color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .viewer-back-btn:hover {\n color: var(--text-primary);\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n .select {\n background: var(--profiler-background);\n border: 1px solid var(--profiler-border);\n color: var(--text-primary);\n border-radius: 4px;\n padding: 4px 16px 2px 6px;\n font-family: var(--font-mono);\n font-size: 12px;\n outline: none;\n cursor: pointer;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right 5px center;\n background-size: 10px;\n }\n\n .select:focus {\n border-color: var(--color-accent);\n }\n\n .full-viewer-container {\n display: none;\n flex-grow: 1;\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n touch-action: none;\n }\n\n}\n", e.appendChild(t);
|
|
276
276
|
}
|
|
277
|
-
},
|
|
277
|
+
}, an = class {
|
|
278
278
|
constructor(e = 512) {
|
|
279
279
|
this.maxPoints = e, this.lines = {}, this.limit = 0, this.limitIndex = 0, this.domElement = document.createElement("canvas"), this.domElement.setAttribute("class", "graph-canvas"), this.ctx = this.domElement.getContext("2d"), this.width = 0, this.height = 0, this.devicePixelRatio = window.devicePixelRatio || 1;
|
|
280
280
|
}
|
|
@@ -345,9 +345,9 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
347
|
dispose() {}
|
|
348
|
-
},
|
|
348
|
+
}, on = class extends ce {
|
|
349
349
|
constructor(e) {
|
|
350
|
-
super(), this.inspector = e, this.tabs = {}, this.activeTabId = null, this.isResizing = !1, this.lastHeightBottom = 350, this.lastWidthRight = 450, this.position = "bottom", this.detachedWindows = [], this.maxZIndex = 1002, this.nextTabOriginalIndex = 0, this.setupShell(), this.setupResizing(),
|
|
350
|
+
super(), this.inspector = e, this.tabs = {}, this.activeTabId = null, this.isResizing = !1, this.lastHeightBottom = 350, this.lastWidthRight = 450, this.position = "bottom", this.detachedWindows = [], this.maxZIndex = 1002, this.nextTabOriginalIndex = 0, this.setupShell(), this.setupResizing(), rn.init(this.domElement), this.setupWindowResizeListener(), this.setupOrientationListener(), this.checkHeaderScroll(), this.panel.addEventListener("transitionend", (e) => {
|
|
351
351
|
e.target === this.panel && (e.propertyName === "width" || e.propertyName === "height" || e.propertyName === "transform") && this.checkHeaderScroll();
|
|
352
352
|
});
|
|
353
353
|
}
|
|
@@ -416,7 +416,7 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
416
416
|
let n = document.createElement("button");
|
|
417
417
|
n.classList.add("hide-panel-btn"), n.textContent = "-", n.onclick = () => this.togglePanel(), t.append(this.floatingBtn, this.maximizeBtn, n), e.append(this.tabsContainer, t), this.contentWrapper = document.createElement("div"), this.contentWrapper.className = "profiler-content-wrapper";
|
|
418
418
|
let r = document.createElement("div");
|
|
419
|
-
r.className = "panel-resizer", this.panel.append(r, e, this.contentWrapper), this.domElement.append(this.toggleButton, this.miniPanel, this.panel), this.panel.classList.add(`position-${this.position}`), this.position === "right" && (this.toggleButton.classList.add("position-right"), this.miniPanel.classList.add("position-right")), this.toggleGraph = new
|
|
419
|
+
r.className = "panel-resizer", this.panel.append(r, e, this.contentWrapper), this.domElement.append(this.toggleButton, this.miniPanel, this.panel), this.panel.classList.add(`position-${this.position}`), this.position === "right" && (this.toggleButton.classList.add("position-right"), this.miniPanel.classList.add("position-right")), this.toggleGraph = new an(80), this.toggleGraph.addLine("fps", "#4c4c6bff"), this.toggleGraph.domElement.className = "profiler-toggle-graph", this.toggleButton.appendChild(this.toggleGraph.domElement);
|
|
420
420
|
}
|
|
421
421
|
setupResizing() {
|
|
422
422
|
let e = this.panel.querySelector(".panel-resizer");
|
|
@@ -716,7 +716,7 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
716
716
|
});
|
|
717
717
|
});
|
|
718
718
|
try {
|
|
719
|
-
|
|
719
|
+
Z("layout", e);
|
|
720
720
|
} catch (e) {
|
|
721
721
|
console.warn("Failed to save profiler layout:", e);
|
|
722
722
|
}
|
|
@@ -724,7 +724,7 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
724
724
|
loadLayout() {
|
|
725
725
|
this.isLoadingLayout = !0;
|
|
726
726
|
try {
|
|
727
|
-
let e =
|
|
727
|
+
let e = Ln("layout");
|
|
728
728
|
if (Object.keys(e).length === 0) return;
|
|
729
729
|
if (e.detachedTabs && e.detachedTabs.length > 0) {
|
|
730
730
|
let t = window.innerWidth, n = window.innerHeight;
|
|
@@ -771,7 +771,7 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
771
771
|
this.updatePanelSize();
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
},
|
|
774
|
+
}, sn = class extends ce {
|
|
775
775
|
constructor(e, t = {}) {
|
|
776
776
|
super(), this.id = e.toLowerCase().replace(/\s+/g, "-"), this.button = document.createElement("button"), this.button.className = "tab-btn", this.button.textContent = e, this.content = document.createElement("div"), this.content.className = "profiler-content", this.content.classList.add(`${this.id}-content`), this._isActive = !1, this.isVisible = !0, this.isDetached = !1, this.detachedWindow = null, this.allowDetach = t.allowDetach === void 0 ? !0 : t.allowDetach, this.builtin = t.builtin === void 0 ? !1 : t.builtin, this.icon = t.icon || null, this.builtinButton = null, this.miniContent = null, this.profiler = null, this.onVisibilityChange = null;
|
|
777
777
|
}
|
|
@@ -811,7 +811,7 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
811
811
|
this.builtinButton && this.builtinButton.classList.remove("active"), this.profiler && (Array.from(this.profiler.miniPanel.querySelectorAll(".mini-panel-content")).some((e) => e.style.display !== "none") || this.profiler.miniPanel.classList.remove("visible"), Array.from(this.profiler.builtinTabsContainer.querySelectorAll(".builtin-tab-btn")).some((e) => e.style.display !== "none") || (this.profiler.builtinTabsContainer.style.display = "none"));
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
},
|
|
814
|
+
}, cn = class {
|
|
815
815
|
constructor(...e) {
|
|
816
816
|
this.headers = e, this.children = [], this.domElement = document.createElement("div"), this.domElement.className = "list-container", this.domElement.style.padding = "5px 10px 10px 10px", this.id = `list-${Math.random().toString(36).slice(2, 11)}`, this.domElement.dataset.listId = this.id, this.gridStyleElement = document.createElement("style"), this.domElement.appendChild(this.gridStyleElement);
|
|
817
817
|
let t = document.createElement("div");
|
|
@@ -835,7 +835,7 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
835
835
|
let t = this.children.indexOf(e);
|
|
836
836
|
return t !== -1 && (this.children.splice(t, 1), this.domElement.removeChild(e.domElement), e.parent = null), this;
|
|
837
837
|
}
|
|
838
|
-
},
|
|
838
|
+
}, G = class {
|
|
839
839
|
constructor(...e) {
|
|
840
840
|
this.children = [], this.isOpen = !0, this.isCollapsible = !1, this.childrenContainer = null, this.parent = null, this.domElement = document.createElement("div"), this.domElement.className = "list-item-wrapper", this.itemRow = document.createElement("div"), this.itemRow.className = "list-item-row", this.userData = {}, this.data = [], e.forEach((e, t) => {
|
|
841
841
|
let n = document.createElement("div");
|
|
@@ -886,14 +886,14 @@ var W = /* @__PURE__ */ new Oe(), Ut = /* @__PURE__ */ new p(), Wt = /* @__PURE_
|
|
|
886
886
|
};
|
|
887
887
|
//#endregion
|
|
888
888
|
//#region ../../node_modules/three/examples/jsm/inspector/ui/utils.js
|
|
889
|
-
function
|
|
889
|
+
function K() {
|
|
890
890
|
let e = document.createElement("span");
|
|
891
891
|
return e.className = "value", e;
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function q(e, t) {
|
|
894
894
|
e && e.textContent !== t && (e.textContent = t);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function ln(e) {
|
|
897
897
|
let t = e.lastIndexOf("/");
|
|
898
898
|
return t === -1 ? {
|
|
899
899
|
path: "",
|
|
@@ -903,10 +903,10 @@ function on(e) {
|
|
|
903
903
|
name: e.substring(t + 1).trim()
|
|
904
904
|
};
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function un(e) {
|
|
907
907
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim();
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function J(e, t = 2) {
|
|
910
910
|
if (e === 0) return "0 Bytes";
|
|
911
911
|
let n = 1024, r = t < 0 ? 0 : t, i = [
|
|
912
912
|
"Bytes",
|
|
@@ -921,7 +921,7 @@ function Y(e, t = 2) {
|
|
|
921
921
|
], a = Math.floor(Math.log(e) / Math.log(n));
|
|
922
922
|
return parseFloat((e / n ** +a).toFixed(r)) + " " + i[a];
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function dn(e, t) {
|
|
925
925
|
let n = e.querySelector(".info-icon");
|
|
926
926
|
if (!n) n = document.createElement("span"), n.className = "info-icon", n.textContent = "i", e.appendChild(n);
|
|
927
927
|
else {
|
|
@@ -951,36 +951,36 @@ function cn(e, t) {
|
|
|
951
951
|
}
|
|
952
952
|
//#endregion
|
|
953
953
|
//#region ../../node_modules/three/examples/jsm/inspector/tabs/Performance.js
|
|
954
|
-
var
|
|
954
|
+
var fn = class extends sn {
|
|
955
955
|
constructor(e = {}) {
|
|
956
956
|
super("Performance", e);
|
|
957
|
-
let t = new
|
|
957
|
+
let t = new cn("Name", "CPU", "GPU", "Total");
|
|
958
958
|
t.setGridStyle("minmax(200px, 2fr) 80px 80px 80px"), t.domElement.style.minWidth = "600px";
|
|
959
959
|
let n = document.createElement("div");
|
|
960
960
|
n.className = "list-scroll-wrapper", n.appendChild(t.domElement), this.content.appendChild(n);
|
|
961
961
|
let r = document.createElement("div");
|
|
962
962
|
r.className = "graph-container";
|
|
963
|
-
let i = new
|
|
964
|
-
i.addLine("fps", "var( --color-fps )"), i.addLine("cpu", "var( --color-yellow )"), i.addLine("gpu", "var( --color-green )"), r.append(i.domElement), this.graphFpsCounter =
|
|
965
|
-
let a = new
|
|
963
|
+
let i = new an();
|
|
964
|
+
i.addLine("fps", "var( --color-fps )"), i.addLine("cpu", "var( --color-yellow )"), i.addLine("gpu", "var( --color-green )"), r.append(i.domElement), this.graphFpsCounter = K();
|
|
965
|
+
let a = new G("Graph Stats", K(), K(), this.graphFpsCounter);
|
|
966
966
|
t.add(a);
|
|
967
|
-
let o = new
|
|
967
|
+
let o = new G(r);
|
|
968
968
|
o.itemRow.childNodes[0].style.gridColumn = "1 / -1", a.add(o);
|
|
969
|
-
let s = new
|
|
969
|
+
let s = new G("Frame Stats", K(), K(), K());
|
|
970
970
|
t.add(s);
|
|
971
|
-
let c = new
|
|
971
|
+
let c = new G("Miscellaneous & Idle", K(), K(), K());
|
|
972
972
|
c.domElement.firstChild.style.backgroundColor = "#00ff0b1a", c.domElement.firstChild.classList.add("no-hover"), s.add(c), this.notInUse = /* @__PURE__ */ new Map(), this.frameStats = s, this.graphStats = a, this.graph = i, this.miscellaneous = c, this.currentRender = null, this.currentItem = null, this.frameItems = /* @__PURE__ */ new Map();
|
|
973
973
|
}
|
|
974
974
|
resolveStats(e, t) {
|
|
975
975
|
let n = e.getStatsData(t.cid), r = n.item;
|
|
976
|
-
if (r === void 0) r = new K(
|
|
976
|
+
if (r === void 0) r = new G(K(), K(), K(), K()), t.name ? t.isComputeStats === !0 && (t.name = `${t.name} [ Compute ]`) : t.name = `Unnamed ${t.cid}`, r.userData.name = t.name, this.currentItem.add(r), n.item = r;
|
|
977
977
|
else {
|
|
978
978
|
r.userData.name = t.name, this.notInUse.has(t.cid) && (r.domElement.firstElementChild.classList.remove("alert"), this.notInUse.delete(t.cid));
|
|
979
979
|
let e = t.parent.children.indexOf(t);
|
|
980
980
|
(r.parent === null || r.parent.children.indexOf(r) !== e) && this.currentItem.add(r, e);
|
|
981
981
|
}
|
|
982
982
|
let i = r.userData.name;
|
|
983
|
-
t.isComputeStats && (i += " [ Compute ]"),
|
|
983
|
+
t.isComputeStats && (i += " [ Compute ]"), q(r.data[0], i), q(r.data[1], n.cpu.toFixed(2)), q(r.data[2], t.gpuNotAvailable === !0 ? "-" : n.gpu.toFixed(2)), q(r.data[3], n.total.toFixed(2));
|
|
984
984
|
let a = this.currentItem;
|
|
985
985
|
this.currentItem = r;
|
|
986
986
|
for (let n of t.children) this.resolveStats(e, n);
|
|
@@ -1004,7 +1004,7 @@ var ln = class extends rn {
|
|
|
1004
1004
|
let { item: t, time: n } = this.notInUse.get(e), r = performance.now(), i = 5 - Math.floor((r - n) / 1e3);
|
|
1005
1005
|
if (i >= 0) {
|
|
1006
1006
|
let e = "*".repeat(Math.max(0, i));
|
|
1007
|
-
|
|
1007
|
+
q(t.domElement.querySelector(".list-item-cell .value"), t.userData.name + " (not in use) " + e);
|
|
1008
1008
|
} else t.domElement.firstElementChild.classList.remove("alert"), t.parent.remove(t), this.notInUse.delete(e);
|
|
1009
1009
|
}
|
|
1010
1010
|
updateText(e, t) {
|
|
@@ -1013,23 +1013,23 @@ var ln = class extends rn {
|
|
|
1013
1013
|
for (let n of t.children) this.resolveStats(e, n);
|
|
1014
1014
|
for (let [e, t] of n) this.frameItems.has(e) || (this.addNotInUse(e, t), n.delete(e));
|
|
1015
1015
|
for (let e of this.notInUse.keys()) this.updateNotInUse(e);
|
|
1016
|
-
|
|
1016
|
+
q(this.graphFpsCounter, e.fps.toFixed() + " FPS"), q(this.frameStats.data[1], t.cpu.toFixed(2)), q(this.frameStats.data[2], e.getRenderer().backend.hasTimestamp ? t.gpu.toFixed(2) : "-"), q(this.frameStats.data[3], t.total.toFixed(2)), q(this.miscellaneous.data[1], t.miscellaneous.toFixed(2)), q(this.miscellaneous.data[2], "-"), q(this.miscellaneous.data[3], t.miscellaneous.toFixed(2)), this.currentItem = null;
|
|
1017
1017
|
}
|
|
1018
|
-
},
|
|
1018
|
+
}, pn = class extends sn {
|
|
1019
1019
|
constructor(e = {}) {
|
|
1020
1020
|
super("Memory", e);
|
|
1021
|
-
let t = new
|
|
1021
|
+
let t = new cn("Name", "Count", "Size");
|
|
1022
1022
|
t.setGridStyle("minmax(200px, 2fr) 60px 100px"), t.domElement.style.minWidth = "300px";
|
|
1023
1023
|
let n = document.createElement("div");
|
|
1024
1024
|
n.className = "list-scroll-wrapper", n.appendChild(t.domElement), this.content.appendChild(n);
|
|
1025
1025
|
let r = document.createElement("div");
|
|
1026
1026
|
r.className = "graph-container";
|
|
1027
|
-
let i = new
|
|
1027
|
+
let i = new an();
|
|
1028
1028
|
i.addLine("total", "var( --color-yellow )"), r.append(i.domElement);
|
|
1029
|
-
let a = new
|
|
1029
|
+
let a = new G("Graph Stats", "", "");
|
|
1030
1030
|
t.add(a);
|
|
1031
|
-
let o = new
|
|
1032
|
-
o.itemRow.childNodes[0].style.gridColumn = "1 / -1", a.add(o), this.memoryStats = new
|
|
1031
|
+
let o = new G(r);
|
|
1032
|
+
o.itemRow.childNodes[0].style.gridColumn = "1 / -1", a.add(o), this.memoryStats = new G("Renderer Info", "", K()), this.memoryStats.domElement.firstChild.classList.add("no-hover"), t.add(this.memoryStats), this.attributes = new G("Attributes", K(), K()), this.memoryStats.add(this.attributes), this.geometries = new G("Geometries", K(), "N/A"), this.memoryStats.add(this.geometries), this.indexAttributes = new G("Index Attributes", K(), K()), this.memoryStats.add(this.indexAttributes), this.indirectStorageAttributes = new G("Indirect Storage Attributes", K(), K()), this.memoryStats.add(this.indirectStorageAttributes), this.programs = new G("Programs", K(), K()), this.memoryStats.add(this.programs), this.readbackBuffers = new G("Readback Buffers", K(), K()), this.memoryStats.add(this.readbackBuffers), this.renderTargets = new G("Render Targets", K(), "N/A"), this.memoryStats.add(this.renderTargets), this.storageAttributes = new G("Storage Attributes", K(), K()), this.memoryStats.add(this.storageAttributes), this.textures = new G("Textures", K(), K()), this.memoryStats.add(this.textures), this.uniformBuffers = new G("Uniform Buffers", K(), K()), this.memoryStats.add(this.uniformBuffers), this.graph = i;
|
|
1033
1033
|
}
|
|
1034
1034
|
updateGraph(e) {
|
|
1035
1035
|
let t = e.getRenderer();
|
|
@@ -1041,9 +1041,9 @@ var ln = class extends rn {
|
|
|
1041
1041
|
let t = e.getRenderer();
|
|
1042
1042
|
if (!t) return;
|
|
1043
1043
|
let n = t.info.memory;
|
|
1044
|
-
|
|
1044
|
+
q(this.memoryStats.data[2], J(n.total)), q(this.attributes.data[1], n.attributes.toString()), q(this.attributes.data[2], J(n.attributesSize)), q(this.geometries.data[1], n.geometries.toString()), q(this.indexAttributes.data[1], n.indexAttributes.toString()), q(this.indexAttributes.data[2], J(n.indexAttributesSize)), q(this.indirectStorageAttributes.data[1], n.indirectStorageAttributes.toString()), q(this.indirectStorageAttributes.data[2], J(n.indirectStorageAttributesSize)), q(this.programs.data[1], n.programs.toString()), q(this.programs.data[2], J(n.programsSize)), q(this.readbackBuffers.data[1], n.readbackBuffers.toString()), q(this.readbackBuffers.data[2], J(n.readbackBuffersSize)), q(this.renderTargets.data[1], n.renderTargets.toString()), q(this.storageAttributes.data[1], n.storageAttributes.toString()), q(this.storageAttributes.data[2], J(n.storageAttributesSize)), q(this.textures.data[1], n.textures.toString()), q(this.textures.data[2], J(n.texturesSize)), q(this.uniformBuffers.data[1], n.uniformBuffers.toString()), q(this.uniformBuffers.data[2], J(n.uniformBuffersSize));
|
|
1045
1045
|
}
|
|
1046
|
-
},
|
|
1046
|
+
}, mn = class extends sn {
|
|
1047
1047
|
constructor(e = {}) {
|
|
1048
1048
|
super("Console", e), this.filters = {
|
|
1049
1049
|
info: !0,
|
|
@@ -1152,7 +1152,7 @@ var ln = class extends rn {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
this.logContainer.scrollTop = this.logContainer.scrollHeight, this.isActive || (e === "error" ? (this.unreadErrors++, this.updateBadges()) : e === "warn" && (this.unreadWarns++, this.updateBadges()));
|
|
1154
1154
|
}
|
|
1155
|
-
},
|
|
1155
|
+
}, Y = class extends ce {
|
|
1156
1156
|
constructor() {
|
|
1157
1157
|
super(), this.domElement = document.createElement("div"), this.domElement.className = "param-control", this._onChangeFunction = null, this.addEventListener("change", (e) => {
|
|
1158
1158
|
requestAnimationFrame(() => {
|
|
@@ -1181,7 +1181,7 @@ var ln = class extends rn {
|
|
|
1181
1181
|
hide() {
|
|
1182
1182
|
return this.dispatchEvent({ type: "hide" }), this;
|
|
1183
1183
|
}
|
|
1184
|
-
},
|
|
1184
|
+
}, hn = class extends Y {
|
|
1185
1185
|
constructor({ value: e = 0, step: t = .1, min: n = -Infinity, max: r = Infinity }) {
|
|
1186
1186
|
super(), this.input = document.createElement("input"), this.input.type = "number", this.input.value = e, this.input.step = t, this.input.min = n, this.input.max = r, this.input.addEventListener("change", this._onChangeValue.bind(this)), this.domElement.appendChild(this.input), this.addDragHandler();
|
|
1187
1187
|
}
|
|
@@ -1212,7 +1212,7 @@ var ln = class extends rn {
|
|
|
1212
1212
|
getValue() {
|
|
1213
1213
|
return parseFloat(this.input.value);
|
|
1214
1214
|
}
|
|
1215
|
-
},
|
|
1215
|
+
}, gn = class extends Y {
|
|
1216
1216
|
constructor({ value: e = !1 }) {
|
|
1217
1217
|
super();
|
|
1218
1218
|
let t = document.createElement("label");
|
|
@@ -1230,10 +1230,10 @@ var ln = class extends rn {
|
|
|
1230
1230
|
getValue() {
|
|
1231
1231
|
return this.checkbox.checked;
|
|
1232
1232
|
}
|
|
1233
|
-
},
|
|
1233
|
+
}, _n = class extends Y {
|
|
1234
1234
|
constructor({ value: e = 0, min: t = 0, max: n = 1, step: r = .01 }) {
|
|
1235
1235
|
super(), this.slider = document.createElement("input"), this.slider.type = "range", this.slider.min = t, this.slider.max = n, this.slider.step = r;
|
|
1236
|
-
let i = new
|
|
1236
|
+
let i = new hn({
|
|
1237
1237
|
value: e,
|
|
1238
1238
|
min: t,
|
|
1239
1239
|
max: n,
|
|
@@ -1254,7 +1254,7 @@ var ln = class extends rn {
|
|
|
1254
1254
|
step(e) {
|
|
1255
1255
|
return this.slider.step = e, this.numberInput.step = e, this.slider.value = parseFloat(this.numberInput.value), this;
|
|
1256
1256
|
}
|
|
1257
|
-
},
|
|
1257
|
+
}, vn = class extends Y {
|
|
1258
1258
|
constructor({ options: e = [], value: t = "" }) {
|
|
1259
1259
|
super();
|
|
1260
1260
|
let n = document.createElement("select"), r = (e, r) => {
|
|
@@ -1277,7 +1277,7 @@ var ln = class extends rn {
|
|
|
1277
1277
|
let e = this.options;
|
|
1278
1278
|
return Array.isArray(e) ? e[this.select.selectedIndex] : e[this.select.value];
|
|
1279
1279
|
}
|
|
1280
|
-
},
|
|
1280
|
+
}, yn = class extends Y {
|
|
1281
1281
|
constructor({ value: e = "#ffffff" }) {
|
|
1282
1282
|
super();
|
|
1283
1283
|
let t = document.createElement("input");
|
|
@@ -1297,13 +1297,13 @@ var ln = class extends rn {
|
|
|
1297
1297
|
let e = this._value;
|
|
1298
1298
|
return typeof e == "string" && (e = parseInt(e.slice(1), 16)), e;
|
|
1299
1299
|
}
|
|
1300
|
-
},
|
|
1300
|
+
}, bn = class extends Y {
|
|
1301
1301
|
constructor({ text: e = "Button", value: t = () => {} }) {
|
|
1302
1302
|
super();
|
|
1303
1303
|
let n = document.createElement("button");
|
|
1304
1304
|
n.textContent = e, n.onclick = t, this.domElement.appendChild(n);
|
|
1305
1305
|
}
|
|
1306
|
-
},
|
|
1306
|
+
}, xn = class extends Y {
|
|
1307
1307
|
constructor({ value: e = "" }) {
|
|
1308
1308
|
super();
|
|
1309
1309
|
let t = document.createElement("input");
|
|
@@ -1317,9 +1317,9 @@ var ln = class extends rn {
|
|
|
1317
1317
|
getValue() {
|
|
1318
1318
|
return this.input.value;
|
|
1319
1319
|
}
|
|
1320
|
-
},
|
|
1320
|
+
}, Sn = class e {
|
|
1321
1321
|
constructor(e, t) {
|
|
1322
|
-
this.parameters = e, this.paramList = new
|
|
1322
|
+
this.parameters = e, this.paramList = new G(t), this.paramList.setCollapsible(!0), this.objects = [];
|
|
1323
1323
|
}
|
|
1324
1324
|
close() {
|
|
1325
1325
|
return this.paramList.close(), this;
|
|
@@ -1338,7 +1338,7 @@ var ln = class extends rn {
|
|
|
1338
1338
|
return typeof n[0] == "object" ? i = this.addSelect(e, t, n[0]) : r === "number" ? i = n.length >= 2 ? this.addSlider(e, t, ...n) : this.addNumber(e, t, ...n) : r === "boolean" ? i = this.addBoolean(e, t) : r === "string" ? i = this.addString(e, t) : r === "function" && (i = this.addButton(e, t, ...n)), i;
|
|
1339
1339
|
}
|
|
1340
1340
|
_addInfo(e, t) {
|
|
1341
|
-
e.info = (n) => (
|
|
1341
|
+
e.info = (n) => (dn(t, n), e);
|
|
1342
1342
|
}
|
|
1343
1343
|
_addParameter(e, t, n, r) {
|
|
1344
1344
|
n.name = (e) => (r.data[0].childNodes.length > 0 && r.data[0].firstChild.nodeType === 3 ? r.data[0].firstChild.textContent = e : r.data[0].insertBefore(document.createTextNode(e), r.data[0].firstChild), n), this._addInfo(n, r.data[0]), n.listen = () => {
|
|
@@ -1358,13 +1358,13 @@ var ln = class extends rn {
|
|
|
1358
1358
|
}), n.addEventListener("show", () => r.show()), n.addEventListener("hide", () => r.hide());
|
|
1359
1359
|
}
|
|
1360
1360
|
addString(e, t) {
|
|
1361
|
-
let n = e[t], r = new
|
|
1361
|
+
let n = e[t], r = new xn({ value: n });
|
|
1362
1362
|
r.addEventListener("change", ({ value: n }) => {
|
|
1363
1363
|
e[t] = n;
|
|
1364
1364
|
});
|
|
1365
|
-
let i =
|
|
1365
|
+
let i = K();
|
|
1366
1366
|
i.textContent = t;
|
|
1367
|
-
let a = new
|
|
1367
|
+
let a = new G(i, r.domElement);
|
|
1368
1368
|
return this.paramList.add(a), a.domElement.firstChild.classList.add("actionable"), this._addParameter(e, t, r, a), r;
|
|
1369
1369
|
}
|
|
1370
1370
|
addFolder(t) {
|
|
@@ -1372,13 +1372,13 @@ var ln = class extends rn {
|
|
|
1372
1372
|
return this.paramList.add(n.paramList), n;
|
|
1373
1373
|
}
|
|
1374
1374
|
addBoolean(e, t) {
|
|
1375
|
-
let n = e[t], r = new
|
|
1375
|
+
let n = e[t], r = new gn({ value: n });
|
|
1376
1376
|
r.addEventListener("change", ({ value: n }) => {
|
|
1377
1377
|
e[t] = n;
|
|
1378
1378
|
});
|
|
1379
|
-
let i =
|
|
1379
|
+
let i = K();
|
|
1380
1380
|
i.textContent = t;
|
|
1381
|
-
let a = new
|
|
1381
|
+
let a = new G(i, r.domElement);
|
|
1382
1382
|
this.paramList.add(a);
|
|
1383
1383
|
let o = a.domElement.firstChild;
|
|
1384
1384
|
return o.classList.add("actionable"), o.addEventListener("click", (e) => {
|
|
@@ -1388,30 +1388,30 @@ var ln = class extends rn {
|
|
|
1388
1388
|
}), this._addParameter(e, t, r, a), r;
|
|
1389
1389
|
}
|
|
1390
1390
|
addSelect(e, t, n) {
|
|
1391
|
-
let r = e[t], i = new
|
|
1391
|
+
let r = e[t], i = new vn({
|
|
1392
1392
|
options: n,
|
|
1393
1393
|
value: r
|
|
1394
1394
|
});
|
|
1395
1395
|
i.addEventListener("change", ({ value: n }) => {
|
|
1396
1396
|
e[t] = n;
|
|
1397
1397
|
});
|
|
1398
|
-
let a =
|
|
1398
|
+
let a = K();
|
|
1399
1399
|
a.textContent = t;
|
|
1400
|
-
let o = new
|
|
1400
|
+
let o = new G(a, i.domElement);
|
|
1401
1401
|
return this.paramList.add(o), o.domElement.firstChild.classList.add("actionable"), this._addParameter(e, t, i, o), i;
|
|
1402
1402
|
}
|
|
1403
1403
|
addColor(e, t) {
|
|
1404
|
-
let n = e[t], r = new
|
|
1404
|
+
let n = e[t], r = new yn({ value: n });
|
|
1405
1405
|
r.addEventListener("change", ({ value: n }) => {
|
|
1406
1406
|
e[t] = n;
|
|
1407
1407
|
});
|
|
1408
|
-
let i =
|
|
1408
|
+
let i = K();
|
|
1409
1409
|
i.textContent = t;
|
|
1410
|
-
let a = new
|
|
1410
|
+
let a = new G(i, r.domElement);
|
|
1411
1411
|
return this.paramList.add(a), a.domElement.firstChild.classList.add("actionable"), this._addParameter(e, t, r, a), r;
|
|
1412
1412
|
}
|
|
1413
1413
|
addSlider(e, t, n = 0, r = 1, i = .01) {
|
|
1414
|
-
let a = e[t], o = new
|
|
1414
|
+
let a = e[t], o = new _n({
|
|
1415
1415
|
value: a,
|
|
1416
1416
|
min: n,
|
|
1417
1417
|
max: r,
|
|
@@ -1420,13 +1420,13 @@ var ln = class extends rn {
|
|
|
1420
1420
|
o.addEventListener("change", ({ value: n }) => {
|
|
1421
1421
|
e[t] = n;
|
|
1422
1422
|
});
|
|
1423
|
-
let s =
|
|
1423
|
+
let s = K();
|
|
1424
1424
|
s.textContent = t;
|
|
1425
|
-
let c = new
|
|
1425
|
+
let c = new G(s, o.domElement);
|
|
1426
1426
|
return this.paramList.add(c), c.domElement.firstChild.classList.add("actionable"), this._addParameter(e, t, o, c), o;
|
|
1427
1427
|
}
|
|
1428
1428
|
addNumber(e, t, ...n) {
|
|
1429
|
-
let r = e[t], [i, a] = n, o = new
|
|
1429
|
+
let r = e[t], [i, a] = n, o = new hn({
|
|
1430
1430
|
value: r,
|
|
1431
1431
|
min: i,
|
|
1432
1432
|
max: a
|
|
@@ -1434,98 +1434,98 @@ var ln = class extends rn {
|
|
|
1434
1434
|
o.addEventListener("change", ({ value: n }) => {
|
|
1435
1435
|
e[t] = n;
|
|
1436
1436
|
});
|
|
1437
|
-
let s =
|
|
1437
|
+
let s = K();
|
|
1438
1438
|
s.textContent = t;
|
|
1439
|
-
let c = new
|
|
1439
|
+
let c = new G(s, o.domElement);
|
|
1440
1440
|
return this.paramList.add(c), c.domElement.firstChild.classList.add("actionable"), this._addParameter(e, t, o, c), o;
|
|
1441
1441
|
}
|
|
1442
1442
|
addButton(e, t) {
|
|
1443
|
-
let n = e[t], r = new
|
|
1443
|
+
let n = e[t], r = new bn({
|
|
1444
1444
|
text: t,
|
|
1445
1445
|
value: n
|
|
1446
1446
|
});
|
|
1447
1447
|
r.addEventListener("change", ({ value: n }) => {
|
|
1448
1448
|
e[t] = n;
|
|
1449
1449
|
});
|
|
1450
|
-
let i = new
|
|
1450
|
+
let i = new G(r.domElement);
|
|
1451
1451
|
return i.itemRow.childNodes[0].style.gridColumn = "1 / -1", this.paramList.add(i), i.domElement.firstChild.classList.add("actionable"), r.name = (e) => {
|
|
1452
1452
|
let t = r.domElement.childNodes[0];
|
|
1453
1453
|
return t.childNodes.length > 0 && t.firstChild.nodeType === 3 ? t.firstChild.textContent = e : t.insertBefore(document.createTextNode(e), t.firstChild), r;
|
|
1454
1454
|
}, this._addInfo(r, r.domElement.childNodes[0]), this._registerParameter(e, t, r, i), r;
|
|
1455
1455
|
}
|
|
1456
|
-
},
|
|
1456
|
+
}, Cn = class extends sn {
|
|
1457
1457
|
constructor(e = {}) {
|
|
1458
1458
|
super(e.name || "Parameters", e);
|
|
1459
|
-
let t = new
|
|
1459
|
+
let t = new cn("Property", "Value");
|
|
1460
1460
|
t.domElement.classList.add("parameters"), t.setGridStyle(".5fr 1fr"), t.domElement.style.minWidth = "300px";
|
|
1461
1461
|
let n = document.createElement("div");
|
|
1462
1462
|
n.className = "list-scroll-wrapper", n.appendChild(t.domElement), this.content.appendChild(n), this.paramList = t, this.groups = [];
|
|
1463
1463
|
}
|
|
1464
1464
|
createGroup(e) {
|
|
1465
|
-
let t = new
|
|
1465
|
+
let t = new Sn(this, e);
|
|
1466
1466
|
return this.paramList.add(t.paramList), this.groups.push(t), t;
|
|
1467
1467
|
}
|
|
1468
|
-
},
|
|
1468
|
+
}, wn = [{
|
|
1469
1469
|
name: "TSL Graph",
|
|
1470
1470
|
url: "../extensions/tsl-graph/TSLGraphEditor.js"
|
|
1471
|
-
}],
|
|
1472
|
-
function
|
|
1473
|
-
e ?
|
|
1471
|
+
}], Tn = ke.prototype.init;
|
|
1472
|
+
function En(e) {
|
|
1473
|
+
e ? ke.prototype.init = async function() {
|
|
1474
1474
|
if (this.backend.isWebGLBackend !== !0) {
|
|
1475
1475
|
let e = this.backend.parameters;
|
|
1476
|
-
this.backend = new
|
|
1476
|
+
this.backend = new Oe(e);
|
|
1477
1477
|
}
|
|
1478
|
-
return
|
|
1479
|
-
} :
|
|
1478
|
+
return Tn.call(this);
|
|
1479
|
+
} : ke.prototype.init = Tn;
|
|
1480
1480
|
}
|
|
1481
|
-
var
|
|
1482
|
-
function
|
|
1483
|
-
if (
|
|
1484
|
-
let e =
|
|
1485
|
-
return
|
|
1481
|
+
var X = null;
|
|
1482
|
+
function Dn() {
|
|
1483
|
+
if (X !== null) return X;
|
|
1484
|
+
let e = Ln("settings");
|
|
1485
|
+
return X = {
|
|
1486
1486
|
forceWebGL: e.forceWebGL === void 0 ? !1 : e.forceWebGL,
|
|
1487
1487
|
captureStackTrace: e.captureStackTrace === void 0 ? !1 : e.captureStackTrace,
|
|
1488
1488
|
activeExtensions: e.activeExtensions === void 0 ? {} : e.activeExtensions,
|
|
1489
1489
|
storage: e.storage === void 0 ? "url" : e.storage
|
|
1490
|
-
},
|
|
1490
|
+
}, X.forceWebGL && En(!0), X.captureStackTrace && (Ce.captureStackTrace = !0), X;
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1493
|
-
|
|
1494
|
-
forceWebGL:
|
|
1495
|
-
captureStackTrace:
|
|
1496
|
-
activeExtensions:
|
|
1497
|
-
storage:
|
|
1492
|
+
function On() {
|
|
1493
|
+
Z("settings", {
|
|
1494
|
+
forceWebGL: X.forceWebGL,
|
|
1495
|
+
captureStackTrace: X.captureStackTrace,
|
|
1496
|
+
activeExtensions: X.activeExtensions,
|
|
1497
|
+
storage: X.storage
|
|
1498
1498
|
});
|
|
1499
1499
|
}
|
|
1500
|
-
|
|
1501
|
-
var
|
|
1500
|
+
Dn();
|
|
1501
|
+
var kn = class extends Cn {
|
|
1502
1502
|
constructor() {
|
|
1503
1503
|
super({ name: "Settings" }), this.extensions = {};
|
|
1504
|
-
let e =
|
|
1504
|
+
let e = Dn(), t = this.createGroup("Renderer");
|
|
1505
1505
|
t.add(e, "forceWebGL").name("Force WebGL").onChange((e) => {
|
|
1506
|
-
|
|
1506
|
+
En(e), On(), location.reload();
|
|
1507
1507
|
}), t.add(e, "captureStackTrace").name("Capture Stack Trace").onChange((e) => {
|
|
1508
|
-
|
|
1508
|
+
Ce.captureStackTrace = e, On(), location.reload();
|
|
1509
1509
|
}), this.createGroup("Render Modes").add({ overdraw: !1 }, "overdraw").name("Overdraw").onChange((e) => {
|
|
1510
1510
|
this.inspector.overdraw = e;
|
|
1511
1511
|
}).info("Shows how many times each pixel is shaded.");
|
|
1512
1512
|
}
|
|
1513
1513
|
init() {
|
|
1514
|
-
let e = this.createGroup("Extensions"), t = this.createGroup("Storage"), n =
|
|
1514
|
+
let e = this.createGroup("Extensions"), t = this.createGroup("Storage"), n = Dn();
|
|
1515
1515
|
t.add(n, "storage", {
|
|
1516
1516
|
"URL Session": "url",
|
|
1517
1517
|
"Keep across Origin": "origin"
|
|
1518
1518
|
}).name("Save Settings").onChange(() => {
|
|
1519
|
-
|
|
1519
|
+
On();
|
|
1520
1520
|
}).info("\nDefines how the **Inspector** preferences and states are stored in the browser.\n\n**URL Session**\nSaves state based on the exact URL. It will reset the settings whenever the URL changes.\n\n**Keep across Origin**\nShares the same state across any page within the current origin."), t.add({ clear: () => {
|
|
1521
1521
|
localStorage.removeItem("threejs-inspector"), location.reload();
|
|
1522
1522
|
} }, "clear").name("Clear Settings"), this._getExtensions().then((t) => {
|
|
1523
1523
|
for (let n of t) n.active = !1, n.loaded = !1, n.tab = null, this.extensions[n.name] = n, n.ui = e.add({ [n.name]: !1 }, n.name).onChange(async (e) => {
|
|
1524
|
-
this.setActiveExtension(n.name, e), e ?
|
|
1524
|
+
this.setActiveExtension(n.name, e), e ? X.activeExtensions[n.name] = {
|
|
1525
1525
|
name: n.name,
|
|
1526
1526
|
url: n.url
|
|
1527
|
-
} : delete
|
|
1528
|
-
}),
|
|
1527
|
+
} : delete X.activeExtensions[n.name], this._updateExtensionUI(n), On();
|
|
1528
|
+
}), X.activeExtensions[n.name] !== void 0 && n.ui.setValue(!0);
|
|
1529
1529
|
});
|
|
1530
1530
|
}
|
|
1531
1531
|
async setActiveExtension(e, t) {
|
|
@@ -1533,7 +1533,7 @@ var En = class extends bn {
|
|
|
1533
1533
|
n && (t ? await this._loadExtension(r, n) : await this._unloadExtension(r, n));
|
|
1534
1534
|
}
|
|
1535
1535
|
_updateExtensionUI(e) {
|
|
1536
|
-
e.active &&
|
|
1536
|
+
e.active && X.activeExtensions[e.name] === void 0 ? (e.ui.checkbox.checked = !0, e.ui.domElement.style.setProperty("--accent-color", "var(--color-green)")) : e.ui.domElement.style.removeProperty("--accent-color");
|
|
1537
1537
|
}
|
|
1538
1538
|
async _unloadExtension(e, t) {
|
|
1539
1539
|
t.active !== !1 && (e.removeTab(t.tab), t.active = !1, t.loaded = !1, t.tab = null, this._updateExtensionUI(t), this.dispatchEvent({
|
|
@@ -1552,17 +1552,17 @@ var En = class extends bn {
|
|
|
1552
1552
|
});
|
|
1553
1553
|
}
|
|
1554
1554
|
async _getExtensions() {
|
|
1555
|
-
return
|
|
1555
|
+
return wn;
|
|
1556
1556
|
}
|
|
1557
|
-
},
|
|
1557
|
+
}, An = /* @__PURE__ */ new p(), jn = /* @__PURE__ */ V(([e, t, n]) => {
|
|
1558
1558
|
let r = j(0);
|
|
1559
|
-
|
|
1559
|
+
It(() => {
|
|
1560
1560
|
let { width: e, height: n } = t.value;
|
|
1561
1561
|
r.value = e / n;
|
|
1562
1562
|
});
|
|
1563
|
-
let i = n.div(r), a = e.sub(.5), o =
|
|
1564
|
-
return
|
|
1565
|
-
}),
|
|
1563
|
+
let i = n.div(r), a = e.sub(.5), o = F(a.x.mul(i), a.y).add(.5), s = F(a.x, a.y.div(i)).add(.5), c = n.greaterThan(r).select(o, s);
|
|
1564
|
+
return I(c, Vt(0, c.x).mul(Vt(c.x, 1)).mul(Vt(0, c.y)).mul(Vt(c.y, 1)));
|
|
1565
|
+
}), Mn = class extends sn {
|
|
1566
1566
|
constructor(e = {}) {
|
|
1567
1567
|
super("Viewer", e), this.content.style.overflow = "hidden", this.maximizedByFullscreenButton = !1;
|
|
1568
1568
|
let t = document.createElement("div");
|
|
@@ -1575,13 +1575,13 @@ var En = class extends bn {
|
|
|
1575
1575
|
i.className = "select", i.style.width = "200px";
|
|
1576
1576
|
let a = document.createElement("option");
|
|
1577
1577
|
a.value = "list", a.textContent = "List", i.appendChild(a), t.appendChild(i), this.content.appendChild(t);
|
|
1578
|
-
let o = new
|
|
1578
|
+
let o = new cn("Viewer", "Name");
|
|
1579
1579
|
o.setGridStyle("150px minmax(200px, 2fr)"), o.domElement.style.minWidth = "400px";
|
|
1580
1580
|
let s = document.createElement("div");
|
|
1581
1581
|
s.className = "list-scroll-wrapper", s.style.flexGrow = "1", s.style.overflowY = "auto", s.style.minHeight = "0", s.appendChild(o.domElement), this.content.appendChild(s);
|
|
1582
1582
|
let c = document.createElement("div");
|
|
1583
1583
|
c.className = "full-viewer-container", c.style.touchAction = "none", this.content.appendChild(c);
|
|
1584
|
-
let l = new
|
|
1584
|
+
let l = new G("User Defined");
|
|
1585
1585
|
l.setCollapsible(!0), o.add(l), this.itemLibrary = /* @__PURE__ */ new Map(), this.folderLibrary = /* @__PURE__ */ new Map(), this.canvasNodes = /* @__PURE__ */ new Map(), this.currentDataList = [], this.nodeList = o, this.nodes = l, this.scrollWrapper = s, this.fullViewerContainer = c, this.select = i, this.backBtn = n, this.activeFullNodeId = null, this.pendingRestoreView = !0, n.addEventListener("click", () => {
|
|
1586
1586
|
i.value = "list", this.showListView(), this.maximizedByFullscreenButton &&= (this.profiler && this.profiler.panel.classList.contains("maximized") && this.profiler.toggleMaximize(), !1), this.saveLastView();
|
|
1587
1587
|
}), i.addEventListener("change", () => {
|
|
@@ -1597,7 +1597,7 @@ var En = class extends bn {
|
|
|
1597
1597
|
}
|
|
1598
1598
|
getFolder(e) {
|
|
1599
1599
|
let t = this.folderLibrary.get(e);
|
|
1600
|
-
return t === void 0 && (t = new
|
|
1600
|
+
return t === void 0 && (t = new G(e), t.setCollapsible(!0), this.folderLibrary.set(e, t), this.nodeList.add(t)), t;
|
|
1601
1601
|
}
|
|
1602
1602
|
hide() {
|
|
1603
1603
|
super.hide(), this.maximizedByFullscreenButton = !1, this.isDraggingThumbnail = !1, this.activeSourceCanvas = null, this.activePointerIds.clear();
|
|
@@ -1616,7 +1616,7 @@ var En = class extends bn {
|
|
|
1616
1616
|
t.stopPropagation(), this.select.value = e.id, this.showNodeView(e.id), this.profiler && !this.profiler.panel.classList.contains("maximized") && (this.profiler.toggleMaximize(), this.maximizedByFullscreenButton = !0, !this._maximizeListenerAdded && this.profiler.maximizeBtn && (this.profiler.maximizeBtn.addEventListener("click", () => {
|
|
1617
1617
|
this.maximizedByFullscreenButton = !1;
|
|
1618
1618
|
}), this._maximizeListenerAdded = !0)), this.saveLastView();
|
|
1619
|
-
}, i.appendChild(r), i.appendChild(a), i.appendChild(o), this.setupEventForwarding(r), e.domElement = r, e.wrapperElement = i, t = new
|
|
1619
|
+
}, i.appendChild(r), i.appendChild(a), i.appendChild(o), this.setupEventForwarding(r), e.domElement = r, e.wrapperElement = i, t = new G(i, n), t.itemRow.children[1].style["justify-content"] = "flex-start", this.itemLibrary.set(e.id, t);
|
|
1620
1620
|
}
|
|
1621
1621
|
return t;
|
|
1622
1622
|
}
|
|
@@ -1691,16 +1691,16 @@ var En = class extends bn {
|
|
|
1691
1691
|
getCanvasDataByNode(e, t) {
|
|
1692
1692
|
let n = this.canvasNodes.get(t);
|
|
1693
1693
|
if (n === void 0) {
|
|
1694
|
-
let r = new
|
|
1694
|
+
let r = new Me(document.createElement("canvas"));
|
|
1695
1695
|
r.setPixelRatio(window.devicePixelRatio), r.setSize(140, 140);
|
|
1696
|
-
let i = t.id, { path: a, name: o } =
|
|
1697
|
-
let t =
|
|
1696
|
+
let i = t.id, { path: a, name: o } = ln(un(t.getName() || "(unnamed)")), s = j(1), c = R(1), l = P(I(t.context({ getUV: (e) => {
|
|
1697
|
+
let t = jn(_t, e, s), n = t.xy;
|
|
1698
1698
|
return c.assign(t.z), n;
|
|
1699
1699
|
} })), 1).mul(c);
|
|
1700
|
-
l =
|
|
1701
|
-
let u = new
|
|
1700
|
+
l = ft(l, 0, e.outputColorSpace), l = l.context({ inspector: !0 });
|
|
1701
|
+
let u = new O();
|
|
1702
1702
|
u.outputNode = l;
|
|
1703
|
-
let d = new
|
|
1703
|
+
let d = new Ae(u);
|
|
1704
1704
|
d.name = "Viewer - " + o, n = {
|
|
1705
1705
|
id: i,
|
|
1706
1706
|
name: o,
|
|
@@ -1740,7 +1740,7 @@ var En = class extends bn {
|
|
|
1740
1740
|
}
|
|
1741
1741
|
let t = !1;
|
|
1742
1742
|
if (this.pendingRestoreView) {
|
|
1743
|
-
let e =
|
|
1743
|
+
let e = Ln("viewerLastView");
|
|
1744
1744
|
if (e !== "list") {
|
|
1745
1745
|
for (let n = 0; n < this.select.options.length; n++) if (this.select.options[n].textContent === e) {
|
|
1746
1746
|
this.select.selectedIndex = n;
|
|
@@ -1778,7 +1778,7 @@ var En = class extends bn {
|
|
|
1778
1778
|
let e = this.getFolder(i);
|
|
1779
1779
|
o[i] === void 0 && (o[i] = 0), (e.parent === null || n.parent !== e || e.children.indexOf(n) !== o[i]) && e.add(n), o[i]++;
|
|
1780
1780
|
} else n.parent || this.nodes.add(n);
|
|
1781
|
-
let a = [], s = r.getDrawingBufferSize(
|
|
1781
|
+
let a = [], s = r.getDrawingBufferSize(An);
|
|
1782
1782
|
e.node.traverse((e) => {
|
|
1783
1783
|
if (e.isRTTNode && e.autoResize === !0) {
|
|
1784
1784
|
let t = e.width, n = e.height;
|
|
@@ -1789,8 +1789,8 @@ var En = class extends bn {
|
|
|
1789
1789
|
});
|
|
1790
1790
|
}
|
|
1791
1791
|
});
|
|
1792
|
-
let c =
|
|
1793
|
-
t.toneMapping = 0, t.outputColorSpace = f, t.setCanvasTarget(e.canvasTarget), e.canvasAspect && (e.canvasAspect.value = e.canvasTarget.domElement.width / e.canvasTarget.domElement.height), e.quad.render(t), t.setCanvasTarget(r),
|
|
1792
|
+
let c = k.resetRendererState(t);
|
|
1793
|
+
t.toneMapping = 0, t.outputColorSpace = f, t.setCanvasTarget(e.canvasTarget), e.canvasAspect && (e.canvasAspect.value = e.canvasTarget.domElement.width / e.canvasTarget.domElement.height), e.quad.render(t), t.setCanvasTarget(r), k.restoreRendererState(t, c);
|
|
1794
1794
|
for (let e of a) e.node.width = e.oldWidth, e.node.height = e.oldHeight;
|
|
1795
1795
|
}
|
|
1796
1796
|
this.currentDataList = r;
|
|
@@ -1799,15 +1799,15 @@ var En = class extends bn {
|
|
|
1799
1799
|
super.setActive(e);
|
|
1800
1800
|
}
|
|
1801
1801
|
saveLastView() {
|
|
1802
|
-
if (this.select.value === "list")
|
|
1802
|
+
if (this.select.value === "list") Z("viewerLastView", "list");
|
|
1803
1803
|
else {
|
|
1804
1804
|
let e = this.select.options[this.select.selectedIndex];
|
|
1805
|
-
e &&
|
|
1805
|
+
e && Z("viewerLastView", e.textContent);
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
|
-
},
|
|
1808
|
+
}, Nn = 500, Pn = 60, Fn = class extends sn {
|
|
1809
1809
|
constructor(e = {}) {
|
|
1810
|
-
super("Timeline", e), this.content.style.overflow = "hidden", this.isRecording = !1, this.frames = [], this.baseTriangles = 0, this.currentFrame = null, this.isHierarchicalView = !0, this.callBlocks = /* @__PURE__ */ new WeakMap(), this.fallbackBlocks = [], this.originalBackend = null, this.originalMethods = /* @__PURE__ */ new Map(), this.renderer = null, this.graph = new
|
|
1810
|
+
super("Timeline", e), this.content.style.overflow = "hidden", this.isRecording = !1, this.frames = [], this.baseTriangles = 0, this.currentFrame = null, this.isHierarchicalView = !0, this.callBlocks = /* @__PURE__ */ new WeakMap(), this.fallbackBlocks = [], this.originalBackend = null, this.originalMethods = /* @__PURE__ */ new Map(), this.renderer = null, this.graph = new an(Nn), this.graph.addLine("fps", "var( --color-fps )"), this.graph.addLine("calls", "var( --color-call )"), this.graph.addLine("triangles", "var( --color-red )"), this.buildHeader(), this.buildUI(), window.addEventListener("resize", () => {
|
|
1811
1811
|
this.isActive && !this.isRecording && this.frames.length > 0 && this.renderSlider();
|
|
1812
1812
|
});
|
|
1813
1813
|
}
|
|
@@ -1830,8 +1830,8 @@ var En = class extends bn {
|
|
|
1830
1830
|
r.value = "counts", r.textContent = "Count", this.viewModeSelect.appendChild(r), this.viewModeSelect.value = this.isHierarchicalView ? "hierarchy" : "counts", this.viewModeSelect.addEventListener("change", () => {
|
|
1831
1831
|
this.isHierarchicalView = this.viewModeSelect.value === "hierarchy", this.selectedFrameIndex !== void 0 && this.selectedFrameIndex !== -1 && this.selectFrame(this.selectedFrameIndex);
|
|
1832
1832
|
}), this.recordRefreshButton = document.createElement("button"), this.recordRefreshButton.className = "console-copy-button", this.recordRefreshButton.title = "Refresh & Record", this.recordRefreshButton.innerHTML = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\"></path><path d=\"M21 3v5h-5\"></path><circle cx=\"12\" cy=\"12\" r=\"3\" fill=\"currentColor\"></circle></svg>", this.recordRefreshButton.style.padding = "0 10px", this.recordRefreshButton.style.lineHeight = "24px", this.recordRefreshButton.style.display = "flex", this.recordRefreshButton.style.alignItems = "center", this.recordRefreshButton.addEventListener("click", () => {
|
|
1833
|
-
let e =
|
|
1834
|
-
e.recording = !0,
|
|
1833
|
+
let e = Ln("timeline");
|
|
1834
|
+
e.recording = !0, Z("timeline", e), window.location.reload();
|
|
1835
1835
|
}), this.exportButton = document.createElement("button"), this.exportButton.className = "console-copy-button", this.exportButton.title = "Export", this.exportButton.innerHTML = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"></path><polyline points=\"7 10 12 15 17 10\"></polyline><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"></line></svg>", this.exportButton.style.padding = "0 10px", this.exportButton.style.lineHeight = "24px", this.exportButton.style.display = "flex", this.exportButton.style.alignItems = "center", this.exportButton.addEventListener("click", () => this.exportData());
|
|
1836
1836
|
let i = document.createElement("div");
|
|
1837
1837
|
i.className = "console-buttons-group", i.appendChild(this.recordButton), i.appendChild(this.recordRefreshButton), i.appendChild(this.exportButton), i.appendChild(t);
|
|
@@ -1913,8 +1913,8 @@ var En = class extends bn {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
setRenderer(e) {
|
|
1915
1915
|
this.renderer = e;
|
|
1916
|
-
let t =
|
|
1917
|
-
t.recording && (t.recording = !1,
|
|
1916
|
+
let t = Ln("timeline");
|
|
1917
|
+
t.recording && (t.recording = !1, Z("timeline", t), this.toggleRecording());
|
|
1918
1918
|
}
|
|
1919
1919
|
toggleRecording() {
|
|
1920
1920
|
if (!this.renderer) {
|
|
@@ -1944,7 +1944,7 @@ var En = class extends bn {
|
|
|
1944
1944
|
for (let t = 0; t < n.length; t++) n[t] *= e;
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
|
-
let t = this.baseTriangles > 0 ? e / this.baseTriangles *
|
|
1947
|
+
let t = this.baseTriangles > 0 ? e / this.baseTriangles * Pn : 0;
|
|
1948
1948
|
this.graph.addPoint("calls", this.currentFrame.calls.length), this.graph.addPoint("fps", this.currentFrame.fps), this.graph.addPoint("triangles", t), this.graph.update();
|
|
1949
1949
|
}
|
|
1950
1950
|
this.currentFrame = {
|
|
@@ -1952,7 +1952,7 @@ var En = class extends bn {
|
|
|
1952
1952
|
calls: [],
|
|
1953
1953
|
fps: 0,
|
|
1954
1954
|
triangles: 0
|
|
1955
|
-
}, this.frames.push(this.currentFrame), this.frames.length >
|
|
1955
|
+
}, this.frames.push(this.currentFrame), this.frames.length > Nn && this.frames.shift();
|
|
1956
1956
|
}
|
|
1957
1957
|
let a = {
|
|
1958
1958
|
method: n,
|
|
@@ -1981,30 +1981,30 @@ var En = class extends bn {
|
|
|
1981
1981
|
let n = t.textures, i = [], a = (e) => {
|
|
1982
1982
|
switch (e.type) {
|
|
1983
1983
|
case ee:
|
|
1984
|
-
case
|
|
1984
|
+
case ae: return "8";
|
|
1985
1985
|
case c:
|
|
1986
|
-
case
|
|
1987
|
-
case
|
|
1988
|
-
case
|
|
1986
|
+
case pe:
|
|
1987
|
+
case C:
|
|
1988
|
+
case me:
|
|
1989
1989
|
case y: return "16";
|
|
1990
1990
|
case m:
|
|
1991
|
-
case
|
|
1991
|
+
case ue:
|
|
1992
1992
|
case b:
|
|
1993
|
-
case
|
|
1993
|
+
case te:
|
|
1994
1994
|
case v:
|
|
1995
|
-
case
|
|
1995
|
+
case x: return "32";
|
|
1996
1996
|
default: return "?";
|
|
1997
1997
|
}
|
|
1998
1998
|
}, u = (t) => {
|
|
1999
1999
|
switch (t.format) {
|
|
2000
|
-
case
|
|
2001
|
-
case
|
|
2000
|
+
case le: return "a";
|
|
2001
|
+
case re:
|
|
2002
2002
|
case e: return "r";
|
|
2003
2003
|
case r:
|
|
2004
|
-
case
|
|
2005
|
-
case
|
|
2006
|
-
case
|
|
2007
|
-
case
|
|
2004
|
+
case fe: return "rg";
|
|
2005
|
+
case oe:
|
|
2006
|
+
case S: return "rgb";
|
|
2007
|
+
case se: return "depth";
|
|
2008
2008
|
case s: return "depth-stencil";
|
|
2009
2009
|
case o:
|
|
2010
2010
|
case l:
|
|
@@ -2218,7 +2218,7 @@ var En = class extends bn {
|
|
|
2218
2218
|
r > t && (t = r);
|
|
2219
2219
|
}
|
|
2220
2220
|
for (let n = 0; n < e.length; n++) {
|
|
2221
|
-
let r = e[n].triangles || 0, i = t > 0 ? r / t *
|
|
2221
|
+
let r = e[n].triangles || 0, i = t > 0 ? r / t * Pn : 0;
|
|
2222
2222
|
this.graph.addPoint("calls", e[n].calls.length), this.graph.addPoint("fps", e[n].fps || 0), this.graph.addPoint("triangles", i);
|
|
2223
2223
|
}
|
|
2224
2224
|
this.graph.update(), this.playhead.style.display = "block";
|
|
@@ -2287,7 +2287,7 @@ var En = class extends bn {
|
|
|
2287
2287
|
if (f.textContent = o.method, u.titleSpan.appendChild(f), o.details) {
|
|
2288
2288
|
let e = `### ${o.method}\n`;
|
|
2289
2289
|
for (let t in o.details) o.details[t] !== void 0 && (e += `**${t}**: ${o.details[t]}\n`);
|
|
2290
|
-
let t =
|
|
2290
|
+
let t = dn(u.titleSpan, e);
|
|
2291
2291
|
t.style.flexShrink = "0", t.style.marginLeft = "6px", t.style.display = "inline-flex", t.style.verticalAlign = "middle";
|
|
2292
2292
|
}
|
|
2293
2293
|
let p = document.createElement("span"), m = o.formatedDetails ? o.formatedDetails : "";
|
|
@@ -2326,27 +2326,27 @@ var En = class extends bn {
|
|
|
2326
2326
|
getColorForMethod(e) {
|
|
2327
2327
|
return e.startsWith("begin") ? "var(--color-green)" : e.startsWith("finish") || e.startsWith("destroy") ? "var(--color-red)" : e.startsWith("draw") || e.startsWith("compute") || e.startsWith("create") || e.startsWith("generate") ? "var(--color-yellow)" : "var(--text-secondary)";
|
|
2328
2328
|
}
|
|
2329
|
-
},
|
|
2329
|
+
}, In = class extends nn {
|
|
2330
2330
|
constructor() {
|
|
2331
2331
|
super();
|
|
2332
|
-
let e = new
|
|
2332
|
+
let e = new on(this);
|
|
2333
2333
|
e.addEventListener("resize", (e) => this.dispatchEvent(e));
|
|
2334
|
-
let t = new
|
|
2334
|
+
let t = new Cn({
|
|
2335
2335
|
builtin: !0,
|
|
2336
2336
|
icon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\" /><path d=\"M4 6l8 0\" /><path d=\"M16 6l4 0\" /><path d=\"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\" /><path d=\"M4 12l2 0\" /><path d=\"M10 12l10 0\" /><path d=\"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\" /><path d=\"M4 18l11 0\" /><path d=\"M19 18l1 0\" /></svg>"
|
|
2337
2337
|
});
|
|
2338
2338
|
t.hide(), e.addTab(t);
|
|
2339
|
-
let n = new
|
|
2339
|
+
let n = new Mn();
|
|
2340
2340
|
n.hide(), e.addTab(n);
|
|
2341
|
-
let r = new
|
|
2341
|
+
let r = new fn();
|
|
2342
2342
|
e.addTab(r);
|
|
2343
|
-
let i = new
|
|
2343
|
+
let i = new pn();
|
|
2344
2344
|
e.addTab(i);
|
|
2345
|
-
let a = new
|
|
2345
|
+
let a = new Fn();
|
|
2346
2346
|
e.addTab(a);
|
|
2347
|
-
let o = new
|
|
2347
|
+
let o = new mn();
|
|
2348
2348
|
e.addTab(o);
|
|
2349
|
-
let s = new
|
|
2349
|
+
let s = new kn();
|
|
2350
2350
|
e.addTab(s), e.loadLayout(), e.activeTabId || e.setActiveTab(r.id), this.statsData = /* @__PURE__ */ new Map(), this.profiler = e, this.performance = r, this.memory = i, this.console = o, this.parameters = t, this.viewer = n, this.timeline = a, this.settings = s, this.once = {}, this.extensionsData = /* @__PURE__ */ new WeakMap(), this.displayCycle = {
|
|
2351
2351
|
text: {
|
|
2352
2352
|
needsUpdate: !1,
|
|
@@ -2473,48 +2473,48 @@ var En = class extends bn {
|
|
|
2473
2473
|
let n = this.getStatsData(t.cid);
|
|
2474
2474
|
e.cpu += n.cpu, e.gpu += n.gpu, e.total += n.total;
|
|
2475
2475
|
}
|
|
2476
|
-
e.deltaTime = t.startTime - e.startTime, e.miscellaneous = e.deltaTime - e.total, e.miscellaneous < 0 && (e.miscellaneous = 0), this.updateCycle(this.displayCycle.text), this.updateCycle(this.displayCycle.graph), this.updateCycle(this.displayCycle.toggleGraph), this.displayCycle.text.needsUpdate && (
|
|
2476
|
+
e.deltaTime = t.startTime - e.startTime, e.miscellaneous = e.deltaTime - e.total, e.miscellaneous < 0 && (e.miscellaneous = 0), this.updateCycle(this.displayCycle.text), this.updateCycle(this.displayCycle.graph), this.updateCycle(this.displayCycle.toggleGraph), this.displayCycle.text.needsUpdate && (q(this.profiler.toggleButton.querySelector(".fps-counter"), this.fps.toFixed()), this.performance.updateText(this, e), this.memory.updateText(this)), this.displayCycle.toggleGraph.needsUpdate && this.profiler.toggleGraph && (this.profiler.toggleGraph.addPoint("fps", this.fps), this.profiler.toggleGraph.update()), this.displayCycle.graph.needsUpdate && (this.performance.updateGraph(this, e), this.memory.updateGraph(this)), this.displayCycle.text.needsUpdate = !1, this.displayCycle.graph.needsUpdate = !1, this.displayCycle.toggleGraph.needsUpdate = !1;
|
|
2477
2477
|
}
|
|
2478
2478
|
}
|
|
2479
2479
|
updateCycle(e) {
|
|
2480
2480
|
e.time += this.nodeFrame.deltaTime, e.time >= e.duration && (e.needsUpdate = !0, e.time = 0);
|
|
2481
2481
|
}
|
|
2482
2482
|
};
|
|
2483
|
-
function
|
|
2483
|
+
function Ln(e) {
|
|
2484
2484
|
let t = JSON.parse(localStorage.getItem("threejs-inspector") || "{}");
|
|
2485
2485
|
return t.version !== "185" || t.settings && t.settings.storage === "url" && t.settings.url !== location.href ? (localStorage.removeItem("threejs-inspector"), {}) : t[e] || {};
|
|
2486
2486
|
}
|
|
2487
|
-
function
|
|
2487
|
+
function Z(e, t) {
|
|
2488
2488
|
let n = JSON.parse(localStorage.getItem("threejs-inspector") || "{}");
|
|
2489
2489
|
t === null ? delete n[e] : n[e] = t, n.settings = n.settings || {}, n.settings.url = n.settings.url || location.href, n.settings.storage = n.settings.storage || "url", n.version = "185", localStorage.setItem("threejs-inspector", JSON.stringify(n));
|
|
2490
2490
|
}
|
|
2491
2491
|
//#endregion
|
|
2492
2492
|
//#region ../../node_modules/three/examples/jsm/tsl/display/SSGINode.js
|
|
2493
|
-
var
|
|
2493
|
+
var Rn = /* @__PURE__ */ new Ae(), zn = /* @__PURE__ */ new p(), Bn = [
|
|
2494
2494
|
60,
|
|
2495
2495
|
300,
|
|
2496
2496
|
180,
|
|
2497
2497
|
240,
|
|
2498
2498
|
120,
|
|
2499
2499
|
0
|
|
2500
|
-
],
|
|
2500
|
+
], Vn = [
|
|
2501
2501
|
0,
|
|
2502
2502
|
.5,
|
|
2503
2503
|
.25,
|
|
2504
2504
|
.75
|
|
2505
|
-
],
|
|
2505
|
+
], Hn, Un = class extends we {
|
|
2506
2506
|
static get type() {
|
|
2507
2507
|
return "SSGINode";
|
|
2508
2508
|
}
|
|
2509
2509
|
constructor(e, t, n, r) {
|
|
2510
|
-
super("vec4"), this.beautyNode = e, this.depthNode = t, this.normalNode = n, this.updateBeforeType =
|
|
2510
|
+
super("vec4"), this.beautyNode = e, this.depthNode = t, this.normalNode = n, this.updateBeforeType = At.FRAME, this.sliceCount = j(1, "uint"), this.stepCount = j(12, "uint"), this.aoIntensity = j(1, "float"), this.giIntensity = j(10, "float"), this.radius = j(12, "float"), this.useScreenSpaceSampling = j(!0, "bool"), this.expFactor = j(2, "float"), this.thickness = j(1, "float"), this.useLinearThickness = j(!1, "bool"), this.backfaceLighting = j(0, "float"), this.useTemporalFiltering = !0, this._resolution = j(new p()), this._halfProjScale = j(1), this._temporalDirection = j(0), this._temporalOffset = j(0), this._cameraProjectionMatrix = j(r.projectionMatrix), this._cameraProjectionMatrixInverse = j(r.projectionMatrixInverse), this._cameraNear = jt("near", "float", r), this._cameraFar = jt("far", "float", r), this._camera = r, this._ssgiRenderTarget = new w(1, 1, {
|
|
2511
2511
|
depthBuffer: !1,
|
|
2512
2512
|
count: 2
|
|
2513
2513
|
});
|
|
2514
2514
|
let i = this._ssgiRenderTarget.textures[0];
|
|
2515
|
-
i.name = "SSGI.AO", i.type =
|
|
2515
|
+
i.name = "SSGI.AO", i.type = ae, i.format = re;
|
|
2516
2516
|
let a = this._ssgiRenderTarget.textures[1];
|
|
2517
|
-
a.name = "SSGI.GI", a.type =
|
|
2517
|
+
a.name = "SSGI.GI", a.type = x, a.format = oe, this._material = new O(), this._material.name = "SSGI", this._aoNode = Xe(this, this._ssgiRenderTarget.textures[0]), this._giNode = Xe(this, this._ssgiRenderTarget.textures[1]);
|
|
2518
2518
|
}
|
|
2519
2519
|
getAONode() {
|
|
2520
2520
|
return this._aoNode;
|
|
@@ -2523,25 +2523,25 @@ var In = /* @__PURE__ */ new Oe(), Ln = /* @__PURE__ */ new p(), Rn = [
|
|
|
2523
2523
|
return this._giNode;
|
|
2524
2524
|
}
|
|
2525
2525
|
setSize(e, t) {
|
|
2526
|
-
this._resolution.value.set(e, t), this._ssgiRenderTarget.setSize(e, t), this._halfProjScale.value = t / (Math.tan(this._camera.fov *
|
|
2526
|
+
this._resolution.value.set(e, t), this._ssgiRenderTarget.setSize(e, t), this._halfProjScale.value = t / (Math.tan(this._camera.fov * ne.DEG2RAD * .5) * 2) * .5;
|
|
2527
2527
|
}
|
|
2528
2528
|
updateBefore(e) {
|
|
2529
2529
|
let { renderer: t } = e;
|
|
2530
|
-
|
|
2531
|
-
let n = t.getDrawingBufferSize(
|
|
2530
|
+
Hn = k.resetRendererState(t, Hn);
|
|
2531
|
+
let n = t.getDrawingBufferSize(zn);
|
|
2532
2532
|
if (this.setSize(n.width, n.height), this.useTemporalFiltering === !0) {
|
|
2533
2533
|
let t = e.frameId;
|
|
2534
|
-
this._temporalDirection.value =
|
|
2534
|
+
this._temporalDirection.value = Bn[t % 6] / 360, this._temporalOffset.value = Vn[t % 4];
|
|
2535
2535
|
} else this._temporalDirection.value = 1, this._temporalOffset.value = 1;
|
|
2536
|
-
|
|
2536
|
+
Rn.material = this._material, Rn.name = "SSGI", t.setClearColor(16777215, 1), t.setRenderTarget(this._ssgiRenderTarget), Rn.render(t), k.restoreRendererState(t, Hn);
|
|
2537
2537
|
}
|
|
2538
2538
|
setup(e) {
|
|
2539
2539
|
let t = e.renderer;
|
|
2540
2540
|
t.backend.isWebGPUBackend === !0 && t.hasFeature("rg11b10ufloat-renderable") === !1 && console.error("THREE.SSGINode: The device does not support the \"rg11b10ufloat-renderable\" feature which is required for SSGI.");
|
|
2541
|
-
let n =
|
|
2541
|
+
let n = Ct(), r = M(32), i = M(0), a = (t) => {
|
|
2542
2542
|
let n = this.depthNode.sample(t).r;
|
|
2543
|
-
return e.renderer.logarithmicDepthBuffer === !0 ?
|
|
2544
|
-
}, o = (e) => this.normalNode === null ?
|
|
2543
|
+
return e.renderer.logarithmicDepthBuffer === !0 ? Ze(Ye(n, this._cameraNear, this._cameraFar), this._cameraNear, this._cameraFar) : n;
|
|
2544
|
+
}, o = (e) => this.normalNode === null ? qe(e, this.depthNode.value, this._cameraProjectionMatrixInverse) : this.normalNode.sample(e).rgb.normalize(), s = (e) => this.beautyNode.sample(e), c = V(([e]) => R(.25).mul(Wt(e.y, e.x).bitAnd(3))).setLayout({
|
|
2545
2545
|
name: "spatialOffsets",
|
|
2546
2546
|
type: "float",
|
|
2547
2547
|
inputs: [{
|
|
@@ -2549,8 +2549,8 @@ var In = /* @__PURE__ */ new Oe(), Ln = /* @__PURE__ */ new p(), Rn = [
|
|
|
2549
2549
|
type: "vec2"
|
|
2550
2550
|
}]
|
|
2551
2551
|
}), l = V(([e]) => {
|
|
2552
|
-
let t = B(e).mul(
|
|
2553
|
-
return t.mulAssign(
|
|
2552
|
+
let t = B(e).mul(R(-.156583)).add(Ft);
|
|
2553
|
+
return t.mulAssign(ot(B(e).oneMinus())), F(e.x.greaterThanEqual(0).select(t.x, dt.sub(t.x)), e.y.greaterThanEqual(0).select(t.y, dt.sub(t.y)));
|
|
2554
2554
|
}).setLayout({
|
|
2555
2555
|
name: "GTAOFastAcos",
|
|
2556
2556
|
type: "vec2",
|
|
@@ -2559,92 +2559,92 @@ var In = /* @__PURE__ */ new Oe(), Ln = /* @__PURE__ */ new p(), Rn = [
|
|
|
2559
2559
|
type: "vec2"
|
|
2560
2560
|
}]
|
|
2561
2561
|
}), u = V(([e, t, n, c, u, d, f, p, m, h]) => {
|
|
2562
|
-
let g = this.stepCount.toConst(), _ = this.expFactor.toConst(), v = this.thickness.toConst(), y = this.backfaceLighting.toConst(), b = e.select(
|
|
2563
|
-
return
|
|
2564
|
-
start:
|
|
2562
|
+
let g = this.stepCount.toConst(), _ = this.expFactor.toConst(), v = this.thickness.toConst(), y = this.backfaceLighting.toConst(), b = e.select(F(1, -1), F(-1, 1)), ee = e.select(1, -1), te = I(0);
|
|
2563
|
+
return st({
|
|
2564
|
+
start: M(0),
|
|
2565
2565
|
end: g,
|
|
2566
2566
|
type: "uint",
|
|
2567
2567
|
condition: "<"
|
|
2568
2568
|
}, ({ i: g }) => {
|
|
2569
|
-
let
|
|
2570
|
-
z(
|
|
2571
|
-
|
|
2569
|
+
let x = kt(B($e(t, R(g).add(d)).div(n)), _).mul(n).toConst(), S = u.mul(H(x, R(g).add(1))).toConst(), C = f.add(S.mul(b)).toConst();
|
|
2570
|
+
z(C.x.lessThanEqual(0).or(C.y.lessThanEqual(0)).or(C.x.greaterThanEqual(1)).or(C.y.greaterThanEqual(1)), () => {
|
|
2571
|
+
Lt();
|
|
2572
2572
|
});
|
|
2573
|
-
let
|
|
2574
|
-
|
|
2575
|
-
let
|
|
2576
|
-
|
|
2577
|
-
let
|
|
2578
|
-
z(
|
|
2579
|
-
let e = s(
|
|
2580
|
-
z(
|
|
2581
|
-
let t =
|
|
2573
|
+
let ne = wt(C, a(C), this._cameraProjectionMatrixInverse).toConst(), w = ne.sub(c).normalize().toConst(), re = this.useLinearThickness.select(ne.z.negate().div(this._cameraFar).clamp().mul(100), R(1)), ie = Ue(ne.sub(re.mul(p).mul(v)).sub(c)), T = F(A(w, p), A(ie, p));
|
|
2574
|
+
T = l(Dt(T, -1, 1)), T = Dt(Qe($e(ee, T.negate()).sub(h.sub(Ft)), dt)), T = e.select(T.yx, T.xy);
|
|
2575
|
+
let ae = T.x.toConst(), oe = T.y.toConst(), se = M(T.mul(R(r))).toConst(), ce = M(Mt(oe.sub(ae).mul(R(r)))).toConst(), E = ce.greaterThan(M(0)).select(M(Nt(M(4294967295), M(32).sub(r).add(r.sub(ce)))), M(0)).toConst().shiftLeft(se);
|
|
2576
|
+
E = E.bitAnd(i.bitNot()), i.assign(i.bitOr(E));
|
|
2577
|
+
let le = Bt(E);
|
|
2578
|
+
z(le.greaterThan(0), () => {
|
|
2579
|
+
let e = s(C);
|
|
2580
|
+
z(N(e).greaterThan(.001), () => {
|
|
2581
|
+
let t = Ue(w), n = Dt(A(m, t));
|
|
2582
2582
|
z(n.greaterThan(.001), () => {
|
|
2583
|
-
let i = o(
|
|
2584
|
-
a = y.greaterThan(0).and(
|
|
2583
|
+
let i = o(C), a = A(i, t.negate()), s = Ot(a).lessThan(0).select(B(a).mul(y), B(a));
|
|
2584
|
+
a = y.greaterThan(0).and(A(i, p).greaterThan(0)).select(s, Dt(a)), te.rgb.addAssign(R(le).div(R(r)).mul(e).mul(n).mul(a));
|
|
2585
2585
|
});
|
|
2586
2586
|
});
|
|
2587
2587
|
});
|
|
2588
|
-
}),
|
|
2589
|
-
}), d =
|
|
2588
|
+
}), te;
|
|
2589
|
+
}), d = xt("float"), f = xt("vec3"), p = rt(d, f), m = V(() => {
|
|
2590
2590
|
let e = a(n).toVar();
|
|
2591
2591
|
e.greaterThanEqual(1).discard();
|
|
2592
|
-
let t =
|
|
2592
|
+
let t = wt(n, e, this._cameraProjectionMatrixInverse).toVar(), s = o(n).toVar(), l = Ue(t.xyz.negate()).toVar(), p = c(mt), m = Ge(mt), h = this._temporalDirection.mul(.02), g = Ie(p.add(this._temporalOffset)).add(ct(n.add(h).mul(2).sub(1))), _ = R(0), v = I(0), y = this.sliceCount.toConst(), b = this.stepCount.toConst(), ee = this.aoIntensity.toConst(), te = this.giIntensity.toConst(), x = this.radius.toConst(), S = R(0).toVar();
|
|
2593
2593
|
z(this.useScreenSpaceSampling, () => {
|
|
2594
|
-
|
|
2594
|
+
S.assign(x.mul(this._resolution.x.div(2)).div(R(16)));
|
|
2595
2595
|
}).Else(() => {
|
|
2596
|
-
|
|
2597
|
-
}),
|
|
2598
|
-
let
|
|
2599
|
-
|
|
2600
|
-
start:
|
|
2596
|
+
S.assign(H(x.mul(this._halfProjScale).div(t.z.negate()), R(b)));
|
|
2597
|
+
}), S.divAssign(R(b).add(1));
|
|
2598
|
+
let C = H(1, R(b.sub(1))).mul(S).toConst();
|
|
2599
|
+
st({
|
|
2600
|
+
start: M(0),
|
|
2601
2601
|
end: y,
|
|
2602
2602
|
type: "uint",
|
|
2603
2603
|
condition: "<"
|
|
2604
2604
|
}, ({ i: e }) => {
|
|
2605
|
-
let a =
|
|
2606
|
-
i.assign(0), v.addAssign(u(
|
|
2607
|
-
}), _.divAssign(
|
|
2608
|
-
let
|
|
2609
|
-
return v.mulAssign(
|
|
2605
|
+
let a = $e(R(e).add(m).add(this._temporalDirection), dt.div(R(y))).toConst(), o = I(F(at(a), bt(a)), 0).toConst(), c = o.xy.mul(R(1).div(this._resolution)).toConst(), d = Ue(Gt(o, l)).toConst(), f = Gt(l, d).toConst(), p = s.sub(d.mul(A(s, d))).toConst(), h = Dt(A(Ue(p).toConst(), l), -1, 1).toConst(), b = Ot(A(p, f)).negate().mul(zt(h)).toConst();
|
|
2606
|
+
i.assign(0), v.addAssign(u(gt(!0), S, C, t, c, g, n, l, s, b)), v.addAssign(u(gt(!1), S, C, t, c, g, n, l, s, b)), _.addAssign(R(Bt(i)).div(R(r)));
|
|
2607
|
+
}), _.divAssign(R(y)), _.assign(kt(_.clamp().oneMinus(), ee).clamp()), v.divAssign(R(y)), v.mulAssign(te);
|
|
2608
|
+
let ne = R(7).toConst(), w = N(v), re = w.greaterThan(ne).select(ne.div(w), R(1));
|
|
2609
|
+
return v.mulAssign(re), d.assign(_), f.assign(v), P(0);
|
|
2610
2610
|
});
|
|
2611
2611
|
return this._material.colorNode = m().context(e.getSharedContext()), this._material.outputNode = p, this._material.needsUpdate = !0, this._aoNode;
|
|
2612
2612
|
}
|
|
2613
2613
|
dispose() {
|
|
2614
2614
|
this._ssgiRenderTarget.dispose(), this._material.dispose();
|
|
2615
2615
|
}
|
|
2616
|
-
},
|
|
2616
|
+
}, Wn = (e, t, n, r) => new Un(vt(e), t, n, r), Gn = class extends we {
|
|
2617
2617
|
static get type() {
|
|
2618
2618
|
return "DenoiseNode";
|
|
2619
2619
|
}
|
|
2620
2620
|
constructor(e, t, n, r) {
|
|
2621
|
-
super("vec4"), this.textureNode = e, this.depthNode = t, this.normalNode = n, this.noiseNode =
|
|
2621
|
+
super("vec4"), this.textureNode = e, this.depthNode = t, this.normalNode = n, this.noiseNode = L(qn()), this.lumaPhi = j(5), this.depthPhi = j(5), this.normalPhi = j(5), this.radius = j(5), this.index = j(0), this.updateBeforeType = At.FRAME, this._resolution = j(new p()), this._sampleVectors = Je(Kn(16, 2, 1)), this._cameraProjectionMatrixInverse = j(r.projectionMatrixInverse);
|
|
2622
2622
|
}
|
|
2623
2623
|
updateBefore() {
|
|
2624
2624
|
let e = this.textureNode.value;
|
|
2625
2625
|
this._resolution.value.set(e.image.width, e.image.height);
|
|
2626
2626
|
}
|
|
2627
2627
|
setup() {
|
|
2628
|
-
let e =
|
|
2629
|
-
let s = t(o).toVar(), c = n(o).toVar(), l = r(o).toVar(), u = s.rgb, d =
|
|
2628
|
+
let e = Ct(), t = (e) => this.textureNode.sample(e), n = (e) => this.depthNode.sample(e).x, r = (e) => this.normalNode === null ? qe(e, this.depthNode.value, this._cameraProjectionMatrixInverse) : this.normalNode.sample(e).rgb.normalize(), i = (e) => this.noiseNode.sample(e), a = V(([e, i, a, o]) => {
|
|
2629
|
+
let s = t(o).toVar(), c = n(o).toVar(), l = r(o).toVar(), u = s.rgb, d = wt(o, c, this._cameraProjectionMatrixInverse).toVar(), f = kt(H(A(i, l).toVar(), 0), this.normalPhi).toVar(), p = B(N(u).sub(N(e))).toVar(), m = H(R(1).sub(p.div(this.lumaPhi)), 0).toVar(), h = B(A(a.sub(d), i)).toVar(), g = H(R(1).sub(h.div(this.depthPhi)), 0), _ = m.mul(g).mul(f);
|
|
2630
2630
|
return P(u.mul(_), _);
|
|
2631
2631
|
}), o = V(([e]) => {
|
|
2632
|
-
let o = n(e).toVar(), s = r(e).toVar(), c = t(e).toVar(), l =
|
|
2633
|
-
return z(o.greaterThanEqual(1).or(
|
|
2632
|
+
let o = n(e).toVar(), s = r(e).toVar(), c = t(e).toVar(), l = xt("vec4");
|
|
2633
|
+
return z(o.greaterThanEqual(1).or(A(s, s).equal(0)), () => {
|
|
2634
2634
|
l.assign(c);
|
|
2635
2635
|
}).Else(() => {
|
|
2636
|
-
let t =
|
|
2636
|
+
let t = I(c.rgb), n = wt(e, o, this._cameraProjectionMatrixInverse).toConst(), r = Fe(this.noiseNode, 0), u = F(e.x, e.y.oneMinus());
|
|
2637
2637
|
u = u.mul(this._resolution.div(r));
|
|
2638
|
-
let d = i(u).toVar(), f =
|
|
2639
|
-
|
|
2640
|
-
start:
|
|
2641
|
-
end:
|
|
2638
|
+
let d = i(u).toVar(), f = F(bt(d.element(this.index.mod(4).mul(2).mul(dt))), at(d.element(this.index.mod(4).mul(2).mul(dt)))), p = Be(f.x, f.y.negate(), f.x, f.y), m = R(1).toVar(), h = I(c.rgb).toVar();
|
|
2639
|
+
st({
|
|
2640
|
+
start: St(0),
|
|
2641
|
+
end: St(16),
|
|
2642
2642
|
type: "int",
|
|
2643
2643
|
condition: "<"
|
|
2644
2644
|
}, ({ i: r }) => {
|
|
2645
|
-
let i = this._sampleVectors.element(r), o = p.mul(i.xy.mul(
|
|
2645
|
+
let i = this._sampleVectors.element(r), o = p.mul(i.xy.mul(R(1).add(i.z.mul(this.radius.sub(1))))).div(this._resolution), c = a(t, s, n, e.add(o));
|
|
2646
2646
|
h.addAssign(c.xyz), m.addAssign(c.w);
|
|
2647
|
-
}), z(m.greaterThan(
|
|
2647
|
+
}), z(m.greaterThan(R(0)), () => {
|
|
2648
2648
|
h.divAssign(m);
|
|
2649
2649
|
}), l.assign(P(h, c.a));
|
|
2650
2650
|
}), l;
|
|
@@ -2652,7 +2652,7 @@ var In = /* @__PURE__ */ new Oe(), Ln = /* @__PURE__ */ new p(), Rn = [
|
|
|
2652
2652
|
return V(() => o(e))();
|
|
2653
2653
|
}
|
|
2654
2654
|
};
|
|
2655
|
-
function
|
|
2655
|
+
function Kn(e, t, r) {
|
|
2656
2656
|
let i = [];
|
|
2657
2657
|
for (let a = 0; a < e; a++) {
|
|
2658
2658
|
let o = 2 * Math.PI * t * a / e, s = (a / (e - 1)) ** r;
|
|
@@ -2660,8 +2660,8 @@ function Wn(e, t, r) {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
return i;
|
|
2662
2662
|
}
|
|
2663
|
-
function
|
|
2664
|
-
let t = new
|
|
2663
|
+
function qn(e = 64) {
|
|
2664
|
+
let t = new he(), n = e * e * 4, r = new Uint8Array(n);
|
|
2665
2665
|
for (let n = 0; n < e; n++) for (let i = 0; i < e; i++) {
|
|
2666
2666
|
let a = n, o = i;
|
|
2667
2667
|
r[(n * e + i) * 4] = (t.noise(a, o) * .5 + .5) * 255, r[(n * e + i) * 4 + 1] = (t.noise(a + e, o) * .5 + .5) * 255, r[(n * e + i) * 4 + 2] = (t.noise(a, o + e) * .5 + .5) * 255, r[(n * e + i) * 4 + 3] = (t.noise(a + e, o + e) * .5 + .5) * 255;
|
|
@@ -2669,7 +2669,7 @@ function Gn(e = 64) {
|
|
|
2669
2669
|
let i = new g(r, e, e);
|
|
2670
2670
|
return i.wrapS = u, i.wrapT = u, i.needsUpdate = !0, i;
|
|
2671
2671
|
}
|
|
2672
|
-
var
|
|
2672
|
+
var Jn = (e, t, n, r) => new Gn(vt(e), tt(t), tt(n), r), Yn = class e extends Zt {
|
|
2673
2673
|
static {
|
|
2674
2674
|
this.passId = "SsgiRenderPass";
|
|
2675
2675
|
}
|
|
@@ -2685,28 +2685,28 @@ var Kn = (e, t, n, r) => new Un(yt(e), tt(t), tt(n), r), qn = class e extends Jt
|
|
|
2685
2685
|
}
|
|
2686
2686
|
assemble(e, t, n, r, i) {
|
|
2687
2687
|
if (!(r instanceof d) || this.sliceCount.value === 0 || this.stepCount.value === 0) return t;
|
|
2688
|
-
let a = e.getTextureNode("output"), o = e.getTextureNode("diffuseColor"), s = e.getTextureNode("depth"), c = e.getTextureNode("normal"), l =
|
|
2688
|
+
let a = e.getTextureNode("output"), o = e.getTextureNode("diffuseColor"), s = e.getTextureNode("depth"), c = e.getTextureNode("normal"), l = Et((e) => Tt(c.sample(e))), u = Wn(a, s, l, r);
|
|
2689
2689
|
u.sliceCount = this.sliceCount, u.stepCount = this.stepCount, u.radius = this.radius, u.expFactor = this.expFactor, u.thickness = this.thickness, u.backfaceLighting = this.backfaceLighting, u.aoIntensity = this.aoIntensity, u.giIntensity = this.giIntensity, u.useLinearThickness = this.useLinearThickness, u.useScreenSpaceSampling = this.useScreenSpaceSampling, u.useTemporalFiltering = this.useTemporalFiltering;
|
|
2690
|
-
let f = u.getGINode(), p = u.getAONode(), m =
|
|
2690
|
+
let f = u.getGINode(), p = u.getAONode(), m = Jn(f, s, l, r);
|
|
2691
2691
|
m.radius = this.giDenoiseRadius;
|
|
2692
|
-
let h =
|
|
2692
|
+
let h = Jn(p, s, l, r);
|
|
2693
2693
|
h.radius = this.aoDenoiseRadius;
|
|
2694
|
-
let g = P(
|
|
2695
|
-
return g.name = "Ssgi Composite", i === "ao only" ? P(
|
|
2694
|
+
let g = P(pt(a.rgb.mul(h.r), o.rgb.mul(m.rgb)), a.a);
|
|
2695
|
+
return g.name = "Ssgi Composite", i === "ao only" ? P(I(p.r), 1) : i === "gi only" ? P(f.rgb, 1) : i === "denoised ao only" ? P(I(h.r), 1) : i === "denoised gi only" ? P(m.rgb, 1) : i === "direct lighting only" ? a : i === "without denoise" ? P(pt(a.rgb.mul(p.r), o.rgb.mul(f.rgb)), a.a) : g;
|
|
2696
2696
|
}
|
|
2697
|
-
},
|
|
2697
|
+
}, Xn = /* @__PURE__ */ new Ae(), Zn = /* @__PURE__ */ new p(), Qn, $n = class extends we {
|
|
2698
2698
|
static get type() {
|
|
2699
2699
|
return "TRAANode";
|
|
2700
2700
|
}
|
|
2701
2701
|
constructor(e, t, n, r) {
|
|
2702
|
-
super("vec4"), this.isTRAANode = !0, this.updateBeforeType =
|
|
2702
|
+
super("vec4"), this.isTRAANode = !0, this.updateBeforeType = Ee.FRAME, this.beautyNode = e, this.depthNode = t, this.velocityNode = n, this.camera = r, this.depthThreshold = 5e-4, this.edgeDepthDiff = .001, this.maxVelocityLength = 128, this.useSubpixelCorrection = !0, this._jitterIndex = 0, this._invSize = j(new p()), this._historyRenderTarget = new w(1, 1, {
|
|
2703
2703
|
depthBuffer: !1,
|
|
2704
|
-
type:
|
|
2704
|
+
type: C,
|
|
2705
2705
|
depthTexture: new _()
|
|
2706
|
-
}), this._historyRenderTarget.texture.name = "TRAANode.history", this._resolveRenderTarget = new
|
|
2706
|
+
}), this._historyRenderTarget.texture.name = "TRAANode.history", this._resolveRenderTarget = new w(1, 1, {
|
|
2707
2707
|
depthBuffer: !1,
|
|
2708
|
-
type:
|
|
2709
|
-
}), this._resolveRenderTarget.texture.name = "TRAANode.resolve", this._resolveMaterial = new
|
|
2708
|
+
type: C
|
|
2709
|
+
}), this._resolveRenderTarget.texture.name = "TRAANode.resolve", this._resolveMaterial = new O(), this._resolveMaterial.name = "TRAA.resolve", this._textureNode = Xe(this, this._resolveRenderTarget.texture), this._originalProjectionMatrix = new E(), this._cameraNearFar = j(new p()), this._cameraWorldMatrix = j(new E()), this._cameraWorldMatrixInverse = j(new E()), this._cameraProjectionMatrixInverse = j(new E()), this._previousCameraWorldMatrix = j(new E()), this._previousCameraProjectionMatrixInverse = j(new E()), this._previousDepthNode = L(new _(1, 1)), this._needsPostProcessingSync = !1, this._velocityNode = null;
|
|
2710
2710
|
}
|
|
2711
2711
|
getTextureNode() {
|
|
2712
2712
|
return this._textureNode;
|
|
@@ -2723,45 +2723,45 @@ var Kn = (e, t, n, r) => new Un(yt(e), tt(t), tt(n), r), qn = class e extends Jt
|
|
|
2723
2723
|
offsetY: 0,
|
|
2724
2724
|
width: e,
|
|
2725
2725
|
height: t
|
|
2726
|
-
}, r =
|
|
2726
|
+
}, r = tr[this._jitterIndex];
|
|
2727
2727
|
this.camera.setViewOffset(n.fullWidth, n.fullHeight, n.offsetX + r[0] - .5, n.offsetY + r[1] - .5, n.width, n.height);
|
|
2728
2728
|
}
|
|
2729
2729
|
clearViewOffset() {
|
|
2730
|
-
this.camera.clearViewOffset(), this._velocityNode.setProjectionMatrix(null), this._jitterIndex++, this._jitterIndex %=
|
|
2730
|
+
this.camera.clearViewOffset(), this._velocityNode.setProjectionMatrix(null), this._jitterIndex++, this._jitterIndex %= tr.length - 1;
|
|
2731
2731
|
}
|
|
2732
2732
|
updateBefore(e) {
|
|
2733
2733
|
let { renderer: t } = e;
|
|
2734
2734
|
this._previousCameraWorldMatrix.value.copy(this._cameraWorldMatrix.value), this._previousCameraProjectionMatrixInverse.value.copy(this._cameraProjectionMatrixInverse.value), this._cameraNearFar.value.set(this.camera.near, this.camera.far), this._cameraWorldMatrix.value.copy(this.camera.matrixWorld), this._cameraWorldMatrixInverse.value.copy(this.camera.matrixWorldInverse), this._cameraProjectionMatrixInverse.value.copy(this.camera.projectionMatrixInverse);
|
|
2735
2735
|
let n = this.beautyNode.isRTTNode ? this.beautyNode.renderTarget : this.beautyNode.passNode.renderTarget, r = n.texture.width, i = n.texture.height;
|
|
2736
|
-
this._needsPostProcessingSync === !0 && (this.setViewOffset(r, i), this._needsPostProcessingSync = !1),
|
|
2736
|
+
this._needsPostProcessingSync === !0 && (this.setViewOffset(r, i), this._needsPostProcessingSync = !1), Qn = k.resetRendererState(t, Qn);
|
|
2737
2737
|
let a = this._historyRenderTarget.width !== r || this._historyRenderTarget.height !== i;
|
|
2738
|
-
this.setSize(r, i), a === !0 && (t.initRenderTarget(this._historyRenderTarget), t.initRenderTarget(this._resolveRenderTarget), t.copyTextureToTexture(n.texture, this._historyRenderTarget.texture)), t.setRenderTarget(this._resolveRenderTarget),
|
|
2739
|
-
let o = t.getDrawingBufferSize(
|
|
2738
|
+
this.setSize(r, i), a === !0 && (t.initRenderTarget(this._historyRenderTarget), t.initRenderTarget(this._resolveRenderTarget), t.copyTextureToTexture(n.texture, this._historyRenderTarget.texture)), t.setRenderTarget(this._resolveRenderTarget), Xn.material = this._resolveMaterial, Xn.name = "TRAA", Xn.render(t), t.setRenderTarget(null), t.copyTextureToTexture(this._resolveRenderTarget.texture, this._historyRenderTarget.texture);
|
|
2739
|
+
let o = t.getDrawingBufferSize(Zn);
|
|
2740
2740
|
if (this._historyRenderTarget.height === o.height && this._historyRenderTarget.width === o.width) {
|
|
2741
2741
|
let e = this.depthNode.value;
|
|
2742
2742
|
t.copyTextureToTexture(e, this._historyRenderTarget.depthTexture), this._previousDepthNode.value = this._historyRenderTarget.depthTexture;
|
|
2743
2743
|
}
|
|
2744
|
-
|
|
2744
|
+
k.restoreRendererState(t, Qn);
|
|
2745
2745
|
}
|
|
2746
2746
|
setup(e) {
|
|
2747
2747
|
let t = e.context.renderPipeline;
|
|
2748
2748
|
t && (this._needsPostProcessingSync = !0, t.context.onBeforeRenderPipeline = () => {
|
|
2749
|
-
let t = e.renderer.getDrawingBufferSize(
|
|
2749
|
+
let t = e.renderer.getDrawingBufferSize(Zn);
|
|
2750
2750
|
this.setViewOffset(t.width, t.height);
|
|
2751
2751
|
}, t.context.onAfterRenderPipeline = () => {
|
|
2752
2752
|
this.clearViewOffset();
|
|
2753
|
-
}), e.renderer.reversedDepthBuffer === !0 && (this._historyRenderTarget.depthTexture.type = b), e.context.velocity === void 0 ? this._velocityNode =
|
|
2753
|
+
}), e.renderer.reversedDepthBuffer === !0 && (this._historyRenderTarget.depthTexture.type = b), e.context.velocity === void 0 ? this._velocityNode = Ve : this._velocityNode = e.context.velocity;
|
|
2754
2754
|
let n = (e) => {
|
|
2755
2755
|
let { x: t, y: n } = this._cameraNearFar;
|
|
2756
|
-
return
|
|
2757
|
-
}, r =
|
|
2756
|
+
return Ze(Ye(e, t, n), t, n);
|
|
2757
|
+
}, r = ut({
|
|
2758
2758
|
closestDepth: "float",
|
|
2759
2759
|
closestPositionTexel: "vec2",
|
|
2760
2760
|
farthestDepth: "float"
|
|
2761
2761
|
}), i = V(([t]) => {
|
|
2762
|
-
let i =
|
|
2762
|
+
let i = R(2).toVar(), a = F(0).toVar(), o = R(-1).toVar();
|
|
2763
2763
|
for (let r = -1; r <= 1; ++r) for (let s = -1; s <= 1; ++s) {
|
|
2764
|
-
let c = t.add(
|
|
2764
|
+
let c = t.add(F(r, s)).toVar(), l = this.depthNode.load(c).r;
|
|
2765
2765
|
e.renderer.reversedDepthBuffer && (l = l.oneMinus()), e.renderer.logarithmicDepthBuffer && (l = n(l)), l = l.toVar(), z(l.lessThan(i), () => {
|
|
2766
2766
|
i.assign(l), a.assign(c);
|
|
2767
2767
|
}), z(l.greaterThan(o), () => {
|
|
@@ -2772,10 +2772,10 @@ var Kn = (e, t, n, r) => new Un(yt(e), tt(t), tt(n), r), qn = class e extends Jt
|
|
|
2772
2772
|
}), a = (t) => {
|
|
2773
2773
|
let r = this._previousDepthNode.sample(t).r;
|
|
2774
2774
|
e.renderer.logarithmicDepthBuffer && (r = n(r));
|
|
2775
|
-
let i =
|
|
2776
|
-
return this.camera.isOrthographicCamera ?
|
|
2775
|
+
let i = wt(t, r, this._previousCameraProjectionMatrixInverse), a = this._previousCameraWorldMatrix.mul(P(i, 1)).xyz, o = this._cameraWorldMatrixInverse.mul(P(a, 1)).z;
|
|
2776
|
+
return this.camera.isOrthographicCamera ? We(o, this._cameraNearFar.x, this._cameraNearFar.y) : Ze(o, this._cameraNearFar.x, this._cameraNearFar.y);
|
|
2777
2777
|
}, o = V(([e, t, n, r]) => {
|
|
2778
|
-
let i = r.rgb.add(n.rgb).mul(.5), a = r.rgb.sub(n.rgb).mul(.5).add(1e-7), o = t.sub(P(i, e.a)), s = o.xyz.div(a).abs(), c =
|
|
2778
|
+
let i = r.rgb.add(n.rgb).mul(.5), a = r.rgb.sub(n.rgb).mul(.5).add(1e-7), o = t.sub(P(i, e.a)), s = o.xyz.div(a).abs(), c = H(s.x, s.y, s.z);
|
|
2779
2779
|
return c.greaterThan(1).select(P(i, e.a).add(o.div(c)), t);
|
|
2780
2780
|
}).setLayout({
|
|
2781
2781
|
name: "clipAABB",
|
|
@@ -2810,13 +2810,13 @@ var Kn = (e, t, n, r) => new Un(yt(e), tt(t), tt(n), r), qn = class e extends Jt
|
|
|
2810
2810
|
[-1, 0]
|
|
2811
2811
|
], a = t.toVar(), s = t.pow2().toVar();
|
|
2812
2812
|
for (let [t, n] of i) {
|
|
2813
|
-
let r = this.beautyNode.offset(
|
|
2813
|
+
let r = this.beautyNode.offset(Ke(t, n)).load(e).max(0);
|
|
2814
2814
|
a.addAssign(r), s.addAssign(r.pow2());
|
|
2815
2815
|
}
|
|
2816
|
-
let c =
|
|
2816
|
+
let c = R(i.length + 1), l = a.div(c), u = s.div(c).sub(l.pow2()).max(0).sqrt().mul(r), d = l.sub(u), f = l.add(u);
|
|
2817
2817
|
return o(l.clamp(d, f), n, d, f);
|
|
2818
2818
|
}), c = V(([e, t]) => {
|
|
2819
|
-
let n = e.mul(t).fract().abs(), r =
|
|
2819
|
+
let n = e.mul(t).fract().abs(), r = H(n, n.oneMinus());
|
|
2820
2820
|
return r.x.mul(r.y).oneMinus().div(.75);
|
|
2821
2821
|
}).setLayout({
|
|
2822
2822
|
name: "subpixelCorrection",
|
|
@@ -2829,11 +2829,11 @@ var Kn = (e, t, n, r) => new Un(yt(e), tt(t), tt(n), r), qn = class e extends Jt
|
|
|
2829
2829
|
type: "ivec2"
|
|
2830
2830
|
}]
|
|
2831
2831
|
}), l = V(([e, t, n]) => {
|
|
2832
|
-
let r = n.oneMinus(), i = e.mul(
|
|
2833
|
-
return n.mulAssign(
|
|
2834
|
-
}), u =
|
|
2835
|
-
let e =
|
|
2836
|
-
return this.useSubpixelCorrection &&
|
|
2832
|
+
let r = n.oneMinus(), i = e.mul(R(1).div(H(e.r, e.g, e.b).add(1))), a = t.mul(R(1).div(H(t.r, t.g, t.b).add(1))), o = N(i.rgb), s = N(a.rgb);
|
|
2833
|
+
return n.mulAssign(R(1).div(o.add(1))), r.mulAssign(R(1).div(s.add(1))), pt(e.mul(n), t.mul(r)).div(H(n.add(r), 1e-5)).toVar();
|
|
2834
|
+
}), u = L(this._historyRenderTarget.texture), d = V(() => {
|
|
2835
|
+
let e = Ct(), t = this.beautyNode.size(), n = e.mul(t), r = i(n), o = r.get("closestDepth"), d = r.get("closestPositionTexel"), f = r.get("farthestDepth"), p = this.velocityNode.load(d).xy.mul(F(.5, -.5)), m = e.sub(p), h = a(m), g = m.greaterThanEqual(0).all().and(m.lessThanEqual(1).all()), _ = f.sub(o).greaterThan(this.edgeDepthDiff), v = o.sub(h).greaterThan(this.depthThreshold), y = g.and(_.or(v.not())), b = this.beautyNode.sample(e), ee = u.sample(e.sub(p)), te = e.sub(m).mul(t).length().div(this.maxVelocityLength).saturate(), x = R(.05).toVar();
|
|
2836
|
+
return this.useSubpixelCorrection && x.addAssign(c(p, t).mul(.25)), x.assign(y.select(x.add(te).saturate(), 1)), l(b, s(n, b, ee, et(.5, 1, te.oneMinus().pow2())), x);
|
|
2837
2837
|
});
|
|
2838
2838
|
return this._resolveMaterial.colorNode = d(), this._textureNode;
|
|
2839
2839
|
}
|
|
@@ -2841,12 +2841,12 @@ var Kn = (e, t, n, r) => new Un(yt(e), tt(t), tt(n), r), qn = class e extends Jt
|
|
|
2841
2841
|
this._historyRenderTarget.dispose(), this._resolveRenderTarget.dispose(), this._resolveMaterial.dispose();
|
|
2842
2842
|
}
|
|
2843
2843
|
};
|
|
2844
|
-
function
|
|
2844
|
+
function er(e, t) {
|
|
2845
2845
|
let n = 1, r = 0;
|
|
2846
2846
|
for (; e > 0;) n /= t, r += e % t * n, e = Math.floor(e / t);
|
|
2847
2847
|
return r;
|
|
2848
2848
|
}
|
|
2849
|
-
var
|
|
2849
|
+
var tr = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [er(t + 1, 2), er(t + 1, 3)]), nr = (e, t, n, r) => new $n(vt(e), t, n, r), rr = class e extends Zt {
|
|
2850
2850
|
constructor(...t) {
|
|
2851
2851
|
super(...t), this.passId = e.passId;
|
|
2852
2852
|
}
|
|
@@ -2854,7 +2854,7 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
2854
2854
|
this.passId = "TraaRenderPass";
|
|
2855
2855
|
}
|
|
2856
2856
|
assemble(e, t, n, r, i) {
|
|
2857
|
-
return r instanceof d ?
|
|
2857
|
+
return r instanceof d ? nr(t, e.getTextureNode("depth"), e.getTextureNode("velocity"), r) : t;
|
|
2858
2858
|
}
|
|
2859
2859
|
addParametersToGUI(e, t) {}
|
|
2860
2860
|
}, Q = {
|
|
@@ -2871,7 +2871,7 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
2871
2871
|
Q.MEDIUM,
|
|
2872
2872
|
Q.LOW,
|
|
2873
2873
|
Q.LOWEST
|
|
2874
|
-
],
|
|
2874
|
+
], ir = $[0], ar = $[$.length - 1], or = Q.HIGHEST, sr = new Map([
|
|
2875
2875
|
[Q.HIGHEST, {
|
|
2876
2876
|
maxPixelRatio: 1.5,
|
|
2877
2877
|
ssgiPerformanceParameters: {
|
|
@@ -2914,7 +2914,7 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
2914
2914
|
stepCount: 0
|
|
2915
2915
|
}
|
|
2916
2916
|
}]
|
|
2917
|
-
]),
|
|
2917
|
+
]), cr = [
|
|
2918
2918
|
{
|
|
2919
2919
|
min: 70,
|
|
2920
2920
|
max: Infinity,
|
|
@@ -2945,16 +2945,16 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
2945
2945
|
max: 19,
|
|
2946
2946
|
value: Q.LOWEST
|
|
2947
2947
|
}
|
|
2948
|
-
],
|
|
2948
|
+
], lr = (e) => cr.find((t) => e >= t.min && e <= t.max).value, ur = class {
|
|
2949
2949
|
constructor(e) {
|
|
2950
|
-
this.qualityLevel =
|
|
2950
|
+
this.qualityLevel = or, this.qualityMap = sr, this.fpsCounter = new xe(), this.applyQualityParametersCallback = e;
|
|
2951
2951
|
}
|
|
2952
2952
|
getQualityLevel() {
|
|
2953
2953
|
return this.qualityLevel;
|
|
2954
2954
|
}
|
|
2955
2955
|
manageQualitySettings(e, t) {
|
|
2956
2956
|
this.fpsCounter.update();
|
|
2957
|
-
let n = this.fpsCounter.getFps(), r = n > 0 && n < e && this.qualityLevel !==
|
|
2957
|
+
let n = this.fpsCounter.getFps(), r = n > 0 && n < e && this.qualityLevel !== ar, i = n > t && this.qualityLevel !== ir, a = r ? "decrement" : i ? "increment" : void 0;
|
|
2958
2958
|
if (a === void 0) {
|
|
2959
2959
|
this.qualityChangePendingSince = void 0, this.qualityChangePendingDirection = void 0;
|
|
2960
2960
|
return;
|
|
@@ -2994,31 +2994,34 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
2994
2994
|
async autoDetectInitialQualityLevel() {
|
|
2995
2995
|
let { getGPUTier: e } = await import("./dist-Blgk0vU0.mjs"), t = await e({ benchmarksURL: "./benchmarks" });
|
|
2996
2996
|
if (!t || !t.fps) {
|
|
2997
|
-
console.info("Could not autodetect performance - no benchmark for graphics hardware. Defaulting to HIGHEST"), this.qualityLevel =
|
|
2997
|
+
console.info("Could not autodetect performance - no benchmark for graphics hardware. Defaulting to HIGHEST"), this.qualityLevel = or;
|
|
2998
2998
|
return;
|
|
2999
2999
|
}
|
|
3000
|
-
this.qualityLevel =
|
|
3000
|
+
this.qualityLevel = lr(t.fps), console.info(`The initial quality setting has been set to ${this.qualityLevel} based on a benchmark performance of ${t.fps}fps of the graphics hardware.`);
|
|
3001
3001
|
}
|
|
3002
|
-
},
|
|
3002
|
+
}, dr = class e extends Zt {
|
|
3003
3003
|
static {
|
|
3004
3004
|
this.passId = "FogRenderPass";
|
|
3005
3005
|
}
|
|
3006
3006
|
constructor(t) {
|
|
3007
|
-
super(), this.passId = e.passId, this.sceneWithFog = void 0, this.fogColor = j(new
|
|
3007
|
+
super(), this.passId = e.passId, this.sceneWithFog = void 0, this.transparentObjectsDepthPass = void 0, this.fogColor = j(new de(t.color)), this.fogNearBlend = j(t.nearBlend), this.fogFarBlend = j(t.farBlend), this.depthOverrideMaterial = new T({ side: 2 });
|
|
3008
3008
|
}
|
|
3009
3009
|
assemble(e, t, n, r, i) {
|
|
3010
3010
|
if (!(r instanceof d) || i === "no fog") return this.removeSceneFog(), t;
|
|
3011
3011
|
let a = e.getTextureNode("depth");
|
|
3012
|
-
if (i === "depth") return this.removeSceneFog(), P(
|
|
3013
|
-
let o = j(r.projectionMatrixInverse),
|
|
3014
|
-
return this.addSceneFog(n,
|
|
3012
|
+
if (i === "depth") return this.removeSceneFog(), P(I(a.r), 1);
|
|
3013
|
+
let o = this.getTransparentObjectsDepthPassTexture(n, r), s = Pe(a.r, o.r), c = j(r.projectionMatrixInverse), l = j(r.matrixWorld), u = Pe(j(r.far).onRenderUpdate(() => r.far), 50).sub(this.fogFarBlend), f = u.sub(this.fogNearBlend), p = P(_t.x.mul(2).sub(1), _t.y.mul(2).sub(1), s, 1), m = c.mul(p), h = m.xyz.div(m.w), g = l.mul(P(h, 1)).xyz.xz.length(), _ = u.sub(g).div(u.sub(f)).clamp(0, 1);
|
|
3014
|
+
return this.addSceneFog(n, f, u), et(P(this.fogColor, 1), t, _);
|
|
3015
3015
|
}
|
|
3016
3016
|
addSceneFog(e, t, n) {
|
|
3017
|
-
let r =
|
|
3018
|
-
e.fogNode =
|
|
3017
|
+
let r = Rt.xz.length(), i = n.sub(r).div(n.sub(t)).clamp(0, 1).oneMinus();
|
|
3018
|
+
e.fogNode = Le(this.fogColor, i), this.sceneWithFog = e;
|
|
3019
|
+
}
|
|
3020
|
+
getTransparentObjectsDepthPassTexture(e, t) {
|
|
3021
|
+
return this.transparentObjectsDepthPass?.dispose(), this.transparentObjectsDepthPass = lt(e, t), this.transparentObjectsDepthPass.opaque = !1, this.transparentObjectsDepthPass.overrideMaterial = this.depthOverrideMaterial, this.transparentObjectsDepthPass.getTextureNode("depth");
|
|
3019
3022
|
}
|
|
3020
3023
|
removeSceneFog() {
|
|
3021
|
-
this.sceneWithFog &&= (this.sceneWithFog.fogNode = null, void 0);
|
|
3024
|
+
this.sceneWithFog &&= (this.sceneWithFog.fogNode = null, void 0), this.transparentObjectsDepthPass?.dispose(), this.transparentObjectsDepthPass = void 0;
|
|
3022
3025
|
}
|
|
3023
3026
|
addParametersToGUI(e, n) {
|
|
3024
3027
|
let r = e.addFolder("Fog Settings");
|
|
@@ -3026,17 +3029,17 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3026
3029
|
this.fogColor.value.set(e), n();
|
|
3027
3030
|
});
|
|
3028
3031
|
}
|
|
3029
|
-
},
|
|
3030
|
-
[
|
|
3031
|
-
[
|
|
3032
|
-
[
|
|
3033
|
-
[
|
|
3034
|
-
[
|
|
3035
|
-
[
|
|
3036
|
-
[
|
|
3037
|
-
},
|
|
3032
|
+
}, fr = {
|
|
3033
|
+
[D.NONE]: 0,
|
|
3034
|
+
[D.LINEAR]: 1,
|
|
3035
|
+
[D.REINHARD]: 2,
|
|
3036
|
+
[D.CINEON]: 3,
|
|
3037
|
+
[D.ACES_FILMIC]: 4,
|
|
3038
|
+
[D.AGX]: 6,
|
|
3039
|
+
[D.NEUTRAL]: 7
|
|
3040
|
+
}, pr = class extends be {
|
|
3038
3041
|
constructor(e, t, n, r, i = n) {
|
|
3039
|
-
super(e, t), this.passNeedsReassembly = !0, this.debugMode = "off", this.renderPasses = /* @__PURE__ */ new Map(), this.guiParameterGroups = /* @__PURE__ */ new Map(), this.lastRenderCamera = void 0, this.qualityManager = new
|
|
3042
|
+
super(e, t), this.passNeedsReassembly = !0, this.debugMode = "off", this.renderPasses = /* @__PURE__ */ new Map(), this.guiParameterGroups = /* @__PURE__ */ new Map(), this.lastRenderCamera = void 0, this.qualityManager = new ur(this.applyQualityParameters.bind(this)), this.freezeFrames = 0, this.freezeRenderTarget = new w(), this.renderPipeline = new De(t), this.applyToneMappingConfig(), this.enableDefaultRenderPasses(n, r, i), this._initData.webGpuConfig.autoDetectQualityLevel ? this.qualityManager.autoDetectInitialQualityLevel().then(() => this.qualityManager.applyCurrentQualityLevel(0)) : this.qualityManager.applyCurrentQualityLevel(0);
|
|
3040
3043
|
}
|
|
3041
3044
|
enableDefaultRenderPasses(e, t, n) {
|
|
3042
3045
|
let r = this._initData.webGpuConfig.fog.enabled, i = this._initData.transparentBackground;
|
|
@@ -3079,11 +3082,11 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3079
3082
|
}
|
|
3080
3083
|
assembleRenderPasses(e, t) {
|
|
3081
3084
|
let n = it(e, t), r = n;
|
|
3082
|
-
n.setMRT(
|
|
3083
|
-
output:
|
|
3084
|
-
diffuseColor:
|
|
3085
|
-
normal:
|
|
3086
|
-
velocity:
|
|
3085
|
+
n.setMRT(ze({
|
|
3086
|
+
output: He,
|
|
3087
|
+
diffuseColor: Ut,
|
|
3088
|
+
normal: nt(Re),
|
|
3089
|
+
velocity: Ve
|
|
3087
3090
|
}));
|
|
3088
3091
|
for (let i of this.renderPasses.values()) r = i.assemble(n, r, e, t, this.debugMode);
|
|
3089
3092
|
return r;
|
|
@@ -3096,7 +3099,7 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3096
3099
|
this.isConfiguratorMode && this._webGpuGroundShadowReflection.setReceiveShadow(e);
|
|
3097
3100
|
}
|
|
3098
3101
|
enableOutline(e, t) {
|
|
3099
|
-
this.getOutlinePassOrUndefined() || this.addRenderPass(new
|
|
3102
|
+
this.getOutlinePassOrUndefined() || this.addRenderPass(new Qt({
|
|
3100
3103
|
selectedObjects: [],
|
|
3101
3104
|
visibleEdgeColor: e,
|
|
3102
3105
|
hiddenEdgeColor: t,
|
|
@@ -3106,13 +3109,13 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3106
3109
|
}));
|
|
3107
3110
|
}
|
|
3108
3111
|
getOutlinePassOrUndefined() {
|
|
3109
|
-
let e = this.renderPasses.get(
|
|
3110
|
-
if (e && e instanceof
|
|
3112
|
+
let e = this.renderPasses.get(Qt.passId);
|
|
3113
|
+
if (e && e instanceof Qt) return e;
|
|
3111
3114
|
}
|
|
3112
3115
|
enableSsgiPass(e) {
|
|
3113
|
-
if (this.renderPasses.get(
|
|
3116
|
+
if (this.renderPasses.get(Yn.passId)) return;
|
|
3114
3117
|
let t = this._initData.webGpuConfig.ssgi;
|
|
3115
|
-
this.addRenderPass(new
|
|
3118
|
+
this.addRenderPass(new Yn({
|
|
3116
3119
|
sliceCount: 2,
|
|
3117
3120
|
stepCount: 12,
|
|
3118
3121
|
radius: 8,
|
|
@@ -3129,20 +3132,20 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3129
3132
|
}));
|
|
3130
3133
|
}
|
|
3131
3134
|
enableTraaPass() {
|
|
3132
|
-
this.renderPasses.get(
|
|
3135
|
+
this.renderPasses.get(rr.passId) || this.addRenderPass(new rr());
|
|
3133
3136
|
}
|
|
3134
3137
|
enableFogPass() {
|
|
3135
|
-
if (this.renderPasses.get(
|
|
3138
|
+
if (this.renderPasses.get(dr.passId)) return;
|
|
3136
3139
|
let e = this._initData.webGpuConfig.fog;
|
|
3137
|
-
this.addRenderPass(new
|
|
3140
|
+
this.addRenderPass(new dr({
|
|
3138
3141
|
color: this._initData.colors.DEFAULT_BACKGROUND,
|
|
3139
3142
|
nearBlend: e.nearBlend,
|
|
3140
3143
|
farBlend: e.farBlend
|
|
3141
3144
|
}));
|
|
3142
3145
|
}
|
|
3143
3146
|
disableFogPass() {
|
|
3144
|
-
let e = this.renderPasses.get(
|
|
3145
|
-
!e || !(e instanceof
|
|
3147
|
+
let e = this.renderPasses.get(dr.passId);
|
|
3148
|
+
!e || !(e instanceof dr) || (e.removeSceneFog(), this.renderPasses.delete(dr.passId));
|
|
3146
3149
|
}
|
|
3147
3150
|
applyQualityParameters(e, t) {
|
|
3148
3151
|
this.freezeFrames = Math.max(t, this.freezeFrames);
|
|
@@ -3150,17 +3153,17 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3150
3153
|
this.renderer.setPixelRatio(Math.min(n, e.maxPixelRatio)), this.getSsgiPassOrUndefined()?.updatePerformanceParameters(e.ssgiPerformanceParameters), this.passNeedsReassembly = !0;
|
|
3151
3154
|
}
|
|
3152
3155
|
getSsgiPassOrUndefined() {
|
|
3153
|
-
let e = this.renderPasses.get(
|
|
3154
|
-
if (e && e instanceof
|
|
3156
|
+
let e = this.renderPasses.get(Yn.passId);
|
|
3157
|
+
if (e && e instanceof Yn) return e;
|
|
3155
3158
|
}
|
|
3156
3159
|
setShadingType(e) {
|
|
3157
|
-
e !==
|
|
3160
|
+
e !== ge.DEFAULT && console.error("RoomleWebGPURenderer.setShadingType is not implemented yet");
|
|
3158
3161
|
}
|
|
3159
3162
|
showGUI(e) {
|
|
3160
|
-
if (this.renderer.inspector instanceof
|
|
3163
|
+
if (this.renderer.inspector instanceof In) return;
|
|
3161
3164
|
let t = document.createElement("style");
|
|
3162
3165
|
t.innerText = ".profiler-toggle,\n .profiler-mini-panel {\n left: 15px;\n right: auto !important;\n }", document.head.appendChild(t);
|
|
3163
|
-
let n = new
|
|
3166
|
+
let n = new In();
|
|
3164
3167
|
this.renderer.inspector = n, this._domHelper.element?.appendChild(n.domElement), this.addDebugGUI(n, e), this.qualityManager.addGUI(n, e);
|
|
3165
3168
|
let r = n.createParameters("Render Pass Settings");
|
|
3166
3169
|
for (let t of this.renderPasses.values()) t.addParametersToGUI(r, e);
|
|
@@ -3187,7 +3190,7 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3187
3190
|
}
|
|
3188
3191
|
applyToneMappingConfig() {
|
|
3189
3192
|
let { toneMapping: e, toneMappingExposure: t } = this._initData.webGpuConfig;
|
|
3190
|
-
this.renderer.toneMapping =
|
|
3193
|
+
this.renderer.toneMapping = fr[e], this.renderer.toneMappingExposure = t;
|
|
3191
3194
|
}
|
|
3192
3195
|
addToneMappingSettings(e, t) {
|
|
3193
3196
|
let n = e.addFolder("Tone Mapping"), r = {
|
|
@@ -3210,7 +3213,7 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3210
3213
|
}
|
|
3211
3214
|
getOrCreateGUIParameters(e) {
|
|
3212
3215
|
let t = this.renderer.inspector;
|
|
3213
|
-
if (t instanceof
|
|
3216
|
+
if (t instanceof In) return this.guiParameterGroups.get(e) ?? this.createAndCacheGUIParameters(t, e);
|
|
3214
3217
|
throw Error("Inspector GUI is not initialized. Call showGUI() before creating parameter groups.");
|
|
3215
3218
|
}
|
|
3216
3219
|
createAndCacheGUIParameters(e, t) {
|
|
@@ -3218,8 +3221,8 @@ var $n = /* @__PURE__ */ Array.from({ length: 32 }, (e, t) => [Qn(t + 1, 2), Qn(
|
|
|
3218
3221
|
return this.guiParameterGroups.set(t, n), n;
|
|
3219
3222
|
}
|
|
3220
3223
|
};
|
|
3221
|
-
|
|
3224
|
+
ye([ve, _e("design:type", Object)], pr.prototype, "_domHelper", void 0), ye([ve, _e("design:type", Object)], pr.prototype, "_webGpuGroundShadowReflection", void 0), ye([ve, _e("design:type", Object)], pr.prototype, "_initData", void 0);
|
|
3222
3225
|
//#endregion
|
|
3223
|
-
export {
|
|
3226
|
+
export { pr as RoomleWebGPURenderer };
|
|
3224
3227
|
|
|
3225
|
-
//# sourceMappingURL=roomle-webgpu-renderer-
|
|
3228
|
+
//# sourceMappingURL=roomle-webgpu-renderer-CS0lYZJ4.mjs.map
|