@roomle/web-sdk 3.9.0-alpha.5 → 3.9.0

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