@roomle/web-sdk 3.9.0-alpha.4 → 3.9.0-alpha.6
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/{BufferGeometry-ltw0XkYt.mjs → BufferGeometry-Dxcf7n9V.mjs} +1 -1
- package/lib/{BufferGeometry-ltw0XkYt.mjs.map → BufferGeometry-Dxcf7n9V.mjs.map} +1 -1
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-yfYOtLdk.mjs → GLTFExporter-kpv1e-Ks.mjs} +84 -84
- package/lib/{GLTFExporter-yfYOtLdk.mjs.map → GLTFExporter-kpv1e-Ks.mjs.map} +1 -1
- package/lib/GaussianBlurNode-CMVlBe39.mjs +59 -0
- package/lib/GaussianBlurNode-CMVlBe39.mjs.map +1 -0
- package/lib/{PointLightHelper-AxCe6I00.mjs → PointLightHelper-fzRB58rC.mjs} +2 -2
- package/lib/{PointLightHelper-AxCe6I00.mjs.map → PointLightHelper-fzRB58rC.mjs.map} +1 -1
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-DpMerFPv.mjs → SpotLightHelper-D5UFwRPb.mjs} +2 -2
- package/lib/{SpotLightHelper-DpMerFPv.mjs.map → SpotLightHelper-D5UFwRPb.mjs.map} +1 -1
- package/lib/{USDZExporter-DFJQYX8l.mjs → USDZExporter-Y0SSGr5_.mjs} +2 -2
- package/lib/{USDZExporter-DFJQYX8l.mjs.map → USDZExporter-Y0SSGr5_.mjs.map} +1 -1
- package/lib/{api-x84SYo8e.mjs → api-52cOotqw.mjs} +2 -2
- package/lib/{api-x84SYo8e.mjs.map → api-52cOotqw.mjs.map} +1 -1
- package/lib/{asset-loader.worker-A7nEeQB4.mjs → asset-loader.worker-C911tbNL.mjs} +1 -1
- package/lib/asset-loader.worker-C911tbNL.mjs.map +1 -0
- package/lib/{banana-for-scale-CFY_5rk1.mjs → banana-for-scale-B_LIHI9q.mjs} +3 -3
- package/lib/{banana-for-scale-CFY_5rk1.mjs.map → banana-for-scale-B_LIHI9q.mjs.map} +1 -1
- package/lib/{budgeteer.sw-CQWYbQSc.mjs → budgeteer.sw-D3VxiASa.mjs} +1 -1
- package/lib/budgeteer.sw-D3VxiASa.mjs.map +1 -0
- package/lib/{common-utils-L3DF6Ey5.mjs → common-utils-B9PC_rvS.mjs} +2 -2
- package/lib/{common-utils-L3DF6Ey5.mjs.map → common-utils-B9PC_rvS.mjs.map} +1 -1
- package/lib/{component-dimensioning-FjlPqIvQ.mjs → component-dimensioning-12aJsCzQ.mjs} +31 -31
- package/lib/{component-dimensioning-FjlPqIvQ.mjs.map → component-dimensioning-12aJsCzQ.mjs.map} +1 -1
- package/lib/{component-raycast-helper-1n4uXeSD.mjs → component-raycast-helper-CcrmOq29.mjs} +14 -14
- package/lib/{component-raycast-helper-1n4uXeSD.mjs.map → component-raycast-helper-CcrmOq29.mjs.map} +1 -1
- package/lib/configurator-CarZpfPv.mjs +2 -0
- package/lib/{configurator-Dw5JbPMY.mjs → configurator-D3ZKy6bf.mjs} +10 -10
- package/lib/{configurator-Dw5JbPMY.mjs.map → configurator-D3ZKy6bf.mjs.map} +1 -1
- package/lib/{continuous-drawing-helper-DEmx54k_.mjs → continuous-drawing-helper-D25YPUle.mjs} +4 -4
- package/lib/{continuous-drawing-helper-DEmx54k_.mjs.map → continuous-drawing-helper-D25YPUle.mjs.map} +1 -1
- package/lib/{dimensioning-helper-BXD6AEqL.mjs → dimensioning-helper-d6JA4UMr.mjs} +49 -49
- package/lib/{dimensioning-helper-BXD6AEqL.mjs.map → dimensioning-helper-d6JA4UMr.mjs.map} +1 -1
- package/lib/dimensioning-helper-pPTkh8pl.mjs +2 -0
- package/lib/{glb-viewer-CWkc6wx7.mjs → glb-viewer-BJJ9OIlH.mjs} +35 -35
- package/lib/{glb-viewer-CWkc6wx7.mjs.map → glb-viewer-BJJ9OIlH.mjs.map} +1 -1
- package/lib/glb-viewer-CJ7BPqI-.mjs +2 -0
- package/lib/{highlight-coordinator-BJJw_RgR.mjs → highlight-coordinator-BuFleG2q.mjs} +8 -8
- package/lib/{highlight-coordinator-BJJw_RgR.mjs.map → highlight-coordinator-BuFleG2q.mjs.map} +1 -1
- package/lib/{homag-intelligence-Dk4WxD0p.mjs → homag-intelligence-BxpMWKLs.mjs} +5 -5
- package/lib/{homag-intelligence-Dk4WxD0p.mjs.map → homag-intelligence-BxpMWKLs.mjs.map} +1 -1
- package/lib/{imos-ix-poc-export-helper-C9wPB6fl.mjs → imos-ix-poc-export-helper-DU0ag-Lw.mjs} +3 -3
- package/lib/{imos-ix-poc-export-helper-C9wPB6fl.mjs.map → imos-ix-poc-export-helper-DU0ag-Lw.mjs.map} +1 -1
- package/lib/{kernel-utils-B5QlsCwn.mjs → kernel-utils-Cj5B4fDD.mjs} +16 -16
- package/lib/{kernel-utils-B5QlsCwn.mjs.map → kernel-utils-Cj5B4fDD.mjs.map} +1 -1
- package/lib/{main-CqSFaC9L.mjs → main-QTvbXAvy.mjs} +27277 -3406
- package/lib/main-QTvbXAvy.mjs.map +1 -0
- package/lib/{material-viewer-BSgvHUAe.mjs → material-viewer-BPcCfvCC.mjs} +18 -18
- package/lib/{material-viewer-BSgvHUAe.mjs.map → material-viewer-BPcCfvCC.mjs.map} +1 -1
- package/lib/packages-JQ2uWInj.mjs +4 -0
- package/lib/{planner-BgAj8Jp1.mjs → planner-C1-sOmHY.mjs} +5 -5
- package/lib/{planner-BgAj8Jp1.mjs.map → planner-C1-sOmHY.mjs.map} +1 -1
- package/lib/planner-CnRaQM_h.mjs +2 -0
- package/lib/{plugin-system-BBgoIai2.mjs → plugin-system-DlME_5b_.mjs} +2 -2
- package/lib/{plugin-system-BBgoIai2.mjs.map → plugin-system-DlME_5b_.mjs.map} +1 -1
- package/lib/rolldown-runtime-BwvMKf85.mjs +23 -0
- package/lib/roomle-headless.d.ts +32 -4
- package/lib/roomle-headless.js +40 -40
- package/lib/roomle-headless.js.map +1 -1
- package/lib/{roomle-renderer-CkSFbpmg.mjs → roomle-renderer-DYQvV88j.mjs} +2 -2
- package/lib/{roomle-renderer-CkSFbpmg.mjs.map → roomle-renderer-DYQvV88j.mjs.map} +1 -1
- package/lib/roomle-sdk.d.ts +32 -4
- package/lib/roomle-sdk.js +8 -8
- package/lib/{roomle-webgpu-renderer-DUr1RZL6.mjs → roomle-webgpu-renderer-BrZZeAGw.mjs} +296 -419
- package/lib/roomle-webgpu-renderer-BrZZeAGw.mjs.map +1 -0
- package/lib/{scene-renderer-BuMnigf2.mjs → scene-renderer-3nhM4cEu.mjs} +394 -394
- package/lib/{scene-renderer-BuMnigf2.mjs.map → scene-renderer-3nhM4cEu.mjs.map} +1 -1
- package/lib/{script-loader-DzyUQT3-.mjs → script-loader-3LiaLeLT.mjs} +2 -2
- package/lib/{script-loader-DzyUQT3-.mjs.map → script-loader-3LiaLeLT.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-BZnX3BX3.mjs → stats-helper-COC7Moh0.mjs} +3 -3
- package/lib/{stats-helper-BZnX3BX3.mjs.map → stats-helper-COC7Moh0.mjs.map} +1 -1
- package/lib/{three.core-DNErG1F6.mjs → three.core-tV_4n8Wg.mjs} +374 -301
- package/lib/{three.core-DNErG1F6.mjs.map → three.core-tV_4n8Wg.mjs.map} +1 -1
- package/lib/{three.module-BZkESKo3.mjs → three.module-DC5fF9Zl.mjs} +1568 -1568
- package/lib/{three.module-BZkESKo3.mjs.map → three.module-DC5fF9Zl.mjs.map} +1 -1
- package/lib/three.tsl-CAEdYyg3.mjs +136 -0
- package/lib/three.tsl-CAEdYyg3.mjs.map +1 -0
- package/lib/three.tsl-S0OKwamA.mjs +2 -0
- package/lib/{three.webgpu-C8myBXe1.mjs → three.webgpu-CkP2nkXM.mjs} +747 -747
- package/lib/{three.webgpu-C8myBXe1.mjs.map → three.webgpu-CkP2nkXM.mjs.map} +1 -1
- package/lib/three.webgpu-qrxDA_v0.mjs +3 -0
- package/lib/{threejs-utils-D7sinreM.mjs → threejs-utils-CElderZe.mjs} +68 -68
- package/lib/threejs-utils-CElderZe.mjs.map +1 -0
- package/lib/{tools-core-BxOoo-C1.mjs → tools-core-mkA4m80O.mjs} +3 -3
- package/lib/{tools-core-BxOoo-C1.mjs.map → tools-core-mkA4m80O.mjs.map} +1 -1
- package/lib/workers-HXGCmmZS.mjs +6 -0
- package/lib/{workers-BJYv3y38.mjs.map → workers-HXGCmmZS.mjs.map} +1 -1
- package/package.json +1 -1
- package/lib/asset-loader.worker-A7nEeQB4.mjs.map +0 -1
- package/lib/budgeteer.sw-CQWYbQSc.mjs.map +0 -1
- package/lib/configurator-DeUTcLI3.mjs +0 -2
- package/lib/dimensioning-helper-Do9jwg8T.mjs +0 -2
- package/lib/glb-viewer-Ci-IZcIt.mjs +0 -2
- package/lib/main-CqSFaC9L.mjs.map +0 -1
- package/lib/packages-0mEYlGTx.mjs +0 -4
- package/lib/planner-CIvdB7af.mjs +0 -2
- package/lib/rolldown-runtime-DgwB9i60.mjs +0 -13
- package/lib/roomle-webgpu-renderer-DUr1RZL6.mjs.map +0 -1
- package/lib/three.webgpu-WIkDzwXU.mjs +0 -3
- package/lib/threejs-utils-D7sinreM.mjs.map +0 -1
- package/lib/workers-BJYv3y38.mjs +0 -6
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { k as e } from "./threejs-utils-
|
|
2
|
-
import {
|
|
3
|
-
import { r as
|
|
4
|
-
import { n as
|
|
5
|
-
import "./dimensioning-helper-
|
|
6
|
-
import { h as
|
|
1
|
+
import { k as e } from "./threejs-utils-CElderZe.mjs";
|
|
2
|
+
import { An as t, Ci as n, E as r, Ei as i, En as a, Gn as o, Hr as s, J as c, Mr as l, On as u, S as d, Si as f, Tr as p, Ur as m, V as h, Vt as g, Wr as _, Y as v, Z as y, _n as b, at as x, bn as S, cn as C, ct as w, en as T, f as E, fi as D, fn as O, gn as ee, h as k, hi as te, hn as ne, ht as re, in as A, kr as j, ln as M, mn as ie, mt as ae, ni as oe, oi as se, on as N, pi as P, qt as F, si as I, sn as L, st as ce, un as le, w as R, xi as z, y as ue, z as de, zt as fe } from "./three.core-tV_4n8Wg.mjs";
|
|
3
|
+
import { r as pe } from "./three.module-DC5fF9Zl.mjs";
|
|
4
|
+
import { n as me, r as he, t as ge } from "./decorate-C9r0zXzz.mjs";
|
|
5
|
+
import "./dimensioning-helper-d6JA4UMr.mjs";
|
|
6
|
+
import { h as _e } from "./common-utils-B9PC_rvS.mjs";
|
|
7
7
|
//#region packages/common-core/src/webgl/renderer/shader-utility.ts
|
|
8
|
-
var
|
|
8
|
+
var ve = {
|
|
9
9
|
uniforms: {
|
|
10
10
|
tDiffuse: { value: null },
|
|
11
|
-
colorTransform: { value: new
|
|
12
|
-
colorBase: { value: new
|
|
11
|
+
colorTransform: { value: new L() },
|
|
12
|
+
colorBase: { value: new n(0, 0, 0, 0) },
|
|
13
13
|
multiplyChannels: { value: 0 },
|
|
14
|
-
uvTransform: { value: new
|
|
14
|
+
uvTransform: { value: new N() }
|
|
15
15
|
},
|
|
16
16
|
vertexShader: "\n varying vec2 vUv;\n uniform mat3 uvTransform;\n\n void main() {\n vUv = (uvTransform * vec3(uv, 1.0)).xy;\n gl_Position = (projectionMatrix * modelViewMatrix * vec4(position, 1.0)).xyww;\n }",
|
|
17
17
|
fragmentShader: "\n uniform sampler2D tDiffuse;\n uniform mat4 colorTransform;\n uniform vec4 colorBase;\n uniform float multiplyChannels;\n varying vec2 vUv;\n\n void main() {\n vec4 color = texture2D(tDiffuse, vUv);\n #if PREMULTIPLIED_ALPHA == 1\n if (color.a > 0.0) color.rgb /= color.a;\n #endif\n color = colorTransform * color + colorBase;\n color.rgb = mix(color.rgb, vec3(color.r * color.g * color.b), multiplyChannels);\n #if LINEAR_TO_SRGB == 1\n color.rgb = mix(color.rgb * 12.92, 1.055 * pow(color.rgb, vec3(0.41666)) - 0.055, step(0.0031308, color.rgb));\n #endif\n gl_FragColor = color;\n }"
|
|
18
|
-
},
|
|
19
|
-
new
|
|
20
|
-
var
|
|
18
|
+
}, B = new L(), ye = new L().set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0), be = new L().set(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0), xe = new L().set(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1);
|
|
19
|
+
new L().set(0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1), new L().set(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
20
|
+
var V = new L().set(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1), H = new n(0, 0, 0, 0), U = new n(0, 0, 0, 1), W = new N(), Se = new N().set(1, 0, 0, 0, -1, 1, 0, 0, 1), Ce = {
|
|
21
21
|
DEFAULT: "default",
|
|
22
22
|
ADDITIVE: "additive"
|
|
23
|
-
},
|
|
24
|
-
constructor(e, t =
|
|
25
|
-
let i = t ===
|
|
23
|
+
}, G = class extends m {
|
|
24
|
+
constructor(e, t = Ce.ADDITIVE, n = !1, r = !1) {
|
|
25
|
+
let i = t === Ce.ADDITIVE ? {
|
|
26
26
|
blendSrc: 208,
|
|
27
27
|
blendDst: 200,
|
|
28
28
|
blendEquation: 100,
|
|
@@ -31,9 +31,9 @@ var U = new M().set(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1), W = new f(0
|
|
|
31
31
|
blendEquationAlpha: 100
|
|
32
32
|
} : {};
|
|
33
33
|
super({
|
|
34
|
-
uniforms:
|
|
35
|
-
vertexShader:
|
|
36
|
-
fragmentShader:
|
|
34
|
+
uniforms: D.clone(ve.uniforms),
|
|
35
|
+
vertexShader: ve.vertexShader,
|
|
36
|
+
fragmentShader: ve.fragmentShader,
|
|
37
37
|
defines: {
|
|
38
38
|
LINEAR_TO_SRGB: n ? 1 : 0,
|
|
39
39
|
PREMULTIPLIED_ALPHA: r ? 1 : 0
|
|
@@ -47,22 +47,22 @@ var U = new M().set(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1), W = new f(0
|
|
|
47
47
|
update(e) {
|
|
48
48
|
return e?.texture !== void 0 && (this.uniforms.tDiffuse.value = e?.texture), e?.colorTransform !== void 0 && (this.uniforms.colorTransform.value = e?.colorTransform), e?.colorBase !== void 0 && (this.uniforms.colorBase.value = e?.colorBase), e?.multiplyChannels !== void 0 && (this.uniforms.multiplyChannels.value = e?.multiplyChannels), e?.uvTransform !== void 0 && (this.uniforms.uvTransform.value = e?.uvTransform), e?.blending !== void 0 && (this.blending = e?.blending), e?.blendSrc !== void 0 && (this.blendSrc = e?.blendSrc), e?.blendDst !== void 0 && (this.blendDst = e?.blendDst), e?.blendEquation !== void 0 && (this.blendEquation = e?.blendEquation), e?.blendSrcAlpha !== void 0 && (this.blendSrcAlpha = e?.blendSrcAlpha), e?.blendDstAlpha !== void 0 && (this.blendDstAlpha = e?.blendDstAlpha), e?.blendEquationAlpha !== void 0 && (this.blendEquationAlpha = e?.blendEquationAlpha), this;
|
|
49
49
|
}
|
|
50
|
-
},
|
|
50
|
+
}, we = {
|
|
51
51
|
uniforms: {
|
|
52
52
|
tDiffuse: { value: null },
|
|
53
|
-
rangeMin: { value: new
|
|
54
|
-
rangeMax: { value: new
|
|
53
|
+
rangeMin: { value: new z(1 / 512, 1 / 512) },
|
|
54
|
+
rangeMax: { value: new z(1 / 512, 1 / 512) }
|
|
55
55
|
},
|
|
56
56
|
vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",
|
|
57
57
|
fragmentShader: "\n uniform sampler2D tDiffuse;\n uniform vec2 rangeMin;\n uniform vec2 rangeMax;\n varying vec2 vUv;\n\n void main() {\n vec4 baseColor = texture2D(tDiffuse, vUv);\n vec2 blur = mix(rangeMax, rangeMin, baseColor.a);\n vec4 sum = vec4( 0.0 );\n sum += texture2D(tDiffuse, vUv - 1.0 * blur) * 0.051;\n sum += texture2D(tDiffuse, vUv - 0.75 * blur) * 0.0918;\n sum += texture2D(tDiffuse, vUv - 0.5 * blur) * 0.12245;\n sum += texture2D(tDiffuse, vUv - 0.25 * blur) * 0.1531;\n sum += baseColor * 0.1633;\n sum += texture2D(tDiffuse, vUv + 0.25 * blur) * 0.1531;\n sum += texture2D(tDiffuse, vUv + 0.5 * blur) * 0.12245;\n sum += texture2D(tDiffuse, vUv + 0.75 * blur) * 0.0918;\n sum += texture2D(tDiffuse, vUv + 1.0 * blur) * 0.051;\n gl_FragColor = sum;\n }"
|
|
58
58
|
};
|
|
59
|
-
new
|
|
60
|
-
var
|
|
59
|
+
new z(.1, .9), new z(.1, .9);
|
|
60
|
+
var Te = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }", Ee = "uniform sampler2D tDepth;\n uniform vec4 depthFilter;\n uniform float cameraNear;\n uniform float cameraFar;\n varying vec2 vUv;\n\n #include <packing>\n\n float getLinearDepth(const in vec2 screenPosition) {\n float fragCoordZ = dot(texture2D(tDepth, screenPosition), depthFilter);\n #if PERSPECTIVE_CAMERA == 1\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\n #else\n return fragCoordZ;\n #endif\n }\n\n void main() {\n float depth = getLinearDepth(vUv);\n gl_FragColor = vec4(vec3(1.0 - depth), 1.0);\n }", De = class e extends m {
|
|
61
61
|
static {
|
|
62
62
|
this._linearDepthShader = {
|
|
63
63
|
uniforms: {
|
|
64
64
|
tDepth: { value: null },
|
|
65
|
-
depthFilter: { value: new
|
|
65
|
+
depthFilter: { value: new n(1, 0, 0, 0) },
|
|
66
66
|
cameraNear: { value: .1 },
|
|
67
67
|
cameraFar: { value: 1 }
|
|
68
68
|
},
|
|
@@ -70,14 +70,14 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
70
70
|
PERSPECTIVE_CAMERA: 1,
|
|
71
71
|
ALPHA_DEPTH: 0
|
|
72
72
|
},
|
|
73
|
-
vertexShader:
|
|
74
|
-
fragmentShader:
|
|
73
|
+
vertexShader: Te,
|
|
74
|
+
fragmentShader: Ee
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
constructor(t) {
|
|
78
78
|
super({
|
|
79
79
|
defines: Object.assign({}, e._linearDepthShader.defines),
|
|
80
|
-
uniforms:
|
|
80
|
+
uniforms: D.clone(e._linearDepthShader.uniforms),
|
|
81
81
|
vertexShader: e._linearDepthShader.vertexShader,
|
|
82
82
|
fragmentShader: e._linearDepthShader.fragmentShader,
|
|
83
83
|
blending: 0
|
|
@@ -90,7 +90,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
90
90
|
}
|
|
91
91
|
return e?.depthFilter !== void 0 && (this.uniforms.depthFilter.value = e?.depthFilter), this;
|
|
92
92
|
}
|
|
93
|
-
},
|
|
93
|
+
}, K = class {
|
|
94
94
|
constructor() {
|
|
95
95
|
this.isPass = !0, this.enabled = !0, this.needsSwap = !0, this.clear = !1, this.renderToScreen = !1;
|
|
96
96
|
}
|
|
@@ -99,9 +99,9 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
99
99
|
console.error("THREE.Pass: .render() must be implemented in derived pass.");
|
|
100
100
|
}
|
|
101
101
|
dispose() {}
|
|
102
|
-
},
|
|
102
|
+
}, Oe = new a(-1, 1, 1, -1, 0, 1), ke = new class extends k {
|
|
103
103
|
constructor() {
|
|
104
|
-
super(), this.setAttribute("position", new
|
|
104
|
+
super(), this.setAttribute("position", new ce([
|
|
105
105
|
-1,
|
|
106
106
|
3,
|
|
107
107
|
0,
|
|
@@ -111,7 +111,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
111
111
|
3,
|
|
112
112
|
-1,
|
|
113
113
|
0
|
|
114
|
-
], 3)), this.setAttribute("uv", new
|
|
114
|
+
], 3)), this.setAttribute("uv", new ce([
|
|
115
115
|
0,
|
|
116
116
|
2,
|
|
117
117
|
0,
|
|
@@ -120,15 +120,15 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
120
120
|
0
|
|
121
121
|
], 2));
|
|
122
122
|
}
|
|
123
|
-
}(),
|
|
123
|
+
}(), Ae = class {
|
|
124
124
|
constructor(e) {
|
|
125
|
-
this._mesh = new
|
|
125
|
+
this._mesh = new C(ke, e);
|
|
126
126
|
}
|
|
127
127
|
dispose() {
|
|
128
128
|
this._mesh.geometry.dispose();
|
|
129
129
|
}
|
|
130
130
|
render(e) {
|
|
131
|
-
e.render(this._mesh,
|
|
131
|
+
e.render(this._mesh, Oe);
|
|
132
132
|
}
|
|
133
133
|
get material() {
|
|
134
134
|
return this._mesh.material;
|
|
@@ -136,7 +136,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
136
136
|
set material(e) {
|
|
137
137
|
this._mesh.material = e;
|
|
138
138
|
}
|
|
139
|
-
},
|
|
139
|
+
}, je = class {
|
|
140
140
|
constructor(e = Math) {
|
|
141
141
|
this.grad3 = [
|
|
142
142
|
[
|
|
@@ -796,26 +796,26 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
796
796
|
noise3d(e, t, n) {
|
|
797
797
|
let r, i, a, o, s = (e + t + n) * (1 / 3), c = Math.floor(e + s), l = Math.floor(t + s), u = Math.floor(n + s), d = 1 / 6, f = (c + l + u) * d, p = c - f, m = l - f, h = u - f, g = e - p, _ = t - m, v = n - h, y, b, x, S, C, w;
|
|
798
798
|
g >= _ ? _ >= v ? (y = 1, b = 0, x = 0, S = 1, C = 1, w = 0) : g >= v ? (y = 1, b = 0, x = 0, S = 1, C = 0, w = 1) : (y = 0, b = 0, x = 1, S = 1, C = 0, w = 1) : _ < v ? (y = 0, b = 0, x = 1, S = 0, C = 1, w = 1) : g < v ? (y = 0, b = 1, x = 0, S = 0, C = 1, w = 1) : (y = 0, b = 1, x = 0, S = 1, C = 1, w = 0);
|
|
799
|
-
let T = g - y + d, E = _ - b + d, D = v - x + d, O = g - S + 2 * d, ee = _ - C + 2 * d,
|
|
800
|
-
|
|
801
|
-
let
|
|
802
|
-
|
|
803
|
-
let
|
|
804
|
-
|
|
805
|
-
let
|
|
806
|
-
return
|
|
799
|
+
let T = g - y + d, E = _ - b + d, D = v - x + d, O = g - S + 2 * d, ee = _ - C + 2 * d, k = v - w + 2 * d, te = g - 1 + 3 * d, ne = _ - 1 + 3 * d, re = v - 1 + 3 * d, A = c & 255, j = l & 255, M = u & 255, ie = this.perm[A + this.perm[j + this.perm[M]]] % 12, ae = this.perm[A + y + this.perm[j + b + this.perm[M + x]]] % 12, oe = this.perm[A + S + this.perm[j + C + this.perm[M + w]]] % 12, se = this.perm[A + 1 + this.perm[j + 1 + this.perm[M + 1]]] % 12, N = .6 - g * g - _ * _ - v * v;
|
|
800
|
+
N < 0 ? r = 0 : (N *= N, r = N * N * this._dot3(this.grad3[ie], g, _, v));
|
|
801
|
+
let P = .6 - T * T - E * E - D * D;
|
|
802
|
+
P < 0 ? i = 0 : (P *= P, i = P * P * this._dot3(this.grad3[ae], T, E, D));
|
|
803
|
+
let F = .6 - O * O - ee * ee - k * k;
|
|
804
|
+
F < 0 ? a = 0 : (F *= F, a = F * F * this._dot3(this.grad3[oe], O, ee, k));
|
|
805
|
+
let I = .6 - te * te - ne * ne - re * re;
|
|
806
|
+
return I < 0 ? o = 0 : (I *= I, o = I * I * this._dot3(this.grad3[se], te, ne, re)), 32 * (r + i + a + o);
|
|
807
807
|
}
|
|
808
808
|
noise4d(e, t, n, r) {
|
|
809
|
-
let i = this.grad4, a = this.simplex, o = this.perm, s = (Math.sqrt(5) - 1) / 4, c = (5 - Math.sqrt(5)) / 20, l, u, d, f, p, m = (e + t + n + r) * s, h = Math.floor(e + m), g = Math.floor(t + m), _ = Math.floor(n + m), v = Math.floor(r + m), y = (h + g + _ + v) * c, b = h - y, x = g - y, S = _ - y, C = v - y, w = e - b, T = t - x, E = n - S, D = r - C, O = w > T ? 32 : 0, ee = w > E ? 16 : 0,
|
|
810
|
-
|
|
811
|
-
let
|
|
812
|
-
|
|
813
|
-
let
|
|
814
|
-
|
|
815
|
-
let
|
|
816
|
-
|
|
817
|
-
let
|
|
818
|
-
return
|
|
809
|
+
let i = this.grad4, a = this.simplex, o = this.perm, s = (Math.sqrt(5) - 1) / 4, c = (5 - Math.sqrt(5)) / 20, l, u, d, f, p, m = (e + t + n + r) * s, h = Math.floor(e + m), g = Math.floor(t + m), _ = Math.floor(n + m), v = Math.floor(r + m), y = (h + g + _ + v) * c, b = h - y, x = g - y, S = _ - y, C = v - y, w = e - b, T = t - x, E = n - S, D = r - C, O = w > T ? 32 : 0, ee = w > E ? 16 : 0, k = T > E ? 8 : 0, te = w > D ? 4 : 0, ne = T > D ? 2 : 0, re = E > D ? 1 : 0, A = O + ee + k + te + ne + re, j = a[A][0] >= 3 ? 1 : 0, M = a[A][1] >= 3 ? 1 : 0, ie = a[A][2] >= 3 ? 1 : 0, ae = a[A][3] >= 3 ? 1 : 0, oe = a[A][0] >= 2 ? 1 : 0, se = a[A][1] >= 2 ? 1 : 0, N = a[A][2] >= 2 ? 1 : 0, P = a[A][3] >= 2 ? 1 : 0, F = a[A][0] >= 1 ? 1 : 0, I = a[A][1] >= 1 ? 1 : 0, L = a[A][2] >= 1 ? 1 : 0, ce = a[A][3] >= 1 ? 1 : 0, le = w - j + c, R = T - M + c, z = E - ie + c, ue = D - ae + c, de = w - oe + 2 * c, fe = T - se + 2 * c, pe = E - N + 2 * c, me = D - P + 2 * c, he = w - F + 3 * c, ge = T - I + 3 * c, _e = E - L + 3 * c, ve = D - ce + 3 * c, B = w - 1 + 4 * c, ye = T - 1 + 4 * c, be = E - 1 + 4 * c, xe = D - 1 + 4 * c, V = h & 255, H = g & 255, U = _ & 255, W = v & 255, Se = o[V + o[H + o[U + o[W]]]] % 32, Ce = o[V + j + o[H + M + o[U + ie + o[W + ae]]]] % 32, G = o[V + oe + o[H + se + o[U + N + o[W + P]]]] % 32, we = o[V + F + o[H + I + o[U + L + o[W + ce]]]] % 32, Te = o[V + 1 + o[H + 1 + o[U + 1 + o[W + 1]]]] % 32, Ee = .6 - w * w - T * T - E * E - D * D;
|
|
810
|
+
Ee < 0 ? l = 0 : (Ee *= Ee, l = Ee * Ee * this._dot4(i[Se], w, T, E, D));
|
|
811
|
+
let De = .6 - le * le - R * R - z * z - ue * ue;
|
|
812
|
+
De < 0 ? u = 0 : (De *= De, u = De * De * this._dot4(i[Ce], le, R, z, ue));
|
|
813
|
+
let K = .6 - de * de - fe * fe - pe * pe - me * me;
|
|
814
|
+
K < 0 ? d = 0 : (K *= K, d = K * K * this._dot4(i[G], de, fe, pe, me));
|
|
815
|
+
let Oe = .6 - he * he - ge * ge - _e * _e - ve * ve;
|
|
816
|
+
Oe < 0 ? f = 0 : (Oe *= Oe, f = Oe * Oe * this._dot4(i[we], he, ge, _e, ve));
|
|
817
|
+
let ke = .6 - B * B - ye * ye - be * be - xe * xe;
|
|
818
|
+
return ke < 0 ? p = 0 : (ke *= ke, p = ke * ke * this._dot4(i[Te], B, ye, be, xe)), 27 * (l + u + d + f + p);
|
|
819
819
|
}
|
|
820
820
|
_dot(e, t, n) {
|
|
821
821
|
return e[0] * t + e[1] * n;
|
|
@@ -826,35 +826,35 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
826
826
|
_dot4(e, t, n, r, i) {
|
|
827
827
|
return e[0] * t + e[1] * n + e[2] * r + e[3] * i;
|
|
828
828
|
}
|
|
829
|
-
}, je = (e, t) => {
|
|
830
|
-
e.left = t.min.x, e.right = t.max.x, e.bottom = t.min.y, e.top = t.max.y, e.near = Math.min(-t.min.z, -t.max.z), e.far = Math.max(-t.min.z, -t.max.z), e.updateProjectionMatrix();
|
|
831
829
|
}, Me = (e, t) => {
|
|
830
|
+
e.left = t.min.x, e.right = t.max.x, e.bottom = t.min.y, e.top = t.max.y, e.near = Math.min(-t.min.z, -t.max.z), e.far = Math.max(-t.min.z, -t.max.z), e.updateProjectionMatrix();
|
|
831
|
+
}, Ne = (e, t) => {
|
|
832
832
|
let n = Math.min(-t.min.z, -t.max.z), r = Math.max(-t.min.z, -t.max.z);
|
|
833
833
|
if (n < .001) return;
|
|
834
834
|
let i = Math.max(Math.abs(t.min.x), Math.abs(t.max.x)), a = Math.max(Math.abs(t.min.y), Math.abs(t.max.y));
|
|
835
|
-
e.aspect = i / a, e.fov =
|
|
836
|
-
},
|
|
835
|
+
e.aspect = i / a, e.fov = A.radToDeg(Math.atan2(a, n) * 2), e.near = n, e.far = r, e.updateProjectionMatrix();
|
|
836
|
+
}, Pe = class {
|
|
837
837
|
constructor() {
|
|
838
|
-
this.bounds = new
|
|
838
|
+
this.bounds = new E(new f(-1, -1, -1), new f(1, 1, 1)), this.size = new f(2, 2, 2), this.center = new f(0, 0, 0), this.maxSceneDistanceFromCenter = Math.sqrt(3), this.maxSceneDistanceFrom0 = Math.sqrt(3);
|
|
839
839
|
}
|
|
840
840
|
updateFromBox(e) {
|
|
841
|
-
this.bounds !== e && this.bounds.copy(e), this.bounds.getSize(this.size), this.bounds.getCenter(this.center), this.maxSceneDistanceFromCenter = this.size.length() / 2, this.maxSceneDistanceFrom0 = new
|
|
841
|
+
this.bounds !== e && this.bounds.copy(e), this.bounds.getSize(this.size), this.bounds.getCenter(this.center), this.maxSceneDistanceFromCenter = this.size.length() / 2, this.maxSceneDistanceFrom0 = new f(Math.max(Math.abs(this.bounds.min.x), Math.abs(this.bounds.max.x)), Math.max(Math.abs(this.bounds.min.y), Math.abs(this.bounds.max.y)), Math.max(Math.abs(this.bounds.min.z), Math.abs(this.bounds.max.z))).length();
|
|
842
842
|
}
|
|
843
843
|
updateCameraViewVolumeFromBounds(e) {
|
|
844
844
|
e.updateMatrixWorld();
|
|
845
845
|
let t = this.bounds.clone().applyMatrix4(e.matrixWorldInverse);
|
|
846
|
-
e instanceof
|
|
846
|
+
e instanceof a ? Me(e, t) : e instanceof u && Ne(e, t);
|
|
847
847
|
}
|
|
848
848
|
getNearAndFarForPerspectiveCamera(e, t = 1) {
|
|
849
849
|
let n = e.clone().sub(this.center).length();
|
|
850
850
|
return [Math.max(.01, n - this.maxSceneDistanceFromCenter - .01), n + this.maxSceneDistanceFromCenter * t + .01];
|
|
851
851
|
}
|
|
852
|
-
},
|
|
852
|
+
}, Fe = class {
|
|
853
853
|
changed(e) {
|
|
854
854
|
let t = !this._lastCameraProjection?.equals(e.projectionMatrix) || !this._lastCameraWorld?.equals(e.matrixWorld);
|
|
855
855
|
return this._lastCameraProjection = e.projectionMatrix?.clone(), this._lastCameraWorld = e.matrixWorld?.clone(), t;
|
|
856
856
|
}
|
|
857
|
-
},
|
|
857
|
+
}, Ie = (e) => {
|
|
858
858
|
let t = Math.floor(e) % 2 == 0 ? Math.floor(e) + 1 : Math.floor(e), n = t * t, r = Array(n).fill(0), i = Math.floor(t / 2), a = t - 1;
|
|
859
859
|
for (let e = 1; e <= n;) {
|
|
860
860
|
if (i === -1 && a === t ? (a = t - 2, i = 0) : (a === t && (a = 0), i < 0 && (i = t - 1)), r[i * t + a] !== 0) {
|
|
@@ -864,17 +864,17 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
864
864
|
a++, i--;
|
|
865
865
|
}
|
|
866
866
|
return r;
|
|
867
|
-
},
|
|
868
|
-
let t = new
|
|
869
|
-
for (let n = 0; n <
|
|
870
|
-
let
|
|
871
|
-
|
|
872
|
-
}
|
|
873
|
-
let
|
|
874
|
-
return
|
|
875
|
-
},
|
|
867
|
+
}, Le = (e) => {
|
|
868
|
+
let t = new je(), n = Math.floor(e) % 2 == 0 ? Math.floor(e) + 1 : Math.floor(e), r = Ie(n), i = r.length, a = new Uint8Array(i * 4);
|
|
869
|
+
for (let n = 0; n < i; ++n) {
|
|
870
|
+
let o = r[n], s = 2 * Math.PI * o / i, c = new f(Math.cos(s), Math.sin(s), 0).normalize();
|
|
871
|
+
a[n * 4] = (c.x * .5 + .5) * 255, a[n * 4 + 1] = (c.y * .5 + .5) * 255, a[n * 4 + 2] = 127, a[n * 4 + 3] = (t.noise(n / e, n % e) * .5 + .5) * 255;
|
|
872
|
+
}
|
|
873
|
+
let o = new h(a, n, n);
|
|
874
|
+
return o.wrapS = l, o.wrapT = l, o.needsUpdate = !0, o;
|
|
875
|
+
}, Re = class {
|
|
876
876
|
constructor() {
|
|
877
|
-
this._originalClearColor = new
|
|
877
|
+
this._originalClearColor = new R(), this._originalClearAlpha = 0, this._originalAutoClear = !1, this._originalRenderTarget = null, this._screenSpaceQuad = new Ae(void 0), this._emptyScene = new s(), this._defaultCamera = new u();
|
|
878
878
|
}
|
|
879
879
|
renderWithOverrideMaterial(e, t, n, r, i, a, o) {
|
|
880
880
|
this._backup(e), this._prepareRenderer(e, i, a, o);
|
|
@@ -899,9 +899,9 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
899
899
|
_restore(e) {
|
|
900
900
|
e.setClearColor(this._originalClearColor), e.setClearAlpha(this._originalClearAlpha), e.setRenderTarget(this._originalRenderTarget), e.autoClear = this._originalAutoClear;
|
|
901
901
|
}
|
|
902
|
-
},
|
|
902
|
+
}, ze = class {
|
|
903
903
|
constructor(e, t) {
|
|
904
|
-
this._passRenderer = t?.passRenderer ?? new
|
|
904
|
+
this._passRenderer = t?.passRenderer ?? new Re(), this._blurMaterial = new m(e ?? we), this._blurMaterial.depthTest = !1;
|
|
905
905
|
}
|
|
906
906
|
dispose() {
|
|
907
907
|
this._blurMaterial.dispose();
|
|
@@ -909,18 +909,18 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
909
909
|
render(e, t, n, r) {
|
|
910
910
|
this._blurMaterial.uniforms.tDiffuse.value = t[0].texture, this._blurMaterial.uniforms.rangeMin.value.x = n[0], this._blurMaterial.uniforms.rangeMin.value.y = 0, this._blurMaterial.uniforms.rangeMax.value.x = r[0], this._blurMaterial.uniforms.rangeMax.value.y = 0, this._passRenderer.renderScreenSpace(e, this._blurMaterial, t[1]), this._blurMaterial.uniforms.tDiffuse.value = t[1].texture, this._blurMaterial.uniforms.rangeMin.value.x = 0, this._blurMaterial.uniforms.rangeMin.value.y = n[1], this._blurMaterial.uniforms.rangeMax.value.x = 0, this._blurMaterial.uniforms.rangeMax.value.y = r[1], this._passRenderer.renderScreenSpace(e, this._blurMaterial, t[2]);
|
|
911
911
|
}
|
|
912
|
-
},
|
|
912
|
+
}, Be = class e extends C {
|
|
913
913
|
static {
|
|
914
914
|
this.alphaMap = !0;
|
|
915
915
|
}
|
|
916
|
-
constructor(
|
|
917
|
-
super(new
|
|
916
|
+
constructor(n, r) {
|
|
917
|
+
super(new t(1, 1, 10, 10), new ee({
|
|
918
918
|
color: e.alphaMap ? 0 : 16777215,
|
|
919
919
|
transparent: !0,
|
|
920
920
|
depthWrite: !1,
|
|
921
921
|
polygonOffset: !0,
|
|
922
922
|
name: "ShadowGroundPlaneMaterial"
|
|
923
|
-
})), this.name = "ShadowGroundPlane", this.userData.isFloor = !0, this.renderOrder = 1, this.receiveShadow = !1, this.layers.disableAll(),
|
|
923
|
+
})), this.name = "ShadowGroundPlane", this.userData.isFloor = !0, this.renderOrder = 1, this.receiveShadow = !1, this.layers.disableAll(), r && this.updateMaterial(r), this.setShadowMap(n);
|
|
924
924
|
}
|
|
925
925
|
setVisibility(e) {
|
|
926
926
|
this.visible = e, this.setVisibilityLayers(e);
|
|
@@ -943,7 +943,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
943
943
|
let t = this.material;
|
|
944
944
|
e.opacity && t.opacity !== e.opacity && (t.opacity = e.opacity), e.polygonOffset && t.polygonOffsetFactor !== e.polygonOffset && (t.polygonOffset = !0, t.polygonOffsetFactor = e.polygonOffset, t.polygonOffsetUnits = e.polygonOffset), t.needsUpdate = !0;
|
|
945
945
|
}
|
|
946
|
-
},
|
|
946
|
+
}, q = class extends K {
|
|
947
947
|
get renderPassManager() {
|
|
948
948
|
return this._renderPassManager;
|
|
949
949
|
}
|
|
@@ -968,14 +968,14 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
968
968
|
render(e, t, n, r, i) {
|
|
969
969
|
this.renderPass(e);
|
|
970
970
|
}
|
|
971
|
-
},
|
|
971
|
+
}, J = {
|
|
972
972
|
INPUT_RGB_NORMAL: "inputRgbNormal",
|
|
973
973
|
FLOAT_BUFFER_NORMAL: "floatBufferNormal",
|
|
974
974
|
CONSTANT_Z: "constantZ"
|
|
975
|
-
},
|
|
975
|
+
}, Y = {
|
|
976
976
|
SEPARATE_BUFFER: "separateBuffer",
|
|
977
977
|
NORMAL_VECTOR_ALPHA: "normalVectorAlpha"
|
|
978
|
-
},
|
|
978
|
+
}, X = {
|
|
979
979
|
SSAO: 0,
|
|
980
980
|
SAO: 1,
|
|
981
981
|
N8AO: 2,
|
|
@@ -989,12 +989,12 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
989
989
|
}
|
|
990
990
|
return r;
|
|
991
991
|
}, He = (e, t) => {
|
|
992
|
-
let
|
|
993
|
-
for (let
|
|
994
|
-
let
|
|
995
|
-
|
|
992
|
+
let r = [];
|
|
993
|
+
for (let i = 0; i < e; i++) {
|
|
994
|
+
let a = i * Math.PI * (3 - Math.sqrt(5)), o = .01 + i / (e - 1) * .99, s = t ? Math.sqrt(1 - o * o) : 1 - o, c = Math.cos(a) * s, l = Math.sin(a) * s, u = Math.floor(e / 4), d = 1 - (Math.floor(i / 4) + i % 4 * u) / e;
|
|
995
|
+
d = .1 + .9 * d, r.push(new n(c, l, o, d));
|
|
996
996
|
}
|
|
997
|
-
return
|
|
997
|
+
return r;
|
|
998
998
|
}, Ue = {
|
|
999
999
|
name: "AOShader",
|
|
1000
1000
|
defines: {
|
|
@@ -1003,7 +1003,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1003
1003
|
SAMPLE_VECTORS: Ve(16, !1),
|
|
1004
1004
|
NORMAL_VECTOR_TYPE: 1,
|
|
1005
1005
|
DEPTH_SWIZZLING: "x",
|
|
1006
|
-
AO_ALGORITHM:
|
|
1006
|
+
AO_ALGORITHM: X.GTAO,
|
|
1007
1007
|
NV_ALIGNED_SAMPLES: 1,
|
|
1008
1008
|
SCREEN_SPACE_RADIUS: 0,
|
|
1009
1009
|
SCREEN_SPACE_RADIUS_SCALE: 100,
|
|
@@ -1015,26 +1015,26 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1015
1015
|
tNormal: { value: null },
|
|
1016
1016
|
tDepth: { value: null },
|
|
1017
1017
|
tNoise: { value: null },
|
|
1018
|
-
resolution: { value: new
|
|
1018
|
+
resolution: { value: new z() },
|
|
1019
1019
|
cameraNear: { value: null },
|
|
1020
1020
|
cameraFar: { value: null },
|
|
1021
|
-
cameraProjectionMatrix: { value: new
|
|
1022
|
-
cameraProjectionMatrixInverse: { value: new
|
|
1023
|
-
cameraWorldMatrix: { value: new
|
|
1021
|
+
cameraProjectionMatrix: { value: new L() },
|
|
1022
|
+
cameraProjectionMatrixInverse: { value: new L() },
|
|
1023
|
+
cameraWorldMatrix: { value: new L() },
|
|
1024
1024
|
radius: { value: 1 },
|
|
1025
1025
|
distanceExponent: { value: 1 },
|
|
1026
1026
|
thickness: { value: 1 },
|
|
1027
1027
|
distanceFallOff: { value: 1 },
|
|
1028
1028
|
bias: { value: .001 },
|
|
1029
1029
|
scale: { value: 1 },
|
|
1030
|
-
sceneBoxMin: { value: new
|
|
1031
|
-
sceneBoxMax: { value: new
|
|
1030
|
+
sceneBoxMin: { value: new f(-1, -1, -1) },
|
|
1031
|
+
sceneBoxMax: { value: new f(1, 1, 1) }
|
|
1032
1032
|
},
|
|
1033
1033
|
vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",
|
|
1034
1034
|
fragmentShader: "\n\n varying vec2 vUv;\n uniform highp sampler2D tNormal;\n uniform highp sampler2D tDepth;\n uniform sampler2D tNoise;\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform mat4 cameraProjectionMatrix;\n uniform mat4 cameraProjectionMatrixInverse;\n uniform mat4 cameraWorldMatrix;\n uniform float radius;\n uniform float distanceExponent;\n uniform float thickness;\n uniform float distanceFallOff;\n uniform float bias;\n uniform float scale;\n #if SCENE_CLIP_BOX == 1\n uniform vec3 sceneBoxMin;\n uniform vec3 sceneBoxMax;\n #endif\n\n #include <common>\n #include <packing>\n\n #ifndef FRAGMENT_OUTPUT\n #define FRAGMENT_OUTPUT vec4(vec3(ao), 1.)\n #endif\n\n const vec4 sampleKernel[SAMPLES] = SAMPLE_VECTORS;\n\n vec3 getViewPosition(const in vec2 screenPosition, const in float depth) {\n vec4 clipSpacePosition = vec4(vec3(screenPosition, depth) * 2.0 - 1.0, 1.0);\n vec4 viewSpacePosition = cameraProjectionMatrixInverse * clipSpacePosition;\n return viewSpacePosition.xyz / viewSpacePosition.w;\n }\n\n float getDepth(const vec2 uv) {\n #if DEPTH_BUFFER_ANTIALIAS == 1\n vec2 size = vec2(textureSize(tDepth, 0));\n ivec2 p = ivec2(uv * size);\n float d0 = texelFetch(tDepth, p, 0).DEPTH_SWIZZLING;\n vec2 depth = vec2(d0, 1.0);\n float d1 = texelFetch(tDepth, p + ivec2(1, 0), 0).DEPTH_SWIZZLING;\n depth += vec2(d1, 1.0) * step(abs(d1 - d0), 0.1);\n float d2 = texelFetch(tDepth, p - ivec2(1, 0), 0).DEPTH_SWIZZLING;\n depth += vec2(d2, 1.0) * step(abs(d2 - d0), 0.1);\n float d3 = texelFetch(tDepth, p + ivec2(0, 1), 0).DEPTH_SWIZZLING;\n depth += vec2(d3, 1.0) * step(abs(d3 - d0), 0.1);\n float d4 = texelFetch(tDepth, p - ivec2(0, 1), 0).DEPTH_SWIZZLING;\n depth += vec2(d4, 1.0) * step(abs(d4 - d0), 0.1);\n return depth.x / depth.y;\n #else\n return textureLod(tDepth, uv.xy, 0.0).DEPTH_SWIZZLING;\n #endif\n }\n\n float fetchDepth(const ivec2 uv) {\n return texelFetch(tDepth, uv.xy, 0).DEPTH_SWIZZLING;\n }\n\n float getViewZ(const in float depth) {\n #if PERSPECTIVE_CAMERA == 1\n return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);\n #else\n return orthographicDepthToViewZ(depth, cameraNear, cameraFar);\n #endif\n }\n\n vec3 computeNormalFromDepth(const vec2 uv) {\n vec2 size = vec2(textureSize(tDepth, 0));\n ivec2 p = ivec2(uv * size);\n float c0 = fetchDepth(p);\n float l2 = fetchDepth(p - ivec2(2, 0));\n float l1 = fetchDepth(p - ivec2(1, 0));\n float r1 = fetchDepth(p + ivec2(1, 0));\n float r2 = fetchDepth(p + ivec2(2, 0));\n float b2 = fetchDepth(p - ivec2(0, 2));\n float b1 = fetchDepth(p - ivec2(0, 1));\n float t1 = fetchDepth(p + ivec2(0, 1));\n float t2 = fetchDepth(p + ivec2(0, 2));\n float dl = abs((2.0 * l1 - l2) - c0);\n float dr = abs((2.0 * r1 - r2) - c0);\n float db = abs((2.0 * b1 - b2) - c0);\n float dt = abs((2.0 * t1 - t2) - c0);\n vec3 ce = getViewPosition(uv, c0).xyz;\n vec3 dpdx = (dl < dr) ? ce - getViewPosition((uv - vec2(1.0 / size.x, 0.0)), l1).xyz\n : -ce + getViewPosition((uv + vec2(1.0 / size.x, 0.0)), r1).xyz;\n vec3 dpdy = (db < dt) ? ce - getViewPosition((uv - vec2(0.0, 1.0 / size.y)), b1).xyz\n : -ce + getViewPosition((uv + vec2(0.0, 1.0 / size.y)), t1).xyz;\n return normalize(cross(dpdx, dpdy));\n }\n\n vec3 getViewNormal(const vec2 uv) {\n #if NORMAL_VECTOR_TYPE == 2\n return normalize(textureLod(tNormal, uv, 0.).rgb);\n #elif NORMAL_VECTOR_TYPE == 1\n return unpackRGBToNormal(textureLod(tNormal, uv, 0.).rgb);\n #else\n return computeNormalFromDepth(uv);\n #endif\n }\n\n vec3 getAntiAliasedViewNormal(const in vec2 screenPosition) {\n #if NORMAL_VECTOR_TYPE == 2\n #if NORMAL_VECTOR_ANTIALIAS == 1\n vec2 uv = screenPosition;\n vec2 size = vec2(textureSize(tNormal, 0));\n ivec2 p = ivec2(screenPosition * size);\n float c0 = texelFetch(tNormal, p, 0).a;\n float l2 = texelFetch(tNormal, p - ivec2(2, 0), 0).a;\n float l1 = texelFetch(tNormal, p - ivec2(1, 0), 0).a;\n float r1 = texelFetch(tNormal, p + ivec2(1, 0), 0).a;\n float r2 = texelFetch(tNormal, p + ivec2(2, 0), 0).a;\n float b2 = texelFetch(tNormal, p - ivec2(0, 2), 0).a;\n float b1 = texelFetch(tNormal, p - ivec2(0, 1), 0).a;\n float t1 = texelFetch(tNormal, p + ivec2(0, 1), 0).a;\n float t2 = texelFetch(tNormal, p + ivec2(0, 2), 0).a;\n float dl = abs((2.0 * l1 - l2) - c0);\n float dr = abs((2.0 * r1 - r2) - c0);\n float db = abs((2.0 * b1 - b2) - c0);\n float dt = abs((2.0 * t1 - t2) - c0);\n vec3 ce = getViewPosition(uv, c0).xyz;\n vec3 dpdx = (dl < dr) ? ce - getViewPosition((uv - vec2(1.0 / size.x, 0.0)), l1).xyz\n : -ce + getViewPosition((uv + vec2(1.0 / size.x, 0.0)), r1).xyz;\n vec3 dpdy = (db < dt) ? ce - getViewPosition((uv - vec2(0.0, 1.0 / size.y)), b1).xyz\n : -ce + getViewPosition((uv + vec2(0.0, 1.0 / size.y)), t1).xyz;\n return normalize(cross(dpdx, dpdy));\n #elif NORMAL_VECTOR_ANTIALIAS == 2\n vec2 size = vec2(textureSize(tNormal, 0));\n ivec2 p = ivec2(screenPosition * size);\n vec3 normalVector = texelFetch(tNormal, p, 0).xyz;\n normalVector += texelFetch(tNormal, p + ivec2(1, 0), 0).xyz;\n normalVector += texelFetch(tNormal, p - ivec2(1, 0), 0).xyz;\n normalVector += texelFetch(tNormal, p + ivec2(0, 1), 0).xyz;\n normalVector += texelFetch(tNormal, p - ivec2(0, 1), 0).xyz;\n return normalize(normalVector);\n #else\n return texture2D(tNormal, screenPosition).xyz;\n #endif\n #elif NORMAL_VECTOR_TYPE == 1\n return unpackRGBToNormal(textureLod(tNormal, screenPosition, 0.).rgb);\n #else\n return computeNormalFromDepth(screenPosition);\n #endif\n }\n\n vec3 getSceneUvAndDepth(vec3 sampleViewPos) {\n vec4 sampleClipPos = cameraProjectionMatrix * vec4(sampleViewPos, 1.);\n vec2 sampleUv = sampleClipPos.xy / sampleClipPos.w * 0.5 + 0.5;\n float sampleSceneDepth = getDepth(sampleUv);\n return vec3(sampleUv, sampleSceneDepth);\n }\n\n float sinusToPlane(vec3 pointOnPlane, vec3 planeNormal, vec3 point) {\n vec3 delta = point - pointOnPlane;\n float sinV = dot(planeNormal, normalize(delta));\n return sinV;\n }\n\n float getFallOff(float delta, float falloffDistance) {\n float fallOff = smoothstep(0., 1., 1. - distanceFallOff * abs(delta) / falloffDistance);\n return fallOff;\n }\n\n void main() {\n float depth = getDepth(vUv.xy);\n if (depth >= 1.0) {\n discard;\n return;\n }\n vec3 viewPos = getViewPosition(vUv, depth);\n vec3 viewNormal = getAntiAliasedViewNormal(vUv);\n\n float radiusToUse = radius;\n float distanceFalloffToUse = thickness;\n #if SCREEN_SPACE_RADIUS == 1\n float radiusScale = getViewPosition(vec2(0.5 + float(SCREEN_SPACE_RADIUS_SCALE) / resolution.x, 0.0), depth).x;\n radiusToUse *= radiusScale;\n distanceFalloffToUse *= radiusScale;\n #endif\n\n #if SCENE_CLIP_BOX == 1\n vec3 worldPos = (cameraWorldMatrix * vec4(viewPos, 1.0)).xyz;\n float boxDistance = length(max(vec3(0.0), max(sceneBoxMin - worldPos, worldPos - sceneBoxMax)));\n if (boxDistance > radiusToUse) {\n discard;\n return;\n }\n #endif\n\n vec2 noiseResolution = vec2(textureSize(tNoise, 0));\n vec2 noiseUv = vUv * resolution / noiseResolution;\n vec4 noiseTexel = textureLod(tNoise, noiseUv, 0.0);\n vec3 randomVec = noiseTexel.xyz * 2.0 - 1.0;\n\n #if NV_ALIGNED_SAMPLES == 1\n vec3 tangent = normalize(randomVec - viewNormal * dot(randomVec, viewNormal));\n vec3 bitangent = cross(viewNormal, tangent);\n mat3 kernelMatrix = mat3(tangent, bitangent, viewNormal);\n #else\n vec3 tangent = normalize(vec3(randomVec.xy, 0.));\n vec3 bitangent = vec3(-tangent.y, tangent.x, 0.);\n mat3 kernelMatrix = mat3(tangent, bitangent, vec3(0., 0., 1.));\n #endif\n\n #if AO_ALGORITHM == 4\n const int DIRECTIONS = SAMPLES < 30 ? 3 : 5;\n const int STEPS = (SAMPLES + DIRECTIONS - 1) / DIRECTIONS;\n #elif AO_ALGORITHM == 3\n const int DIRECTIONS = SAMPLES < 16 ? 3 : 5;\n const int STEPS = (SAMPLES + DIRECTIONS - 1) / DIRECTIONS;\n #else\n const int DIRECTIONS = SAMPLES;\n const int STEPS = 1;\n #endif\n\n float ao = 0.0, totalWeight = 0.0;\n for (int i = 0; i < DIRECTIONS; ++i) {\n\n #if AO_ALGORITHM == 4\n float angle = float(i) / float(DIRECTIONS) * PI;\n vec4 sampleDir = vec4(cos(angle), sin(angle), 0., 0.5 + 0.5 * noiseTexel.w);\n #elif AO_ALGORITHM == 3\n float angle = float(i) / float(DIRECTIONS) * 2. * PI;\n vec4 sampleDir = vec4(cos(angle), sin(angle), 0., 0.5 + 0.5 * noiseTexel.w);\n #else\n vec4 sampleDir = sampleKernel[i];\n #endif\n sampleDir.xyz = normalize(kernelMatrix * sampleDir.xyz);\n\n vec3 viewDir = normalize(-viewPos.xyz);\n vec3 sliceBitangent = normalize(cross(sampleDir.xyz, viewDir));\n vec3 sliceTangent = cross(sliceBitangent, viewDir);\n vec3 normalInSlice = normalize(viewNormal - sliceBitangent * dot(viewNormal, sliceBitangent));\n\n #if (AO_ALGORITHM == 3 || AO_ALGORITHM == 4)\n vec3 tangentToNormalInSlice = cross(normalInSlice, sliceBitangent);\n #if AO_ALGORITHM == 4\n vec2 cosHorizons = vec2(dot(viewDir, tangentToNormalInSlice), dot(viewDir, -tangentToNormalInSlice));\n #else\n vec2 cosHorizons = vec2(dot(viewDir, tangentToNormalInSlice));\n #endif\n for (int j = 0; j < STEPS; ++j) {\n vec3 sampleViewOffset = sampleDir.xyz * radiusToUse * sampleDir.w * pow(float(j + 1) / float(STEPS), distanceExponent);\n vec3 sampleViewPos = viewPos + sampleViewOffset;\n #else\n vec3 sampleViewPos = viewPos + sampleDir.xyz * radiusToUse * pow(sampleDir.w, distanceExponent);\n #endif\n\n vec3 sampleSceneUvDepth = getSceneUvAndDepth(sampleViewPos);\n vec3 sampleSceneViewPos = getViewPosition(sampleSceneUvDepth.xy, sampleSceneUvDepth.z);\n float sceneSampleDist = abs(sampleSceneViewPos.z);\n float sampleDist = abs(sampleViewPos.z);\n\n #if (AO_ALGORITHM == 3 || AO_ALGORITHM == 4)\n // HBAO || GTAO\n vec3 viewDelta = sampleSceneViewPos - viewPos;\n if (abs(viewDelta.z) < thickness) {\n vec2 clipRangeCheck = step(0., sampleSceneUvDepth.xy) * step(sampleSceneUvDepth.xy, vec2(1.));\n float sampleCosHorizon = dot(viewDir, normalize(viewDelta));\n cosHorizons.x += max(0., (sampleCosHorizon - cosHorizons.x) * mix(1., 2. / float(j + 2), distanceFallOff) * clipRangeCheck.x * clipRangeCheck.y);\n }\n #if AO_ALGORITHM == 4\n sampleSceneUvDepth = getSceneUvAndDepth(viewPos - sampleViewOffset);\n sampleSceneViewPos = getViewPosition(sampleSceneUvDepth.xy, sampleSceneUvDepth.z);\n viewDelta = sampleSceneViewPos - viewPos;\n if (abs(viewDelta.z) < thickness) {\n vec2 clipRangeCheck = step(0., sampleSceneUvDepth.xy) * step(sampleSceneUvDepth.xy, vec2(1.));\n float sampleCosHorizon = dot(viewDir, normalize(viewDelta));\n cosHorizons.y += max(0., (sampleCosHorizon - cosHorizons.y) * mix(1., 2. / float(j + 2), distanceFallOff) * clipRangeCheck.x * clipRangeCheck.y);\n }\n #endif\n #elif AO_ALGORITHM == 2\n // N8AO\n float weight = dot(viewNormal, sampleDir.xyz);\n float occlusion = weight * step(sceneSampleDist + bias, sampleDist);\n #elif AO_ALGORITHM == 1\n // SAO\n vec3 viewDelta = sampleSceneViewPos - viewPos;\n float minResolution = 0.; // ?\n float scaledViewDist = length( viewDelta ) / scale;\n float weight = 1.;\n float occlusion = max(0., (dot(viewNormal, viewDelta) - minResolution) / scaledViewDist - bias) / (1. + scaledViewDist * scaledViewDist );\n #else\n // SSAO\n float weight = 1.;\n float occlusion = step(sceneSampleDist + bias, sampleDist);\n #endif\n\n #if AO_ALGORITHM == 4\n }\n // GTAO\n vec2 sinHorizons = sqrt(1. - cosHorizons * cosHorizons);\n float nx = dot(normalInSlice, sliceTangent);\n float ny = dot(normalInSlice, viewDir);\n float nxb = 1. / 2. * (acos(cosHorizons.y) - acos(cosHorizons.x) + sinHorizons.x * cosHorizons.x - sinHorizons.y * cosHorizons.y);\n float nyb = 1. / 2. * (2. - cosHorizons.x * cosHorizons.x - cosHorizons.y * cosHorizons.y);\n float occlusion = nx * nxb + ny * nyb;\n ao += occlusion;\n }\n ao = clamp(ao / float(DIRECTIONS), 0., 1.);\n #elif AO_ALGORITHM == 3\n }\n totalWeight += 1.;\n ao += max(0., cosHorizons.x - max(0., cosHorizons.y));\n }\n ao /= totalWeight + 1. - step(0., totalWeight);\n ao = clamp(1. - ao, 0., 1.);\n #else\n\n float fallOff = getFallOff(sceneSampleDist - sampleDist, distanceFalloffToUse);\n occlusion *= fallOff;\n vec2 diff = (vUv - sampleSceneUvDepth.xy) * resolution;\n occlusion *= step(1., dot(diff, diff));\n vec2 clipRangeCheck = step(0., sampleSceneUvDepth.xy) * step(sampleSceneUvDepth.xy, vec2(1.));\n occlusion *= clipRangeCheck.x * clipRangeCheck.y;\n weight *= clipRangeCheck.x * clipRangeCheck.y;\n totalWeight += weight;\n ao += occlusion;\n }\n ao /= totalWeight + 1. - step(0., totalWeight);\n ao = clamp(1. - ao, 0., 1.);\n #endif\n\n #if SCENE_CLIP_BOX == 1\n ao = mix(ao, 1., smoothstep(0., radiusToUse, boxDistance));\n #endif\n #if AO_ALGORITHM != 1\n ao = pow(ao, scale);\n #endif\n gl_FragColor = FRAGMENT_OUTPUT;\n }"
|
|
1035
1035
|
}, We = {
|
|
1036
1036
|
resolutionScale: 1,
|
|
1037
|
-
algorithm:
|
|
1037
|
+
algorithm: X.SSAO,
|
|
1038
1038
|
samples: 32,
|
|
1039
1039
|
radius: .25,
|
|
1040
1040
|
distanceExponent: 2,
|
|
@@ -1048,16 +1048,16 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1048
1048
|
return this._renderTarget ? this._renderTarget?.texture : null;
|
|
1049
1049
|
}
|
|
1050
1050
|
constructor(e, t, n, r, i) {
|
|
1051
|
-
this.needsUpdate = !0, this.parameters = { ...We }, this._width = 0, this._height = 0, this._samples = 0, this._gBufferAntiAliasing = !1, this._normalVectorSourceType =
|
|
1051
|
+
this.needsUpdate = !0, this.parameters = { ...We }, this._width = 0, this._height = 0, this._samples = 0, this._gBufferAntiAliasing = !1, this._normalVectorSourceType = J.FLOAT_BUFFER_NORMAL, this._depthValueSourceType = Y.NORMAL_VECTOR_ALPHA, this._modulateRedChannel = !1, this.depthTexture = null, this.normalTexture = null, this._noiseTexture = null, this._renderTarget = null, this._passRenderer = new Re(), this._sceneClipBox = new E(new f(-1, -1, -1), new f(1, 1, 1)), this._sceneScale = 1, this._width = e, this._height = t, this._samples = n, this._gBufferAntiAliasing = r, this._normalVectorSourceType = i?.normalVectorSourceType || J.FLOAT_BUFFER_NORMAL, this._depthValueSourceType = i?.depthValueSourceType || Y.NORMAL_VECTOR_ALPHA, this._modulateRedChannel = i?.modulateRedChannel || !1, i?.aoParameters && (this.parameters = i.aoParameters), i && this.updateTextures(i);
|
|
1052
1052
|
}
|
|
1053
1053
|
_getNoiseTexture(e = 64) {
|
|
1054
1054
|
if (!this._noiseTexture) {
|
|
1055
|
-
let t = new
|
|
1056
|
-
for (let
|
|
1057
|
-
let a =
|
|
1058
|
-
|
|
1055
|
+
let t = new je(), n = new Uint8Array(e * e * 4);
|
|
1056
|
+
for (let r = 0; r < e; r++) for (let i = 0; i < e; i++) {
|
|
1057
|
+
let a = r, o = i;
|
|
1058
|
+
n[(r * e + i) * 4] = (t.noise(a, o) + 1) * 127.5, n[(r * e + i) * 4 + 1] = (t.noise(a + e, o) + 1) * 127.5, n[(r * e + i) * 4 + 2] = (t.noise(a, o + e) + 1) * 127.5, n[(r * e + i) * 4 + 3] = (t.noise(a + e, o + e) + 1) * 127.5;
|
|
1059
1059
|
}
|
|
1060
|
-
this._noiseTexture = new n
|
|
1060
|
+
this._noiseTexture = new h(n, e, e, o, P), this._noiseTexture.wrapS = l, this._noiseTexture.wrapT = l, this._noiseTexture.needsUpdate = !0;
|
|
1061
1061
|
}
|
|
1062
1062
|
return this._noiseTexture;
|
|
1063
1063
|
}
|
|
@@ -1066,30 +1066,30 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1066
1066
|
return this._aoMaterial || (this._aoMaterial = this._newAoMaterial(), n = !0), n && (this._updateShader(this._aoMaterial, e), this._aoMaterial.needsUpdate = !0), this._updateUniforms(this._aoMaterial, e, n), this._aoMaterial;
|
|
1067
1067
|
}
|
|
1068
1068
|
_newAoMaterial() {
|
|
1069
|
-
let e = new
|
|
1069
|
+
let e = new m({
|
|
1070
1070
|
defines: Object.assign({}, Ue.defines),
|
|
1071
|
-
uniforms:
|
|
1071
|
+
uniforms: D.clone(Ue.uniforms),
|
|
1072
1072
|
vertexShader: Ue.vertexShader,
|
|
1073
1073
|
fragmentShader: Ue.fragmentShader,
|
|
1074
1074
|
depthTest: !1,
|
|
1075
1075
|
depthWrite: !1
|
|
1076
1076
|
});
|
|
1077
|
-
return this._modulateRedChannel && (e.blending = 5, e.blendEquation = 103, e.blendEquationAlpha = null, e.blendSrc = 201, e.blendSrcAlpha = null, e.blendDst = 201, e.blendDstAlpha = null), e.defines.FRAGMENT_OUTPUT = this._modulateRedChannel ? "vec4(ao, 1., 1., 1.)" : void 0, e.uniforms.tNoise.value =
|
|
1077
|
+
return this._modulateRedChannel && (e.blending = 5, e.blendEquation = 103, e.blendEquationAlpha = null, e.blendSrc = 201, e.blendSrcAlpha = null, e.blendDst = 201, e.blendDstAlpha = null), e.defines.FRAGMENT_OUTPUT = this._modulateRedChannel ? "vec4(ao, 1., 1., 1.)" : void 0, e.uniforms.tNoise.value = Le(5), e;
|
|
1078
1078
|
}
|
|
1079
1079
|
_updateShader(e, t) {
|
|
1080
|
-
e.defines.PERSPECTIVE_CAMERA = t.isPerspectiveCamera ? 1 : 0, e.defines.SAMPLES = this.parameters.samples, e.defines.SAMPLE_VECTORS = Ve(this.parameters.samples, this.parameters.algorithm ===
|
|
1080
|
+
e.defines.PERSPECTIVE_CAMERA = t.isPerspectiveCamera ? 1 : 0, e.defines.SAMPLES = this.parameters.samples, e.defines.SAMPLE_VECTORS = Ve(this.parameters.samples, this.parameters.algorithm === X.SSAO), e.defines.NORMAL_VECTOR_TYPE = this._normalVectorSourceType === J.FLOAT_BUFFER_NORMAL ? 2 : 1, e.defines.DEPTH_SWIZZLING = this._depthValueSourceType === Y.NORMAL_VECTOR_ALPHA ? "a" : "x", e.defines.AO_ALGORITHM = this.parameters.algorithm, e.defines.NV_ALIGNED_SAMPLES = this.parameters.algorithm === X.HBAO || this.parameters.algorithm === X.GTAO ? 0 : 1, e.defines.SCREEN_SPACE_RADIUS = this.parameters.screenSpaceRadius ? 1 : 0, e.defines.SCENE_CLIP_BOX = 1, e.defines.NORMAL_VECTOR_ANTIALIAS = this._gBufferAntiAliasing ? 2 : 0, e.defines.DEPTH_BUFFER_ANTIALIAS = this._gBufferAntiAliasing ? 1 : 0;
|
|
1081
1081
|
}
|
|
1082
1082
|
_updateUniforms(e, t, n) {
|
|
1083
|
-
let r = this.parameters.screenSpaceRadius ? 1 : this._sceneScale, i = this._depthValueSourceType ===
|
|
1083
|
+
let r = this.parameters.screenSpaceRadius ? 1 : this._sceneScale, i = this._depthValueSourceType === Y.NORMAL_VECTOR_ALPHA ? this.normalTexture : this.depthTexture;
|
|
1084
1084
|
e.uniforms.tNormal.value = this.normalTexture, e.uniforms.tDepth.value = i, e.uniforms.resolution.value.set(this._width, this._height), e.uniforms.cameraProjectionMatrix.value.copy(t.projectionMatrix), e.uniforms.cameraProjectionMatrixInverse.value.copy(t.projectionMatrixInverse), e.uniforms.cameraWorldMatrix.value.copy(t.matrixWorld);
|
|
1085
1085
|
let a = t;
|
|
1086
1086
|
e.uniforms.cameraNear.value = a.near, e.uniforms.cameraFar.value = a.far, n && (e.uniforms.radius.value = this.parameters.radius * r, e.uniforms.distanceExponent.value = this.parameters.distanceExponent, e.uniforms.thickness.value = this.parameters.thickness * r, e.uniforms.distanceFallOff.value = this.parameters.distanceFallOff, e.uniforms.scale.value = this.parameters.scale, this._sceneClipBox && (e.uniforms.sceneBoxMin.value.copy(this._sceneClipBox.min), e.uniforms.sceneBoxMax.value.copy(this._sceneClipBox.max)));
|
|
1087
1087
|
}
|
|
1088
1088
|
_getRenderTargets() {
|
|
1089
|
-
return this._renderTarget ||= new
|
|
1089
|
+
return this._renderTarget ||= new i(this._width, this._height, {
|
|
1090
1090
|
samples: this._samples,
|
|
1091
|
-
magFilter: this._samples > 1 ?
|
|
1092
|
-
minFilter: this._samples > 1 ?
|
|
1091
|
+
magFilter: this._samples > 1 ? F : S,
|
|
1092
|
+
minFilter: this._samples > 1 ? F : S
|
|
1093
1093
|
}), this._renderTarget;
|
|
1094
1094
|
}
|
|
1095
1095
|
dispose() {
|
|
@@ -1099,7 +1099,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1099
1099
|
this._width = e, this._height = t, this._renderTarget?.setSize(e, t), this.needsUpdate = !0;
|
|
1100
1100
|
}
|
|
1101
1101
|
updateBounds(e, t) {
|
|
1102
|
-
this._sceneClipBox = new
|
|
1102
|
+
this._sceneClipBox = new E().copy(e), this._sceneScale = t ?? 1, this.needsUpdate = !0;
|
|
1103
1103
|
}
|
|
1104
1104
|
updateParameters(e) {
|
|
1105
1105
|
for (let t in e) this.parameters.hasOwnProperty(t) && (this.parameters[t] = e[t], this.needsUpdate = !0);
|
|
@@ -1117,14 +1117,14 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1117
1117
|
}, Ke = {
|
|
1118
1118
|
uniforms: {
|
|
1119
1119
|
tDiffuse: { value: null },
|
|
1120
|
-
intensity: { value: new
|
|
1120
|
+
intensity: { value: new z(1, 1) }
|
|
1121
1121
|
},
|
|
1122
1122
|
vertexShader: "\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = (projectionMatrix * modelViewMatrix * vec4(position, 1.0)).xyww;\n }",
|
|
1123
1123
|
fragmentShader: "\n uniform sampler2D tDiffuse;\n uniform vec2 intensity;\n varying vec2 vUv;\n\n void main() {\n vec4 textureColor = texture2D(tDiffuse, vUv);\n vec2 aoAndShadow = vec2(1.0) - intensity + intensity * textureColor.rg;\n gl_FragColor = vec4(vec3(aoAndShadow.r * aoAndShadow.g), 1.0);\n }"
|
|
1124
|
-
}, qe = class extends
|
|
1124
|
+
}, qe = class extends m {
|
|
1125
1125
|
constructor(e) {
|
|
1126
1126
|
super({
|
|
1127
|
-
uniforms:
|
|
1127
|
+
uniforms: D.clone(Ke.uniforms),
|
|
1128
1128
|
vertexShader: Ke.vertexShader,
|
|
1129
1129
|
fragmentShader: Ke.fragmentShader,
|
|
1130
1130
|
transparent: !0,
|
|
@@ -1136,7 +1136,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1136
1136
|
blendSrcAlpha: 206,
|
|
1137
1137
|
blendDstAlpha: 200,
|
|
1138
1138
|
blendEquationAlpha: 100
|
|
1139
|
-
}), this._intensity = new
|
|
1139
|
+
}), this._intensity = new z(1, 1), this.uniforms.intensity.value = this._intensity, this.update(e);
|
|
1140
1140
|
}
|
|
1141
1141
|
update(e) {
|
|
1142
1142
|
return e?.texture !== void 0 && (this.uniforms.tDiffuse.value = e.texture), e?.blending !== void 0 && (this.blending = e.blending), e?.aoIntensity !== void 0 && (this._intensity.x = e.aoIntensity), e?.shadowIntensity !== void 0 && (this._intensity.y = e.shadowIntensity), this;
|
|
@@ -1152,7 +1152,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1152
1152
|
let i = [];
|
|
1153
1153
|
for (let a = 0; a < e; a++) {
|
|
1154
1154
|
let o = 2 * Math.PI * t * a / e, s = (1 + (n - 1) * (a / (e - 1)) ** r) / n;
|
|
1155
|
-
i.push(new
|
|
1155
|
+
i.push(new f(Math.cos(o), Math.sin(o), s));
|
|
1156
1156
|
}
|
|
1157
1157
|
return i;
|
|
1158
1158
|
}, Xe = {
|
|
@@ -1174,10 +1174,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1174
1174
|
tNormal: { value: null },
|
|
1175
1175
|
tDepth: { value: null },
|
|
1176
1176
|
tNoise: { value: null },
|
|
1177
|
-
resolution: { value: new
|
|
1178
|
-
cameraProjectionMatrix: { value: new
|
|
1179
|
-
cameraProjectionMatrixInverse: { value: new
|
|
1180
|
-
cameraWorldMatrix: { value: new
|
|
1177
|
+
resolution: { value: new z() },
|
|
1178
|
+
cameraProjectionMatrix: { value: new L() },
|
|
1179
|
+
cameraProjectionMatrixInverse: { value: new L() },
|
|
1180
|
+
cameraWorldMatrix: { value: new L() },
|
|
1181
1181
|
lumaPhi: { value: 5 },
|
|
1182
1182
|
depthPhi: { value: 1 },
|
|
1183
1183
|
normalPhi: { value: 1 },
|
|
@@ -1185,8 +1185,8 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1185
1185
|
radiusExponent: { value: 1.3 },
|
|
1186
1186
|
iteration: { value: 0 },
|
|
1187
1187
|
noOfIterations: { value: 2 },
|
|
1188
|
-
sceneBoxMin: { value: new
|
|
1189
|
-
sceneBoxMax: { value: new
|
|
1188
|
+
sceneBoxMin: { value: new f(-1, -1, -1) },
|
|
1189
|
+
sceneBoxMax: { value: new f(1, 1, 1) }
|
|
1190
1190
|
},
|
|
1191
1191
|
vertexShader: "\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
|
|
1192
1192
|
fragmentShader: "\nvarying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform sampler2D tNormal;\nuniform sampler2D tDepth;\nuniform sampler2D tNoise;\nuniform vec2 resolution;\nuniform mat4 cameraProjectionMatrix;\nuniform mat4 cameraProjectionMatrixInverse;\nuniform mat4 cameraWorldMatrix;\nuniform float lumaPhi;\nuniform float depthPhi;\nuniform float normalPhi;\nuniform float radius;\nuniform float radiusExponent;\nuniform int iteration;\nuniform int noOfIterations;\n#if SCENE_CLIP_BOX == 1\n uniform vec3 sceneBoxMin;\n uniform vec3 sceneBoxMax;\n#endif\n\n#include <common>\n#include <packing>\n\n#if LUMINANCE_WEIGHTED == 1 \n\n#ifndef LUMINANCE_TYPE\n#define LUMINANCE_TYPE float\n#endif\n#ifndef SAMPLE_LUMINANCE\n#define SAMPLE_LUMINANCE dot(vec3(0.2125, 0.7154, 0.0721), a)\n#endif\n#define WEIGHT_TYPE LUMINANCE_TYPE\n\n#else\n#define WEIGHT_TYPE float\n#endif\n\n#ifndef FRAGMENT_OUTPUT\n#define FRAGMENT_OUTPUT vec4(vec3(denoised), 1.)\n#endif\n\nLUMINANCE_TYPE getLuminance(const in vec3 a) {\n return SAMPLE_LUMINANCE;\n}\n\nconst vec3 poissonDisk[SAMPLES] = SAMPLE_VECTORS;\n\nvec3 getViewPosition(const in vec2 screenPosition, const in float depth) {\n vec4 clipSpacePosition = vec4(vec3(screenPosition, depth) * 2.0 - 1.0, 1.0);\n vec4 viewSpacePosition = cameraProjectionMatrixInverse * clipSpacePosition;\n return viewSpacePosition.xyz / viewSpacePosition.w;\n}\n\nfloat getDepth(const vec2 uv) {\n#if DEPTH_VALUE_SOURCE == 1 \n return textureLod(tDepth, uv.xy, 0.0).a;\n#else\n return textureLod(tDepth, uv.xy, 0.0).r;\n#endif\n}\n\nfloat fetchDepth(const ivec2 uv) {\n#if DEPTH_VALUE_SOURCE == 1 \n return texelFetch(tDepth, uv.xy, 0).a;\n#else\n return texelFetch(tDepth, uv.xy, 0).r;\n#endif\n}\n\nvec3 computeNormalFromDepth(const vec2 uv) {\n vec2 size = vec2(textureSize(tDepth, 0));\n ivec2 p = ivec2(uv * size);\n float c0 = fetchDepth(p);\n float l2 = fetchDepth(p - ivec2(2, 0));\n float l1 = fetchDepth(p - ivec2(1, 0));\n float r1 = fetchDepth(p + ivec2(1, 0));\n float r2 = fetchDepth(p + ivec2(2, 0));\n float b2 = fetchDepth(p - ivec2(0, 2));\n float b1 = fetchDepth(p - ivec2(0, 1));\n float t1 = fetchDepth(p + ivec2(0, 1));\n float t2 = fetchDepth(p + ivec2(0, 2));\n float dl = abs((2.0 * l1 - l2) - c0);\n float dr = abs((2.0 * r1 - r2) - c0);\n float db = abs((2.0 * b1 - b2) - c0);\n float dt = abs((2.0 * t1 - t2) - c0);\n vec3 ce = getViewPosition(uv, c0).xyz;\n vec3 dpdx = (dl < dr) ? ce - getViewPosition((uv - vec2(1.0 / size.x, 0.0)), l1).xyz\n : -ce + getViewPosition((uv + vec2(1.0 / size.x, 0.0)), r1).xyz;\n vec3 dpdy = (db < dt) ? ce - getViewPosition((uv - vec2(0.0, 1.0 / size.y)), b1).xyz\n : -ce + getViewPosition((uv + vec2(0.0, 1.0 / size.y)), t1).xyz;\n return normalize(cross(dpdx, dpdy));\n}\n\nvec3 getViewNormal(const vec2 uv) {\n#if NORMAL_VECTOR_TYPE == 2\n return normalize(textureLod(tNormal, uv, 0.).rgb);\n#elif NORMAL_VECTOR_TYPE == 1\n return unpackRGBToNormal(textureLod(tNormal, uv, 0.).rgb);\n#else\n return computeNormalFromDepth(uv);\n#endif\n}\n\nvoid denoiseSample(in vec3 center, in vec3 viewNormal, in vec3 viewPos, in vec2 sampleUv, inout vec3 denoised, inout WEIGHT_TYPE totalWeight) {\n vec4 sampleTexel = textureLod(tDiffuse, sampleUv, 0.0);\n float sampleDepth = getDepth(sampleUv);\n vec3 sampleNormal = getViewNormal(sampleUv);\n vec3 neighborColor = sampleTexel.rgb;\n vec3 viewPosSample = getViewPosition(sampleUv, sampleDepth);\n \n float normalDiff = dot(viewNormal, sampleNormal);\n float normalSimilarity = pow(max(normalDiff, 0.), normalPhi);\n float depthDiff = abs(dot(normalize(viewPos - viewPosSample), viewNormal));\n float depthSimilarity = max(1. - depthDiff / depthPhi, 0.);\n #if LUMINANCE_WEIGHTED == 1 \n LUMINANCE_TYPE lumaDiff = abs(getLuminance(neighborColor) - getLuminance(center));\n LUMINANCE_TYPE lumaSimilarity = max(1. - lumaDiff / lumaPhi, 0.);\n LUMINANCE_TYPE w = lumaSimilarity * depthSimilarity * normalSimilarity;\n #else\n WEIGHT_TYPE w = depthSimilarity * normalSimilarity;\n #endif\n\n denoised += w * neighborColor;\n totalWeight += w;\n}\n\nvoid main() {\n float depth = fetchDepth(ivec2(vec2(textureSize(tDepth, 0)) * vUv.xy)); \n vec3 viewNormal = getViewNormal(vUv); \n if (depth == 1. || dot(viewNormal, viewNormal) == 0.) {\n discard;\n return;\n }\n vec4 texel = textureLod(tDiffuse, vUv, 0.0);\n vec3 center = texel.rgb;\n vec3 viewPos = getViewPosition(vUv, depth);\n\n #if SCENE_CLIP_BOX == 1\n vec3 worldPos = (cameraWorldMatrix * vec4(viewPos, 1.0)).xyz;\n float boxDistance = length(max(vec3(0.0), max(sceneBoxMin - worldPos, worldPos - sceneBoxMax)));\n if (boxDistance > radius * 2.) {\n discard;\n return;\n }\n #endif\n\n vec2 noiseResolution = vec2(textureSize(tNoise, 0));\n vec2 noiseUv = vUv * resolution / noiseResolution;\n vec4 noiseTexel = textureLod(tNoise, noiseUv, 0.0);\n vec2 noiseVec = vec2(sin(noiseTexel[iteration % 4] * 2. * PI), cos(noiseTexel[iteration % 4] * 2. * PI));\n #if SAMPLE_DISTRIBUTION == 1\n vec3 randomVec = normalize(vec3(noiseVec.xy, 0.));\n vec3 tangent = normalize(randomVec - viewNormal * dot(randomVec, viewNormal));\n vec3 bitangent = cross(viewNormal, tangent);\n mat3 kernelMatrix = mat3(tangent, bitangent, viewNormal);\n #else\n mat2 rotationMatrix = mat2(noiseVec.x, -noiseVec.y, noiseVec.x, noiseVec.y);\n #endif\n\n WEIGHT_TYPE totalWeight = WEIGHT_TYPE(1.);\n vec3 denoised = texel.rgb;\n for (int i = 0; i < SAMPLES; i++) {\n vec3 sampleDir = poissonDisk[i];\n #if SAMPLE_DISTRIBUTION == 1\n vec3 offsetViewPos = viewPos + normalize(kernelMatrix * vec3(sampleDir.xy, 0.)) * sampleDir.z * radius * radius;\n vec4 samplePointNDC = cameraProjectionMatrix * vec4(offsetViewPos, 1.0); \n vec2 sampleUv = (samplePointNDC.xy / samplePointNDC.w * 0.5 + 0.5);\n #else\n vec2 offset = rotationMatrix * sampleDir.xy * (1. + sampleDir.z * (radius - 1.));\n offset *= mix(vec2(1.0), sqrt(1.0 - viewNormal.xy * viewNormal.xy), float(iteration) / float(noOfIterations-1));\n offset *= max(1.0, 1.0 / length(offset));\n vec2 sampleUv = vUv + offset / resolution;\n #endif\n denoiseSample(center, viewNormal, viewPos, sampleUv, denoised, totalWeight);\n }\n\n denoised /= totalWeight + 1.0 - step(0.0, totalWeight);\n gl_FragColor = FRAGMENT_OUTPUT;\n}"
|
|
@@ -1208,24 +1208,24 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1208
1208
|
this._inputTexture = e;
|
|
1209
1209
|
}
|
|
1210
1210
|
constructor(e, t, n, r) {
|
|
1211
|
-
this.needsUpdate = !0, this.parameters = { ...Ze }, this._width = 0, this._height = 0, this._samples = 0, this._normalVectorSourceType =
|
|
1211
|
+
this.needsUpdate = !0, this.parameters = { ...Ze }, this._width = 0, this._height = 0, this._samples = 0, this._normalVectorSourceType = J.FLOAT_BUFFER_NORMAL, this._depthValueSourceType = Y.NORMAL_VECTOR_ALPHA, this._inputTexture = null, this.depthTexture = null, this.normalTexture = null, this._noiseTexture = null, this._renderTargets = [], this._outputRenderTargetIndex = 0, this._passRenderer = new Re(), this._rgInputTexture = !1, this._luminanceWeighted = !0, this._width = e, this._height = t, this._samples = n, this._normalVectorSourceType = r?.normalVectorSourceType || J.FLOAT_BUFFER_NORMAL, this._depthValueSourceType = r?.depthValueSourceType || Y.NORMAL_VECTOR_ALPHA, this._inputTexture = r?.inputTexture || null, this.depthTexture = r?.depthTexture || null, this.normalTexture = r?.normalTexture || null, this._rgInputTexture = r?.rgInputTexture || !1, this._luminanceWeighted = r?.luminanceWeighted === !0, this._luminanceType = r?.luminanceType || "vec3", this._sampleLuminance = r?.sampleLuminance || "a", this._fragmentOutput = r?.fragmentOutput || "vec4(denoised.xyz, 1.)", r?.poissonDenoisePassParameters && (this.parameters = r.poissonDenoisePassParameters), r && this.updateTextures(r);
|
|
1212
1212
|
}
|
|
1213
1213
|
_getNoiseTexture(e = 64) {
|
|
1214
1214
|
if (!this._noiseTexture) {
|
|
1215
|
-
let t = new
|
|
1216
|
-
for (let
|
|
1217
|
-
let a =
|
|
1218
|
-
|
|
1215
|
+
let t = new je(), n = new Uint8Array(e * e * 4);
|
|
1216
|
+
for (let r = 0; r < e; r++) for (let i = 0; i < e; i++) {
|
|
1217
|
+
let a = r, o = i;
|
|
1218
|
+
n[(r * e + i) * 4] = (t.noise(a, o) + 1) * 127.5, n[(r * e + i) * 4 + 1] = (t.noise(a + e, o) + 1) * 127.5, n[(r * e + i) * 4 + 2] = (t.noise(a, o + e) + 1) * 127.5, n[(r * e + i) * 4 + 3] = (t.noise(a + e, o + e) + 1) * 127.5;
|
|
1219
1219
|
}
|
|
1220
|
-
this._noiseTexture = new n
|
|
1220
|
+
this._noiseTexture = new h(n, e, e, o, P), this._noiseTexture.wrapS = l, this._noiseTexture.wrapT = l, this._noiseTexture.needsUpdate = !0;
|
|
1221
1221
|
}
|
|
1222
1222
|
return this._noiseTexture;
|
|
1223
1223
|
}
|
|
1224
1224
|
_getMaterial(e, t) {
|
|
1225
1225
|
let n = t;
|
|
1226
|
-
return this._pdMaterial || (this._pdMaterial = new
|
|
1226
|
+
return this._pdMaterial || (this._pdMaterial = new m({
|
|
1227
1227
|
defines: Object.assign({}, Xe.defines),
|
|
1228
|
-
uniforms:
|
|
1228
|
+
uniforms: D.clone(Xe.uniforms),
|
|
1229
1229
|
vertexShader: Xe.vertexShader,
|
|
1230
1230
|
fragmentShader: Xe.fragmentShader,
|
|
1231
1231
|
depthTest: !1,
|
|
@@ -1233,25 +1233,25 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1233
1233
|
}), this._pdMaterial.uniforms.tNoise.value = this._getNoiseTexture(), n = !0), n && this._updateShader(this._pdMaterial), this._updateUniforms(this._pdMaterial, e, n), this._pdMaterial;
|
|
1234
1234
|
}
|
|
1235
1235
|
_updateShader(e) {
|
|
1236
|
-
e.defines.SAMPLES = this.parameters.samples, e.defines.SAMPLE_VECTORS = Je(this.parameters.samples, this.parameters.rings, this.parameters.radius, this.parameters.radiusExponent), e.defines.SAMPLE_DISTRIBUTION = this.parameters.nvOrientatedSamples ? 1 : 0, e.defines.NORMAL_VECTOR_TYPE = this._normalVectorSourceType ===
|
|
1236
|
+
e.defines.SAMPLES = this.parameters.samples, e.defines.SAMPLE_VECTORS = Je(this.parameters.samples, this.parameters.rings, this.parameters.radius, this.parameters.radiusExponent), e.defines.SAMPLE_DISTRIBUTION = this.parameters.nvOrientatedSamples ? 1 : 0, e.defines.NORMAL_VECTOR_TYPE = this._normalVectorSourceType === J.FLOAT_BUFFER_NORMAL ? 2 : 1, e.defines.DEPTH_VALUE_SOURCE = this._depthValueSourceType === Y.NORMAL_VECTOR_ALPHA ? 1 : 0, e.needsUpdate = !0, e.defines.LUMINANCE_WEIGHTED = this._luminanceWeighted ? 1 : 0, e.defines.LUMINANCE_TYPE = this._luminanceType, e.defines.SAMPLE_LUMINANCE = this._sampleLuminance, e.defines.FRAGMENT_OUTPUT = this._fragmentOutput, e.defines.SCENE_CLIP_BOX = this._sceneClipBox ? 1 : 0, e.needsUpdate = !0;
|
|
1237
1237
|
}
|
|
1238
1238
|
_updateUniforms(e, t, n) {
|
|
1239
|
-
let r = this._depthValueSourceType ===
|
|
1239
|
+
let r = this._depthValueSourceType === Y.NORMAL_VECTOR_ALPHA ? this.normalTexture : this.depthTexture;
|
|
1240
1240
|
e.uniforms.tDiffuse.value = this._inputTexture, e.uniforms.tNormal.value = this.normalTexture, e.uniforms.tDepth.value = r, e.uniforms.resolution.value.set(this._width, this._height), t.projectionMatrix && e.uniforms.cameraProjectionMatrix.value.copy(t.projectionMatrix), t.projectionMatrixInverse && e.uniforms.cameraProjectionMatrixInverse.value.copy(t.projectionMatrixInverse), t.matrixWorld && e.uniforms.cameraWorldMatrix.value.copy(t.matrixWorld), n && (e.uniforms.lumaPhi.value = this.parameters.lumaPhi, e.uniforms.depthPhi.value = this.parameters.depthPhi, e.uniforms.normalPhi.value = this.parameters.normalPhi, e.uniforms.radius.value = this.parameters.radius, e.uniforms.radiusExponent.value = this.parameters.radiusExponent, this._sceneClipBox && (e.uniforms.sceneBoxMin.value.copy(this._sceneClipBox.min), e.uniforms.sceneBoxMax.value.copy(this._sceneClipBox.max)));
|
|
1241
1241
|
}
|
|
1242
1242
|
_getRenderTargets() {
|
|
1243
|
-
return this._renderTargets.length < 2 && (this._renderTargets = [new
|
|
1243
|
+
return this._renderTargets.length < 2 && (this._renderTargets = [new i(this._width, this._height, {
|
|
1244
1244
|
samples: this._samples,
|
|
1245
|
-
format:
|
|
1246
|
-
type:
|
|
1247
|
-
magFilter:
|
|
1248
|
-
minFilter:
|
|
1249
|
-
}), new
|
|
1245
|
+
format: o,
|
|
1246
|
+
type: re,
|
|
1247
|
+
magFilter: S,
|
|
1248
|
+
minFilter: S
|
|
1249
|
+
}), new i(this._width, this._height, {
|
|
1250
1250
|
samples: this._samples,
|
|
1251
|
-
format:
|
|
1252
|
-
type:
|
|
1253
|
-
magFilter:
|
|
1254
|
-
minFilter:
|
|
1251
|
+
format: o,
|
|
1252
|
+
type: re,
|
|
1253
|
+
magFilter: S,
|
|
1254
|
+
minFilter: S
|
|
1255
1255
|
})]), this._renderTargets;
|
|
1256
1256
|
}
|
|
1257
1257
|
dispose() {
|
|
@@ -1261,7 +1261,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1261
1261
|
this._width = e, this._height = t, this._renderTargets.forEach((n) => n.setSize(e, t)), this.needsUpdate = !0;
|
|
1262
1262
|
}
|
|
1263
1263
|
updateBounds(e) {
|
|
1264
|
-
this._sceneClipBox = new
|
|
1264
|
+
this._sceneClipBox = new E().copy(e), this.needsUpdate = !0;
|
|
1265
1265
|
}
|
|
1266
1266
|
updateParameters(e) {
|
|
1267
1267
|
for (let t in e) this.parameters.hasOwnProperty(t) && (this.parameters[t] = e[t], this.needsUpdate = !0);
|
|
@@ -1299,12 +1299,12 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1299
1299
|
shadowOnGround: !1,
|
|
1300
1300
|
alwaysUpdate: !1,
|
|
1301
1301
|
progressiveDenoiseIterations: 0
|
|
1302
|
-
}, et = class extends
|
|
1302
|
+
}, et = class extends q {
|
|
1303
1303
|
static {
|
|
1304
|
-
this.shadowTransform = new
|
|
1304
|
+
this.shadowTransform = new L().set(0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1);
|
|
1305
1305
|
}
|
|
1306
1306
|
get aoAndSoftShadowRenderTarget() {
|
|
1307
|
-
return this._aoAndSoftShadowRenderTarget = this._aoAndSoftShadowRenderTarget ?? new
|
|
1307
|
+
return this._aoAndSoftShadowRenderTarget = this._aoAndSoftShadowRenderTarget ?? new i(this._width, this._height, {
|
|
1308
1308
|
samples: this._samples,
|
|
1309
1309
|
format: 1030,
|
|
1310
1310
|
magFilter: this._samples > 1 ? 1006 : 1003,
|
|
@@ -1313,8 +1313,8 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1313
1313
|
}
|
|
1314
1314
|
get aoRenderPass() {
|
|
1315
1315
|
return this._aoPass ||= new Ge(this._width, this._height, this._samples, !this.parameters.applyToMaterial, {
|
|
1316
|
-
normalVectorSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ?
|
|
1317
|
-
depthValueSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ?
|
|
1316
|
+
normalVectorSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? J.FLOAT_BUFFER_NORMAL : J.INPUT_RGB_NORMAL,
|
|
1317
|
+
depthValueSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? Y.NORMAL_VECTOR_ALPHA : Y.SEPARATE_BUFFER,
|
|
1318
1318
|
modulateRedChannel: !0,
|
|
1319
1319
|
aoParameters: this.parameters.ao
|
|
1320
1320
|
}), this._aoPass;
|
|
@@ -1324,8 +1324,8 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1324
1324
|
inputTexture: void 0,
|
|
1325
1325
|
depthTexture: this.gBufferTextures.depthBufferTexture,
|
|
1326
1326
|
normalTexture: this.gBufferTextures.gBufferTexture,
|
|
1327
|
-
normalVectorSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ?
|
|
1328
|
-
depthValueSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ?
|
|
1327
|
+
normalVectorSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? J.FLOAT_BUFFER_NORMAL : J.INPUT_RGB_NORMAL,
|
|
1328
|
+
depthValueSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? Y.NORMAL_VECTOR_ALPHA : Y.SEPARATE_BUFFER,
|
|
1329
1329
|
rgInputTexture: !0,
|
|
1330
1330
|
luminanceWeighted: !1,
|
|
1331
1331
|
fragmentOutput: "vec4(1.0, denoised.x, 0.0, 1.0)",
|
|
@@ -1348,7 +1348,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1348
1348
|
return this._softShadowPass;
|
|
1349
1349
|
}
|
|
1350
1350
|
get fadeRenderTarget() {
|
|
1351
|
-
return this._fadeRenderTarget = this._fadeRenderTarget ?? new
|
|
1351
|
+
return this._fadeRenderTarget = this._fadeRenderTarget ?? new i(this._width, this._height, {
|
|
1352
1352
|
samples: this._samples,
|
|
1353
1353
|
format: 1030,
|
|
1354
1354
|
magFilter: this._samples > 1 ? 1006 : 1003,
|
|
@@ -1360,8 +1360,8 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1360
1360
|
inputTexture: this.aoAndSoftShadowRenderTarget.texture,
|
|
1361
1361
|
depthTexture: this.gBufferTextures.depthBufferTexture,
|
|
1362
1362
|
normalTexture: this.gBufferTextures.gBufferTexture,
|
|
1363
|
-
normalVectorSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ?
|
|
1364
|
-
depthValueSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ?
|
|
1363
|
+
normalVectorSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? J.FLOAT_BUFFER_NORMAL : J.INPUT_RGB_NORMAL,
|
|
1364
|
+
depthValueSourceType: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? Y.NORMAL_VECTOR_ALPHA : Y.SEPARATE_BUFFER,
|
|
1365
1365
|
rgInputTexture: !0,
|
|
1366
1366
|
luminanceWeighted: !1,
|
|
1367
1367
|
fragmentOutput: "vec4(denoised.xy, vec2(fract(depth * 1024.0), floor(depth * 1024.0)))",
|
|
@@ -1386,7 +1386,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1386
1386
|
shadowFadeInBlurType: Z.FULL,
|
|
1387
1387
|
shadowFadeInMix: 0,
|
|
1388
1388
|
noOStaticFrames: 0
|
|
1389
|
-
}, this._cameraUpdate = new
|
|
1389
|
+
}, this._cameraUpdate = new Fe(), this._finalTexture = null, this._onlyHardShadow = !1, this._width = t, this._height = n, this._samples = r, this.parameters = {
|
|
1390
1390
|
enabled: i?.enabled ?? Q.enabled,
|
|
1391
1391
|
applyToMaterial: i?.applyToMaterial ?? Q.applyToMaterial,
|
|
1392
1392
|
aoIntensity: i?.aoIntensity ?? Q.aoIntensity,
|
|
@@ -1398,7 +1398,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1398
1398
|
shadow: { ...$e },
|
|
1399
1399
|
ao: { ...We },
|
|
1400
1400
|
poissonDenoise: { ...Ze }
|
|
1401
|
-
}, this._copyMaterial = new
|
|
1401
|
+
}, this._copyMaterial = new G(), this._blendMaterial = new G({}, Ce.DEFAULT), this._blendAoAndShadowMaterial = new qe();
|
|
1402
1402
|
}
|
|
1403
1403
|
dispose() {
|
|
1404
1404
|
super.dispose(), this._aoAndSoftShadowRenderTarget?.dispose(), this._softShadowPass?.dispose(), this._aoPass?.dispose(), this._fadeRenderTarget?.dispose(), this._poissonDenoisePass?.dispose(), this._copyMaterial?.dispose(), this._blendMaterial?.dispose(), this._blendAoAndShadowMaterial?.dispose();
|
|
@@ -1467,13 +1467,13 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1467
1467
|
return i && (this._copyMaterial.update({
|
|
1468
1468
|
texture: t,
|
|
1469
1469
|
blending: 0,
|
|
1470
|
-
colorTransform:
|
|
1471
|
-
colorBase:
|
|
1470
|
+
colorTransform: B,
|
|
1471
|
+
colorBase: H,
|
|
1472
1472
|
multiplyChannels: 0
|
|
1473
1473
|
}), this.passRenderer.renderScreenSpace(e, this._copyMaterial, this.fadeRenderTarget)), r > .001 && (this._blendMaterial.update({
|
|
1474
1474
|
texture: n,
|
|
1475
1475
|
blending: i ? 5 : 0,
|
|
1476
|
-
colorTransform: new
|
|
1476
|
+
colorTransform: new L().set(0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, i ? r : 1),
|
|
1477
1477
|
multiplyChannels: 0
|
|
1478
1478
|
}), this.passRenderer.renderScreenSpace(e, this._blendMaterial, this.fadeRenderTarget)), this.fadeRenderTarget.texture;
|
|
1479
1479
|
}
|
|
@@ -1539,7 +1539,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1539
1539
|
aoIntensity: .3,
|
|
1540
1540
|
shadow: { shadowRadius: .1 },
|
|
1541
1541
|
ao: {
|
|
1542
|
-
algorithm:
|
|
1542
|
+
algorithm: X.SSAO,
|
|
1543
1543
|
samples: 32,
|
|
1544
1544
|
radius: .02,
|
|
1545
1545
|
distanceExponent: 2,
|
|
@@ -1562,7 +1562,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1562
1562
|
if (e.length === 0) return null;
|
|
1563
1563
|
if (e.length === 1) return e[0];
|
|
1564
1564
|
let t = e[0];
|
|
1565
|
-
for (let n = 1; n < e.length; n++) t =
|
|
1565
|
+
for (let n = 1; n < e.length; n++) t = _e(t, e[n]);
|
|
1566
1566
|
return t;
|
|
1567
1567
|
}, at = (e) => e ? { groundReflectionParameters: { enabled: !1 } } : null, ot = (e) => !e || e === nt.DEFAULT ? null : e === nt.BRIGHT ? rt : null, $ = (e) => Math.max(0, Math.min(1, e)), st = (e) => {
|
|
1568
1568
|
let t = {
|
|
@@ -1676,7 +1676,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1676
1676
|
addLineOrPoint(e) {}
|
|
1677
1677
|
addObject(e) {}
|
|
1678
1678
|
addMesh(e) {
|
|
1679
|
-
this._doNotWriteDepth && this._doNotWriteDepth(e) && e.material instanceof
|
|
1679
|
+
this._doNotWriteDepth && this._doNotWriteDepth(e) && e.material instanceof b && e.material.depthWrite && this._depthWriteCache.add(e.material);
|
|
1680
1680
|
}
|
|
1681
1681
|
onBeforeRender() {
|
|
1682
1682
|
this._depthWriteCache.forEach((e) => {
|
|
@@ -1697,7 +1697,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1697
1697
|
}
|
|
1698
1698
|
onBeforeRender() {
|
|
1699
1699
|
this._objectCache.forEach((e, t) => {
|
|
1700
|
-
t instanceof
|
|
1700
|
+
t instanceof C && (t.material !== e.originalObjectData.material && t.material !== e.updateObjectData.material && (e.originalObjectData.material = t.material), t.receiveShadow !== e.originalObjectData.receiveShadow && (e.originalObjectData.receiveShadow = t.receiveShadow), t.castShadow !== e.originalObjectData.castShadow && (e.originalObjectData.castShadow = t.castShadow), t.visible !== e.originalObjectData.visible && (e.originalObjectData.visible = t.visible)), this._updateObject(t, e.updateObjectData);
|
|
1701
1701
|
});
|
|
1702
1702
|
}
|
|
1703
1703
|
onAfterRender() {
|
|
@@ -1710,35 +1710,35 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1710
1710
|
originalObjectData: {
|
|
1711
1711
|
visible: e.visible,
|
|
1712
1712
|
castShadow: e.castShadow,
|
|
1713
|
-
receiveShadow: e instanceof
|
|
1714
|
-
material: e instanceof
|
|
1713
|
+
receiveShadow: e instanceof C ? e.receiveShadow : void 0,
|
|
1714
|
+
material: e instanceof C ? e.material : void 0
|
|
1715
1715
|
},
|
|
1716
1716
|
updateObjectData: t
|
|
1717
1717
|
});
|
|
1718
1718
|
}
|
|
1719
1719
|
_updateObject(e, t) {
|
|
1720
|
-
t.visible !== void 0 && (e.visible = t.visible), t.castShadow !== void 0 && (e.castShadow = t.castShadow), e instanceof
|
|
1720
|
+
t.visible !== void 0 && (e.visible = t.visible), t.castShadow !== void 0 && (e.castShadow = t.castShadow), e instanceof C && t.receiveShadow !== void 0 && (e.receiveShadow = t.receiveShadow), e instanceof C && t.material !== void 0 && (e.material = t.material);
|
|
1721
1721
|
}
|
|
1722
1722
|
}, vt = (e) => {
|
|
1723
1723
|
if (!e.isMesh || !e.castShadow && !e.userData?.meshId) return !1;
|
|
1724
1724
|
let t = e.material;
|
|
1725
1725
|
return !t.transparent || t.opacity > .5;
|
|
1726
|
-
}, yt = class extends
|
|
1726
|
+
}, yt = class extends q {
|
|
1727
1727
|
static {
|
|
1728
1728
|
this.addTestMesh = !1;
|
|
1729
1729
|
}
|
|
1730
1730
|
get shadowGroundPlane() {
|
|
1731
1731
|
let e = this._sharedShadowGroundPlane;
|
|
1732
|
-
return e ||= (this._shadowGroundPlane ??= new
|
|
1732
|
+
return e ||= (this._shadowGroundPlane ??= new Be(this.renderTarget.texture, this.parameters), this._shadowGroundPlane), e.parent !== this._groundGroup && this._groundGroup.add(e), e;
|
|
1733
1733
|
}
|
|
1734
1734
|
constructor(e, t, n, r) {
|
|
1735
|
-
super(e), this.limitPlaneSize = !0, this.needsUpdate = !0, this.noNeedOfUpdateCount = 0, this._blurScale = 1, this._shadowScale = 1, this._groundGroup = n, this.shadowMapSize = r.shadowMapSize ?? 2048, this.parameters = this._getDefaultParameters(r), this._groundShadowFar = this.parameters.cameraFar, this._renderer = t, this.renderCacheManager?.registerCache(this, new ht((e) => e.isMesh && !vt(e) || e.name !== void 0 && ["Ground", "Floor"].includes(e.name))), this.renderTarget = new
|
|
1735
|
+
super(e), this.limitPlaneSize = !0, this.needsUpdate = !0, this.noNeedOfUpdateCount = 0, this._blurScale = 1, this._shadowScale = 1, this._groundGroup = n, this.shadowMapSize = r.shadowMapSize ?? 2048, this.parameters = this._getDefaultParameters(r), this._groundShadowFar = this.parameters.cameraFar, this._renderer = t, this.renderCacheManager?.registerCache(this, new ht((e) => e.isMesh && !vt(e) || e.name !== void 0 && ["Ground", "Floor"].includes(e.name))), this.renderTarget = new i(this.shadowMapSize, this.shadowMapSize), this.renderTarget.texture.generateMipmaps = !1, this._renderTargetBlur = new i(this.shadowMapSize, this.shadowMapSize), this._renderTargetBlur.texture.generateMipmaps = !1, this._sharedShadowGroundPlane = r?.sharedShadowGroundPlane, this.shadowGroundPlane.setShadowMap(this.renderTarget.texture), this.shadowGroundPlane.updateMaterial(this.parameters), this._groundContactCamera = new bt(), this._groundGroup.add(this._groundContactCamera), this._depthMaterial = new le(), this._depthMaterial.userData.fadeoutBias = { value: this.parameters.fadeoutBias }, this._depthMaterial.userData.fadeoutFalloff = { value: this.parameters.fadeoutFalloff }, this._depthMaterial.onBeforeCompile = (e) => {
|
|
1736
1736
|
e.uniforms.fadeoutBias = this._depthMaterial.userData.fadeoutBias, e.uniforms.fadeoutFalloff = this._depthMaterial.userData.fadeoutFalloff, e.fragmentShader = `
|
|
1737
1737
|
uniform float fadeoutBias;
|
|
1738
1738
|
uniform float fadeoutFalloff;
|
|
1739
|
-
${e.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );",
|
|
1739
|
+
${e.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );", Be.alphaMap ? "gl_FragColor = vec4(clamp(pow(1.0 + fadeoutBias - fragCoordZ, 1.0/(1.0-fadeoutFalloff)), 0.0, 1.0));" : "gl_FragColor = vec4(vec3(0.0), clamp(pow(1.0 + fadeoutBias - fragCoordZ, 1.0/(1.0-fadeoutFalloff)), 0.0, 1.0));")}
|
|
1740
1740
|
`;
|
|
1741
|
-
}, this._depthMaterial.side = 2, this._depthMaterial.depthTest = !0, this._depthMaterial.depthWrite = !0, this._blurPass = new
|
|
1741
|
+
}, this._depthMaterial.side = 2, this._depthMaterial.depthTest = !0, this._depthMaterial.depthWrite = !0, this._blurPass = new ze(we, {
|
|
1742
1742
|
...r,
|
|
1743
1743
|
passRenderer: this.renderPassManager.passRenderer
|
|
1744
1744
|
}), this.updatePlaneAndShadowCamera();
|
|
@@ -1828,7 +1828,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1828
1828
|
this.renderTarget
|
|
1829
1829
|
], [e, e], [t, t]);
|
|
1830
1830
|
}
|
|
1831
|
-
}, bt = class extends
|
|
1831
|
+
}, bt = class extends a {
|
|
1832
1832
|
constructor() {
|
|
1833
1833
|
super(-1, 1, -1, 1, -1, 1), this.rotation.x = Math.PI;
|
|
1834
1834
|
}
|
|
@@ -1839,12 +1839,12 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1839
1839
|
this.far = e, this.updateProjectionMatrix(), this.cameraHelper?.update();
|
|
1840
1840
|
}
|
|
1841
1841
|
updateCameraHelper(e, t) {
|
|
1842
|
-
e ? (this.cameraHelper = this.cameraHelper ?? new
|
|
1842
|
+
e ? (this.cameraHelper = this.cameraHelper ?? new ue(this), this.cameraHelper.visible = !0, t?.add(this.cameraHelper)) : this.cameraHelper?.parent && this.cameraHelper?.removeFromParent();
|
|
1843
1843
|
}
|
|
1844
1844
|
setCameraHelperVisibility(e) {
|
|
1845
1845
|
this.cameraHelper && (this.cameraHelper.visible = e);
|
|
1846
1846
|
}
|
|
1847
|
-
}, xt = "varying vec3 vNormal;\n#if LINEAR_DEPTH == 1\n varying float vZ; \n#endif\n\n void main() {\n vNormal = normalMatrix * normal;\n vec4 viewPosition = modelViewMatrix * vec4(position, 1.0);\n #if LINEAR_DEPTH == 1\n vZ = viewPosition.z; \n #endif\n gl_Position = projectionMatrix * viewPosition;\n }", St = "varying vec3 vNormal;\n#if LINEAR_DEPTH == 1\n varying float vZ; \n uniform float cameraNear;\n uniform float cameraFar;\n#endif\n\n void main() {\n #if FLOAT_BUFFER == 1\n vec3 normal = normalize(vNormal);\n #else\n vec3 normal = normalize(vNormal) * 0.5 + 0.5;\n #endif\n #if LINEAR_DEPTH == 1\n float depth = (-vZ - cameraNear) / (cameraFar - cameraNear);\n #else\n float depth = gl_FragCoord.z;\n #endif\n gl_FragColor = vec4(normal, depth);\n }", Ct = class e extends
|
|
1847
|
+
}, xt = "varying vec3 vNormal;\n#if LINEAR_DEPTH == 1\n varying float vZ; \n#endif\n\n void main() {\n vNormal = normalMatrix * normal;\n vec4 viewPosition = modelViewMatrix * vec4(position, 1.0);\n #if LINEAR_DEPTH == 1\n vZ = viewPosition.z; \n #endif\n gl_Position = projectionMatrix * viewPosition;\n }", St = "varying vec3 vNormal;\n#if LINEAR_DEPTH == 1\n varying float vZ; \n uniform float cameraNear;\n uniform float cameraFar;\n#endif\n\n void main() {\n #if FLOAT_BUFFER == 1\n vec3 normal = normalize(vNormal);\n #else\n vec3 normal = normalize(vNormal) * 0.5 + 0.5;\n #endif\n #if LINEAR_DEPTH == 1\n float depth = (-vZ - cameraNear) / (cameraFar - cameraNear);\n #else\n float depth = gl_FragCoord.z;\n #endif\n gl_FragColor = vec4(normal, depth);\n }", Ct = class e extends m {
|
|
1848
1848
|
static {
|
|
1849
1849
|
this._normalAndDepthShader = {
|
|
1850
1850
|
uniforms: {
|
|
@@ -1866,7 +1866,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1866
1866
|
FLOAT_BUFFER: t?.floatBufferType ? 1 : 0,
|
|
1867
1867
|
LINEAR_DEPTH: t?.linearDepth ? 1 : 0
|
|
1868
1868
|
}),
|
|
1869
|
-
uniforms:
|
|
1869
|
+
uniforms: D.clone(e._normalAndDepthShader.uniforms),
|
|
1870
1870
|
vertexShader: e._normalAndDepthShader.vertexShader,
|
|
1871
1871
|
fragmentShader: e._normalAndDepthShader.fragmentShader,
|
|
1872
1872
|
blending: t?.blending ?? 0
|
|
@@ -1879,7 +1879,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1879
1879
|
}
|
|
1880
1880
|
return this;
|
|
1881
1881
|
}
|
|
1882
|
-
}, wt = class extends
|
|
1882
|
+
}, wt = class extends q {
|
|
1883
1883
|
set groundDepthWrite(e) {
|
|
1884
1884
|
this._gBufferMaterialCache && (this._gBufferMaterialCache.groundDepthWrite = e);
|
|
1885
1885
|
}
|
|
@@ -1900,18 +1900,18 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1900
1900
|
blending: 0,
|
|
1901
1901
|
floatBufferType: !0,
|
|
1902
1902
|
linearDepth: !1
|
|
1903
|
-
}) : new
|
|
1903
|
+
}) : new ie({ blending: 0 })), this._gBufferRenderMaterial instanceof Ct && this._gBufferRenderMaterial.update({ camera: e }), this._gBufferRenderMaterial;
|
|
1904
1904
|
}
|
|
1905
1905
|
get depthNormalRenderTarget() {
|
|
1906
|
-
if (!this._depthNormalRenderTarget) if (this.floatRgbNormalAlphaDepth) this._depthNormalRenderTarget = new
|
|
1906
|
+
if (!this._depthNormalRenderTarget) if (this.floatRgbNormalAlphaDepth) this._depthNormalRenderTarget = new i(this._width * this.parameters.depthNormalScale, this._height * this.parameters.depthNormalScale, {
|
|
1907
1907
|
minFilter: this._targetMinificationTextureFilter,
|
|
1908
1908
|
magFilter: this._targetMagnificationTextureFilter,
|
|
1909
|
-
type:
|
|
1909
|
+
type: w,
|
|
1910
1910
|
samples: this._samples
|
|
1911
1911
|
});
|
|
1912
1912
|
else {
|
|
1913
|
-
let e = new
|
|
1914
|
-
e.format =
|
|
1913
|
+
let e = new v(this._width * this.parameters.depthNormalScale, this._height * this.parameters.depthNormalScale);
|
|
1914
|
+
e.format = c, e.type = te, this._depthNormalRenderTarget = new i(this._width * this.parameters.depthNormalScale, this._height * this.parameters.depthNormalScale, {
|
|
1915
1915
|
minFilter: this._targetMinificationTextureFilter,
|
|
1916
1916
|
magFilter: this._targetMagnificationTextureFilter,
|
|
1917
1917
|
depthTexture: e
|
|
@@ -1920,10 +1920,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1920
1920
|
return this._depthNormalRenderTarget;
|
|
1921
1921
|
}
|
|
1922
1922
|
get separateDeptRenderTarget() {
|
|
1923
|
-
return this._separateDeptRenderTarget ||= new
|
|
1923
|
+
return this._separateDeptRenderTarget ||= new i(this._width * this.parameters.depthNormalScale, this._height * this.parameters.depthNormalScale, {
|
|
1924
1924
|
minFilter: this._targetMinificationTextureFilter,
|
|
1925
1925
|
magFilter: this._targetMagnificationTextureFilter,
|
|
1926
|
-
type:
|
|
1926
|
+
type: w,
|
|
1927
1927
|
samples: 0
|
|
1928
1928
|
}), this._separateDeptRenderTarget;
|
|
1929
1929
|
}
|
|
@@ -1945,16 +1945,16 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1945
1945
|
this.passRenderer.renderWithOverrideMaterial(e, t, n, this.updateGBufferRenderMaterial(n), this.depthNormalRenderTarget, 7829503, 1);
|
|
1946
1946
|
}
|
|
1947
1947
|
getCopyMaterial(e) {
|
|
1948
|
-
return this._copyMaterial ??= new
|
|
1948
|
+
return this._copyMaterial ??= new G(), this._copyMaterial.update(e);
|
|
1949
1949
|
}
|
|
1950
1950
|
_copyDepthToSeparateDepthTexture(e, t) {
|
|
1951
1951
|
this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
1952
1952
|
texture: t.texture,
|
|
1953
1953
|
blending: 0,
|
|
1954
|
-
colorTransform:
|
|
1955
|
-
colorBase:
|
|
1954
|
+
colorTransform: be,
|
|
1955
|
+
colorBase: U,
|
|
1956
1956
|
multiplyChannels: 0,
|
|
1957
|
-
uvTransform:
|
|
1957
|
+
uvTransform: W
|
|
1958
1958
|
}), this.separateDeptRenderTarget);
|
|
1959
1959
|
}
|
|
1960
1960
|
}, Tt = class extends _t {
|
|
@@ -1974,7 +1974,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1974
1974
|
addObject(e) {
|
|
1975
1975
|
e.name === "dimensioning" && this.addToCache(e, { visible: !1 });
|
|
1976
1976
|
}
|
|
1977
|
-
}, Et = class extends
|
|
1977
|
+
}, Et = class extends q {
|
|
1978
1978
|
get reflectionRenderTarget() {
|
|
1979
1979
|
return this._reflectionRenderTarget = this._reflectionRenderTarget ?? this._newRenderTarget(!0), this._reflectionRenderTarget;
|
|
1980
1980
|
}
|
|
@@ -1998,18 +1998,18 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1998
1998
|
groundReflectionScale: 1,
|
|
1999
1999
|
renderTargetDownScale: 4,
|
|
2000
2000
|
...i
|
|
2001
|
-
}, this._copyMaterial = new
|
|
2001
|
+
}, this._copyMaterial = new G({}, Ce.ADDITIVE, !0, !0), this._updateCopyMaterial(null), this._reflectionIntensityMaterial = new kt({
|
|
2002
2002
|
width: this._width / this.parameters.renderTargetDownScale,
|
|
2003
2003
|
height: this._height / this.parameters.renderTargetDownScale
|
|
2004
|
-
}), this._blurPass = new
|
|
2004
|
+
}), this._blurPass = new ze(we, {
|
|
2005
2005
|
...i,
|
|
2006
2006
|
passRenderer: this.renderPassManager.passRenderer
|
|
2007
2007
|
});
|
|
2008
2008
|
}
|
|
2009
2009
|
_newRenderTarget(e) {
|
|
2010
2010
|
let t = this._width / this.parameters.renderTargetDownScale, n = this._height / this.parameters.renderTargetDownScale, r = {};
|
|
2011
|
-
return e ? (r.depthTexture = new
|
|
2012
|
-
format:
|
|
2011
|
+
return e ? (r.depthTexture = new v(t, n), r.samples = this._samples) : r.samples = 1, new i(t, n, {
|
|
2012
|
+
format: o,
|
|
2013
2013
|
...r
|
|
2014
2014
|
});
|
|
2015
2015
|
}
|
|
@@ -2032,13 +2032,13 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2032
2032
|
let n = this.parameters.intensity * t, r = this.parameters.brightness;
|
|
2033
2033
|
this._copyMaterial.update({
|
|
2034
2034
|
texture: e?.texture ?? void 0,
|
|
2035
|
-
colorTransform: new
|
|
2035
|
+
colorTransform: new L().set(r, 0, 0, 0, 0, r, 0, 0, 0, 0, r, 0, 0, 0, 0, n),
|
|
2036
2036
|
multiplyChannels: 0,
|
|
2037
|
-
uvTransform:
|
|
2037
|
+
uvTransform: Se
|
|
2038
2038
|
}), this._copyMaterial.depthTest = !0, this._copyMaterial.depthWrite = !1;
|
|
2039
2039
|
}
|
|
2040
2040
|
renderPass(e) {
|
|
2041
|
-
if (!this.parameters.enabled || !(this.camera instanceof
|
|
2041
|
+
if (!this.parameters.enabled || !(this.camera instanceof u)) return;
|
|
2042
2042
|
let t = this._createGroundReflectionCamera(this.camera);
|
|
2043
2043
|
this.renderCacheManager.render("groundReflection", this.scene, () => {
|
|
2044
2044
|
this._renderGroundReflection(e, this.scene, t, this.reflectionRenderTarget);
|
|
@@ -2064,7 +2064,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2064
2064
|
}), e.getRenderTarget()), e.setRenderTarget(r);
|
|
2065
2065
|
}
|
|
2066
2066
|
blurReflection(e, t, n) {
|
|
2067
|
-
let r = new
|
|
2067
|
+
let r = new f(t.matrixWorld.elements[4], t.matrixWorld.elements[5], t.matrixWorld.elements[6]), i = this.parameters.blurHorizontal / this._width, a = this.parameters.blurVertical / this._height * Math.abs(r.dot(new f(0, 0, 1)));
|
|
2068
2068
|
this._blurPass.render(e, n, [i * 4, a * 4], [i * 4 * (1 + this.parameters.blurAscent), a * 4 * (1 + this.parameters.blurAscent)]);
|
|
2069
2069
|
}
|
|
2070
2070
|
_createGroundReflectionCamera(e) {
|
|
@@ -2076,18 +2076,18 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2076
2076
|
bottom: 1 - n._offset.top
|
|
2077
2077
|
}, t.position.set(e.position.x, -e.position.y + 2 * this.parameters.groundLevel, e.position.z), t.rotation.set(-e.rotation.x, e.rotation.y, -e.rotation.z), t.updateMatrixWorld(), t.updateProjectionMatrix(), t;
|
|
2078
2078
|
}
|
|
2079
|
-
}, Dt = "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }", Ot = "\n uniform sampler2D tDiffuse;\n uniform sampler2D tDepth;\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform mat4 cameraProjectionMatrix;\n uniform mat4 cameraInverseProjectionMatrix;\n uniform mat4 inverseViewMatrix;\n uniform float groundLevel;\n uniform float fadeOutDistance;\n uniform float fadeOutExponent;\n varying vec2 vUv;\n\n #include <packing>\n\n float getDepth(const in vec2 screenPosition) {\n return texture2D(tDepth, screenPosition).x;\n }\n\n float getLinearDepth(const in vec2 screenPosition) {\n #if PERSPECTIVE_CAMERA == 1\n float fragCoordZ = texture2D(tDepth, screenPosition).x;\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\n #else\n return texture2D(tDepth, screenPosition).x;\n #endif\n }\n\n float getViewZ(const in float depth) {\n #if PERSPECTIVE_CAMERA == 1\n return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);\n #else\n return 0.0;//orthographicDepthToViewZ(depth, cameraNear, cameraFar);\n #endif\n }\n\n vec3 getViewPosition(const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n float clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n vec4 clipPosition = vec4((vec3(screenPosition, depth) - 0.5) * 2.0, 1.0);\n clipPosition *= clipW;\n return (cameraInverseProjectionMatrix * clipPosition).xyz;\n }\n\n void main() {\n float verticalBias = 1.5 / resolution.y;\n vec2 uv = vUv.xy + vec2(0.0, verticalBias);\n float depth = getDepth(uv);\n float viewZ = getViewZ(depth);\n vec4 worldPosition = inverseViewMatrix * vec4(getViewPosition(uv, depth, viewZ), 1.0);\n float distance = worldPosition.y - groundLevel;\n vec2 diffuseTextureSize = vec2(textureSize(tDiffuse, 0 ));\n vec4 fragColor = texelFetch(tDiffuse, ivec2(uv * diffuseTextureSize), 0).rgba;\n #if LINEAR_TO_SRGB == 1\n fragColor.rgb = mix(fragColor.rgb * 12.92, 1.055 * pow(fragColor.rgb, vec3(0.41666)) - 0.055, step(0.0031308, fragColor.rgb));\n #endif\n float fadeOutAlpha = pow(clamp(1.0 - distance / fadeOutDistance, 0.0, 1.0), fadeOutExponent);\n fragColor.a *= fadeOutAlpha * step(depth, 0.9999);\n #if PREMULTIPLIED_ALPHA == 1\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n #else\n gl_FragColor = fragColor;\n #endif\n }", kt = class e extends
|
|
2079
|
+
}, Dt = "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }", Ot = "\n uniform sampler2D tDiffuse;\n uniform sampler2D tDepth;\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform mat4 cameraProjectionMatrix;\n uniform mat4 cameraInverseProjectionMatrix;\n uniform mat4 inverseViewMatrix;\n uniform float groundLevel;\n uniform float fadeOutDistance;\n uniform float fadeOutExponent;\n varying vec2 vUv;\n\n #include <packing>\n\n float getDepth(const in vec2 screenPosition) {\n return texture2D(tDepth, screenPosition).x;\n }\n\n float getLinearDepth(const in vec2 screenPosition) {\n #if PERSPECTIVE_CAMERA == 1\n float fragCoordZ = texture2D(tDepth, screenPosition).x;\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\n #else\n return texture2D(tDepth, screenPosition).x;\n #endif\n }\n\n float getViewZ(const in float depth) {\n #if PERSPECTIVE_CAMERA == 1\n return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);\n #else\n return 0.0;//orthographicDepthToViewZ(depth, cameraNear, cameraFar);\n #endif\n }\n\n vec3 getViewPosition(const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n float clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n vec4 clipPosition = vec4((vec3(screenPosition, depth) - 0.5) * 2.0, 1.0);\n clipPosition *= clipW;\n return (cameraInverseProjectionMatrix * clipPosition).xyz;\n }\n\n void main() {\n float verticalBias = 1.5 / resolution.y;\n vec2 uv = vUv.xy + vec2(0.0, verticalBias);\n float depth = getDepth(uv);\n float viewZ = getViewZ(depth);\n vec4 worldPosition = inverseViewMatrix * vec4(getViewPosition(uv, depth, viewZ), 1.0);\n float distance = worldPosition.y - groundLevel;\n vec2 diffuseTextureSize = vec2(textureSize(tDiffuse, 0 ));\n vec4 fragColor = texelFetch(tDiffuse, ivec2(uv * diffuseTextureSize), 0).rgba;\n #if LINEAR_TO_SRGB == 1\n fragColor.rgb = mix(fragColor.rgb * 12.92, 1.055 * pow(fragColor.rgb, vec3(0.41666)) - 0.055, step(0.0031308, fragColor.rgb));\n #endif\n float fadeOutAlpha = pow(clamp(1.0 - distance / fadeOutDistance, 0.0, 1.0), fadeOutExponent);\n fragColor.a *= fadeOutAlpha * step(depth, 0.9999);\n #if PREMULTIPLIED_ALPHA == 1\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n #else\n gl_FragColor = fragColor;\n #endif\n }", kt = class e extends m {
|
|
2080
2080
|
static {
|
|
2081
2081
|
this.shader = {
|
|
2082
2082
|
uniforms: {
|
|
2083
2083
|
tDiffuse: { value: null },
|
|
2084
2084
|
tDepth: { value: null },
|
|
2085
|
-
resolution: { value: new
|
|
2085
|
+
resolution: { value: new z() },
|
|
2086
2086
|
cameraNear: { value: .1 },
|
|
2087
2087
|
cameraFar: { value: 1 },
|
|
2088
|
-
cameraProjectionMatrix: { value: new
|
|
2089
|
-
cameraInverseProjectionMatrix: { value: new
|
|
2090
|
-
inverseViewMatrix: { value: new
|
|
2088
|
+
cameraProjectionMatrix: { value: new L() },
|
|
2089
|
+
cameraInverseProjectionMatrix: { value: new L() },
|
|
2090
|
+
inverseViewMatrix: { value: new L() },
|
|
2091
2091
|
groundLevel: { value: 0 },
|
|
2092
2092
|
fadeOutDistance: { value: 1 },
|
|
2093
2093
|
fadeOutExponent: { value: 1 }
|
|
@@ -2104,7 +2104,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2104
2104
|
constructor(t) {
|
|
2105
2105
|
super({
|
|
2106
2106
|
defines: Object.assign({}, e.shader.defines),
|
|
2107
|
-
uniforms:
|
|
2107
|
+
uniforms: D.clone(e.shader.uniforms),
|
|
2108
2108
|
vertexShader: e.shader.vertexShader,
|
|
2109
2109
|
fragmentShader: e.shader.fragmentShader,
|
|
2110
2110
|
blending: 0
|
|
@@ -2121,7 +2121,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2121
2121
|
}
|
|
2122
2122
|
return e?.groundLevel !== void 0 && (this.uniforms.groundLevel.value = e?.groundLevel), e?.fadeOutDistance !== void 0 && (this.uniforms.fadeOutDistance.value = e?.fadeOutDistance), e?.fadeOutExponent !== void 0 && (this.uniforms.fadeOutExponent.value = e?.fadeOutExponent), this;
|
|
2123
2123
|
}
|
|
2124
|
-
}, At = class extends
|
|
2124
|
+
}, At = class extends fe {
|
|
2125
2125
|
constructor(e, t) {
|
|
2126
2126
|
let n = [
|
|
2127
2127
|
1,
|
|
@@ -2139,11 +2139,11 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2139
2139
|
1,
|
|
2140
2140
|
1,
|
|
2141
2141
|
0
|
|
2142
|
-
],
|
|
2143
|
-
|
|
2144
|
-
let
|
|
2145
|
-
super(
|
|
2146
|
-
let
|
|
2142
|
+
], r = new k();
|
|
2143
|
+
r.setAttribute("position", new ce(n, 3)), r.computeBoundingSphere();
|
|
2144
|
+
let i = new g({ fog: !1 });
|
|
2145
|
+
super(r, i), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
|
|
2146
|
+
let a = [
|
|
2147
2147
|
1,
|
|
2148
2148
|
1,
|
|
2149
2149
|
0,
|
|
@@ -2162,8 +2162,8 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2162
2162
|
1,
|
|
2163
2163
|
-1,
|
|
2164
2164
|
0
|
|
2165
|
-
],
|
|
2166
|
-
|
|
2165
|
+
], o = new k();
|
|
2166
|
+
o.setAttribute("position", new ce(a, 3)), o.computeBoundingSphere(), this.add(new C(o, new M({
|
|
2167
2167
|
side: 1,
|
|
2168
2168
|
fog: !1
|
|
2169
2169
|
})));
|
|
@@ -2180,21 +2180,21 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2180
2180
|
dispose() {
|
|
2181
2181
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
|
2182
2182
|
}
|
|
2183
|
-
}, jt = class e extends
|
|
2183
|
+
}, jt = class e extends O {
|
|
2184
2184
|
static {
|
|
2185
2185
|
this._enableGroundBoundary = !1;
|
|
2186
2186
|
}
|
|
2187
2187
|
static {
|
|
2188
|
-
this._shadowFadeOut = new
|
|
2188
|
+
this._shadowFadeOut = new z(.1, 20);
|
|
2189
2189
|
}
|
|
2190
2190
|
static {
|
|
2191
|
-
this._sceneBoxMin = new
|
|
2191
|
+
this._sceneBoxMin = new f(-1, -1, -1);
|
|
2192
2192
|
}
|
|
2193
2193
|
static {
|
|
2194
|
-
this._sceneBoxMax = new
|
|
2194
|
+
this._sceneBoxMax = new f(1, 1, 1);
|
|
2195
2195
|
}
|
|
2196
2196
|
static {
|
|
2197
|
-
this._distributionProperties = new
|
|
2197
|
+
this._distributionProperties = new n(1, 1, 1, 1);
|
|
2198
2198
|
}
|
|
2199
2199
|
constructor(e) {
|
|
2200
2200
|
super(e), this.customProgramCacheKey = this._customProgramCacheKey, this.onBeforeCompile = this._onBeforeCompile;
|
|
@@ -2232,7 +2232,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2232
2232
|
groundBoundary: 1,
|
|
2233
2233
|
fadeOutDistance: .1,
|
|
2234
2234
|
fadeOutBlur: 5
|
|
2235
|
-
}, It = class extends
|
|
2235
|
+
}, It = class extends q {
|
|
2236
2236
|
get shadowTexture() {
|
|
2237
2237
|
return this._shadowRenderTarget.texture;
|
|
2238
2238
|
}
|
|
@@ -2240,13 +2240,13 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2240
2240
|
this._shadowMapPassOverrideMaterialCache.shadowOnGround = e;
|
|
2241
2241
|
}
|
|
2242
2242
|
constructor(e, t, n) {
|
|
2243
|
-
super(e), this.needsUpdate = !1, this.drawGround = !0, this.shadowTypeNeedsUpdate = !0, this.shadowConfiguration = new zt(), this._shadowLightSources = [], this._shadowScale = 1, this._groundMapScale = 1, this._cameraUpdate = new
|
|
2243
|
+
super(e), this.needsUpdate = !1, this.drawGround = !0, this.shadowTypeNeedsUpdate = !0, this.shadowConfiguration = new zt(), this._shadowLightSources = [], this._shadowScale = 1, this._groundMapScale = 1, this._cameraUpdate = new Fe(), this._viewportSize = new z(t.x, t.y), this._samples = n?.samples ?? 0, this._shadowMapSize = n?.shadowMapSize ?? 1024, this.parameters = this._getScreenSpaceShadowMapParameters(n), this.castShadow = this.parameters.enableShadowMap, this._shadowMapPassOverrideMaterialCache = new Rt(), this.renderCacheManager?.registerCache(this, this._shadowMapPassOverrideMaterialCache);
|
|
2244
2244
|
let r = this._samples;
|
|
2245
|
-
this._shadowRenderTarget = new
|
|
2245
|
+
this._shadowRenderTarget = new i(this._viewportSize.x, this._viewportSize.y, {
|
|
2246
2246
|
samples: r,
|
|
2247
|
-
format:
|
|
2248
|
-
magFilter: this._samples > 0 ?
|
|
2249
|
-
minFilter: this._samples > 0 ?
|
|
2247
|
+
format: j,
|
|
2248
|
+
magFilter: this._samples > 0 ? F : S,
|
|
2249
|
+
minFilter: this._samples > 0 ? F : S
|
|
2250
2250
|
});
|
|
2251
2251
|
}
|
|
2252
2252
|
_getScreenSpaceShadowMapParameters(e) {
|
|
@@ -2265,7 +2265,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2265
2265
|
let n = this._shadowScale;
|
|
2266
2266
|
if (this._shadowScale = t, Math.abs(n - this._shadowScale) > 1e-5 && (this.shadowTypeNeedsUpdate = !0), this._shadowLightSources.forEach((t) => t.updateBounds(e)), this._shadowLightSources.length > 0) {
|
|
2267
2267
|
let e = this._shadowLightSources[0].getShadowLight().shadow?.camera;
|
|
2268
|
-
e instanceof
|
|
2268
|
+
e instanceof a && (this._groundMapScale = 2 * this._shadowMapSize / (Math.abs(e.right - e.left) + Math.abs(e.top - e.bottom)));
|
|
2269
2269
|
} else this._groundMapScale = 1;
|
|
2270
2270
|
this._shadowMapPassOverrideMaterialCache.setBoundingBox(e.bounds);
|
|
2271
2271
|
}
|
|
@@ -2311,7 +2311,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2311
2311
|
e.forEach((e) => {
|
|
2312
2312
|
let n = e.maxIntensity * t;
|
|
2313
2313
|
if (n >= .1 && e.position.z >= 0) {
|
|
2314
|
-
let t = new Ht(new
|
|
2314
|
+
let t = new Ht(new f(e.position.x, e.position.z, e.position.y).multiplyScalar(7), n, {
|
|
2315
2315
|
shadowMapSize: this._shadowMapSize,
|
|
2316
2316
|
shadowLightSourceType: this.parameters.shadowLightSourceType
|
|
2317
2317
|
});
|
|
@@ -2322,13 +2322,13 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2322
2322
|
_createShadowLightSourceArray(e) {
|
|
2323
2323
|
let t = [];
|
|
2324
2324
|
if (e) {
|
|
2325
|
-
let e = new Ut(new
|
|
2325
|
+
let e = new Ut(new f(0, 7, 0), { shadowMapSize: this._shadowMapSize });
|
|
2326
2326
|
t.push(e);
|
|
2327
2327
|
}
|
|
2328
2328
|
return this.parameters.enableGroundBoundary = e, t;
|
|
2329
2329
|
}
|
|
2330
2330
|
setSize(e, t) {
|
|
2331
|
-
this._viewportSize = new
|
|
2331
|
+
this._viewportSize = new z(e, t), this._shadowRenderTarget.setSize(this._viewportSize.x, this._viewportSize.y);
|
|
2332
2332
|
}
|
|
2333
2333
|
updatePositionAndTarget() {
|
|
2334
2334
|
this._shadowLightSources.forEach((e) => e.updatePositionAndTarget());
|
|
@@ -2392,10 +2392,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2392
2392
|
}
|
|
2393
2393
|
_createShadowMaterial(t) {
|
|
2394
2394
|
let n;
|
|
2395
|
-
return n = t === Lt.EMISSIVE || t === Lt.UNLIT ? new
|
|
2395
|
+
return n = t === Lt.EMISSIVE || t === Lt.UNLIT ? new M({
|
|
2396
2396
|
color: 16777215,
|
|
2397
2397
|
side: 2
|
|
2398
|
-
}) : t === Lt.SHADOW ? new
|
|
2398
|
+
}) : t === Lt.SHADOW ? new _({ side: 2 }) : e.useModifiedMaterial ? this._createCustomerShadowMaterial() : new ne({
|
|
2399
2399
|
color: 16777215,
|
|
2400
2400
|
shininess: 0,
|
|
2401
2401
|
polygonOffsetFactor: 0,
|
|
@@ -2423,7 +2423,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2423
2423
|
}
|
|
2424
2424
|
_setShadowMaterialForOpaqueObject(e) {
|
|
2425
2425
|
let t = e.material;
|
|
2426
|
-
t instanceof
|
|
2426
|
+
t instanceof g || t instanceof M ? this.addToCache(e, { material: this._unlitMaterial }) : t instanceof b ? this._setMeshShadowStandardMaterial(e, t) : this.addToCache(e, { material: e.receiveShadow ? this._shadowObjectMaterial : this._unlitMaterial });
|
|
2427
2427
|
}
|
|
2428
2428
|
_setMeshShadowStandardMaterial(e, t) {
|
|
2429
2429
|
let n = t.emissiveIntensity > 0 && (t.emissive.r > 0 || t.emissive.g > 0 || t.emissive.b > 0);
|
|
@@ -2493,7 +2493,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2493
2493
|
}
|
|
2494
2494
|
}, Bt = class {
|
|
2495
2495
|
constructor(e, t) {
|
|
2496
|
-
this._isVisibleBackup = !0, this._castShadowBackup = !0, this._shadowMapSize = t?.shadowMapSize ?? 1024, this._blurSamples = t?.blurSamples ?? 8, this._shadowLightSource = e, this._shadowLightSource.visible = !1, this._shadowLightSource.castShadow = !0, this._shadowLightSource.shadow && (this._shadowLightSource.shadow.mapSize = new
|
|
2496
|
+
this._isVisibleBackup = !0, this._castShadowBackup = !0, this._shadowMapSize = t?.shadowMapSize ?? 1024, this._blurSamples = t?.blurSamples ?? 8, this._shadowLightSource = e, this._shadowLightSource.visible = !1, this._shadowLightSource.castShadow = !0, this._shadowLightSource.shadow && (this._shadowLightSource.shadow.mapSize = new z(this._shadowMapSize, this._shadowMapSize), this._shadowLightSource.shadow.blurSamples = this._blurSamples, this._shadowLightSource.shadow.autoUpdate = !1), this._shadowLightSource.userData.shadowLightSource = this;
|
|
2497
2497
|
}
|
|
2498
2498
|
getPosition() {
|
|
2499
2499
|
return this._shadowLightSource.position;
|
|
@@ -2514,10 +2514,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2514
2514
|
e.remove(this._shadowLightSource);
|
|
2515
2515
|
}
|
|
2516
2516
|
updatePositionAndTarget() {
|
|
2517
|
-
this._updateShadowPositionAndTarget(this.getPosition(), new
|
|
2517
|
+
this._updateShadowPositionAndTarget(this.getPosition(), new f(0, 0, 0));
|
|
2518
2518
|
}
|
|
2519
2519
|
updateBounds(e) {
|
|
2520
|
-
if (this._shadowLightSource instanceof
|
|
2520
|
+
if (this._shadowLightSource instanceof oe) {
|
|
2521
2521
|
let t = this._shadowLightSource.shadow.camera, n = e.bounds.clone().applyMatrix4(t.matrixWorldInverse), r = Math.max(.001, Math.min(-n.min.z, -n.max.z)), i = Math.max(-n.min.z, -n.max.z), a = Math.max(Math.abs(n.min.x), Math.abs(n.max.x)), o = Math.max(Math.abs(n.min.y), Math.abs(n.max.y)), s = Math.atan2(Math.hypot(o, a) * 1.05, r);
|
|
2522
2522
|
t.aspect = 1, t.near = r, t.far = i, this._shadowLightSource.angle = s;
|
|
2523
2523
|
} else if (this._shadowLightSource.shadow) {
|
|
@@ -2532,7 +2532,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2532
2532
|
this._shadowLightSource.shadow && (this._shadowLightSource.shadow.needsUpdate = !0);
|
|
2533
2533
|
}
|
|
2534
2534
|
_updateShadowPositionAndTarget(e, t) {
|
|
2535
|
-
if (this._shadowLightSource instanceof
|
|
2535
|
+
if (this._shadowLightSource instanceof oe) {
|
|
2536
2536
|
let n = t.clone().sub(e), r = n.length();
|
|
2537
2537
|
n.normalize();
|
|
2538
2538
|
let i = t.clone().sub(n.clone().multiplyScalar(r * 4));
|
|
@@ -2557,7 +2557,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2557
2557
|
n = new y(16777215, 1);
|
|
2558
2558
|
break;
|
|
2559
2559
|
case Pt.SPOT_LIGHT_SHADOW:
|
|
2560
|
-
n = new
|
|
2560
|
+
n = new oe(16777215, 1, 0, Math.PI / 4, 0);
|
|
2561
2561
|
break;
|
|
2562
2562
|
}
|
|
2563
2563
|
n.position.copy(e.position), n.lookAt(0, 0, 0), super(n, t), this._rectAreaLight = e, this._rectAreaLight.userData.shadowLightSource = this, t?.addHelper && (this._rectLightHelper = new At(this._rectAreaLight), this._rectLightHelper.material.depthWrite = !1, this._rectAreaLight.add(this._rectLightHelper));
|
|
@@ -2629,35 +2629,35 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2629
2629
|
name: "FXAAShader",
|
|
2630
2630
|
uniforms: {
|
|
2631
2631
|
tDiffuse: { value: null },
|
|
2632
|
-
resolution: { value: new
|
|
2632
|
+
resolution: { value: new z(1 / 1024, 1 / 512) }
|
|
2633
2633
|
},
|
|
2634
2634
|
vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
|
|
2635
2635
|
fragmentShader: "\n\n uniform sampler2D tDiffuse;\n uniform vec2 resolution;\n varying vec2 vUv;\n\n #define EDGE_STEP_COUNT 6\n #define EDGE_GUESS 8.0\n #define EDGE_STEPS 1.0, 1.5, 2.0, 2.0, 2.0, 4.0\n const float edgeSteps[EDGE_STEP_COUNT] = float[EDGE_STEP_COUNT]( EDGE_STEPS );\n\n float _ContrastThreshold = 0.0312;\n float _RelativeThreshold = 0.063;\n float _SubpixelBlending = 1.0;\n\n vec4 Sample( sampler2D tex2D, vec2 uv ) {\n\n return texture( tex2D, uv );\n\n }\n\n float SampleLuminance( sampler2D tex2D, vec2 uv ) {\n\n return dot( Sample( tex2D, uv ).rgb, vec3( 0.3, 0.59, 0.11 ) );\n\n }\n\n float SampleLuminance( sampler2D tex2D, vec2 texSize, vec2 uv, float uOffset, float vOffset ) {\n\n uv += texSize * vec2(uOffset, vOffset);\n return SampleLuminance(tex2D, uv);\n\n }\n\n struct LuminanceData {\n\n float m, n, e, s, w;\n float ne, nw, se, sw;\n float highest, lowest, contrast;\n\n };\n\n LuminanceData SampleLuminanceNeighborhood( sampler2D tex2D, vec2 texSize, vec2 uv ) {\n\n LuminanceData l;\n l.m = SampleLuminance( tex2D, uv );\n l.n = SampleLuminance( tex2D, texSize, uv, 0.0, 1.0 );\n l.e = SampleLuminance( tex2D, texSize, uv, 1.0, 0.0 );\n l.s = SampleLuminance( tex2D, texSize, uv, 0.0, -1.0 );\n l.w = SampleLuminance( tex2D, texSize, uv, -1.0, 0.0 );\n\n l.ne = SampleLuminance( tex2D, texSize, uv, 1.0, 1.0 );\n l.nw = SampleLuminance( tex2D, texSize, uv, -1.0, 1.0 );\n l.se = SampleLuminance( tex2D, texSize, uv, 1.0, -1.0 );\n l.sw = SampleLuminance( tex2D, texSize, uv, -1.0, -1.0 );\n\n l.highest = max( max( max( max( l.n, l.e ), l.s ), l.w ), l.m );\n l.lowest = min( min( min( min( l.n, l.e ), l.s ), l.w ), l.m );\n l.contrast = l.highest - l.lowest;\n return l;\n\n }\n\n bool ShouldSkipPixel( LuminanceData l ) {\n\n float threshold = max( _ContrastThreshold, _RelativeThreshold * l.highest );\n return l.contrast < threshold;\n\n }\n\n float DeterminePixelBlendFactor( LuminanceData l ) {\n\n float f = 2.0 * ( l.n + l.e + l.s + l.w );\n f += l.ne + l.nw + l.se + l.sw;\n f *= 1.0 / 12.0;\n f = abs( f - l.m );\n f = clamp( f / l.contrast, 0.0, 1.0 );\n\n float blendFactor = smoothstep( 0.0, 1.0, f );\n return blendFactor * blendFactor * _SubpixelBlending;\n\n }\n\n struct EdgeData {\n\n bool isHorizontal;\n float pixelStep;\n float oppositeLuminance, gradient;\n\n };\n\n EdgeData DetermineEdge( vec2 texSize, LuminanceData l ) {\n\n EdgeData e;\n float horizontal =\n abs( l.n + l.s - 2.0 * l.m ) * 2.0 +\n abs( l.ne + l.se - 2.0 * l.e ) +\n abs( l.nw + l.sw - 2.0 * l.w );\n float vertical =\n abs( l.e + l.w - 2.0 * l.m ) * 2.0 +\n abs( l.ne + l.nw - 2.0 * l.n ) +\n abs( l.se + l.sw - 2.0 * l.s );\n e.isHorizontal = horizontal >= vertical;\n\n float pLuminance = e.isHorizontal ? l.n : l.e;\n float nLuminance = e.isHorizontal ? l.s : l.w;\n float pGradient = abs( pLuminance - l.m );\n float nGradient = abs( nLuminance - l.m );\n\n e.pixelStep = e.isHorizontal ? texSize.y : texSize.x;\n\n if (pGradient < nGradient) {\n\n e.pixelStep = -e.pixelStep;\n e.oppositeLuminance = nLuminance;\n e.gradient = nGradient;\n\n } else {\n\n e.oppositeLuminance = pLuminance;\n e.gradient = pGradient;\n\n }\n\n return e;\n\n }\n\n float DetermineEdgeBlendFactor( sampler2D tex2D, vec2 texSize, LuminanceData l, EdgeData e, vec2 uv ) {\n\n vec2 uvEdge = uv;\n vec2 edgeStep;\n if (e.isHorizontal) {\n\n uvEdge.y += e.pixelStep * 0.5;\n edgeStep = vec2( texSize.x, 0.0 );\n\n } else {\n\n uvEdge.x += e.pixelStep * 0.5;\n edgeStep = vec2( 0.0, texSize.y );\n\n }\n\n float edgeLuminance = ( l.m + e.oppositeLuminance ) * 0.5;\n float gradientThreshold = e.gradient * 0.25;\n\n vec2 puv = uvEdge + edgeStep * edgeSteps[0];\n float pLuminanceDelta = SampleLuminance( tex2D, puv ) - edgeLuminance;\n bool pAtEnd = abs( pLuminanceDelta ) >= gradientThreshold;\n\n for ( int i = 1; i < EDGE_STEP_COUNT && !pAtEnd; i++ ) {\n\n puv += edgeStep * edgeSteps[i];\n pLuminanceDelta = SampleLuminance( tex2D, puv ) - edgeLuminance;\n pAtEnd = abs( pLuminanceDelta ) >= gradientThreshold;\n\n }\n\n if ( !pAtEnd ) {\n\n puv += edgeStep * EDGE_GUESS;\n\n }\n\n vec2 nuv = uvEdge - edgeStep * edgeSteps[0];\n float nLuminanceDelta = SampleLuminance( tex2D, nuv ) - edgeLuminance;\n bool nAtEnd = abs( nLuminanceDelta ) >= gradientThreshold;\n\n for ( int i = 1; i < EDGE_STEP_COUNT && !nAtEnd; i++ ) {\n\n nuv -= edgeStep * edgeSteps[i];\n nLuminanceDelta = SampleLuminance( tex2D, nuv ) - edgeLuminance;\n nAtEnd = abs( nLuminanceDelta ) >= gradientThreshold;\n\n }\n\n if ( !nAtEnd ) {\n\n nuv -= edgeStep * EDGE_GUESS;\n\n }\n\n float pDistance, nDistance;\n if ( e.isHorizontal ) {\n\n pDistance = puv.x - uv.x;\n nDistance = uv.x - nuv.x;\n\n } else {\n\n pDistance = puv.y - uv.y;\n nDistance = uv.y - nuv.y;\n\n }\n\n float shortestDistance;\n bool deltaSign;\n if ( pDistance <= nDistance ) {\n\n shortestDistance = pDistance;\n deltaSign = pLuminanceDelta >= 0.0;\n\n } else {\n\n shortestDistance = nDistance;\n deltaSign = nLuminanceDelta >= 0.0;\n\n }\n\n if ( deltaSign == ( l.m - edgeLuminance >= 0.0 ) ) {\n\n return 0.0;\n\n }\n\n return 0.5 - shortestDistance / ( pDistance + nDistance );\n\n }\n\n vec4 ApplyFXAA( sampler2D tex2D, vec2 texSize, vec2 uv ) {\n\n LuminanceData luminance = SampleLuminanceNeighborhood( tex2D, texSize, uv );\n if ( ShouldSkipPixel( luminance ) ) {\n\n return Sample( tex2D, uv );\n\n }\n\n float pixelBlend = DeterminePixelBlendFactor( luminance );\n EdgeData edge = DetermineEdge( texSize, luminance );\n float edgeBlend = DetermineEdgeBlendFactor( tex2D, texSize, luminance, edge, uv );\n float finalBlend = max( pixelBlend, edgeBlend );\n\n if (edge.isHorizontal) {\n\n uv.y += edge.pixelStep * finalBlend;\n\n } else {\n\n uv.x += edge.pixelStep * finalBlend;\n\n }\n\n return Sample( tex2D, uv );\n\n }\n\n void main() {\n\n gl_FragColor = ApplyFXAA( tDiffuse, resolution.xy, vUv );\n\n }"
|
|
2636
|
-
}, Kt = class e extends
|
|
2636
|
+
}, Kt = class e extends q {
|
|
2637
2637
|
static {
|
|
2638
|
-
this.BlurDirectionX = new
|
|
2638
|
+
this.BlurDirectionX = new z(1, 0);
|
|
2639
2639
|
}
|
|
2640
2640
|
static {
|
|
2641
|
-
this.BlurDirectionY = new
|
|
2641
|
+
this.BlurDirectionY = new z(0, 1);
|
|
2642
2642
|
}
|
|
2643
2643
|
static {
|
|
2644
2644
|
this.highlightLines = !0;
|
|
2645
2645
|
}
|
|
2646
|
-
constructor(e, t, n, r, a,
|
|
2647
|
-
super(e), this.patternTexture = null, this.clearBackground = !1, this.renderScene = n, this.renderCamera = r, this.selectedObjects = a === void 0 ? [] : a, this.visibleEdgeColor = new
|
|
2648
|
-
let
|
|
2649
|
-
this.renderTargetMaskBuffer = new
|
|
2650
|
-
let
|
|
2651
|
-
this.copyUniforms =
|
|
2646
|
+
constructor(e, t, n, r, a, o) {
|
|
2647
|
+
super(e), this.patternTexture = null, this.clearBackground = !1, this.renderScene = n, this.renderCamera = r, this.selectedObjects = a === void 0 ? [] : a, this.visibleEdgeColor = new R(1, 1, 1), this.hiddenEdgeColor = new R(.1, .04, .02), this.edgeGlow = 0, this.usePatternTexture = !1, this.edgeThickness = 1, this.edgeStrength = 3, this.downSampleRatio = o?.downSampleRatio || 2, this.pulsePeriod = 0, this.edgeDetectionFxaa = o?.edgeDetectionFxaa || !1, this._visibilityCache = /* @__PURE__ */ new Map(), this.resolution = t === void 0 ? new z(256, 256) : new z(t.x, t.y);
|
|
2648
|
+
let s = Math.round(this.resolution.x / this.downSampleRatio), c = Math.round(this.resolution.y / this.downSampleRatio);
|
|
2649
|
+
this.renderTargetMaskBuffer = new i(this.resolution.x, this.resolution.y), this.renderTargetMaskBuffer.texture.name = "OutlinePass.mask", this.renderTargetMaskBuffer.texture.generateMipmaps = !1, this.prepareMaskMaterial = this._getPrepareMaskMaterial(this.gBufferTextures?.isFloatGBufferWithRgbNormalAlphaDepth), this.prepareMaskMaterial.side = 2, this.prepareMaskMaterial.fragmentShader = u(this.prepareMaskMaterial.fragmentShader, this.renderCamera), this.edgeDetectionFxaa && (this.fxaaRenderMaterial = new m(Gt), this.fxaaRenderMaterial.uniforms.tDiffuse.value = this.renderTargetMaskBuffer.texture, this.fxaaRenderMaterial.uniforms.resolution.value.set(1 / this.resolution.x, 1 / this.resolution.y), this.renderTargetFxaaBuffer = new i(this.resolution.x, this.resolution.y), this.renderTargetFxaaBuffer.texture.name = "OutlinePass.fxaa", this.renderTargetFxaaBuffer.texture.generateMipmaps = !1), this.renderTargetMaskDownSampleBuffer = new i(s, c), this.renderTargetMaskDownSampleBuffer.texture.name = "OutlinePass.depthDownSample", this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = !1, this.renderTargetBlurBuffer1 = new i(s, c), this.renderTargetBlurBuffer1.texture.name = "OutlinePass.blur1", this.renderTargetBlurBuffer1.texture.generateMipmaps = !1, this.renderTargetBlurBuffer2 = new i(Math.round(s / 2), Math.round(c / 2)), this.renderTargetBlurBuffer2.texture.name = "OutlinePass.blur2", this.renderTargetBlurBuffer2.texture.generateMipmaps = !1, this.edgeDetectionMaterial = this._getEdgeDetectionMaterial(), this.renderTargetEdgeBuffer1 = new i(s, c), this.renderTargetEdgeBuffer1.texture.name = "OutlinePass.edge1", this.renderTargetEdgeBuffer1.texture.generateMipmaps = !1, this.renderTargetEdgeBuffer2 = new i(Math.round(s / 2), Math.round(c / 2)), this.renderTargetEdgeBuffer2.texture.name = "OutlinePass.edge2", this.renderTargetEdgeBuffer2.texture.generateMipmaps = !1, this.separableBlurMaterial1 = this._getSeperableBlurMaterial(4), this.separableBlurMaterial1.uniforms.texSize.value.set(s, c), this.separableBlurMaterial1.uniforms.kernelRadius.value = 1, this.separableBlurMaterial2 = this._getSeperableBlurMaterial(4), this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(s / 2), Math.round(c / 2)), this.separableBlurMaterial2.uniforms.kernelRadius.value = 4, this.overlayMaterial = this._getOverlayMaterial();
|
|
2650
|
+
let l = Wt;
|
|
2651
|
+
this.copyUniforms = D.clone(l.uniforms), this.copyUniforms.opacity.value = 1, this.materialCopy = new m({
|
|
2652
2652
|
uniforms: this.copyUniforms,
|
|
2653
|
-
vertexShader:
|
|
2654
|
-
fragmentShader:
|
|
2653
|
+
vertexShader: l.vertexShader,
|
|
2654
|
+
fragmentShader: l.fragmentShader,
|
|
2655
2655
|
blending: 0,
|
|
2656
2656
|
depthTest: !1,
|
|
2657
2657
|
depthWrite: !1,
|
|
2658
2658
|
transparent: !0
|
|
2659
|
-
}), this.enabled = !0, this.needsSwap = !1, this.oldClearColor = new
|
|
2660
|
-
function
|
|
2659
|
+
}), this.enabled = !0, this.needsSwap = !1, this.oldClearColor = new R(), this.oldClearAlpha = 1, this.fsQuad = new Ae(void 0), this.tempPulseColor1 = new R(), this.tempPulseColor2 = new R(), this.textureMatrix = new L();
|
|
2660
|
+
function u(e, t) {
|
|
2661
2661
|
let n = t.isPerspectiveCamera ? "perspective" : "orthographic";
|
|
2662
2662
|
return e.replace(/DEPTH_TO_VIEW_Z/g, n + "DepthToViewZ");
|
|
2663
2663
|
}
|
|
@@ -2715,10 +2715,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2715
2715
|
this.render(e, null, null, 0, !1);
|
|
2716
2716
|
}
|
|
2717
2717
|
_getPrepareMaskMaterial(e) {
|
|
2718
|
-
return new
|
|
2718
|
+
return new m({
|
|
2719
2719
|
uniforms: {
|
|
2720
2720
|
depthTexture: { value: null },
|
|
2721
|
-
cameraNearFar: { value: new
|
|
2721
|
+
cameraNearFar: { value: new z(.5, .5) },
|
|
2722
2722
|
textureMatrix: { value: null }
|
|
2723
2723
|
},
|
|
2724
2724
|
defines: { FLOAT_ALPHA_DEPTH: e ? 1 : 0 },
|
|
@@ -2727,24 +2727,24 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2727
2727
|
});
|
|
2728
2728
|
}
|
|
2729
2729
|
_getEdgeDetectionMaterial() {
|
|
2730
|
-
return new
|
|
2730
|
+
return new m({
|
|
2731
2731
|
uniforms: {
|
|
2732
2732
|
maskTexture: { value: null },
|
|
2733
|
-
texSize: { value: new
|
|
2734
|
-
visibleEdgeColor: { value: new
|
|
2735
|
-
hiddenEdgeColor: { value: new
|
|
2733
|
+
texSize: { value: new z(.5, .5) },
|
|
2734
|
+
visibleEdgeColor: { value: new f(1, 1, 1) },
|
|
2735
|
+
hiddenEdgeColor: { value: new f(1, 1, 1) }
|
|
2736
2736
|
},
|
|
2737
2737
|
vertexShader: "varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",
|
|
2738
2738
|
fragmentShader: "varying vec2 vUv;\n\n uniform sampler2D maskTexture;\n uniform vec2 texSize;\n uniform vec3 visibleEdgeColor;\n uniform vec3 hiddenEdgeColor;\n\n void main() {\n vec2 invSize = 1.0 / texSize;\n vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n vec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n vec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n vec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n vec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n float diff1 = (c1.r - c2.r)*0.5;\n float diff2 = (c3.r - c4.r)*0.5;\n float d = length( vec2(diff1, diff2) );\n float a1 = min(c1.g, c2.g);\n float a2 = min(c3.g, c4.g);\n float visibilityFactor = min(a1, a2);\n vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n gl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n }"
|
|
2739
2739
|
});
|
|
2740
2740
|
}
|
|
2741
2741
|
_getSeperableBlurMaterial(e) {
|
|
2742
|
-
return new
|
|
2742
|
+
return new m({
|
|
2743
2743
|
defines: { MAX_RADIUS: e },
|
|
2744
2744
|
uniforms: {
|
|
2745
2745
|
colorTexture: { value: null },
|
|
2746
|
-
texSize: { value: new
|
|
2747
|
-
direction: { value: new
|
|
2746
|
+
texSize: { value: new z(.5, .5) },
|
|
2747
|
+
direction: { value: new z(.5, .5) },
|
|
2748
2748
|
kernelRadius: { value: 1 }
|
|
2749
2749
|
},
|
|
2750
2750
|
vertexShader: "varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",
|
|
@@ -2752,7 +2752,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2752
2752
|
});
|
|
2753
2753
|
}
|
|
2754
2754
|
_getOverlayMaterial() {
|
|
2755
|
-
return new
|
|
2755
|
+
return new m({
|
|
2756
2756
|
uniforms: {
|
|
2757
2757
|
maskTexture: { value: null },
|
|
2758
2758
|
edgeTexture1: { value: null },
|
|
@@ -2774,10 +2774,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2774
2774
|
uniforms: { tDiffuse: { value: null } },
|
|
2775
2775
|
vertexShader: "\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = (projectionMatrix * modelViewMatrix * vec4(position, 1.0)).xyww;\n }",
|
|
2776
2776
|
fragmentShader: "\n uniform highp sampler2D tDiffuse;\n varying vec2 vUv;\n\n void main() {\n vec4 textureColor = texture2D(tDiffuse, vUv);\n float aoPassDepth = dot(textureColor.wz, vec2(1.0/1024.0));\n gl_FragColor = vec4(vec3(aoPassDepth * aoPassDepth), 1.0);\n }"
|
|
2777
|
-
}, Jt = class extends
|
|
2777
|
+
}, Jt = class extends m {
|
|
2778
2778
|
constructor(e) {
|
|
2779
2779
|
super({
|
|
2780
|
-
uniforms:
|
|
2780
|
+
uniforms: D.clone(qt.uniforms),
|
|
2781
2781
|
vertexShader: qt.vertexShader,
|
|
2782
2782
|
fragmentShader: qt.fragmentShader,
|
|
2783
2783
|
transparent: !0,
|
|
@@ -2789,56 +2789,56 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2789
2789
|
blendSrcAlpha: 206,
|
|
2790
2790
|
blendDstAlpha: 200,
|
|
2791
2791
|
blendEquationAlpha: 100
|
|
2792
|
-
}), this._intensity = new
|
|
2792
|
+
}), this._intensity = new z(1, 1), this.update(e);
|
|
2793
2793
|
}
|
|
2794
2794
|
update(e) {
|
|
2795
2795
|
return e?.texture !== void 0 && (this.uniforms.tDiffuse.value = e.texture), e?.blending !== void 0 && (this.blending = e.blending), this;
|
|
2796
2796
|
}
|
|
2797
|
-
}, Yt = (e) => new
|
|
2797
|
+
}, Yt = (e) => new z(Math.atan2(e.y, e.x) / (2 * Math.PI) + .5, Math.asin(e.z) / Math.PI + .5), Xt = class {
|
|
2798
2798
|
get colorRenderTarget() {
|
|
2799
|
-
return this._colorRenderTarget = this._colorRenderTarget ?? new
|
|
2799
|
+
return this._colorRenderTarget = this._colorRenderTarget ?? new i(), this._colorRenderTarget;
|
|
2800
2800
|
}
|
|
2801
2801
|
environmentMapDecodeTarget(e) {
|
|
2802
|
-
let t = e instanceof
|
|
2803
|
-
return this._environmentMapDecodeTarget = this._environmentMapDecodeTarget ?? new
|
|
2802
|
+
let t = e instanceof pe && e.capabilities.isWebGL2 ? w : P;
|
|
2803
|
+
return this._environmentMapDecodeTarget = this._environmentMapDecodeTarget ?? new i(1, 1, { type: t }), this._environmentMapDecodeTarget;
|
|
2804
2804
|
}
|
|
2805
2805
|
environmentMapDecodeMaterial(e) {
|
|
2806
2806
|
return e ? (this._equirectangularDecodeMaterial = this._equirectangularDecodeMaterial ?? new Qt(!0, !1), this._equirectangularDecodeMaterial) : (this._pmremDecodeMaterial = this._pmremDecodeMaterial ?? new Qt(!1, !1), this._pmremDecodeMaterial);
|
|
2807
2807
|
}
|
|
2808
2808
|
get camera() {
|
|
2809
|
-
return this._camera = this._camera ?? new
|
|
2810
|
-
}
|
|
2811
|
-
scaleTexture(e,
|
|
2812
|
-
this.colorRenderTarget.setSize(
|
|
2813
|
-
let
|
|
2814
|
-
e.setRenderTarget(this.colorRenderTarget), e.render(this._planeMesh, this.camera), e.setRenderTarget(
|
|
2815
|
-
let
|
|
2816
|
-
return e.readRenderTargetPixels(this.colorRenderTarget, 0, 0,
|
|
2817
|
-
texture:
|
|
2818
|
-
pixels:
|
|
2809
|
+
return this._camera = this._camera ?? new a(-1, 1, 1, -1, -1, 1), this._camera;
|
|
2810
|
+
}
|
|
2811
|
+
scaleTexture(e, n, r, i) {
|
|
2812
|
+
this.colorRenderTarget.setSize(r, i), this._planeMesh = this._planeMesh ?? new C(new t(2, 2), new M({ map: n }));
|
|
2813
|
+
let a = e.getRenderTarget();
|
|
2814
|
+
e.setRenderTarget(this.colorRenderTarget), e.render(this._planeMesh, this.camera), e.setRenderTarget(a);
|
|
2815
|
+
let o = this.environmentMapDecodeTarget(e).texture, s = new Uint8Array(r * i * 4);
|
|
2816
|
+
return e.readRenderTargetPixels(this.colorRenderTarget, 0, 0, r, i, s), {
|
|
2817
|
+
texture: o,
|
|
2818
|
+
pixels: s,
|
|
2819
2819
|
sRgbaPixels: !1
|
|
2820
2820
|
};
|
|
2821
2821
|
}
|
|
2822
|
-
newGrayscaleTexture(e,
|
|
2823
|
-
let
|
|
2824
|
-
|
|
2825
|
-
let
|
|
2826
|
-
e.setRenderTarget(
|
|
2827
|
-
let
|
|
2828
|
-
return e.readRenderTargetPixels(
|
|
2829
|
-
texture:
|
|
2830
|
-
pixels:
|
|
2831
|
-
sRgbaPixels:
|
|
2822
|
+
newGrayscaleTexture(e, n, r, i) {
|
|
2823
|
+
let a = this.environmentMapDecodeMaterial(n.name === "PMREM.cubeUv"), o = this.environmentMapDecodeTarget(e);
|
|
2824
|
+
o.setSize(r, i), a.setSourceTexture(n), this._planeMesh = this._planeMesh ?? new C(new t(2, 2), a);
|
|
2825
|
+
let s = e.getRenderTarget();
|
|
2826
|
+
e.setRenderTarget(o), e.render(this._planeMesh, this.camera), e.setRenderTarget(s);
|
|
2827
|
+
let c = o.texture, l = o.texture.type === w, u = l ? new Float32Array(r * i * 4) : new Uint8Array(r * i * 4);
|
|
2828
|
+
return e.readRenderTargetPixels(o, 0, 0, r, i, u), {
|
|
2829
|
+
texture: c,
|
|
2830
|
+
pixels: u,
|
|
2831
|
+
sRgbaPixels: l
|
|
2832
2832
|
};
|
|
2833
2833
|
}
|
|
2834
2834
|
}, Zt = {
|
|
2835
2835
|
uniforms: { tDiffuse: { value: null } },
|
|
2836
2836
|
vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = (projectionMatrix * modelViewMatrix * vec4(position, 1.0)).xyww;\n }",
|
|
2837
2837
|
fragmentShader: "\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n }\n return 0.5 * ( uv + 1.0 );\n }\n\n void main() {\n #if PMREM_DECODE == 1\n float altitude = (vUv.y - 0.5) * 3.141593;\n float azimuth = vUv.x * 2.0 * 3.141593;\n vec3 direction = vec3(\n cos(altitude) * cos(azimuth) * -1.0,\n sin(altitude),\n cos(altitude) * sin(azimuth) * -1.0\n );\n float face = getFace(direction);\n vec2 uv = getUV(direction, face) / vec2(3.0, 4.0);\n if (face > 2.5) {\n uv.y += 0.25;\n face -= 3.0;\n }\n uv.x += face / 3.0;\n vec4 color = texture2D(tDiffuse, uv);\n #else\n vec4 color = texture2D(tDiffuse, vUv);\n #endif\n #if GRAYSCALE_CONVERT == 1\n float grayscale = dot(color.rgb, vec3(0.2126, 0.7152, 0.0722));\n //float grayscale = dot(color.rgb, vec3(1.0/3.0));\n gl_FragColor = vec4(vec3(grayscale), 1.0);\n #else\n gl_FragColor = vec4(color.rgb, 1.0);\n #endif\n }"
|
|
2838
|
-
}, Qt = class extends
|
|
2838
|
+
}, Qt = class extends m {
|
|
2839
2839
|
constructor(e, t) {
|
|
2840
2840
|
super({
|
|
2841
|
-
uniforms:
|
|
2841
|
+
uniforms: D.clone(Zt.uniforms),
|
|
2842
2842
|
vertexShader: Zt.vertexShader,
|
|
2843
2843
|
fragmentShader: Zt.fragmentShader,
|
|
2844
2844
|
defines: {
|
|
@@ -2853,14 +2853,14 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2853
2853
|
}, $t = class {
|
|
2854
2854
|
constructor(e) {
|
|
2855
2855
|
this.samplePoints = [], this.sampleUVs = [], this.grayscaleTexture = {
|
|
2856
|
-
texture: new
|
|
2856
|
+
texture: new se(),
|
|
2857
2857
|
pixels: new Uint8Array(),
|
|
2858
2858
|
sRgbaPixels: !1
|
|
2859
|
-
}, this.detectorTexture = new
|
|
2859
|
+
}, this.detectorTexture = new se(), this.detectorArray = new Float32Array(), this.lightSamples = [], this.lightGraph = new tn(0), this.lightSources = [], this._grayScale = new f(.2126, .7152, .0722), this._createEquirectangularSamplePoints = (e) => {
|
|
2860
2860
|
let t = [];
|
|
2861
2861
|
for (let n = 0; n < e; n++) {
|
|
2862
2862
|
let r = n * Math.PI * (3 - Math.sqrt(5)), i = 1 - n / (e - 1) * 2, a = Math.sqrt(1 - i * i), o = Math.cos(r) * a, s = Math.sin(r) * a;
|
|
2863
|
-
t.push(new
|
|
2863
|
+
t.push(new f(o, s, i));
|
|
2864
2864
|
}
|
|
2865
2865
|
return t;
|
|
2866
2866
|
}, this._numberOfSamples = e?.numberOfSamples ?? 1e3, this._width = e?.width ?? 1024, this._height = e?.height ?? 512, this._sampleThreshold = e?.sampleThreshold ?? .707, this.pointDistance = Math.sqrt(4 * Math.PI) / Math.sqrt(this._numberOfSamples), this.pixelDistance = Math.sqrt(2) * Math.PI * 2 / this._width, this.samplePoints = this._createEquirectangularSamplePoints(this._numberOfSamples), this.sampleUVs = this.samplePoints.map((e) => Yt(e));
|
|
@@ -2869,25 +2869,25 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2869
2869
|
this._textureConverter = this._textureConverter ?? new Xt(), this.grayscaleTexture = this._textureConverter.newGrayscaleTexture(e, t, this._width, this._height), this.detectorArray = this._redFromRgbaToNormalizedFloatArray(this.grayscaleTexture.pixels, this.grayscaleTexture.sRgbaPixels), this.detectorTexture = this._grayscaleTextureFromFloatArray(this.detectorArray, this._width, this._height), this.lightSamples = this._filterLightSamples(this._sampleThreshold), this.lightGraph = this._findClusterSegments(this.lightSamples, this._sampleThreshold), this.lightGraph.findConnectedComponents(), this.lightSources = this.createLightSourcesFromLightGraph(this.lightSamples, this.lightGraph), this.lightSources.sort((e, t) => t.maxIntensity - e.maxIntensity);
|
|
2870
2870
|
}
|
|
2871
2871
|
_redFromRgbaToNormalizedFloatArray(e, t, n) {
|
|
2872
|
-
let r = new Float32Array(e.length / 4),
|
|
2872
|
+
let r = new Float32Array(e.length / 4), i = 1, a = 0;
|
|
2873
2873
|
for (let t = 0; t < e.length / 4; ++t) {
|
|
2874
|
-
let n = new
|
|
2874
|
+
let n = new R(...e.slice(t * 4, t * 4 + 3));
|
|
2875
2875
|
e instanceof Float32Array && n.convertSRGBToLinear();
|
|
2876
|
-
let
|
|
2877
|
-
|
|
2876
|
+
let o = new f(n.r, n.g, n.b).dot(this._grayScale);
|
|
2877
|
+
i = Math.min(i, o), a = Math.max(a, o), r[t] = o;
|
|
2878
2878
|
}
|
|
2879
|
-
if (n) for (let e = 0; e < r.length; ++e) r[e] = (t ? r[e] : (r[e] -
|
|
2880
|
-
else if (!t) for (let e = 0; e < r.length; ++e) r[e] = (r[e] -
|
|
2879
|
+
if (n) for (let e = 0; e < r.length; ++e) r[e] = (t ? r[e] : (r[e] - i) / (a - i)) ** +n;
|
|
2880
|
+
else if (!t) for (let e = 0; e < r.length; ++e) r[e] = (r[e] - i) / (a - i);
|
|
2881
2881
|
return r;
|
|
2882
2882
|
}
|
|
2883
|
-
_grayscaleTextureFromFloatArray(e, t,
|
|
2884
|
-
let
|
|
2885
|
-
for (let t = 0; t <
|
|
2883
|
+
_grayscaleTextureFromFloatArray(e, t, n) {
|
|
2884
|
+
let r = t * n, i = new Uint8Array(4 * r);
|
|
2885
|
+
for (let t = 0; t < r; t++) {
|
|
2886
2886
|
let n = e[t] * 255;
|
|
2887
|
-
|
|
2887
|
+
i[t * 4 + 0] = n, i[t * 4 + 1] = n, i[t * 4 + 2] = n, i[t * 4 + 3] = 255;
|
|
2888
2888
|
}
|
|
2889
|
-
let
|
|
2890
|
-
return
|
|
2889
|
+
let a = new h(i, t, n);
|
|
2890
|
+
return a.needsUpdate = !0, a;
|
|
2891
2891
|
}
|
|
2892
2892
|
_filterLightSamples(e) {
|
|
2893
2893
|
let t = [];
|
|
@@ -2949,10 +2949,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2949
2949
|
}
|
|
2950
2950
|
}, nn = class {
|
|
2951
2951
|
constructor(e) {
|
|
2952
|
-
this.position = new
|
|
2952
|
+
this.position = new f(), this.uv = new z(), this.averageIntensity = 0, this.maxIntensity = 0, this.size = 0, this.lightSamples = e;
|
|
2953
2953
|
}
|
|
2954
2954
|
calculateLightSourceProperties(e) {
|
|
2955
|
-
this.position = new
|
|
2955
|
+
this.position = new f(), this.averageIntensity = 0, this.maxIntensity = 0;
|
|
2956
2956
|
for (let t of this.lightSamples) {
|
|
2957
2957
|
this.position.add(t.position);
|
|
2958
2958
|
let n = e(t.uv);
|
|
@@ -2963,7 +2963,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2963
2963
|
for (let e of this.lightSamples) t += e.position.distanceTo(this.position);
|
|
2964
2964
|
t /= this.lightSamples.length, this.size = t / Math.PI;
|
|
2965
2965
|
}
|
|
2966
|
-
}, rn = class extends
|
|
2966
|
+
}, rn = class extends q {
|
|
2967
2967
|
constructor(e) {
|
|
2968
2968
|
super(e), this.debugOutput = "", this._environmentMapDecodeMaterial = new Qt(!0, !1), this._environmentMapDecodeMaterial.blending = 0, this._environmentMapDecodeMaterial.depthTest = !1;
|
|
2969
2969
|
}
|
|
@@ -2971,7 +2971,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2971
2971
|
this._depthRenderMaterial?.dispose(), this._copyMaterial?.dispose(), this._srgbToLinearCopyMaterial?.dispose();
|
|
2972
2972
|
}
|
|
2973
2973
|
getCopyMaterial(e) {
|
|
2974
|
-
return this._copyMaterial = this._copyMaterial ?? new
|
|
2974
|
+
return this._copyMaterial = this._copyMaterial ?? new G(), this._copyMaterial.update(e);
|
|
2975
2975
|
}
|
|
2976
2976
|
getBlendAoAndShadowMaterial(e) {
|
|
2977
2977
|
return this._blendAoAndShadowMaterial = this._blendAoAndShadowMaterial ?? new qe({ blending: 0 }), this._blendAoAndShadowMaterial.update(e);
|
|
@@ -2980,12 +2980,12 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2980
2980
|
return this._blendAoPassDepthMaterial = this._blendAoPassDepthMaterial ?? new Jt({ blending: 0 }), this._blendAoPassDepthMaterial.update(e);
|
|
2981
2981
|
}
|
|
2982
2982
|
getSrgbToLinearCopyMaterial(e) {
|
|
2983
|
-
return this._srgbToLinearCopyMaterial = this._copyMaterial ?? new
|
|
2983
|
+
return this._srgbToLinearCopyMaterial = this._copyMaterial ?? new G({}, Ce.ADDITIVE, !0, !0), this._srgbToLinearCopyMaterial.update(e);
|
|
2984
2984
|
}
|
|
2985
2985
|
_getDepthRenderMaterial(e) {
|
|
2986
|
-
return this._depthRenderMaterial = this._depthRenderMaterial ?? new
|
|
2986
|
+
return this._depthRenderMaterial = this._depthRenderMaterial ?? new De({
|
|
2987
2987
|
depthTexture: this.gBufferTextures.textureWithDepthValue,
|
|
2988
|
-
depthFilter: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? new
|
|
2988
|
+
depthFilter: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? new n(0, 0, 0, 1) : new n(1, 0, 0, 0)
|
|
2989
2989
|
}), this._depthRenderMaterial.update({ camera: e });
|
|
2990
2990
|
}
|
|
2991
2991
|
renderPass(e) {
|
|
@@ -2998,64 +2998,64 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2998
2998
|
this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
2999
2999
|
texture: this.gBufferTextures?.gBufferTexture,
|
|
3000
3000
|
blending: 0,
|
|
3001
|
-
colorTransform: new
|
|
3002
|
-
colorBase: new
|
|
3001
|
+
colorTransform: new L().set(.5, 0, 0, 0, 0, .5, 0, 0, 0, 0, .5, 0, 0, 0, 0, 0),
|
|
3002
|
+
colorBase: new n(.5, .5, .5, 1),
|
|
3003
3003
|
multiplyChannels: 0,
|
|
3004
|
-
uvTransform:
|
|
3004
|
+
uvTransform: W
|
|
3005
3005
|
}), null) : this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
3006
3006
|
texture: this.gBufferTextures?.gBufferTexture,
|
|
3007
3007
|
blending: 0,
|
|
3008
|
-
colorTransform:
|
|
3009
|
-
colorBase:
|
|
3008
|
+
colorTransform: ye,
|
|
3009
|
+
colorBase: U,
|
|
3010
3010
|
multiplyChannels: 0,
|
|
3011
|
-
uvTransform:
|
|
3011
|
+
uvTransform: W
|
|
3012
3012
|
}), null);
|
|
3013
3013
|
break;
|
|
3014
3014
|
case "g-depth":
|
|
3015
3015
|
this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
3016
3016
|
texture: this.gBufferTextures?.gBufferTexture,
|
|
3017
3017
|
blending: 0,
|
|
3018
|
-
colorTransform:
|
|
3019
|
-
colorBase:
|
|
3018
|
+
colorTransform: be,
|
|
3019
|
+
colorBase: U,
|
|
3020
3020
|
multiplyChannels: 0,
|
|
3021
|
-
uvTransform:
|
|
3021
|
+
uvTransform: W
|
|
3022
3022
|
}), null) : this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
3023
3023
|
texture: this.gBufferTextures?.depthBufferTexture,
|
|
3024
3024
|
blending: 0,
|
|
3025
|
-
colorTransform:
|
|
3026
|
-
colorBase:
|
|
3025
|
+
colorTransform: xe,
|
|
3026
|
+
colorBase: U,
|
|
3027
3027
|
multiplyChannels: 0,
|
|
3028
|
-
uvTransform:
|
|
3028
|
+
uvTransform: W
|
|
3029
3029
|
}), null);
|
|
3030
3030
|
break;
|
|
3031
3031
|
case "ssao":
|
|
3032
3032
|
this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
3033
3033
|
texture: this.renderPassManager.shadowAndAoPass.aoAndSoftShadowRenderTarget.texture,
|
|
3034
3034
|
blending: 0,
|
|
3035
|
-
colorTransform:
|
|
3036
|
-
colorBase:
|
|
3035
|
+
colorTransform: V,
|
|
3036
|
+
colorBase: H,
|
|
3037
3037
|
multiplyChannels: 0,
|
|
3038
|
-
uvTransform:
|
|
3038
|
+
uvTransform: W
|
|
3039
3039
|
}), null);
|
|
3040
3040
|
break;
|
|
3041
3041
|
case "ssaodenoise":
|
|
3042
3042
|
this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
3043
3043
|
texture: this.renderPassManager.shadowAndAoPass.denoiseRenderTargetTexture,
|
|
3044
3044
|
blending: 0,
|
|
3045
|
-
colorTransform:
|
|
3046
|
-
colorBase:
|
|
3045
|
+
colorTransform: V,
|
|
3046
|
+
colorBase: H,
|
|
3047
3047
|
multiplyChannels: 0,
|
|
3048
|
-
uvTransform:
|
|
3048
|
+
uvTransform: W
|
|
3049
3049
|
}), null);
|
|
3050
3050
|
break;
|
|
3051
3051
|
case "shadowmap":
|
|
3052
3052
|
this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
3053
3053
|
texture: this.renderPassManager.screenSpaceShadowMapPass.shadowTexture,
|
|
3054
3054
|
blending: 0,
|
|
3055
|
-
colorTransform:
|
|
3056
|
-
colorBase:
|
|
3055
|
+
colorTransform: V,
|
|
3056
|
+
colorBase: H,
|
|
3057
3057
|
multiplyChannels: 0,
|
|
3058
|
-
uvTransform:
|
|
3058
|
+
uvTransform: W
|
|
3059
3059
|
}), null);
|
|
3060
3060
|
break;
|
|
3061
3061
|
case "shadowsoft":
|
|
@@ -3063,9 +3063,9 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3063
3063
|
texture: this.renderPassManager.shadowAndAoPass.aoAndSoftShadowRenderTarget.texture,
|
|
3064
3064
|
blending: 0,
|
|
3065
3065
|
colorTransform: et.shadowTransform,
|
|
3066
|
-
colorBase:
|
|
3066
|
+
colorBase: H,
|
|
3067
3067
|
multiplyChannels: 0,
|
|
3068
|
-
uvTransform:
|
|
3068
|
+
uvTransform: W
|
|
3069
3069
|
}), null);
|
|
3070
3070
|
break;
|
|
3071
3071
|
case "shadowdenoise":
|
|
@@ -3073,9 +3073,9 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3073
3073
|
texture: this.renderPassManager.shadowAndAoPass.denoiseRenderTargetTexture,
|
|
3074
3074
|
blending: 0,
|
|
3075
3075
|
colorTransform: et.shadowTransform,
|
|
3076
|
-
colorBase:
|
|
3076
|
+
colorBase: H,
|
|
3077
3077
|
multiplyChannels: 0,
|
|
3078
|
-
uvTransform:
|
|
3078
|
+
uvTransform: W
|
|
3079
3079
|
}), null);
|
|
3080
3080
|
break;
|
|
3081
3081
|
case "shadowfadein":
|
|
@@ -3083,9 +3083,9 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3083
3083
|
texture: this.renderPassManager.shadowAndAoPass.fadeRenderTarget.texture,
|
|
3084
3084
|
blending: 0,
|
|
3085
3085
|
colorTransform: et.shadowTransform,
|
|
3086
|
-
colorBase:
|
|
3086
|
+
colorBase: H,
|
|
3087
3087
|
multiplyChannels: 0,
|
|
3088
|
-
uvTransform:
|
|
3088
|
+
uvTransform: W
|
|
3089
3089
|
}), null);
|
|
3090
3090
|
break;
|
|
3091
3091
|
case "shadowandao":
|
|
@@ -3106,40 +3106,40 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3106
3106
|
this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
3107
3107
|
texture: this.renderPassManager.aoPassMapTexture,
|
|
3108
3108
|
blending: 0,
|
|
3109
|
-
colorTransform:
|
|
3110
|
-
colorBase:
|
|
3109
|
+
colorTransform: B,
|
|
3110
|
+
colorBase: H,
|
|
3111
3111
|
multiplyChannels: 0,
|
|
3112
|
-
uvTransform:
|
|
3112
|
+
uvTransform: W
|
|
3113
3113
|
}), null);
|
|
3114
3114
|
break;
|
|
3115
3115
|
case "groundreflection":
|
|
3116
3116
|
this.passRenderer.renderScreenSpace(e, this.getSrgbToLinearCopyMaterial({
|
|
3117
3117
|
texture: this.renderPassManager.groundReflectionPass.reflectionRenderTarget.texture,
|
|
3118
3118
|
blending: 0,
|
|
3119
|
-
colorTransform:
|
|
3120
|
-
colorBase:
|
|
3119
|
+
colorTransform: B,
|
|
3120
|
+
colorBase: H,
|
|
3121
3121
|
multiplyChannels: 0,
|
|
3122
|
-
uvTransform:
|
|
3122
|
+
uvTransform: Se
|
|
3123
3123
|
}), null);
|
|
3124
3124
|
break;
|
|
3125
3125
|
case "groundreflectionfinal":
|
|
3126
3126
|
this.passRenderer.renderScreenSpace(e, this.getSrgbToLinearCopyMaterial({
|
|
3127
3127
|
texture: this.renderPassManager.groundReflectionPass.intensityRenderTarget.texture,
|
|
3128
3128
|
blending: 0,
|
|
3129
|
-
colorTransform:
|
|
3130
|
-
colorBase:
|
|
3129
|
+
colorTransform: B,
|
|
3130
|
+
colorBase: H,
|
|
3131
3131
|
multiplyChannels: 0,
|
|
3132
|
-
uvTransform:
|
|
3132
|
+
uvTransform: Se
|
|
3133
3133
|
}), null);
|
|
3134
3134
|
break;
|
|
3135
3135
|
case "bakedgroundshadow":
|
|
3136
3136
|
this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
3137
3137
|
texture: this.renderPassManager.bakedGroundContactShadowPass.renderTarget.texture,
|
|
3138
3138
|
blending: 0,
|
|
3139
|
-
colorTransform:
|
|
3140
|
-
colorBase:
|
|
3139
|
+
colorTransform: B,
|
|
3140
|
+
colorBase: H,
|
|
3141
3141
|
multiplyChannels: 0,
|
|
3142
|
-
uvTransform:
|
|
3142
|
+
uvTransform: W
|
|
3143
3143
|
}), null);
|
|
3144
3144
|
break;
|
|
3145
3145
|
case "environmentmap":
|
|
@@ -3147,15 +3147,15 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3147
3147
|
break;
|
|
3148
3148
|
case "lightsourcedetection":
|
|
3149
3149
|
if (this.scene.userData?.environmentDefinition) {
|
|
3150
|
-
let t = this.renderPassManager.aspect, n = new
|
|
3151
|
-
r.background = new
|
|
3150
|
+
let t = this.renderPassManager.aspect, n = new a(-1, 1, 1 / t, -1 / t, -1, 1), r = this.scene.userData?.environmentDefinition.createDebugScene(e, this.scene, this.renderPassManager.screenSpaceShadowMapPass.parameters.maximumNumberOfLightSources);
|
|
3151
|
+
r.background = new R(16777215), e.render(r, n);
|
|
3152
3152
|
}
|
|
3153
3153
|
break;
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
3156
|
-
}, an = class extends
|
|
3156
|
+
}, an = class extends q {
|
|
3157
3157
|
constructor(e) {
|
|
3158
|
-
super(e), this.drawGround = !0, this.drawWithDebugMaterial = !1, this.grayDebugMaterial = new
|
|
3158
|
+
super(e), this.drawGround = !0, this.drawWithDebugMaterial = !1, this.grayDebugMaterial = new b({
|
|
3159
3159
|
color: 12632256,
|
|
3160
3160
|
side: 2,
|
|
3161
3161
|
envMapIntensity: .4
|
|
@@ -3216,15 +3216,15 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3216
3216
|
_initUniforms(e) {
|
|
3217
3217
|
e && (e.uniforms.tAoPassMap = this._aoPassMapUniform, e.uniforms.aoPassMapScale = this._aoPassMapScaleUniform, e.uniforms.aoPassMapIntensity = this._aoPassMapIntensityUniform, e.uniforms.shPassMapIntensity = this._shPassMapIntensityUniform, e.uniforms.tReflectionPassMap = this._reflectionPassMapUniform, e.uniforms.reflectionPassMapScale = this._reflectionPassMapScaleUniform, e.uniforms.reflectionPassMapIntensity = this._reflectionPassMapIntensityUniform);
|
|
3218
3218
|
}
|
|
3219
|
-
}, sn = "\n#ifdef USE_AOMAP\n\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n\n#endif\n\n uniform highp sampler2D tAoPassMap;\n uniform float aoPassMapScale;\n uniform float aoPassMapIntensity;\n uniform float shPassMapIntensity;\n uniform sampler2D tReflectionPassMap;\n uniform float reflectionPassMapScale;\n uniform float reflectionPassMapIntensity;\n", cn = "\n#ifndef AOPASSMAP_SWIZZLE\n #define AOPASSMAP_SWIZZLE rg\n#endif\n\nfloat ambientOcclusion = 1.0;\nfloat shadowValue = 1.0;\n\n#ifdef USE_AOMAP\n\n // reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n ambientOcclusion = texture2D( aoMap, vAoMapUv ).r;\n ambientOcclusion = ( ambientOcclusion - 1.0 ) * aoMapIntensity + 1.0;\n\n#endif\n\n vec4 aoAndShadowMap = texelFetch( tAoPassMap, ivec2( gl_FragCoord.xy * aoPassMapScale ), 0 );\n vec2 aoAndShadow = aoAndShadowMap.rg;\n float depthDelta = abs( dot(aoAndShadowMap.wz, vec2(1.0/1024.0)) - gl_FragCoord.z );\n const ivec2 aoOffsetArray[8] = ivec2[8](\n ivec2(1, 0), ivec2(-1, 0), ivec2(0, 1), ivec2(0, -1), ivec2(1, 1), ivec2(-1, 1), ivec2(1, -1), ivec2(-1, -1));\n for (int aoOffsetI = 0; aoOffsetI < 8; aoOffsetI++) {\n aoAndShadowMap = texelFetch( tAoPassMap, ivec2( gl_FragCoord.xy * aoPassMapScale ) + aoOffsetArray[aoOffsetI], 0 );\n float testDepthDelta = abs( dot(aoAndShadowMap.wz, vec2(1.0/1024.0)) - gl_FragCoord.z );\n if (testDepthDelta < depthDelta) {\n aoAndShadow = aoAndShadowMap.rg;\n depthDelta = testDepthDelta;\n }\n }\n\n float aoPassMapValue = aoPassMapIntensity < 0.0 ? 1.0 : max(0.0, (aoAndShadow.r - 1.0) * aoPassMapIntensity + 1.0);\n shadowValue = shPassMapIntensity < 0.0 ? 1.0 : max(0.0, (aoAndShadow.g - 1.0) * shPassMapIntensity + 1.0);\n\n #ifdef USE_REFLECTION_PASS_MAP\n\n ivec2 reflectionPassMapSize = textureSize( tReflectionPassMap, 0 );\n vec2 reflectionPassMapUv = vec2( gl_FragCoord.x * reflectionPassMapScale, float(reflectionPassMapSize.y) - gl_FragCoord.y * reflectionPassMapScale );\n vec4 reflectionPassMapColor = texture2D( tReflectionPassMap, reflectionPassMapUv / vec2(reflectionPassMapSize) );\n if (reflectionPassMapColor.a > 0.0) reflectionPassMapColor.rgb /= reflectionPassMapColor.a;\n vec3 diffuseReflectionPassMapColor = reflectionPassMapColor.rgb * material.diffuseColor;\n reflectedLight.indirectDiffuse += diffuseReflectionPassMapColor * reflectionPassMapColor.a * reflectionPassMapIntensity;\n //reflectedLight.indirectDiffuse = mix(reflectedLight.indirectDiffuse, diffuseReflectionPassMapColor, reflectionPassMapColor.a * reflectionPassMapIntensity);\n\n #endif\n\n #if defined ( USE_APPLY_AO_AND_SHADOW_TO_ALPHA )\n diffuseColor.a = 1.0 - (1.0 - diffuseColor.a) * aoPassMapValue * shadowValue;\n #else\n ambientOcclusion = min( ambientOcclusion, aoPassMapValue );\n #endif\n\n reflectedLight.indirectDiffuse *= ambientOcclusion * shadowValue;\n\n #if defined( USE_CLEARCOAT )\n clearcoatSpecularIndirect *= ambientOcclusion * shadowValue;\n #endif\n\n #if defined( USE_SHEEN )\n sheenSpecularIndirect *= ambientOcclusion * shadowValue;\n #endif\n\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n float specularOcclusion = computeSpecularOcclusion( dotNV, ambientOcclusion * shadowValue, material.roughness );\n reflectedLight.indirectSpecular *= specularOcclusion;\n\n #ifdef USE_REFLECTION_PASS_MAP\n reflectedLight.indirectSpecular += material.specularColor * reflectionPassMapColor.rgb * reflectionPassMapColor.a * reflectionPassMapIntensity * specularOcclusion;\n #endif\n\n #endif\n", ln = class extends
|
|
3219
|
+
}, sn = "\n#ifdef USE_AOMAP\n\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n\n#endif\n\n uniform highp sampler2D tAoPassMap;\n uniform float aoPassMapScale;\n uniform float aoPassMapIntensity;\n uniform float shPassMapIntensity;\n uniform sampler2D tReflectionPassMap;\n uniform float reflectionPassMapScale;\n uniform float reflectionPassMapIntensity;\n", cn = "\n#ifndef AOPASSMAP_SWIZZLE\n #define AOPASSMAP_SWIZZLE rg\n#endif\n\nfloat ambientOcclusion = 1.0;\nfloat shadowValue = 1.0;\n\n#ifdef USE_AOMAP\n\n // reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n ambientOcclusion = texture2D( aoMap, vAoMapUv ).r;\n ambientOcclusion = ( ambientOcclusion - 1.0 ) * aoMapIntensity + 1.0;\n\n#endif\n\n vec4 aoAndShadowMap = texelFetch( tAoPassMap, ivec2( gl_FragCoord.xy * aoPassMapScale ), 0 );\n vec2 aoAndShadow = aoAndShadowMap.rg;\n float depthDelta = abs( dot(aoAndShadowMap.wz, vec2(1.0/1024.0)) - gl_FragCoord.z );\n const ivec2 aoOffsetArray[8] = ivec2[8](\n ivec2(1, 0), ivec2(-1, 0), ivec2(0, 1), ivec2(0, -1), ivec2(1, 1), ivec2(-1, 1), ivec2(1, -1), ivec2(-1, -1));\n for (int aoOffsetI = 0; aoOffsetI < 8; aoOffsetI++) {\n aoAndShadowMap = texelFetch( tAoPassMap, ivec2( gl_FragCoord.xy * aoPassMapScale ) + aoOffsetArray[aoOffsetI], 0 );\n float testDepthDelta = abs( dot(aoAndShadowMap.wz, vec2(1.0/1024.0)) - gl_FragCoord.z );\n if (testDepthDelta < depthDelta) {\n aoAndShadow = aoAndShadowMap.rg;\n depthDelta = testDepthDelta;\n }\n }\n\n float aoPassMapValue = aoPassMapIntensity < 0.0 ? 1.0 : max(0.0, (aoAndShadow.r - 1.0) * aoPassMapIntensity + 1.0);\n shadowValue = shPassMapIntensity < 0.0 ? 1.0 : max(0.0, (aoAndShadow.g - 1.0) * shPassMapIntensity + 1.0);\n\n #ifdef USE_REFLECTION_PASS_MAP\n\n ivec2 reflectionPassMapSize = textureSize( tReflectionPassMap, 0 );\n vec2 reflectionPassMapUv = vec2( gl_FragCoord.x * reflectionPassMapScale, float(reflectionPassMapSize.y) - gl_FragCoord.y * reflectionPassMapScale );\n vec4 reflectionPassMapColor = texture2D( tReflectionPassMap, reflectionPassMapUv / vec2(reflectionPassMapSize) );\n if (reflectionPassMapColor.a > 0.0) reflectionPassMapColor.rgb /= reflectionPassMapColor.a;\n vec3 diffuseReflectionPassMapColor = reflectionPassMapColor.rgb * material.diffuseColor;\n reflectedLight.indirectDiffuse += diffuseReflectionPassMapColor * reflectionPassMapColor.a * reflectionPassMapIntensity;\n //reflectedLight.indirectDiffuse = mix(reflectedLight.indirectDiffuse, diffuseReflectionPassMapColor, reflectionPassMapColor.a * reflectionPassMapIntensity);\n\n #endif\n\n #if defined ( USE_APPLY_AO_AND_SHADOW_TO_ALPHA )\n diffuseColor.a = 1.0 - (1.0 - diffuseColor.a) * aoPassMapValue * shadowValue;\n #else\n ambientOcclusion = min( ambientOcclusion, aoPassMapValue );\n #endif\n\n reflectedLight.indirectDiffuse *= ambientOcclusion * shadowValue;\n\n #if defined( USE_CLEARCOAT )\n clearcoatSpecularIndirect *= ambientOcclusion * shadowValue;\n #endif\n\n #if defined( USE_SHEEN )\n sheenSpecularIndirect *= ambientOcclusion * shadowValue;\n #endif\n\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n float specularOcclusion = computeSpecularOcclusion( dotNV, ambientOcclusion * shadowValue, material.roughness );\n reflectedLight.indirectSpecular *= specularOcclusion;\n\n #ifdef USE_REFLECTION_PASS_MAP\n reflectedLight.indirectSpecular += material.specularColor * reflectionPassMapColor.rgb * reflectionPassMapColor.a * reflectionPassMapIntensity * specularOcclusion;\n #endif\n\n #endif\n", ln = class extends K {
|
|
3220
3220
|
constructor(e, t = "tDiffuse") {
|
|
3221
|
-
super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof
|
|
3221
|
+
super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof m ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = D.clone(e.uniforms), this.material = new m({
|
|
3222
3222
|
name: e.name === void 0 ? "unspecified" : e.name,
|
|
3223
3223
|
defines: Object.assign({}, e.defines),
|
|
3224
3224
|
uniforms: this.uniforms,
|
|
3225
3225
|
vertexShader: e.vertexShader,
|
|
3226
3226
|
fragmentShader: e.fragmentShader
|
|
3227
|
-
})), this._fsQuad = new
|
|
3227
|
+
})), this._fsQuad = new Ae(this.material);
|
|
3228
3228
|
}
|
|
3229
3229
|
render(e, t, n) {
|
|
3230
3230
|
this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = n.texture), this._fsQuad.material = this.material, this.renderToScreen ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e));
|
|
@@ -3259,15 +3259,15 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3259
3259
|
get intensity() {
|
|
3260
3260
|
return this.material.uniforms.intensity.value;
|
|
3261
3261
|
}
|
|
3262
|
-
}, fn = class extends
|
|
3262
|
+
}, fn = class extends T {
|
|
3263
3263
|
constructor(e) {
|
|
3264
|
-
super(e), this.type =
|
|
3264
|
+
super(e), this.type = P;
|
|
3265
3265
|
}
|
|
3266
3266
|
setType(e) {
|
|
3267
3267
|
return this.type = e, this;
|
|
3268
3268
|
}
|
|
3269
3269
|
load(e, t, n, r) {
|
|
3270
|
-
let i = new
|
|
3270
|
+
let i = new x(this.manager);
|
|
3271
3271
|
i.setPath(this.path), i.setResponseType("text"), i.load(e, (n) => {
|
|
3272
3272
|
try {
|
|
3273
3273
|
t(this.parse(n));
|
|
@@ -3279,25 +3279,25 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3279
3279
|
parse(e) {
|
|
3280
3280
|
let t = /TITLE +"([^"]*)"/, n = /LUT_3D_SIZE +(\d+)/, r = /DOMAIN_MIN +([\d.]+) +([\d.]+) +([\d.]+)/, i = /DOMAIN_MAX +([\d.]+) +([\d.]+) +([\d.]+)/, a = /^([\d.e+-]+) +([\d.e+-]+) +([\d.e+-]+) *$/gm, o = t.exec(e), s = o === null ? null : o[1];
|
|
3281
3281
|
if (o = n.exec(e), o === null) throw Error("LUTCubeLoader: Missing LUT_3D_SIZE information");
|
|
3282
|
-
let
|
|
3282
|
+
let c = Number(o[1]), l = c ** 3 * 4, u = this.type === 1009 ? new Uint8Array(l) : new Float32Array(l), p = new f(0, 0, 0), m = new f(1, 1, 1);
|
|
3283
3283
|
if (o = r.exec(e), o !== null && p.set(Number(o[1]), Number(o[2]), Number(o[3])), o = i.exec(e), o !== null && m.set(Number(o[1]), Number(o[2]), Number(o[3])), p.x > m.x || p.y > m.y || p.z > m.z) throw Error("LUTCubeLoader: Invalid input domain");
|
|
3284
3284
|
let h = this.type === 1009 ? 255 : 1, g = 0;
|
|
3285
|
-
for (; (o = a.exec(e)) !== null;)
|
|
3286
|
-
let _ = new
|
|
3287
|
-
return _.image.data =
|
|
3285
|
+
for (; (o = a.exec(e)) !== null;) u[g++] = Number(o[1]) * h, u[g++] = Number(o[2]) * h, u[g++] = Number(o[3]) * h, u[g++] = h;
|
|
3286
|
+
let _ = new de();
|
|
3287
|
+
return _.image.data = u, _.image.width = c, _.image.height = c, _.image.depth = c, _.type = this.type, _.magFilter = F, _.minFilter = F, _.wrapS = d, _.wrapT = d, _.wrapR = d, _.generateMipmaps = !1, _.needsUpdate = !0, {
|
|
3288
3288
|
title: s,
|
|
3289
|
-
size:
|
|
3289
|
+
size: c,
|
|
3290
3290
|
domainMin: p,
|
|
3291
3291
|
domainMax: m,
|
|
3292
3292
|
texture3D: _
|
|
3293
3293
|
};
|
|
3294
3294
|
}
|
|
3295
|
-
}, pn = class extends
|
|
3295
|
+
}, pn = class extends T {
|
|
3296
3296
|
constructor(e) {
|
|
3297
3297
|
super(e), this.flip = !1;
|
|
3298
3298
|
}
|
|
3299
3299
|
load(e, t, n, r) {
|
|
3300
|
-
let i = new
|
|
3300
|
+
let i = new I(this.manager);
|
|
3301
3301
|
i.setCrossOrigin(this.crossOrigin), i.setPath(this.path), i.load(e, (n) => {
|
|
3302
3302
|
try {
|
|
3303
3303
|
let e;
|
|
@@ -3308,8 +3308,8 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3308
3308
|
}, n, r);
|
|
3309
3309
|
}
|
|
3310
3310
|
parse(e, t) {
|
|
3311
|
-
let n = new Uint8Array(e), r = new
|
|
3312
|
-
return r.image.data = n, r.image.width = t, r.image.height = t, r.image.depth = t, r.format =
|
|
3311
|
+
let n = new Uint8Array(e), r = new de();
|
|
3312
|
+
return r.image.data = n, r.image.width = t, r.image.height = t, r.image.depth = t, r.format = o, r.type = P, r.magFilter = F, r.minFilter = F, r.wrapS = d, r.wrapT = d, r.wrapR = d, r.generateMipmaps = !1, r.needsUpdate = !0, {
|
|
3313
3313
|
size: t,
|
|
3314
3314
|
texture3D: r
|
|
3315
3315
|
};
|
|
@@ -3331,15 +3331,15 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3331
3331
|
}
|
|
3332
3332
|
return i.getImageData(0, 0, t, n);
|
|
3333
3333
|
}
|
|
3334
|
-
}, mn = class extends
|
|
3334
|
+
}, mn = class extends T {
|
|
3335
3335
|
constructor(e) {
|
|
3336
|
-
super(e), this.type =
|
|
3336
|
+
super(e), this.type = P;
|
|
3337
3337
|
}
|
|
3338
3338
|
setType(e) {
|
|
3339
3339
|
return this.type = e, this;
|
|
3340
3340
|
}
|
|
3341
3341
|
load(e, t, n, r) {
|
|
3342
|
-
let i = new
|
|
3342
|
+
let i = new x(this.manager);
|
|
3343
3343
|
i.setPath(this.path), i.setResponseType("text"), i.load(e, (n) => {
|
|
3344
3344
|
try {
|
|
3345
3345
|
t(this.parse(n));
|
|
@@ -3351,23 +3351,23 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3351
3351
|
parse(e) {
|
|
3352
3352
|
let t = /^[\d ]+$/m, n = /^([\d.e+-]+) +([\d.e+-]+) +([\d.e+-]+) *$/gm, r = t.exec(e);
|
|
3353
3353
|
if (r === null) throw Error("LUT3dlLoader: Missing grid information");
|
|
3354
|
-
let i = r[0].trim().split(/\s+/g).map(Number), a = i[1] - i[0],
|
|
3354
|
+
let i = r[0].trim().split(/\s+/g).map(Number), a = i[1] - i[0], s = i.length, c = s ** 2;
|
|
3355
3355
|
for (let e = 1, t = i.length; e < t; ++e) if (a !== i[e] - i[e - 1]) throw Error("LUT3dlLoader: Inconsistent grid size");
|
|
3356
|
-
let l = new Float32Array(
|
|
3356
|
+
let l = new Float32Array(s ** 3 * 4), u = 0, f = 0;
|
|
3357
3357
|
for (; (r = n.exec(e)) !== null;) {
|
|
3358
3358
|
let e = Number(r[1]), t = Number(r[2]), n = Number(r[3]);
|
|
3359
|
-
|
|
3360
|
-
let i = f %
|
|
3361
|
-
l[
|
|
3359
|
+
u = Math.max(u, e, t, n);
|
|
3360
|
+
let i = f % s, a = Math.floor(f / s) % s, o = Math.floor(f / c) % s, d = (i * c + a * s + o) * 4;
|
|
3361
|
+
l[d + 0] = e, l[d + 1] = t, l[d + 2] = n, ++f;
|
|
3362
3362
|
}
|
|
3363
|
-
let p = 2 ** Math.ceil(Math.log2(
|
|
3363
|
+
let p = 2 ** Math.ceil(Math.log2(u)), m = this.type === 1009 ? new Uint8Array(l.length) : l, h = this.type === 1009 ? 255 : 1;
|
|
3364
3364
|
for (let e = 0, t = m.length; e < t; e += 4) {
|
|
3365
3365
|
let t = e + 1, n = e + 2, r = e + 3;
|
|
3366
3366
|
m[e] = l[e] / p * h, m[t] = l[t] / p * h, m[n] = l[n] / p * h, m[r] = h;
|
|
3367
3367
|
}
|
|
3368
|
-
let g = new
|
|
3369
|
-
return g.image.data = m, g.image.width =
|
|
3370
|
-
size:
|
|
3368
|
+
let g = new de();
|
|
3369
|
+
return g.image.data = m, g.image.width = s, g.image.height = s, g.image.depth = s, g.format = o, g.type = this.type, g.magFilter = F, g.minFilter = F, g.wrapS = d, g.wrapT = d, g.wrapR = d, g.generateMipmaps = !1, g.needsUpdate = !0, {
|
|
3370
|
+
size: s,
|
|
3371
3371
|
texture3D: g
|
|
3372
3372
|
};
|
|
3373
3373
|
}
|
|
@@ -3379,17 +3379,17 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3379
3379
|
},
|
|
3380
3380
|
vertexShader: "\n precision highp float;\n\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n\n attribute vec3 position;\n attribute vec2 uv;\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
|
|
3381
3381
|
fragmentShader: "\n\n precision highp float;\n\n uniform sampler2D tDiffuse;\n\n #include <tonemapping_pars_fragment>\n #include <colorspace_pars_fragment>\n\n varying vec2 vUv;\n\n void main() {\n\n gl_FragColor = texture2D( tDiffuse, vUv );\n\n // tone mapping\n\n #ifdef LINEAR_TONE_MAPPING\n\n gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );\n\n #elif defined( REINHARD_TONE_MAPPING )\n\n gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );\n\n #elif defined( CINEON_TONE_MAPPING )\n\n gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );\n\n #elif defined( ACES_FILMIC_TONE_MAPPING )\n\n gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );\n\n #elif defined( AGX_TONE_MAPPING )\n\n gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );\n\n #elif defined( NEUTRAL_TONE_MAPPING )\n\n gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );\n\n #elif defined( CUSTOM_TONE_MAPPING )\n\n gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );\n\n #endif\n\n // color space\n\n #ifdef SRGB_TRANSFER\n\n gl_FragColor = sRGBTransferOETF( gl_FragColor );\n\n #endif\n\n }"
|
|
3382
|
-
}, gn = class extends
|
|
3382
|
+
}, gn = class extends K {
|
|
3383
3383
|
constructor() {
|
|
3384
|
-
super(), this.isOutputPass = !0, this.uniforms =
|
|
3384
|
+
super(), this.isOutputPass = !0, this.uniforms = D.clone(hn.uniforms), this.material = new p({
|
|
3385
3385
|
name: hn.name,
|
|
3386
3386
|
uniforms: this.uniforms,
|
|
3387
3387
|
vertexShader: hn.vertexShader,
|
|
3388
3388
|
fragmentShader: hn.fragmentShader
|
|
3389
|
-
}), this._fsQuad = new
|
|
3389
|
+
}), this._fsQuad = new Ae(this.material), this._outputColorSpace = null, this._toneMapping = null;
|
|
3390
3390
|
}
|
|
3391
3391
|
render(e, t, n) {
|
|
3392
|
-
this.uniforms.tDiffuse.value = n.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {},
|
|
3392
|
+
this.uniforms.tDiffuse.value = n.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {}, r.getTransfer(this._outputColorSpace) === "srgb" && (this.material.defines.SRGB_TRANSFER = ""), this._toneMapping === 1 ? this.material.defines.LINEAR_TONE_MAPPING = "" : this._toneMapping === 2 ? this.material.defines.REINHARD_TONE_MAPPING = "" : this._toneMapping === 3 ? this.material.defines.CINEON_TONE_MAPPING = "" : this._toneMapping === 4 ? this.material.defines.ACES_FILMIC_TONE_MAPPING = "" : this._toneMapping === 6 ? this.material.defines.AGX_TONE_MAPPING = "" : this._toneMapping === 7 ? this.material.defines.NEUTRAL_TONE_MAPPING = "" : this._toneMapping === 5 && (this.material.defines.CUSTOM_TONE_MAPPING = ""), this.material.needsUpdate = !0), this.renderToScreen === !0 ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e));
|
|
3393
3393
|
}
|
|
3394
3394
|
dispose() {
|
|
3395
3395
|
this.material.dispose(), this._fsQuad.dispose();
|
|
@@ -3460,7 +3460,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3460
3460
|
return this._sceneRenderer.debugOutput;
|
|
3461
3461
|
}
|
|
3462
3462
|
constructor(t, n) {
|
|
3463
|
-
this.materialsNeedUpdate = !0, this._passRenderer = new
|
|
3463
|
+
this.materialsNeedUpdate = !0, this._passRenderer = new Re(), this._outlinePass = null, this._debugPass = null, this._cameraUpdate = new Fe(), this._cameraChanged = !0, this._noUpdateNeededCount = 0, this._noOStaticFrames = 0, this._maxSamples = 1, this._passUpdateStates = {
|
|
3464
3464
|
updateGroundReflection: !1,
|
|
3465
3465
|
updateGBuffer: !1,
|
|
3466
3466
|
updateScreenSpaceShadow: !1,
|
|
@@ -3475,9 +3475,9 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3475
3475
|
width: this._sceneRenderer.width,
|
|
3476
3476
|
height: this._sceneRenderer.height,
|
|
3477
3477
|
samples: i,
|
|
3478
|
-
textureMinificationFilter: r ?
|
|
3479
|
-
textureMagnificationFilter: r ?
|
|
3480
|
-
}), this._groundReflectionPass = new Et(this, this._sceneRenderer.width, this._sceneRenderer.height, this._maxSamples, {}), this._screenSpaceShadowMapPass = new It(this, new
|
|
3478
|
+
textureMinificationFilter: r ? F : S,
|
|
3479
|
+
textureMagnificationFilter: r ? F : S
|
|
3480
|
+
}), this._groundReflectionPass = new Et(this, this._sceneRenderer.width, this._sceneRenderer.height, this._maxSamples, {}), this._screenSpaceShadowMapPass = new It(this, new z(this._sceneRenderer.width, this._sceneRenderer.height), {
|
|
3481
3481
|
samples: a,
|
|
3482
3482
|
alwaysUpdate: !1
|
|
3483
3483
|
}), this._shadowAndAoPass = new et(this, this._sceneRenderer.width, this._sceneRenderer.height, i), this._lutPass = new dn({
|
|
@@ -3509,19 +3509,19 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3509
3509
|
});
|
|
3510
3510
|
}
|
|
3511
3511
|
createOutlinePass() {
|
|
3512
|
-
return this._outlinePass ||= new Kt(this, new
|
|
3512
|
+
return this._outlinePass ||= new Kt(this, new z(this._sceneRenderer.width, this._sceneRenderer.height), this.scene, this.camera, [], {
|
|
3513
3513
|
downSampleRatio: 2,
|
|
3514
3514
|
edgeDetectionFxaa: !0
|
|
3515
3515
|
}), this._outlinePass;
|
|
3516
3516
|
}
|
|
3517
3517
|
getRenderPassRenderTarget(e) {
|
|
3518
|
-
return this._lutPassParameters.enabled ? (this._passRenderTarget = this._passRenderTarget ?? new
|
|
3518
|
+
return this._lutPassParameters.enabled ? (this._passRenderTarget = this._passRenderTarget ?? new i(this._sceneRenderer.width * e.getPixelRatio(), this._sceneRenderer.height * e.getPixelRatio(), {
|
|
3519
3519
|
type: 1016,
|
|
3520
3520
|
samples: this._maxSamples
|
|
3521
3521
|
}), this._passRenderTarget) : null;
|
|
3522
3522
|
}
|
|
3523
3523
|
getPostPassRenderTarget(e) {
|
|
3524
|
-
return this._lutPassParameters.enabled ? (this._passPassRenderTarget = this._passPassRenderTarget ?? new
|
|
3524
|
+
return this._lutPassParameters.enabled ? (this._passPassRenderTarget = this._passPassRenderTarget ?? new i(this._sceneRenderer.width * e.getPixelRatio(), this._sceneRenderer.height * e.getPixelRatio(), { type: 1016 }), this._passPassRenderTarget) : null;
|
|
3525
3525
|
}
|
|
3526
3526
|
setGroundVisibility(e) {
|
|
3527
3527
|
this._sceneRenderer.shadowAndAoGroundPlane.setVisibility(e);
|
|
@@ -3612,7 +3612,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3612
3612
|
this.materialsNeedUpdate = !1, t.traverse((e) => {
|
|
3613
3613
|
if (e.isMesh) {
|
|
3614
3614
|
let t = e.material;
|
|
3615
|
-
t instanceof
|
|
3615
|
+
t instanceof b && this._updateMaterial(e, t, n);
|
|
3616
3616
|
}
|
|
3617
3617
|
});
|
|
3618
3618
|
}
|
|
@@ -3633,7 +3633,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3633
3633
|
e.setRenderTarget(n), this._bakedGroundContactShadowPass.renderPass(e), this._passUpdateStates.updateGBuffer && this._gBufferRenderPass.renderPass(e), this._passUpdateStates.updateScreenSpaceShadow && this._screenSpaceShadowMapPass.renderPass(e), this._passUpdateStates.updateShadowAndAoPass && this._shadowAndAoPass.renderPass(e), this._updateMaterials(e, t), this._sceneRenderPass.renderPass(e), this._passUpdateStates.updateGroundReflection && this._groundReflectionPass.renderPass(e), this._passUpdateStates.updateShadowAndAoPass && !this._shadowAndAoPass.parameters.applyToMaterial && this._shadowAndAoPass.renderToTarget(e), this._lutPassParameters.enabled && (e.setRenderTarget(r), this._outputPass.renderToScreen = !1, this._outputPass.render(e, e.getRenderTarget(), n, 0, !1), e.setRenderTarget(null), this._lutPass.renderToScreen = !0, this._lutPass.render(e, e.getRenderTarget(), r, 0, !1)), this._passUpdateStates.updateOutlinePass && this._outlinePass?.renderPass(e), this._passUpdateStates.updateDebugPass && this._debugPass?.renderPass(e);
|
|
3634
3634
|
}
|
|
3635
3635
|
};
|
|
3636
|
-
|
|
3636
|
+
ge([he, me("design:type", Object)], vn.prototype, "_initData", void 0);
|
|
3637
3637
|
//#endregion
|
|
3638
3638
|
//#region packages/common-core/src/webgl/renderer/scene-renderer.ts
|
|
3639
3639
|
var yn = {
|
|
@@ -3673,7 +3673,7 @@ var yn = {
|
|
|
3673
3673
|
return this._shadowAndAoGroundPlane;
|
|
3674
3674
|
}
|
|
3675
3675
|
constructor(e, t, n, r, i) {
|
|
3676
|
-
this.debugOutput = "off", this.outputColorSpace = "", this.toneMapping = "", this.linearAoFilter = !0, this.environmentLights = !1, this.enableObjectSelection = !0, this.groundLevel = 0, this.uiInteractionMode = !1, this.width = 0, this.height = 0, this.boundingVolume = new
|
|
3676
|
+
this.debugOutput = "off", this.outputColorSpace = "", this.toneMapping = "", this.linearAoFilter = !0, this.environmentLights = !1, this.enableObjectSelection = !0, this.groundLevel = 0, this.uiInteractionMode = !1, this.width = 0, this.height = 0, this.boundingVolume = new Pe(), this.boundingVolumeSet = !1, this.renderCacheManager = new mt(), this.selectedObjects = [], this.groundGroup = new ae(), this._shadingType = nt.DEFAULT, this._qualityLevel = yn.HIGHEST, this._qualityMap = /* @__PURE__ */ new Map(), this._customShadingParameters = null, this._creator_ = e, this.width = n, this.height = r, this.linearAoFilter = i ?? !0, this.renderer = t, this.renderCacheManager.registerCache("inivisibleGround", new ht((e) => e === this.groundGroup)), this.renderCacheManager.registerCache("groundReflection", new ht((e) => e === this.groundGroup || e.name === "dimensioning" ? !0 : !!(e instanceof C && ft(e.material)))), this.renderCacheManager.registerCache("debug", new ht()), this.renderCacheManager.registerCache("floorDepthWrite", new gt((e) => e.userData?.isFloor)), this._shadowAndAoGroundPlane = new Be(null), this.groundGroup.rotateX(-Math.PI / 2), this._renderPassManager = new vn(e, this), this.outlineRenderer = new tt(this._renderPassManager, null, {}), this.parameters = {
|
|
3677
3677
|
gBufferRenderTargetParameters: this.gBufferRenderPass.parameters,
|
|
3678
3678
|
bakedGroundContactShadowParameters: this.bakedGroundContactShadowPass.parameters,
|
|
3679
3679
|
screenSpaceShadowMapParameters: this.screenSpaceShadowMapPass.parameters,
|
|
@@ -3802,8 +3802,8 @@ var yn = {
|
|
|
3802
3802
|
t?.projectionMatrix && (e.add(this.groundGroup), this._updateEnvironment(this.renderer, e), this.outlineRenderer.updateOutline(e, t, this.enableObjectSelection ? this.selectedObjects : []), this._renderPassManager.updatePasses(this.renderer, e, t), this._renderPassManager.renderPasses(this.renderer, e), e.remove(this.groundGroup));
|
|
3803
3803
|
}
|
|
3804
3804
|
};
|
|
3805
|
-
|
|
3805
|
+
ge([he, me("design:type", Object)], bn.prototype, "_initData", void 0);
|
|
3806
3806
|
//#endregion
|
|
3807
|
-
export { At as a,
|
|
3807
|
+
export { At as a, X as c, $t as i, bn as n, nt as o, Qt as r, Z as s, yn as t };
|
|
3808
3808
|
|
|
3809
|
-
//# sourceMappingURL=scene-renderer-
|
|
3809
|
+
//# sourceMappingURL=scene-renderer-3nhM4cEu.mjs.map
|