@roomle/web-sdk 3.9.0-alpha.1 → 3.9.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-BqjC9LhS.mjs → GLTFExporter-yfYOtLdk.mjs} +2 -2
- package/lib/{GLTFExporter-BqjC9LhS.mjs.map → GLTFExporter-yfYOtLdk.mjs.map} +1 -1
- package/lib/RoomleCore.js +3 -3
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{USDZExporter-qUD2VgwK.mjs → USDZExporter-DFJQYX8l.mjs} +2 -2
- package/lib/{USDZExporter-qUD2VgwK.mjs.map → USDZExporter-DFJQYX8l.mjs.map} +1 -1
- package/lib/{api-ByHTYrQ_.mjs → api-s0Yey2rD.mjs} +12 -12
- package/lib/api-s0Yey2rD.mjs.map +1 -0
- package/lib/asset-loader.worker-A7nEeQB4.mjs.map +1 -1
- package/lib/{banana-for-scale-DiBCpVNM.mjs → banana-for-scale-CFY_5rk1.mjs} +4 -4
- package/lib/{banana-for-scale-DiBCpVNM.mjs.map → banana-for-scale-CFY_5rk1.mjs.map} +1 -1
- package/lib/budgeteer.sw-CQWYbQSc.mjs.map +1 -1
- package/lib/{common-utils-AB4Lnet3.mjs → common-utils-L3DF6Ey5.mjs} +2 -2
- package/lib/{common-utils-AB4Lnet3.mjs.map → common-utils-L3DF6Ey5.mjs.map} +1 -1
- package/lib/{component-dimensioning-LUnZnpqG.mjs → component-dimensioning-DmcHgmpq.mjs} +44 -38
- package/lib/component-dimensioning-DmcHgmpq.mjs.map +1 -0
- package/lib/{component-raycast-helper-Bl0mWPcj.mjs → component-raycast-helper-cJxdYLXm.mjs} +28 -28
- package/lib/{component-raycast-helper-Bl0mWPcj.mjs.map → component-raycast-helper-cJxdYLXm.mjs.map} +1 -1
- package/lib/configurator-CC0uDa2i.mjs +2 -0
- package/lib/configurator-CxsFgHxg.mjs +45 -0
- package/lib/{configurator-Cf6J4eOF.mjs.map → configurator-CxsFgHxg.mjs.map} +1 -1
- package/lib/{continuous-drawing-helper-BlRy7u2t.mjs → continuous-drawing-helper-DEmx54k_.mjs} +3 -3
- package/lib/{continuous-drawing-helper-BlRy7u2t.mjs.map → continuous-drawing-helper-DEmx54k_.mjs.map} +1 -1
- package/lib/{decorate-Bck1_lG8.mjs → decorate-C9r0zXzz.mjs} +1 -1
- package/lib/{decorate-Bck1_lG8.mjs.map → decorate-C9r0zXzz.mjs.map} +1 -1
- package/lib/{dimensioning-helper-vPhGfHd-.mjs → dimensioning-helper-BXD6AEqL.mjs} +28 -21
- package/lib/dimensioning-helper-BXD6AEqL.mjs.map +1 -0
- package/lib/dimensioning-helper-Do9jwg8T.mjs +2 -0
- package/lib/glb-viewer-DyHnMYi0.mjs +2 -0
- package/lib/{glb-viewer-B95ZWAO-.mjs → glb-viewer-I86nXb0A.mjs} +69 -69
- package/lib/{glb-viewer-B95ZWAO-.mjs.map → glb-viewer-I86nXb0A.mjs.map} +1 -1
- package/lib/{highlight-coordinator-DeB46jQq.mjs → highlight-coordinator-DvgAfvb2.mjs} +3 -3
- package/lib/{highlight-coordinator-DeB46jQq.mjs.map → highlight-coordinator-DvgAfvb2.mjs.map} +1 -1
- package/lib/{homag-intelligence-ByOCaAFW.mjs → homag-intelligence-Bt--x6_f.mjs} +17 -7
- package/lib/homag-intelligence-Bt--x6_f.mjs.map +1 -0
- package/lib/{imos-ix-poc-export-helper-Vyv-uuNs.mjs → imos-ix-poc-export-helper-C9wPB6fl.mjs} +3 -3
- package/lib/{imos-ix-poc-export-helper-Vyv-uuNs.mjs.map → imos-ix-poc-export-helper-C9wPB6fl.mjs.map} +1 -1
- package/lib/kernel-C7YDLxq8.mjs.map +1 -1
- package/lib/{kernel-utils-BG1uqfT_.mjs → kernel-utils-B5QlsCwn.mjs} +15 -7
- package/lib/kernel-utils-B5QlsCwn.mjs.map +1 -0
- package/lib/{layer-BfckfWZz.mjs → layer-C_JtkhdO.mjs} +1 -1
- package/lib/{layer-BfckfWZz.mjs.map → layer-C_JtkhdO.mjs.map} +1 -1
- package/lib/{main-TlUQxOeW.mjs → main-DeOPstVA.mjs} +36481 -3268
- package/lib/main-DeOPstVA.mjs.map +1 -0
- package/lib/{material-viewer-37JiZSuS.mjs → material-viewer-D8Qdq6-m.mjs} +55 -55
- package/lib/material-viewer-D8Qdq6-m.mjs.map +1 -0
- package/lib/packages-eckwotTn.mjs +4 -0
- package/lib/{planner-DBhjeG6D.mjs → planner-BWZr-Th2.mjs} +14 -14
- package/lib/{planner-DBhjeG6D.mjs.map → planner-BWZr-Th2.mjs.map} +1 -1
- package/lib/planner-D3jvWraY.mjs +2 -0
- package/lib/{plugin-system-BEZnFUyT.mjs → plugin-system-BBgoIai2.mjs} +3 -3
- package/lib/{plugin-system-BEZnFUyT.mjs.map → plugin-system-BBgoIai2.mjs.map} +1 -1
- package/lib/roomle-headless-setup-CMK-quZI.mjs.map +1 -1
- package/lib/roomle-headless.d.ts +212 -32
- package/lib/roomle-headless.js +42 -41
- package/lib/roomle-headless.js.map +1 -1
- package/lib/{roomle-renderer-BgT28pfp.mjs → roomle-renderer-CkSFbpmg.mjs} +2 -2
- package/lib/{roomle-renderer-BgT28pfp.mjs.map → roomle-renderer-CkSFbpmg.mjs.map} +1 -1
- package/lib/roomle-sdk.d.ts +212 -32
- package/lib/roomle-sdk.js +8 -7
- package/lib/{roomle-webgpu-renderer-CdD3cYxN.mjs → roomle-webgpu-renderer-Cs4eLEwf.mjs} +426 -393
- package/lib/roomle-webgpu-renderer-Cs4eLEwf.mjs.map +1 -0
- package/lib/{scene-renderer-Bdl7umAf.mjs → scene-renderer-4zk6BXsR.mjs} +228 -228
- package/lib/{scene-renderer-Bdl7umAf.mjs.map → scene-renderer-4zk6BXsR.mjs.map} +1 -1
- package/lib/{script-loader-D3Cbc5BY.mjs → script-loader-DSL6zJat.mjs} +9 -9
- package/lib/{script-loader-D3Cbc5BY.mjs.map → script-loader-DSL6zJat.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/src/embind/configuratorCoreInterface.d.ts +7 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js +2 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +35 -2
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js +12 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +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.js +3 -3
- 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-BvDfWWfq.mjs → stats-helper-DyRFKnMs.mjs} +3 -3
- package/lib/{stats-helper-BvDfWWfq.mjs.map → stats-helper-DyRFKnMs.mjs.map} +1 -1
- package/lib/{three.core-K1JzUaep.mjs → three.core-DNErG1F6.mjs} +1 -1
- package/lib/{three.core-K1JzUaep.mjs.map → three.core-DNErG1F6.mjs.map} +1 -1
- package/lib/{three.module-Q2K9uyhi.mjs → three.module-BZkESKo3.mjs} +2 -2
- package/lib/{three.module-Q2K9uyhi.mjs.map → three.module-BZkESKo3.mjs.map} +1 -1
- package/lib/{three.webgpu-7v7o6Pxs.mjs → three.webgpu-C8myBXe1.mjs} +2 -2
- package/lib/{three.webgpu-7v7o6Pxs.mjs.map → three.webgpu-C8myBXe1.mjs.map} +1 -1
- package/lib/three.webgpu-WIkDzwXU.mjs +3 -0
- package/lib/{threejs-utils-BzXU2M3w.mjs → threejs-utils-fEhH05zP.mjs} +103 -87
- package/lib/threejs-utils-fEhH05zP.mjs.map +1 -0
- package/lib/{tools-core-CUTTHUku.mjs → tools-core-Bf4_WCg8.mjs} +5 -5
- package/lib/{tools-core-CUTTHUku.mjs.map → tools-core-Bf4_WCg8.mjs.map} +1 -1
- package/package.json +5 -2
- package/lib/api-ByHTYrQ_.mjs.map +0 -1
- package/lib/component-dimensioning-LUnZnpqG.mjs.map +0 -1
- package/lib/configurator-Cf6J4eOF.mjs +0 -45
- package/lib/configurator-D5FuWg5f.mjs +0 -2
- package/lib/dimensioning-helper-5xsc6I7Y.mjs +0 -2
- package/lib/dimensioning-helper-vPhGfHd-.mjs.map +0 -1
- package/lib/glb-viewer-C-IBj6p6.mjs +0 -2
- package/lib/homag-intelligence-ByOCaAFW.mjs.map +0 -1
- package/lib/kernel-utils-BG1uqfT_.mjs.map +0 -1
- package/lib/main-TlUQxOeW.mjs.map +0 -1
- package/lib/material-viewer-37JiZSuS.mjs.map +0 -1
- package/lib/packages-BPyzoYeC.mjs +0 -4
- package/lib/planner-BBUr8xHt.mjs +0 -2
- package/lib/roomle-webgpu-renderer-CdD3cYxN.mjs.map +0 -1
- package/lib/three.webgpu-ChguPx4k.mjs +0 -3
- package/lib/threejs-utils-BzXU2M3w.mjs.map +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as ue } from "./three.
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { k as e } from "./threejs-utils-fEhH05zP.mjs";
|
|
2
|
+
import { $t as t, B as n, Bt as r, C as i, Dn as a, Hr as o, J as s, Kt as c, Or as l, R as u, Rt as d, Si as f, T as p, Ti as m, Tn as h, Ur as g, Vr as _, Wn as v, X as y, ai as b, an as x, bi as S, cn as C, d as w, di as T, dn as E, fi as D, gn as O, hn as ee, it as te, jr as k, kn as ne, ln as re, m as A, mi as j, mn as ie, mt as ae, oi as oe, on as M, ot as N, pn as P, pt as F, q as I, rn as L, sn as R, st as se, ti as ce, v as le, wr as ue, x as z, xi as B, yn as V } from "./three.core-DNErG1F6.mjs";
|
|
3
|
+
import { r as de } from "./three.module-BZkESKo3.mjs";
|
|
4
|
+
import { n as fe, r as pe, t as me } from "./decorate-C9r0zXzz.mjs";
|
|
5
|
+
import "./dimensioning-helper-BXD6AEqL.mjs";
|
|
6
|
+
import { h as he } from "./common-utils-L3DF6Ey5.mjs";
|
|
7
7
|
//#region packages/common-core/src/webgl/renderer/shader-utility.ts
|
|
8
8
|
var ge = {
|
|
9
9
|
uniforms: {
|
|
10
10
|
tDiffuse: { value: null },
|
|
11
|
-
colorTransform: { value: new
|
|
12
|
-
colorBase: { value: new
|
|
11
|
+
colorTransform: { value: new M() },
|
|
12
|
+
colorBase: { value: new f(0, 0, 0, 0) },
|
|
13
13
|
multiplyChannels: { value: 0 },
|
|
14
|
-
uvTransform: { value: new
|
|
14
|
+
uvTransform: { value: new x() }
|
|
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
|
-
}, H = new
|
|
19
|
-
new
|
|
20
|
-
var U = new
|
|
18
|
+
}, H = new M(), _e = new M().set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0), ve = new M().set(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0), ye = new M().set(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1);
|
|
19
|
+
new M().set(0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1), new M().set(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
20
|
+
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, 0, 0, 0), G = new f(0, 0, 0, 1), K = new x(), be = new x().set(1, 0, 0, 0, -1, 1, 0, 0, 1), xe = {
|
|
21
21
|
DEFAULT: "default",
|
|
22
22
|
ADDITIVE: "additive"
|
|
23
|
-
}, Se = class extends
|
|
23
|
+
}, Se = class extends o {
|
|
24
24
|
constructor(e, t = xe.ADDITIVE, n = !1, r = !1) {
|
|
25
25
|
let i = t === xe.ADDITIVE ? {
|
|
26
26
|
blendSrc: 208,
|
|
@@ -31,7 +31,7 @@ var U = new P().set(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1), W = new d(0
|
|
|
31
31
|
blendEquationAlpha: 100
|
|
32
32
|
} : {};
|
|
33
33
|
super({
|
|
34
|
-
uniforms:
|
|
34
|
+
uniforms: T.clone(ge.uniforms),
|
|
35
35
|
vertexShader: ge.vertexShader,
|
|
36
36
|
fragmentShader: ge.fragmentShader,
|
|
37
37
|
defines: {
|
|
@@ -50,19 +50,19 @@ var U = new P().set(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1), W = new d(0
|
|
|
50
50
|
}, Ce = {
|
|
51
51
|
uniforms: {
|
|
52
52
|
tDiffuse: { value: null },
|
|
53
|
-
rangeMin: { value: new
|
|
54
|
-
rangeMax: { value: new
|
|
53
|
+
rangeMin: { value: new S(1 / 512, 1 / 512) },
|
|
54
|
+
rangeMax: { value: new S(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 we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }", Te = "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 }", Ee = class e extends
|
|
59
|
+
new S(.1, .9), new S(.1, .9);
|
|
60
|
+
var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }", Te = "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 }", Ee = class e extends o {
|
|
61
61
|
static {
|
|
62
62
|
this._linearDepthShader = {
|
|
63
63
|
uniforms: {
|
|
64
64
|
tDepth: { value: null },
|
|
65
|
-
depthFilter: { value: new
|
|
65
|
+
depthFilter: { value: new f(1, 0, 0, 0) },
|
|
66
66
|
cameraNear: { value: .1 },
|
|
67
67
|
cameraFar: { value: 1 }
|
|
68
68
|
},
|
|
@@ -77,7 +77,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
77
77
|
constructor(t) {
|
|
78
78
|
super({
|
|
79
79
|
defines: Object.assign({}, e._linearDepthShader.defines),
|
|
80
|
-
uniforms:
|
|
80
|
+
uniforms: T.clone(e._linearDepthShader.uniforms),
|
|
81
81
|
vertexShader: e._linearDepthShader.vertexShader,
|
|
82
82
|
fragmentShader: e._linearDepthShader.fragmentShader,
|
|
83
83
|
blending: 0
|
|
@@ -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
|
-
}, De = new
|
|
102
|
+
}, De = new h(-1, 1, 1, -1, 0, 1), Oe = new class extends A {
|
|
103
103
|
constructor() {
|
|
104
|
-
super(), this.setAttribute("position", new
|
|
104
|
+
super(), this.setAttribute("position", new N([
|
|
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 N([
|
|
115
115
|
0,
|
|
116
116
|
2,
|
|
117
117
|
0,
|
|
@@ -796,22 +796,22 @@ 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, te = v - w + 2 * d, k = g - 1 + 3 * d, ne = _ - 1 + 3 * d, re = v - 1 + 3 * d, A = c & 255, j = l & 255, ie = u & 255, ae = this.perm[A + this.perm[j + this.perm[ie]]] % 12, oe = this.perm[A + y + this.perm[j + b + this.perm[ie + x]]] % 12, M = this.perm[A + S + this.perm[j + C + this.perm[ie + w]]] % 12, N = this.perm[A + 1 + this.perm[j + 1 + this.perm[ie + 1]]] % 12, P = .6 - g * g - _ * _ - v * v;
|
|
800
|
+
P < 0 ? r = 0 : (P *= P, r = P * P * this._dot3(this.grad3[ae], g, _, v));
|
|
801
|
+
let F = .6 - T * T - E * E - D * D;
|
|
802
|
+
F < 0 ? i = 0 : (F *= F, i = F * F * this._dot3(this.grad3[oe], T, E, D));
|
|
803
|
+
let I = .6 - O * O - ee * ee - te * te;
|
|
804
|
+
I < 0 ? a = 0 : (I *= I, a = I * I * this._dot3(this.grad3[M], O, ee, te));
|
|
805
|
+
let L = .6 - k * k - ne * ne - re * re;
|
|
806
|
+
return L < 0 ? o = 0 : (L *= L, o = L * L * this._dot3(this.grad3[N], k, 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,
|
|
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, te = T > E ? 8 : 0, k = w > D ? 4 : 0, ne = T > D ? 2 : 0, re = E > D ? 1 : 0, A = O + ee + te + k + ne + re, j = a[A][0] >= 3 ? 1 : 0, ie = a[A][1] >= 3 ? 1 : 0, ae = a[A][2] >= 3 ? 1 : 0, oe = a[A][3] >= 3 ? 1 : 0, M = a[A][0] >= 2 ? 1 : 0, N = a[A][1] >= 2 ? 1 : 0, P = a[A][2] >= 2 ? 1 : 0, F = a[A][3] >= 2 ? 1 : 0, I = a[A][0] >= 1 ? 1 : 0, L = a[A][1] >= 1 ? 1 : 0, R = a[A][2] >= 1 ? 1 : 0, se = a[A][3] >= 1 ? 1 : 0, ce = w - j + c, le = T - ie + c, ue = E - ae + c, z = D - oe + c, B = w - M + 2 * c, V = T - N + 2 * c, de = E - P + 2 * c, fe = D - F + 2 * c, pe = w - I + 3 * c, me = T - L + 3 * c, he = E - R + 3 * c, ge = D - se + 3 * c, H = w - 1 + 4 * c, _e = T - 1 + 4 * c, ve = E - 1 + 4 * c, ye = D - 1 + 4 * c, U = h & 255, W = g & 255, G = _ & 255, K = v & 255, be = o[U + o[W + o[G + o[K]]]] % 32, xe = o[U + j + o[W + ie + o[G + ae + o[K + oe]]]] % 32, Se = o[U + M + o[W + N + o[G + P + o[K + F]]]] % 32, Ce = o[U + I + o[W + L + o[G + R + o[K + se]]]] % 32, we = o[U + 1 + o[W + 1 + o[G + 1 + o[K + 1]]]] % 32, Te = .6 - w * w - T * T - E * E - D * D;
|
|
810
810
|
Te < 0 ? l = 0 : (Te *= Te, l = Te * Te * this._dot4(i[be], w, T, E, D));
|
|
811
|
-
let Ee = .6 - ce * ce - le * le -
|
|
812
|
-
Ee < 0 ? u = 0 : (Ee *= Ee, u = Ee * Ee * this._dot4(i[xe], ce, le,
|
|
813
|
-
let q = .6 -
|
|
814
|
-
q < 0 ? d = 0 : (q *= q, d = q * q * this._dot4(i[Se],
|
|
811
|
+
let Ee = .6 - ce * ce - le * le - ue * ue - z * z;
|
|
812
|
+
Ee < 0 ? u = 0 : (Ee *= Ee, u = Ee * Ee * this._dot4(i[xe], ce, le, ue, z));
|
|
813
|
+
let q = .6 - B * B - V * V - de * de - fe * fe;
|
|
814
|
+
q < 0 ? d = 0 : (q *= q, d = q * q * this._dot4(i[Se], B, V, de, fe));
|
|
815
815
|
let De = .6 - pe * pe - me * me - he * he - ge * ge;
|
|
816
816
|
De < 0 ? f = 0 : (De *= De, f = De * De * this._dot4(i[Ce], pe, me, he, ge));
|
|
817
817
|
let Oe = .6 - H * H - _e * _e - ve * ve - ye * ye;
|
|
@@ -835,7 +835,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
835
835
|
e.aspect = i / a, e.fov = L.radToDeg(Math.atan2(a, n) * 2), e.near = n, e.far = r, e.updateProjectionMatrix();
|
|
836
836
|
}, Ne = class {
|
|
837
837
|
constructor() {
|
|
838
|
-
this.bounds = new
|
|
838
|
+
this.bounds = new w(new B(-1, -1, -1), new B(1, 1, 1)), this.size = new B(2, 2, 2), this.center = new B(0, 0, 0), this.maxSceneDistanceFromCenter = Math.sqrt(3), this.maxSceneDistanceFrom0 = Math.sqrt(3);
|
|
839
839
|
}
|
|
840
840
|
updateFromBox(e) {
|
|
841
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 B(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();
|
|
@@ -843,7 +843,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
843
843
|
updateCameraViewVolumeFromBounds(e) {
|
|
844
844
|
e.updateMatrixWorld();
|
|
845
845
|
let t = this.bounds.clone().applyMatrix4(e.matrixWorldInverse);
|
|
846
|
-
e instanceof
|
|
846
|
+
e instanceof h ? je(e, t) : e instanceof a && Me(e, t);
|
|
847
847
|
}
|
|
848
848
|
getNearAndFarForPerspectiveCamera(e, t = 1) {
|
|
849
849
|
let n = e.clone().sub(this.center).length();
|
|
@@ -865,16 +865,16 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
865
865
|
}
|
|
866
866
|
return r;
|
|
867
867
|
}, Ie = (e) => {
|
|
868
|
-
let
|
|
869
|
-
for (let
|
|
870
|
-
let r = i[
|
|
871
|
-
o[
|
|
868
|
+
let t = new Ae(), r = Math.floor(e) % 2 == 0 ? Math.floor(e) + 1 : Math.floor(e), i = Fe(r), a = i.length, o = new Uint8Array(a * 4);
|
|
869
|
+
for (let n = 0; n < a; ++n) {
|
|
870
|
+
let r = i[n], s = 2 * Math.PI * r / a, c = new B(Math.cos(s), Math.sin(s), 0).normalize();
|
|
871
|
+
o[n * 4] = (c.x * .5 + .5) * 255, o[n * 4 + 1] = (c.y * .5 + .5) * 255, o[n * 4 + 2] = 127, o[n * 4 + 3] = (t.noise(n / e, n % e) * .5 + .5) * 255;
|
|
872
872
|
}
|
|
873
|
-
let s = new
|
|
873
|
+
let s = new n(o, r, r);
|
|
874
874
|
return s.wrapS = k, s.wrapT = k, s.needsUpdate = !0, s;
|
|
875
875
|
}, Le = class {
|
|
876
876
|
constructor() {
|
|
877
|
-
this._originalClearColor = new
|
|
877
|
+
this._originalClearColor = new i(), this._originalClearAlpha = 0, this._originalAutoClear = !1, this._originalRenderTarget = null, this._screenSpaceQuad = new ke(void 0), this._emptyScene = new _(), this._defaultCamera = new a();
|
|
878
878
|
}
|
|
879
879
|
renderWithOverrideMaterial(e, t, n, r, i, a, o) {
|
|
880
880
|
this._backup(e), this._prepareRenderer(e, i, a, o);
|
|
@@ -901,7 +901,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
901
901
|
}
|
|
902
902
|
}, Re = class {
|
|
903
903
|
constructor(e, t) {
|
|
904
|
-
this._passRenderer = t?.passRenderer ?? new Le(), this._blurMaterial = new
|
|
904
|
+
this._passRenderer = t?.passRenderer ?? new Le(), this._blurMaterial = new o(e ?? Ce), this._blurMaterial.depthTest = !1;
|
|
905
905
|
}
|
|
906
906
|
dispose() {
|
|
907
907
|
this._blurMaterial.dispose();
|
|
@@ -914,7 +914,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
914
914
|
this.alphaMap = !0;
|
|
915
915
|
}
|
|
916
916
|
constructor(t, n) {
|
|
917
|
-
super(new
|
|
917
|
+
super(new ne(1, 1, 10, 10), new ee({
|
|
918
918
|
color: e.alphaMap ? 0 : 16777215,
|
|
919
919
|
transparent: !0,
|
|
920
920
|
depthWrite: !1,
|
|
@@ -992,7 +992,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
992
992
|
let n = [];
|
|
993
993
|
for (let r = 0; r < e; r++) {
|
|
994
994
|
let i = r * Math.PI * (3 - Math.sqrt(5)), a = .01 + r / (e - 1) * .99, o = t ? Math.sqrt(1 - a * a) : 1 - a, s = Math.cos(i) * o, c = Math.sin(i) * o, l = Math.floor(e / 4), u = 1 - (Math.floor(r / 4) + r % 4 * l) / e;
|
|
995
|
-
u = .1 + .9 * u, n.push(new
|
|
995
|
+
u = .1 + .9 * u, n.push(new f(s, c, a, u));
|
|
996
996
|
}
|
|
997
997
|
return n;
|
|
998
998
|
}, Ue = {
|
|
@@ -1015,12 +1015,12 @@ 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 S() },
|
|
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 M() },
|
|
1022
|
+
cameraProjectionMatrixInverse: { value: new M() },
|
|
1023
|
+
cameraWorldMatrix: { value: new M() },
|
|
1024
1024
|
radius: { value: 1 },
|
|
1025
1025
|
distanceExponent: { value: 1 },
|
|
1026
1026
|
thickness: { value: 1 },
|
|
@@ -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 = Y.FLOAT_BUFFER_NORMAL, this._depthValueSourceType = X.NORMAL_VECTOR_ALPHA, this._modulateRedChannel = !1, this.depthTexture = null, this.normalTexture = null, this._noiseTexture = null, this._renderTarget = null, this._passRenderer = new Le(), this._sceneClipBox = new
|
|
1051
|
+
this.needsUpdate = !0, this.parameters = { ...We }, this._width = 0, this._height = 0, this._samples = 0, this._gBufferAntiAliasing = !1, this._normalVectorSourceType = Y.FLOAT_BUFFER_NORMAL, this._depthValueSourceType = X.NORMAL_VECTOR_ALPHA, this._modulateRedChannel = !1, this.depthTexture = null, this.normalTexture = null, this._noiseTexture = null, this._renderTarget = null, this._passRenderer = new Le(), this._sceneClipBox = new w(new B(-1, -1, -1), new B(1, 1, 1)), this._sceneScale = 1, this._width = e, this._height = t, this._samples = n, this._gBufferAntiAliasing = r, this._normalVectorSourceType = i?.normalVectorSourceType || Y.FLOAT_BUFFER_NORMAL, this._depthValueSourceType = i?.depthValueSourceType || X.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
|
|
1056
|
-
for (let
|
|
1057
|
-
let a =
|
|
1058
|
-
r[(
|
|
1055
|
+
let t = new Ae(), r = new Uint8Array(e * e * 4);
|
|
1056
|
+
for (let n = 0; n < e; n++) for (let i = 0; i < e; i++) {
|
|
1057
|
+
let a = n, o = i;
|
|
1058
|
+
r[(n * e + i) * 4] = (t.noise(a, o) + 1) * 127.5, r[(n * e + i) * 4 + 1] = (t.noise(a + e, o) + 1) * 127.5, r[(n * e + i) * 4 + 2] = (t.noise(a, o + e) + 1) * 127.5, r[(n * e + i) * 4 + 3] = (t.noise(a + e, o + e) + 1) * 127.5;
|
|
1059
1059
|
}
|
|
1060
|
-
this._noiseTexture = new
|
|
1060
|
+
this._noiseTexture = new n(r, e, e, v, D), this._noiseTexture.wrapS = k, this._noiseTexture.wrapT = k, this._noiseTexture.needsUpdate = !0;
|
|
1061
1061
|
}
|
|
1062
1062
|
return this._noiseTexture;
|
|
1063
1063
|
}
|
|
@@ -1066,9 +1066,9 @@ 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 o({
|
|
1070
1070
|
defines: Object.assign({}, Ue.defines),
|
|
1071
|
-
uniforms:
|
|
1071
|
+
uniforms: T.clone(Ue.uniforms),
|
|
1072
1072
|
vertexShader: Ue.vertexShader,
|
|
1073
1073
|
fragmentShader: Ue.fragmentShader,
|
|
1074
1074
|
depthTest: !1,
|
|
@@ -1086,10 +1086,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
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 m(this._width, this._height, {
|
|
1090
1090
|
samples: this._samples,
|
|
1091
|
-
magFilter: this._samples > 1 ?
|
|
1092
|
-
minFilter: this._samples > 1 ?
|
|
1091
|
+
magFilter: this._samples > 1 ? c : V,
|
|
1092
|
+
minFilter: this._samples > 1 ? c : V
|
|
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 w().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 S(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 o {
|
|
1125
1125
|
constructor(e) {
|
|
1126
1126
|
super({
|
|
1127
|
-
uniforms:
|
|
1127
|
+
uniforms: T.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 S(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;
|
|
@@ -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 S() },
|
|
1178
|
+
cameraProjectionMatrix: { value: new M() },
|
|
1179
|
+
cameraProjectionMatrixInverse: { value: new M() },
|
|
1180
|
+
cameraWorldMatrix: { value: new M() },
|
|
1181
1181
|
lumaPhi: { value: 5 },
|
|
1182
1182
|
depthPhi: { value: 1 },
|
|
1183
1183
|
normalPhi: { value: 1 },
|
|
@@ -1212,20 +1212,20 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1212
1212
|
}
|
|
1213
1213
|
_getNoiseTexture(e = 64) {
|
|
1214
1214
|
if (!this._noiseTexture) {
|
|
1215
|
-
let
|
|
1216
|
-
for (let
|
|
1217
|
-
let a =
|
|
1218
|
-
r[(
|
|
1215
|
+
let t = new Ae(), r = new Uint8Array(e * e * 4);
|
|
1216
|
+
for (let n = 0; n < e; n++) for (let i = 0; i < e; i++) {
|
|
1217
|
+
let a = n, o = i;
|
|
1218
|
+
r[(n * e + i) * 4] = (t.noise(a, o) + 1) * 127.5, r[(n * e + i) * 4 + 1] = (t.noise(a + e, o) + 1) * 127.5, r[(n * e + i) * 4 + 2] = (t.noise(a, o + e) + 1) * 127.5, r[(n * e + i) * 4 + 3] = (t.noise(a + e, o + e) + 1) * 127.5;
|
|
1219
1219
|
}
|
|
1220
|
-
this._noiseTexture = new
|
|
1220
|
+
this._noiseTexture = new n(r, e, e, v, D), this._noiseTexture.wrapS = k, this._noiseTexture.wrapT = k, 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 o({
|
|
1227
1227
|
defines: Object.assign({}, Xe.defines),
|
|
1228
|
-
uniforms:
|
|
1228
|
+
uniforms: T.clone(Xe.uniforms),
|
|
1229
1229
|
vertexShader: Xe.vertexShader,
|
|
1230
1230
|
fragmentShader: Xe.fragmentShader,
|
|
1231
1231
|
depthTest: !1,
|
|
@@ -1240,16 +1240,16 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
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 m(this._width, this._height, {
|
|
1244
1244
|
samples: this._samples,
|
|
1245
|
-
format:
|
|
1246
|
-
type:
|
|
1245
|
+
format: v,
|
|
1246
|
+
type: ae,
|
|
1247
1247
|
magFilter: V,
|
|
1248
1248
|
minFilter: V
|
|
1249
|
-
}), new
|
|
1249
|
+
}), new m(this._width, this._height, {
|
|
1250
1250
|
samples: this._samples,
|
|
1251
|
-
format:
|
|
1252
|
-
type:
|
|
1251
|
+
format: v,
|
|
1252
|
+
type: ae,
|
|
1253
1253
|
magFilter: V,
|
|
1254
1254
|
minFilter: V
|
|
1255
1255
|
})]), this._renderTargets;
|
|
@@ -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 w().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);
|
|
@@ -1301,10 +1301,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1301
1301
|
progressiveDenoiseIterations: 0
|
|
1302
1302
|
}, et = class extends J {
|
|
1303
1303
|
static {
|
|
1304
|
-
this.shadowTransform = new
|
|
1304
|
+
this.shadowTransform = new M().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 m(this._width, this._height, {
|
|
1308
1308
|
samples: this._samples,
|
|
1309
1309
|
format: 1030,
|
|
1310
1310
|
magFilter: this._samples > 1 ? 1006 : 1003,
|
|
@@ -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 m(this._width, this._height, {
|
|
1352
1352
|
samples: this._samples,
|
|
1353
1353
|
format: 1030,
|
|
1354
1354
|
magFilter: this._samples > 1 ? 1006 : 1003,
|
|
@@ -1473,7 +1473,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
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 M().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
|
}
|
|
@@ -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 = he(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 = {
|
|
@@ -1580,7 +1580,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1580
1580
|
t.shBakedOnGround ? (e.bakedGroundContactShadowParameters.enabled = !0, e.shAndAoPassParameters.shadowIntensity = 0, t.shadowIntensity !== void 0 && (e.bakedGroundContactShadowParameters.opacity = $(t.shadowIntensity)), t.shadowIntensity !== void 0 && (e.bakedGroundContactShadowParameters.blurMax = $(t.shadowIntensity) * .1, e.bakedGroundContactShadowParameters.blurMin = e.bakedGroundContactShadowParameters.blurMax * .01)) : (t.shBakedOnGround !== void 0 && (e.bakedGroundContactShadowParameters.enabled = !1), t.shadowIntensity !== void 0 && (e.shAndAoPassParameters.shadowIntensity = $(t.shadowIntensity)), t.shadowSoftening !== void 0 && (e.shAndAoPassParameters.shadow.shadowRadius = .001 + $(t.shadowSoftening) * .2));
|
|
1581
1581
|
}, ut = (e, t) => {
|
|
1582
1582
|
t.grReflectIntensity !== void 0 && (e.groundReflectionParameters.enabled = t.grReflectIntensity > 0, e.groundReflectionParameters.intensity = $(t.grReflectIntensity)), t.grReflectFadeOut !== void 0 && (e.groundReflectionParameters.fadeOutDistance = (1 - $(t.grReflectFadeOut)) * 4);
|
|
1583
|
-
}, dt = (e, t) => Array.isArray(e) ? e.some((e) => dt(e, t)) : e.transparent && e.opacity < t || e.alphaTest > 0, ft = (e) => Array.isArray(e) ? e.some((e) => ft(e)) : e instanceof
|
|
1583
|
+
}, dt = (e, t) => Array.isArray(e) ? e.some((e) => dt(e, t)) : e.transparent && e.opacity < t || e.alphaTest > 0, ft = (e) => Array.isArray(e) ? e.some((e) => ft(e)) : e instanceof ee && e.transmission > 0, pt = class {
|
|
1584
1584
|
constructor(e) {
|
|
1585
1585
|
this.needsUpdate = !0, this._cache = null, this._cache = e;
|
|
1586
1586
|
}
|
|
@@ -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 O && e.material.depthWrite && this._depthWriteCache.add(e.material);
|
|
1680
1680
|
}
|
|
1681
1681
|
onBeforeRender() {
|
|
1682
1682
|
this._depthWriteCache.forEach((e) => {
|
|
@@ -1732,7 +1732,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
1732
1732
|
return e ||= (this._shadowGroundPlane ??= new ze(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 m(this.shadowMapSize, this.shadowMapSize), this.renderTarget.texture.generateMipmaps = !1, this._renderTargetBlur = new m(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 re(), 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;
|
|
@@ -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 h {
|
|
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 le(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 o {
|
|
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: T.clone(e._normalAndDepthShader.uniforms),
|
|
1870
1870
|
vertexShader: e._normalAndDepthShader.vertexShader,
|
|
1871
1871
|
fragmentShader: e._normalAndDepthShader.fragmentShader,
|
|
1872
1872
|
blending: t?.blending ?? 0
|
|
@@ -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 P({ 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 m(this._width * this.parameters.depthNormalScale, this._height * this.parameters.depthNormalScale, {
|
|
1907
1907
|
minFilter: this._targetMinificationTextureFilter,
|
|
1908
1908
|
magFilter: this._targetMagnificationTextureFilter,
|
|
1909
|
-
type:
|
|
1909
|
+
type: se,
|
|
1910
1910
|
samples: this._samples
|
|
1911
1911
|
});
|
|
1912
1912
|
else {
|
|
1913
|
-
let e = new
|
|
1914
|
-
e.format = I, e.type = j, this._depthNormalRenderTarget = new
|
|
1913
|
+
let e = new s(this._width * this.parameters.depthNormalScale, this._height * this.parameters.depthNormalScale);
|
|
1914
|
+
e.format = I, e.type = j, this._depthNormalRenderTarget = new m(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 m(this._width * this.parameters.depthNormalScale, this._height * this.parameters.depthNormalScale, {
|
|
1924
1924
|
minFilter: this._targetMinificationTextureFilter,
|
|
1925
1925
|
magFilter: this._targetMagnificationTextureFilter,
|
|
1926
|
-
type:
|
|
1926
|
+
type: se,
|
|
1927
1927
|
samples: 0
|
|
1928
1928
|
}), this._separateDeptRenderTarget;
|
|
1929
1929
|
}
|
|
@@ -2008,8 +2008,8 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
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 s(t, n), r.samples = this._samples) : r.samples = 1, new m(t, n, {
|
|
2012
|
+
format: v,
|
|
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 M().set(r, 0, 0, 0, 0, r, 0, 0, 0, 0, r, 0, 0, 0, 0, n),
|
|
2036
2036
|
multiplyChannels: 0,
|
|
2037
2037
|
uvTransform: be
|
|
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 a)) 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);
|
|
@@ -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 o {
|
|
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 S() },
|
|
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 M() },
|
|
2089
|
+
cameraInverseProjectionMatrix: { value: new M() },
|
|
2090
|
+
inverseViewMatrix: { value: new M() },
|
|
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: T.clone(e.shader.uniforms),
|
|
2108
2108
|
vertexShader: e.shader.vertexShader,
|
|
2109
2109
|
fragmentShader: e.shader.fragmentShader,
|
|
2110
2110
|
blending: 0
|
|
@@ -2121,9 +2121,9 @@ 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 d {
|
|
2125
2125
|
constructor(e, t) {
|
|
2126
|
-
let
|
|
2126
|
+
let n = [
|
|
2127
2127
|
1,
|
|
2128
2128
|
1,
|
|
2129
2129
|
0,
|
|
@@ -2140,8 +2140,8 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2140
2140
|
1,
|
|
2141
2141
|
0
|
|
2142
2142
|
], i = new A();
|
|
2143
|
-
i.setAttribute("position", new
|
|
2144
|
-
let a = new
|
|
2143
|
+
i.setAttribute("position", new N(n, 3)), i.computeBoundingSphere();
|
|
2144
|
+
let a = new r({ fog: !1 });
|
|
2145
2145
|
super(i, a), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
|
|
2146
2146
|
let o = [
|
|
2147
2147
|
1,
|
|
@@ -2163,7 +2163,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2163
2163
|
-1,
|
|
2164
2164
|
0
|
|
2165
2165
|
], s = new A();
|
|
2166
|
-
s.setAttribute("position", new
|
|
2166
|
+
s.setAttribute("position", new N(o, 3)), s.computeBoundingSphere(), this.add(new R(s, new C({
|
|
2167
2167
|
side: 1,
|
|
2168
2168
|
fog: !1
|
|
2169
2169
|
})));
|
|
@@ -2180,12 +2180,12 @@ 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 E {
|
|
2184
2184
|
static {
|
|
2185
2185
|
this._enableGroundBoundary = !1;
|
|
2186
2186
|
}
|
|
2187
2187
|
static {
|
|
2188
|
-
this._shadowFadeOut = new
|
|
2188
|
+
this._shadowFadeOut = new S(.1, 20);
|
|
2189
2189
|
}
|
|
2190
2190
|
static {
|
|
2191
2191
|
this._sceneBoxMin = new B(-1, -1, -1);
|
|
@@ -2194,7 +2194,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2194
2194
|
this._sceneBoxMax = new B(1, 1, 1);
|
|
2195
2195
|
}
|
|
2196
2196
|
static {
|
|
2197
|
-
this._distributionProperties = new
|
|
2197
|
+
this._distributionProperties = new f(1, 1, 1, 1);
|
|
2198
2198
|
}
|
|
2199
2199
|
constructor(e) {
|
|
2200
2200
|
super(e), this.customProgramCacheKey = this._customProgramCacheKey, this.onBeforeCompile = this._onBeforeCompile;
|
|
@@ -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 Pe(), this._viewportSize = 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 Pe(), this._viewportSize = new S(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 m(this._viewportSize.x, this._viewportSize.y, {
|
|
2246
2246
|
samples: r,
|
|
2247
|
-
format:
|
|
2248
|
-
magFilter: this._samples > 0 ?
|
|
2249
|
-
minFilter: this._samples > 0 ?
|
|
2247
|
+
format: l,
|
|
2248
|
+
magFilter: this._samples > 0 ? c : V,
|
|
2249
|
+
minFilter: this._samples > 0 ? c : V
|
|
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 h && (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
|
}
|
|
@@ -2328,7 +2328,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2328
2328
|
return this.parameters.enableGroundBoundary = e, t;
|
|
2329
2329
|
}
|
|
2330
2330
|
setSize(e, t) {
|
|
2331
|
-
this._viewportSize = new
|
|
2331
|
+
this._viewportSize = new S(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 C({
|
|
2396
2396
|
color: 16777215,
|
|
2397
2397
|
side: 2
|
|
2398
|
-
}) : t === Lt.SHADOW ? new
|
|
2398
|
+
}) : t === Lt.SHADOW ? new g({ side: 2 }) : e.useModifiedMaterial ? this._createCustomerShadowMaterial() : new ie({
|
|
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 r || t instanceof C ? this.addToCache(e, { material: this._unlitMaterial }) : t instanceof O ? 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 S(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;
|
|
@@ -2517,7 +2517,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2517
2517
|
this._updateShadowPositionAndTarget(this.getPosition(), new B(0, 0, 0));
|
|
2518
2518
|
}
|
|
2519
2519
|
updateBounds(e) {
|
|
2520
|
-
if (this._shadowLightSource instanceof
|
|
2520
|
+
if (this._shadowLightSource instanceof ce) {
|
|
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 ce) {
|
|
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));
|
|
@@ -2554,10 +2554,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2554
2554
|
switch (t?.shadowLightSourceType) {
|
|
2555
2555
|
default:
|
|
2556
2556
|
case Pt.DIRECTION_LIGHT_SHADOW:
|
|
2557
|
-
n = new
|
|
2557
|
+
n = new y(16777215, 1);
|
|
2558
2558
|
break;
|
|
2559
2559
|
case Pt.SPOT_LIGHT_SHADOW:
|
|
2560
|
-
n = new
|
|
2560
|
+
n = new ce(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));
|
|
@@ -2583,7 +2583,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2583
2583
|
}
|
|
2584
2584
|
}, Ht = class extends Bt {
|
|
2585
2585
|
constructor(e, t, n) {
|
|
2586
|
-
let r = new
|
|
2586
|
+
let r = new y(16777215, t);
|
|
2587
2587
|
r.position.copy(e), r.lookAt(0, 0, 0), r.updateMatrix(), r.castShadow = !0, super(r, n), this._position = e.clone(), this._intensity = t;
|
|
2588
2588
|
}
|
|
2589
2589
|
getPosition() {
|
|
@@ -2601,7 +2601,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2601
2601
|
}
|
|
2602
2602
|
}, Ut = class extends Bt {
|
|
2603
2603
|
constructor(e, t) {
|
|
2604
|
-
let n = new
|
|
2604
|
+
let n = new y(16777215, 1);
|
|
2605
2605
|
n.position.copy(e), n.lookAt(0, 0, 0), n.updateMatrix(), n.castShadow = !0, super(n, t), this._position = e.clone();
|
|
2606
2606
|
}
|
|
2607
2607
|
getPosition() {
|
|
@@ -2629,26 +2629,26 @@ 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 S(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
2636
|
}, Kt = class e extends J {
|
|
2637
2637
|
static {
|
|
2638
|
-
this.BlurDirectionX = new
|
|
2638
|
+
this.BlurDirectionX = new S(1, 0);
|
|
2639
2639
|
}
|
|
2640
2640
|
static {
|
|
2641
|
-
this.BlurDirectionY = new
|
|
2641
|
+
this.BlurDirectionY = new S(0, 1);
|
|
2642
2642
|
}
|
|
2643
2643
|
static {
|
|
2644
2644
|
this.highlightLines = !0;
|
|
2645
2645
|
}
|
|
2646
|
-
constructor(e, t, n,
|
|
2647
|
-
super(e), this.patternTexture = null, this.clearBackground = !1, this.renderScene = n, this.renderCamera =
|
|
2646
|
+
constructor(e, t, n, r, a, s) {
|
|
2647
|
+
super(e), this.patternTexture = null, this.clearBackground = !1, this.renderScene = n, this.renderCamera = r, this.selectedObjects = a === void 0 ? [] : a, this.visibleEdgeColor = new i(1, 1, 1), this.hiddenEdgeColor = new i(.1, .04, .02), this.edgeGlow = 0, this.usePatternTexture = !1, this.edgeThickness = 1, this.edgeStrength = 3, this.downSampleRatio = s?.downSampleRatio || 2, this.pulsePeriod = 0, this.edgeDetectionFxaa = s?.edgeDetectionFxaa || !1, this._visibilityCache = /* @__PURE__ */ new Map(), this.resolution = t === void 0 ? new S(256, 256) : new S(t.x, t.y);
|
|
2648
2648
|
let c = Math.round(this.resolution.x / this.downSampleRatio), l = Math.round(this.resolution.y / this.downSampleRatio);
|
|
2649
|
-
this.renderTargetMaskBuffer = new
|
|
2649
|
+
this.renderTargetMaskBuffer = new m(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 = d(this.prepareMaskMaterial.fragmentShader, this.renderCamera), this.edgeDetectionFxaa && (this.fxaaRenderMaterial = new o(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 m(this.resolution.x, this.resolution.y), this.renderTargetFxaaBuffer.texture.name = "OutlinePass.fxaa", this.renderTargetFxaaBuffer.texture.generateMipmaps = !1), this.renderTargetMaskDownSampleBuffer = new m(c, l), this.renderTargetMaskDownSampleBuffer.texture.name = "OutlinePass.depthDownSample", this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = !1, this.renderTargetBlurBuffer1 = new m(c, l), this.renderTargetBlurBuffer1.texture.name = "OutlinePass.blur1", this.renderTargetBlurBuffer1.texture.generateMipmaps = !1, this.renderTargetBlurBuffer2 = new m(Math.round(c / 2), Math.round(l / 2)), this.renderTargetBlurBuffer2.texture.name = "OutlinePass.blur2", this.renderTargetBlurBuffer2.texture.generateMipmaps = !1, this.edgeDetectionMaterial = this._getEdgeDetectionMaterial(), this.renderTargetEdgeBuffer1 = new m(c, l), this.renderTargetEdgeBuffer1.texture.name = "OutlinePass.edge1", this.renderTargetEdgeBuffer1.texture.generateMipmaps = !1, this.renderTargetEdgeBuffer2 = new m(Math.round(c / 2), Math.round(l / 2)), this.renderTargetEdgeBuffer2.texture.name = "OutlinePass.edge2", this.renderTargetEdgeBuffer2.texture.generateMipmaps = !1, this.separableBlurMaterial1 = this._getSeperableBlurMaterial(4), this.separableBlurMaterial1.uniforms.texSize.value.set(c, l), this.separableBlurMaterial1.uniforms.kernelRadius.value = 1, this.separableBlurMaterial2 = this._getSeperableBlurMaterial(4), this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(c / 2), Math.round(l / 2)), this.separableBlurMaterial2.uniforms.kernelRadius.value = 4, this.overlayMaterial = this._getOverlayMaterial();
|
|
2650
2650
|
let u = Wt;
|
|
2651
|
-
this.copyUniforms =
|
|
2651
|
+
this.copyUniforms = T.clone(u.uniforms), this.copyUniforms.opacity.value = 1, this.materialCopy = new o({
|
|
2652
2652
|
uniforms: this.copyUniforms,
|
|
2653
2653
|
vertexShader: u.vertexShader,
|
|
2654
2654
|
fragmentShader: u.fragmentShader,
|
|
@@ -2656,7 +2656,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2656
2656
|
depthTest: !1,
|
|
2657
2657
|
depthWrite: !1,
|
|
2658
2658
|
transparent: !0
|
|
2659
|
-
}), this.enabled = !0, this.needsSwap = !1, this.oldClearColor = new
|
|
2659
|
+
}), this.enabled = !0, this.needsSwap = !1, this.oldClearColor = new i(), this.oldClearAlpha = 1, this.fsQuad = new ke(void 0), this.tempPulseColor1 = new i(), this.tempPulseColor2 = new i(), this.textureMatrix = new M();
|
|
2660
2660
|
function d(e, t) {
|
|
2661
2661
|
let n = t.isPerspectiveCamera ? "perspective" : "orthographic";
|
|
2662
2662
|
return e.replace(/DEPTH_TO_VIEW_Z/g, n + "DepthToViewZ");
|
|
@@ -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 o({
|
|
2719
2719
|
uniforms: {
|
|
2720
2720
|
depthTexture: { value: null },
|
|
2721
|
-
cameraNearFar: { value: new
|
|
2721
|
+
cameraNearFar: { value: new S(.5, .5) },
|
|
2722
2722
|
textureMatrix: { value: null }
|
|
2723
2723
|
},
|
|
2724
2724
|
defines: { FLOAT_ALPHA_DEPTH: e ? 1 : 0 },
|
|
@@ -2727,10 +2727,10 @@ 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 o({
|
|
2731
2731
|
uniforms: {
|
|
2732
2732
|
maskTexture: { value: null },
|
|
2733
|
-
texSize: { value: new
|
|
2733
|
+
texSize: { value: new S(.5, .5) },
|
|
2734
2734
|
visibleEdgeColor: { value: new B(1, 1, 1) },
|
|
2735
2735
|
hiddenEdgeColor: { value: new B(1, 1, 1) }
|
|
2736
2736
|
},
|
|
@@ -2739,12 +2739,12 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2739
2739
|
});
|
|
2740
2740
|
}
|
|
2741
2741
|
_getSeperableBlurMaterial(e) {
|
|
2742
|
-
return new
|
|
2742
|
+
return new o({
|
|
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 S(.5, .5) },
|
|
2747
|
+
direction: { value: new S(.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 o({
|
|
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 o {
|
|
2778
2778
|
constructor(e) {
|
|
2779
2779
|
super({
|
|
2780
|
-
uniforms:
|
|
2780
|
+
uniforms: T.clone(qt.uniforms),
|
|
2781
2781
|
vertexShader: qt.vertexShader,
|
|
2782
2782
|
fragmentShader: qt.fragmentShader,
|
|
2783
2783
|
transparent: !0,
|
|
@@ -2789,27 +2789,27 @@ 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 S(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 S(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 m(), 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 de && e.capabilities.isWebGL2 ? se : D;
|
|
2803
|
+
return this._environmentMapDecodeTarget = this._environmentMapDecodeTarget ?? new m(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
|
|
2809
|
+
return this._camera = this._camera ?? new h(-1, 1, 1, -1, -1, 1), this._camera;
|
|
2810
2810
|
}
|
|
2811
2811
|
scaleTexture(e, t, n, r) {
|
|
2812
|
-
this.colorRenderTarget.setSize(n, r), this._planeMesh = this._planeMesh ?? new R(new
|
|
2812
|
+
this.colorRenderTarget.setSize(n, r), this._planeMesh = this._planeMesh ?? new R(new ne(2, 2), new C({ map: t }));
|
|
2813
2813
|
let i = e.getRenderTarget();
|
|
2814
2814
|
e.setRenderTarget(this.colorRenderTarget), e.render(this._planeMesh, this.camera), e.setRenderTarget(i);
|
|
2815
2815
|
let a = this.environmentMapDecodeTarget(e).texture, o = new Uint8Array(n * r * 4);
|
|
@@ -2821,10 +2821,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2821
2821
|
}
|
|
2822
2822
|
newGrayscaleTexture(e, t, n, r) {
|
|
2823
2823
|
let i = this.environmentMapDecodeMaterial(t.name === "PMREM.cubeUv"), a = this.environmentMapDecodeTarget(e);
|
|
2824
|
-
a.setSize(n, r), i.setSourceTexture(t), this._planeMesh = this._planeMesh ?? new R(new
|
|
2824
|
+
a.setSize(n, r), i.setSourceTexture(t), this._planeMesh = this._planeMesh ?? new R(new ne(2, 2), i);
|
|
2825
2825
|
let o = e.getRenderTarget();
|
|
2826
2826
|
e.setRenderTarget(a), e.render(this._planeMesh, this.camera), e.setRenderTarget(o);
|
|
2827
|
-
let s = a.texture, c = a.texture.type ===
|
|
2827
|
+
let s = a.texture, c = a.texture.type === se, l = c ? new Float32Array(n * r * 4) : new Uint8Array(n * r * 4);
|
|
2828
2828
|
return e.readRenderTargetPixels(a, 0, 0, n, r, l), {
|
|
2829
2829
|
texture: s,
|
|
2830
2830
|
pixels: l,
|
|
@@ -2835,10 +2835,10 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
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 o {
|
|
2839
2839
|
constructor(e, t) {
|
|
2840
2840
|
super({
|
|
2841
|
-
uniforms:
|
|
2841
|
+
uniforms: T.clone(Zt.uniforms),
|
|
2842
2842
|
vertexShader: Zt.vertexShader,
|
|
2843
2843
|
fragmentShader: Zt.fragmentShader,
|
|
2844
2844
|
defines: {
|
|
@@ -2853,10 +2853,10 @@ 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 b(),
|
|
2857
2857
|
pixels: new Uint8Array(),
|
|
2858
2858
|
sRgbaPixels: !1
|
|
2859
|
-
}, this.detectorTexture = new
|
|
2859
|
+
}, this.detectorTexture = new b(), this.detectorArray = new Float32Array(), this.lightSamples = [], this.lightGraph = new tn(0), this.lightSources = [], this._grayScale = new B(.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;
|
|
@@ -2869,24 +2869,24 @@ 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
|
|
2872
|
+
let r = new Float32Array(e.length / 4), a = 1, o = 0;
|
|
2873
2873
|
for (let t = 0; t < e.length / 4; ++t) {
|
|
2874
|
-
let n = new
|
|
2874
|
+
let n = new i(...e.slice(t * 4, t * 4 + 3));
|
|
2875
2875
|
e instanceof Float32Array && n.convertSRGBToLinear();
|
|
2876
2876
|
let s = new B(n.r, n.g, n.b).dot(this._grayScale);
|
|
2877
|
-
a = Math.min(a, s), o = Math.max(o, s),
|
|
2877
|
+
a = Math.min(a, s), o = Math.max(o, s), r[t] = s;
|
|
2878
2878
|
}
|
|
2879
|
-
if (n) for (let e = 0; e <
|
|
2880
|
-
else if (!t) for (let e = 0; e <
|
|
2881
|
-
return
|
|
2879
|
+
if (n) for (let e = 0; e < r.length; ++e) r[e] = (t ? r[e] : (r[e] - a) / (o - a)) ** +n;
|
|
2880
|
+
else if (!t) for (let e = 0; e < r.length; ++e) r[e] = (r[e] - a) / (o - a);
|
|
2881
|
+
return r;
|
|
2882
2882
|
}
|
|
2883
|
-
_grayscaleTextureFromFloatArray(e,
|
|
2884
|
-
let i =
|
|
2883
|
+
_grayscaleTextureFromFloatArray(e, t, r) {
|
|
2884
|
+
let i = t * r, a = new Uint8Array(4 * i);
|
|
2885
2885
|
for (let t = 0; t < i; t++) {
|
|
2886
2886
|
let n = e[t] * 255;
|
|
2887
2887
|
a[t * 4 + 0] = n, a[t * 4 + 1] = n, a[t * 4 + 2] = n, a[t * 4 + 3] = 255;
|
|
2888
2888
|
}
|
|
2889
|
-
let o = new
|
|
2889
|
+
let o = new n(a, t, r);
|
|
2890
2890
|
return o.needsUpdate = !0, o;
|
|
2891
2891
|
}
|
|
2892
2892
|
_filterLightSamples(e) {
|
|
@@ -2949,7 +2949,7 @@ 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 B(), this.uv = new
|
|
2952
|
+
this.position = new B(), this.uv = new S(), this.averageIntensity = 0, this.maxIntensity = 0, this.size = 0, this.lightSamples = e;
|
|
2953
2953
|
}
|
|
2954
2954
|
calculateLightSourceProperties(e) {
|
|
2955
2955
|
this.position = new B(), this.averageIntensity = 0, this.maxIntensity = 0;
|
|
@@ -2985,7 +2985,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
2985
2985
|
_getDepthRenderMaterial(e) {
|
|
2986
2986
|
return this._depthRenderMaterial = this._depthRenderMaterial ?? new Ee({
|
|
2987
2987
|
depthTexture: this.gBufferTextures.textureWithDepthValue,
|
|
2988
|
-
depthFilter: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? new
|
|
2988
|
+
depthFilter: this.gBufferTextures.isFloatGBufferWithRgbNormalAlphaDepth ? new f(0, 0, 0, 1) : new f(1, 0, 0, 0)
|
|
2989
2989
|
}), this._depthRenderMaterial.update({ camera: e });
|
|
2990
2990
|
}
|
|
2991
2991
|
renderPass(e) {
|
|
@@ -2998,8 +2998,8 @@ 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 M().set(.5, 0, 0, 0, 0, .5, 0, 0, 0, 0, .5, 0, 0, 0, 0, 0),
|
|
3002
|
+
colorBase: new f(.5, .5, .5, 1),
|
|
3003
3003
|
multiplyChannels: 0,
|
|
3004
3004
|
uvTransform: K
|
|
3005
3005
|
}), null) : this.passRenderer.renderScreenSpace(e, this.getCopyMaterial({
|
|
@@ -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
|
-
|
|
3150
|
+
let t = this.renderPassManager.aspect, n = new h(-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 i(16777215), e.render(r, n);
|
|
3152
3152
|
}
|
|
3153
3153
|
break;
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
3156
3156
|
}, an = class extends J {
|
|
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 O({
|
|
3159
3159
|
color: 12632256,
|
|
3160
3160
|
side: 2,
|
|
3161
3161
|
envMapIntensity: .4
|
|
@@ -3218,7 +3218,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3218
3218
|
}
|
|
3219
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 q {
|
|
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 o ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = T.clone(e.uniforms), this.material = new o({
|
|
3222
3222
|
name: e.name === void 0 ? "unspecified" : e.name,
|
|
3223
3223
|
defines: Object.assign({}, e.defines),
|
|
3224
3224
|
uniforms: this.uniforms,
|
|
@@ -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 = D;
|
|
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 te(this.manager);
|
|
3271
3271
|
i.setPath(this.path), i.setResponseType("text"), i.load(e, (n) => {
|
|
3272
3272
|
try {
|
|
3273
3273
|
t(this.parse(n));
|
|
@@ -3277,27 +3277,27 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3277
3277
|
}, n, r);
|
|
3278
3278
|
}
|
|
3279
3279
|
parse(e) {
|
|
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),
|
|
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 l = Number(o[1]), d = l ** 3 * 4, f = this.type === 1009 ? new Uint8Array(d) : new Float32Array(d), p = new B(0, 0, 0), m = new B(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
3285
|
for (; (o = a.exec(e)) !== null;) f[g++] = Number(o[1]) * h, f[g++] = Number(o[2]) * h, f[g++] = Number(o[3]) * h, f[g++] = h;
|
|
3286
|
-
let _ = new
|
|
3287
|
-
return _.image.data = f, _.image.width =
|
|
3288
|
-
title:
|
|
3289
|
-
size:
|
|
3286
|
+
let _ = new u();
|
|
3287
|
+
return _.image.data = f, _.image.width = l, _.image.height = l, _.image.depth = l, _.type = this.type, _.magFilter = c, _.minFilter = c, _.wrapS = z, _.wrapT = z, _.wrapR = z, _.generateMipmaps = !1, _.needsUpdate = !0, {
|
|
3288
|
+
title: s,
|
|
3289
|
+
size: l,
|
|
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 oe(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 u();
|
|
3312
|
+
return r.image.data = n, r.image.width = t, r.image.height = t, r.image.depth = t, r.format = v, r.type = D, r.magFilter = c, r.minFilter = c, r.wrapS = z, r.wrapT = z, r.wrapR = z, 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 = D;
|
|
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 te(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,22 +3351,22 @@ 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], o = i.length,
|
|
3354
|
+
let i = r[0].trim().split(/\s+/g).map(Number), a = i[1] - i[0], o = i.length, s = o ** 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
|
|
3356
|
+
let l = new Float32Array(o ** 3 * 4), d = 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
3359
|
d = Math.max(d, e, t, n);
|
|
3360
|
-
let i = f % o, a = Math.floor(f / o) % o,
|
|
3361
|
-
u
|
|
3360
|
+
let i = f % o, a = Math.floor(f / o) % o, c = Math.floor(f / s) % o, u = (i * s + a * o + c) * 4;
|
|
3361
|
+
l[u + 0] = e, l[u + 1] = t, l[u + 2] = n, ++f;
|
|
3362
3362
|
}
|
|
3363
|
-
let p = 2 ** Math.ceil(Math.log2(d)), m = this.type === 1009 ? new Uint8Array(
|
|
3363
|
+
let p = 2 ** Math.ceil(Math.log2(d)), 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
|
-
m[e] =
|
|
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 = o, g.image.height = o, g.image.depth = o, g.format =
|
|
3368
|
+
let g = new u();
|
|
3369
|
+
return g.image.data = m, g.image.width = o, g.image.height = o, g.image.depth = o, g.format = v, g.type = this.type, g.magFilter = c, g.minFilter = c, g.wrapS = z, g.wrapT = z, g.wrapR = z, g.generateMipmaps = !1, g.needsUpdate = !0, {
|
|
3370
3370
|
size: o,
|
|
3371
3371
|
texture3D: g
|
|
3372
3372
|
};
|
|
@@ -3381,7 +3381,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
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
3382
|
}, gn = class extends q {
|
|
3383
3383
|
constructor() {
|
|
3384
|
-
super(), this.isOutputPass = !0, this.uniforms =
|
|
3384
|
+
super(), this.isOutputPass = !0, this.uniforms = T.clone(hn.uniforms), this.material = new ue({
|
|
3385
3385
|
name: hn.name,
|
|
3386
3386
|
uniforms: this.uniforms,
|
|
3387
3387
|
vertexShader: hn.vertexShader,
|
|
@@ -3389,7 +3389,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3389
3389
|
}), this._fsQuad = new ke(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 = {}, p.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();
|
|
@@ -3459,7 +3459,7 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3459
3459
|
get debugOutput() {
|
|
3460
3460
|
return this._sceneRenderer.debugOutput;
|
|
3461
3461
|
}
|
|
3462
|
-
constructor(
|
|
3462
|
+
constructor(t, n) {
|
|
3463
3463
|
this.materialsNeedUpdate = !0, this._passRenderer = new Le(), this._outlinePass = null, this._debugPass = null, this._cameraUpdate = new Pe(), this._cameraChanged = !0, this._noUpdateNeededCount = 0, this._noOStaticFrames = 0, this._maxSamples = 1, this._passUpdateStates = {
|
|
3464
3464
|
updateGroundReflection: !1,
|
|
3465
3465
|
updateGBuffer: !1,
|
|
@@ -3467,20 +3467,20 @@ var we = "varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position
|
|
|
3467
3467
|
updateShadowAndAoPass: !1,
|
|
3468
3468
|
updateOutlinePass: !1,
|
|
3469
3469
|
updateDebugPass: !1
|
|
3470
|
-
}, this.aoPassMapTexture = null, this._lutMap = /* @__PURE__ */ new Map(), this._lutPassParameters = _n, this.lutPassNeedsUpdate = !1, this._renderToRenderTarget = !1, this._creator_ =
|
|
3471
|
-
let
|
|
3470
|
+
}, this.aoPassMapTexture = null, this._lutMap = /* @__PURE__ */ new Map(), this._lutPassParameters = _n, this.lutPassNeedsUpdate = !1, this._renderToRenderTarget = !1, this._creator_ = t, this._sceneRenderer = n, this._maxSamples = e(this._sceneRenderer.renderer);
|
|
3471
|
+
let r = this._sceneRenderer.linearAoFilter, i = r ? this._maxSamples : 0, a = r ? this._maxSamples : 0;
|
|
3472
3472
|
this._sceneRenderPass = new an(this), this._bakedGroundContactShadowPass = new yt(this, this._sceneRenderer.renderer, this._sceneRenderer.groundGroup, { sharedShadowGroundPlane: this._sceneRenderer.shadowAndAoGroundPlane }), this._gBufferRenderPass = new wt(this, {
|
|
3473
3473
|
shared: !0,
|
|
3474
3474
|
capabilities: this._sceneRenderer.renderer.capabilities,
|
|
3475
3475
|
width: this._sceneRenderer.width,
|
|
3476
3476
|
height: this._sceneRenderer.height,
|
|
3477
|
-
samples: r,
|
|
3478
|
-
textureMinificationFilter: n ? s : V,
|
|
3479
|
-
textureMagnificationFilter: n ? s : V
|
|
3480
|
-
}), this._groundReflectionPass = new Et(this, this._sceneRenderer.width, this._sceneRenderer.height, this._maxSamples, {}), this._screenSpaceShadowMapPass = new It(this, new x(this._sceneRenderer.width, this._sceneRenderer.height), {
|
|
3481
3477
|
samples: i,
|
|
3478
|
+
textureMinificationFilter: r ? c : V,
|
|
3479
|
+
textureMagnificationFilter: r ? c : V
|
|
3480
|
+
}), this._groundReflectionPass = new Et(this, this._sceneRenderer.width, this._sceneRenderer.height, this._maxSamples, {}), this._screenSpaceShadowMapPass = new It(this, new S(this._sceneRenderer.width, this._sceneRenderer.height), {
|
|
3481
|
+
samples: a,
|
|
3482
3482
|
alwaysUpdate: !1
|
|
3483
|
-
}), this._shadowAndAoPass = new et(this, this._sceneRenderer.width, this._sceneRenderer.height,
|
|
3483
|
+
}), this._shadowAndAoPass = new et(this, this._sceneRenderer.width, this._sceneRenderer.height, i), this._lutPass = new dn({
|
|
3484
3484
|
lut: void 0,
|
|
3485
3485
|
intensity: 1
|
|
3486
3486
|
}), this._outputPass = new gn();
|
|
@@ -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 S(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 m(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 m(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 O && 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
|
+
me([pe, fe("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 = {
|
|
@@ -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
|
+
me([pe, fe("design:type", Object)], bn.prototype, "_initData", void 0);
|
|
3806
3806
|
//#endregion
|
|
3807
3807
|
export { At as a, Be 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-4zk6BXsR.mjs.map
|