@roomle/web-sdk 4.0.0 → 4.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/lib/{BufferGeometry-CnbfgBmz.mjs → BufferGeometry-DcRNeLZD.mjs} +2 -2
  2. package/lib/{BufferGeometry-CnbfgBmz.mjs.map → BufferGeometry-DcRNeLZD.mjs.map} +1 -1
  3. package/lib/{GLTFExporter-BxcjPMva.mjs → GLTFExporter-DdzTpCjW.mjs} +46 -46
  4. package/lib/{GLTFExporter-BxcjPMva.mjs.map → GLTFExporter-DdzTpCjW.mjs.map} +1 -1
  5. package/lib/{GaussianBlurNode-8gO-I1qG.mjs → GaussianBlurNode-CLuzhfDu.mjs} +19 -19
  6. package/lib/{GaussianBlurNode-8gO-I1qG.mjs.map → GaussianBlurNode-CLuzhfDu.mjs.map} +1 -1
  7. package/lib/{Object3D-DMaDdv-D.mjs → Object3D-CEXK2mMb.mjs} +1 -1
  8. package/lib/{Object3D-DMaDdv-D.mjs.map → Object3D-CEXK2mMb.mjs.map} +1 -1
  9. package/lib/Pass-C7MZilDW.mjs +53 -0
  10. package/lib/Pass-C7MZilDW.mjs.map +1 -0
  11. package/lib/{PointLightHelper-CahXSxiA.mjs → PointLightHelper-dDeo1kUI.mjs} +4 -4
  12. package/lib/{PointLightHelper-CahXSxiA.mjs.map → PointLightHelper-dDeo1kUI.mjs.map} +1 -1
  13. package/lib/{SpotLightHelper-BEqeYq1p.mjs → SpotLightHelper-BsMEPgVo.mjs} +3 -3
  14. package/lib/{SpotLightHelper-BEqeYq1p.mjs.map → SpotLightHelper-BsMEPgVo.mjs.map} +1 -1
  15. package/lib/{USDZExporter-ZZoG1mne.mjs → USDZExporter-BIDQSKG4.mjs} +3 -3
  16. package/lib/{USDZExporter-ZZoG1mne.mjs.map → USDZExporter-BIDQSKG4.mjs.map} +1 -1
  17. package/lib/{Vector4-BkA_VGid.mjs → Vector4-D-4p8rfn.mjs} +2 -2
  18. package/lib/{Vector4-BkA_VGid.mjs.map → Vector4-D-4p8rfn.mjs.map} +1 -1
  19. package/lib/{api-CUyBdNba.mjs → api-BEszDVqh.mjs} +10 -10
  20. package/lib/{api-CUyBdNba.mjs.map → api-BEszDVqh.mjs.map} +1 -1
  21. package/lib/{asset-loader.worker-C_5RQYHp.mjs → asset-loader.worker-eqHzNAwa.mjs} +1 -1
  22. package/lib/asset-loader.worker-eqHzNAwa.mjs.map +1 -0
  23. package/lib/{banana-for-scale-B77S3z9R.mjs → banana-for-scale-CiCouumi.mjs} +4 -4
  24. package/lib/{banana-for-scale-B77S3z9R.mjs.map → banana-for-scale-CiCouumi.mjs.map} +1 -1
  25. package/lib/{budgeteer.sw-DxeAvd0v.mjs → budgeteer.sw-BUMElkO1.mjs} +1 -1
  26. package/lib/budgeteer.sw-BUMElkO1.mjs.map +1 -0
  27. package/lib/{common-utils-BiOW17Ao.mjs → common-utils-CCzT4Gnn.mjs} +2 -2
  28. package/lib/{common-utils-BiOW17Ao.mjs.map → common-utils-CCzT4Gnn.mjs.map} +1 -1
  29. package/lib/{component-dimensioning-DPyPzSsa.mjs → component-dimensioning-DWEZ4jZg.mjs} +7 -7
  30. package/lib/{component-dimensioning-DPyPzSsa.mjs.map → component-dimensioning-DWEZ4jZg.mjs.map} +1 -1
  31. package/lib/{component-raycast-helper-RiQIybsX.mjs → component-raycast-helper-D2hyLpdX.mjs} +17 -17
  32. package/lib/{component-raycast-helper-RiQIybsX.mjs.map → component-raycast-helper-D2hyLpdX.mjs.map} +1 -1
  33. package/lib/configurator-BENT3shs.mjs +2 -0
  34. package/lib/{configurator-C_rsqn9l.mjs → configurator-BjLLdSf8.mjs} +16 -16
  35. package/lib/{configurator-C_rsqn9l.mjs.map → configurator-BjLLdSf8.mjs.map} +1 -1
  36. package/lib/{continuous-drawing-helper-C_Yc0uuv.mjs → continuous-drawing-helper-CCuU99Vh.mjs} +3 -3
  37. package/lib/{continuous-drawing-helper-C_Yc0uuv.mjs.map → continuous-drawing-helper-CCuU99Vh.mjs.map} +1 -1
  38. package/lib/{dat.gui.module-BLjoST8r.mjs → dat.gui.module-B2PXSbre.mjs} +1 -1
  39. package/lib/{dat.gui.module-BLjoST8r.mjs.map → dat.gui.module-B2PXSbre.mjs.map} +1 -1
  40. package/lib/{decorate-BAtqSPNS.mjs → decorate-CX1ZGuFY.mjs} +1 -1
  41. package/lib/{decorate-BAtqSPNS.mjs.map → decorate-CX1ZGuFY.mjs.map} +1 -1
  42. package/lib/{dimensioning-helper-D9oxGkry.mjs → dimensioning-helper-CjuQqjBn.mjs} +14 -14
  43. package/lib/{dimensioning-helper-D9oxGkry.mjs.map → dimensioning-helper-CjuQqjBn.mjs.map} +1 -1
  44. package/lib/dimensioning-helper-ImsWfczi.mjs +2 -0
  45. package/lib/{dist-DGov-RNo.mjs → dist-Blgk0vU0.mjs} +1 -1
  46. package/lib/{dist-DGov-RNo.mjs.map → dist-Blgk0vU0.mjs.map} +1 -1
  47. package/lib/{fflate.module-CTnSdWOb.mjs → fflate.module-DTkA0kF8.mjs} +1 -1
  48. package/lib/{fflate.module-CTnSdWOb.mjs.map → fflate.module-DTkA0kF8.mjs.map} +1 -1
  49. package/lib/{glb-viewer-A5vSLFZ5.mjs → glb-viewer-9Ata6ZNJ.mjs} +59 -45
  50. package/lib/glb-viewer-9Ata6ZNJ.mjs.map +1 -0
  51. package/lib/glb-viewer-CGqSGT38.mjs +2 -0
  52. package/lib/{highlight-coordinator-CZEJGeXA.mjs → highlight-coordinator-PyWNABN9.mjs} +3 -3
  53. package/lib/{highlight-coordinator-CZEJGeXA.mjs.map → highlight-coordinator-PyWNABN9.mjs.map} +1 -1
  54. package/lib/{homag-intelligence-BdCDX7LF.mjs → homag-intelligence-BNqPqVgE.mjs} +3 -3
  55. package/lib/{homag-intelligence-BdCDX7LF.mjs.map → homag-intelligence-BNqPqVgE.mjs.map} +1 -1
  56. package/lib/{imos-ix-poc-export-helper-CaXXDNvP.mjs → imos-ix-poc-export-helper-C1LfrtjM.mjs} +3 -3
  57. package/lib/{imos-ix-poc-export-helper-CaXXDNvP.mjs.map → imos-ix-poc-export-helper-C1LfrtjM.mjs.map} +1 -1
  58. package/lib/{kernel-utils-BYEsHVYJ.mjs → kernel-utils-Cn4evFqF.mjs} +2 -2
  59. package/lib/{kernel-utils-BYEsHVYJ.mjs.map → kernel-utils-Cn4evFqF.mjs.map} +1 -1
  60. package/lib/{layer-CIWL5ZW3.mjs → layer-DvZF9ur3.mjs} +1 -1
  61. package/lib/{layer-CIWL5ZW3.mjs.map → layer-DvZF9ur3.mjs.map} +1 -1
  62. package/lib/{main-BUl8iCi1.mjs → main-n3n3jdja.mjs} +1097 -1017
  63. package/lib/{main-BUl8iCi1.mjs.map → main-n3n3jdja.mjs.map} +1 -1
  64. package/lib/{material-viewer-C4SqVaGG.mjs → material-viewer-Cv5Awgwm.mjs} +24 -24
  65. package/lib/{material-viewer-C4SqVaGG.mjs.map → material-viewer-Cv5Awgwm.mjs.map} +1 -1
  66. package/lib/{packages-C9gO5mKk.mjs → packages-B3bi3adH.mjs} +5 -5
  67. package/lib/{packages-C9gO5mKk.mjs.map → packages-B3bi3adH.mjs.map} +1 -1
  68. package/lib/planner-DIT2VvMG.mjs +44 -0
  69. package/lib/{planner-t4QH26WW.mjs.map → planner-DIT2VvMG.mjs.map} +1 -1
  70. package/lib/planner-DaI8ZwEe.mjs +2 -0
  71. package/lib/{plugin-system-COZJdJH_.mjs → plugin-system-FuZpDWqv.mjs} +3 -3
  72. package/lib/{plugin-system-COZJdJH_.mjs.map → plugin-system-FuZpDWqv.mjs.map} +1 -1
  73. package/lib/roomle-headless-setup-CMHahWyC.mjs +612 -0
  74. package/lib/roomle-headless-setup-CMHahWyC.mjs.map +1 -0
  75. package/lib/roomle-headless.d.ts +113 -34
  76. package/lib/roomle-headless.js +433 -84
  77. package/lib/roomle-headless.js.map +1 -1
  78. package/lib/{roomle-renderer-DhLUaHJZ.mjs → roomle-renderer-BR0UKz2y.mjs} +2 -2
  79. package/lib/{roomle-renderer-DhLUaHJZ.mjs.map → roomle-renderer-BR0UKz2y.mjs.map} +1 -1
  80. package/lib/roomle-sdk.d.ts +37 -9
  81. package/lib/roomle-sdk.js +8 -8
  82. package/lib/{roomle-webgpu-renderer-CRGcdahn.mjs → roomle-webgpu-renderer-fOYJoKJU.mjs} +175 -173
  83. package/lib/roomle-webgpu-renderer-fOYJoKJU.mjs.map +1 -0
  84. package/lib/{scene-renderer-D5CfxCag.mjs → scene-renderer-CAzAJ4pS.mjs} +212 -211
  85. package/lib/{scene-renderer-D5CfxCag.mjs.map → scene-renderer-CAzAJ4pS.mjs.map} +1 -1
  86. package/lib/{script-loader-D6IuUFjw.mjs → script-loader-BAWHLt9q.mjs} +3 -3
  87. package/lib/{script-loader-D6IuUFjw.mjs.map → script-loader-BAWHLt9q.mjs.map} +1 -1
  88. package/lib/{shading-settings-BEMqEGzB.mjs → shading-settings-BPpgt0Fq.mjs} +101 -146
  89. package/lib/shading-settings-BPpgt0Fq.mjs.map +1 -0
  90. package/lib/{stats-helper-DAfbSToL.mjs → stats-helper-CqiTcJuc.mjs} +3 -3
  91. package/lib/{stats-helper-DAfbSToL.mjs.map → stats-helper-CqiTcJuc.mjs.map} +1 -1
  92. package/lib/{svgo.browser-DYieWzyw.mjs → svgo.browser-EB1zkPfG.mjs} +1 -1
  93. package/lib/{svgo.browser-DYieWzyw.mjs.map → svgo.browser-EB1zkPfG.mjs.map} +1 -1
  94. package/lib/{three.core-DjCexDCp.mjs → three.core-CmmDf_BZ.mjs} +73 -38
  95. package/lib/{three.core-DjCexDCp.mjs.map → three.core-CmmDf_BZ.mjs.map} +1 -1
  96. package/lib/{three.module-CuRNgijg.mjs → three.module-BkkLbA6n.mjs} +857 -857
  97. package/lib/{three.module-CuRNgijg.mjs.map → three.module-BkkLbA6n.mjs.map} +1 -1
  98. package/lib/three.tsl-8HwZJGJ8.mjs +2 -0
  99. package/lib/{three.tsl-BIBER8nk.mjs → three.tsl-Cw9IeeKW.mjs} +64 -52
  100. package/lib/{three.tsl-BIBER8nk.mjs.map → three.tsl-Cw9IeeKW.mjs.map} +1 -1
  101. package/lib/three.webgpu-Bw4_U6Q1.mjs +3 -0
  102. package/lib/{three.webgpu-Bz4Xtk0X.mjs → three.webgpu-DL5l_0xI.mjs} +1742 -1728
  103. package/lib/{three.webgpu-Bz4Xtk0X.mjs.map → three.webgpu-DL5l_0xI.mjs.map} +1 -1
  104. package/lib/{threejs-utils-Dpvg3Czz.mjs → threejs-utils-PRhv_eX3.mjs} +63 -63
  105. package/lib/{threejs-utils-Dpvg3Czz.mjs.map → threejs-utils-PRhv_eX3.mjs.map} +1 -1
  106. package/lib/{tools-core-BDOFf9le.mjs → tools-core-CmrXkw3J.mjs} +3 -3
  107. package/lib/{tools-core-BDOFf9le.mjs.map → tools-core-CmrXkw3J.mjs.map} +1 -1
  108. package/lib/webgpu-wkXAkJ6p.mjs +5084 -0
  109. package/lib/webgpu-wkXAkJ6p.mjs.map +1 -0
  110. package/lib/workers-YGDNEfpU.mjs +6 -0
  111. package/lib/{workers-DcgrO-z7.mjs.map → workers-YGDNEfpU.mjs.map} +1 -1
  112. package/package.json +5 -4
  113. package/lib/asset-loader.worker-C_5RQYHp.mjs.map +0 -1
  114. package/lib/budgeteer.sw-DxeAvd0v.mjs.map +0 -1
  115. package/lib/configurator-BBlZVIId.mjs +0 -2
  116. package/lib/dimensioning-helper-Bzf1sbpy.mjs +0 -2
  117. package/lib/glb-viewer-A5vSLFZ5.mjs.map +0 -1
  118. package/lib/glb-viewer-B4ILlvw0.mjs +0 -2
  119. package/lib/planner-49YwTdiA.mjs +0 -2
  120. package/lib/planner-t4QH26WW.mjs +0 -44
  121. package/lib/roomle-headless-setup-Cc8EAnVe.mjs +0 -1204
  122. package/lib/roomle-headless-setup-Cc8EAnVe.mjs.map +0 -1
  123. package/lib/roomle-webgpu-renderer-CRGcdahn.mjs.map +0 -1
  124. package/lib/shading-settings-BEMqEGzB.mjs.map +0 -1
  125. package/lib/three.tsl-Q-21y0pO.mjs +0 -2
  126. package/lib/three.webgpu-dtN0kDKB.mjs +0 -3
  127. package/lib/workers-DcgrO-z7.mjs +0 -6
@@ -1,4 +1,4 @@
1
- import { $t as e, A as t, An as n, Ar as r, B as i, Bi as a, Br as o, Ci as s, Cr as c, E as l, Ei as u, En as d, Fi as f, Gn as p, Ii as m, It as h, J as g, Kn as _, Li as v, M as y, Mi as b, Mr as x, Ni as S, Oi as C, On as w, Pi as T, Pr as E, Qt as D, S as O, Si as k, Sn as A, Ti as ee, Tr as j, Ui as M, Ur as N, V as P, Vi as te, Vn as F, Vr as ne, Wi as I, Xt as re, Y as ie, Zt as ae, _i as oe, a as L, bi as se, bn as ce, cn as R, ct as z, di as le, dn as ue, dt as de, fi as fe, h as pe, hi as me, ht as he, it as ge, j as _e, kn as B, ln as ve, m as ye, oi as be, on as V, p as xe, pi as Se, q as Ce, qt as H, rt as we, sn as Te, st as Ee, ui as De, un as Oe, vi as ke, w as U, wr as Ae, xi as je, xn as Me, yi as Ne, yn as Pe, z as W, zi as Fe } from "./three.core-DjCexDCp.mjs";
1
+ import { $t as e, A as t, An as n, Ar as r, B as i, Bi as a, Br as o, Ci as s, Cr as c, Di as l, E as u, Ei as d, En as f, Fi as p, Gi as m, Gn as h, Hi as g, Ii as _, It as v, J as y, Kn as b, Li as x, M as S, Mr as C, Ni as w, On as T, Pi as E, Pr as D, Qt as O, Ri as k, S as ee, Si as A, Sn as j, Tr as M, Ur as N, V as P, Vi as F, Vn as te, Vr as I, Wi as L, Xt as ne, Y as re, Zt as ie, a as R, bi as ae, bn as oe, cn as z, ct as B, di as se, dn as ce, dt as le, fi as ue, gi as de, h as fe, ht as pe, it as me, j as he, ki as V, kn as ge, ln as _e, m as ve, mi as ye, oi as be, on as H, p as xe, pi as Se, q as Ce, qt as we, rt as Te, sn as Ee, st as De, un as Oe, vi as ke, w as U, wi as Ae, wr as je, xi as Me, xn as Ne, yi as Pe, yn as Fe, z as W } from "./three.core-CmmDf_BZ.mjs";
2
2
  //#region ../../node_modules/three/build/three.module.js
3
3
  function Ie() {
4
4
  let e = null, t = !1, n = null, r = null;
@@ -243,18 +243,18 @@ var G = {
243
243
  diffuse: { value: /* @__PURE__ */ new U(16777215) },
244
244
  opacity: { value: 1 },
245
245
  map: { value: null },
246
- mapTransform: { value: /* @__PURE__ */ new V() },
246
+ mapTransform: { value: /* @__PURE__ */ new H() },
247
247
  alphaMap: { value: null },
248
- alphaMapTransform: { value: /* @__PURE__ */ new V() },
248
+ alphaMapTransform: { value: /* @__PURE__ */ new H() },
249
249
  alphaTest: { value: 0 }
250
250
  },
251
251
  specularmap: {
252
252
  specularMap: { value: null },
253
- specularMapTransform: { value: /* @__PURE__ */ new V() }
253
+ specularMapTransform: { value: /* @__PURE__ */ new H() }
254
254
  },
255
255
  envmap: {
256
256
  envMap: { value: null },
257
- envMapRotation: { value: /* @__PURE__ */ new V() },
257
+ envMapRotation: { value: /* @__PURE__ */ new H() },
258
258
  reflectivity: { value: 1 },
259
259
  ior: { value: 1.5 },
260
260
  refractionRatio: { value: .98 },
@@ -263,40 +263,40 @@ var G = {
263
263
  aomap: {
264
264
  aoMap: { value: null },
265
265
  aoMapIntensity: { value: 1 },
266
- aoMapTransform: { value: /* @__PURE__ */ new V() }
266
+ aoMapTransform: { value: /* @__PURE__ */ new H() }
267
267
  },
268
268
  lightmap: {
269
269
  lightMap: { value: null },
270
270
  lightMapIntensity: { value: 1 },
271
- lightMapTransform: { value: /* @__PURE__ */ new V() }
271
+ lightMapTransform: { value: /* @__PURE__ */ new H() }
272
272
  },
273
273
  bumpmap: {
274
274
  bumpMap: { value: null },
275
- bumpMapTransform: { value: /* @__PURE__ */ new V() },
275
+ bumpMapTransform: { value: /* @__PURE__ */ new H() },
276
276
  bumpScale: { value: 1 }
277
277
  },
278
278
  normalmap: {
279
279
  normalMap: { value: null },
280
- normalMapTransform: { value: /* @__PURE__ */ new V() },
281
- normalScale: { value: /* @__PURE__ */ new je(1, 1) }
280
+ normalMapTransform: { value: /* @__PURE__ */ new H() },
281
+ normalScale: { value: /* @__PURE__ */ new A(1, 1) }
282
282
  },
283
283
  displacementmap: {
284
284
  displacementMap: { value: null },
285
- displacementMapTransform: { value: /* @__PURE__ */ new V() },
285
+ displacementMapTransform: { value: /* @__PURE__ */ new H() },
286
286
  displacementScale: { value: 1 },
287
287
  displacementBias: { value: 0 }
288
288
  },
289
289
  emissivemap: {
290
290
  emissiveMap: { value: null },
291
- emissiveMapTransform: { value: /* @__PURE__ */ new V() }
291
+ emissiveMapTransform: { value: /* @__PURE__ */ new H() }
292
292
  },
293
293
  metalnessmap: {
294
294
  metalnessMap: { value: null },
295
- metalnessMapTransform: { value: /* @__PURE__ */ new V() }
295
+ metalnessMapTransform: { value: /* @__PURE__ */ new H() }
296
296
  },
297
297
  roughnessmap: {
298
298
  roughnessMap: { value: null },
299
- roughnessMapTransform: { value: /* @__PURE__ */ new V() }
299
+ roughnessMapTransform: { value: /* @__PURE__ */ new H() }
300
300
  },
301
301
  gradientmap: { gradientMap: { value: null } },
302
302
  fog: {
@@ -392,9 +392,9 @@ var G = {
392
392
  ltc_1: { value: null },
393
393
  ltc_2: { value: null },
394
394
  probesSH: { value: null },
395
- probesMin: { value: /* @__PURE__ */ new k() },
396
- probesMax: { value: /* @__PURE__ */ new k() },
397
- probesResolution: { value: /* @__PURE__ */ new k() }
395
+ probesMin: { value: /* @__PURE__ */ new s() },
396
+ probesMax: { value: /* @__PURE__ */ new s() },
397
+ probesResolution: { value: /* @__PURE__ */ new s() }
398
398
  },
399
399
  points: {
400
400
  diffuse: { value: /* @__PURE__ */ new U(16777215) },
@@ -403,24 +403,24 @@ var G = {
403
403
  scale: { value: 1 },
404
404
  map: { value: null },
405
405
  alphaMap: { value: null },
406
- alphaMapTransform: { value: /* @__PURE__ */ new V() },
406
+ alphaMapTransform: { value: /* @__PURE__ */ new H() },
407
407
  alphaTest: { value: 0 },
408
- uvTransform: { value: /* @__PURE__ */ new V() }
408
+ uvTransform: { value: /* @__PURE__ */ new H() }
409
409
  },
410
410
  sprite: {
411
411
  diffuse: { value: /* @__PURE__ */ new U(16777215) },
412
412
  opacity: { value: 1 },
413
- center: { value: /* @__PURE__ */ new je(.5, .5) },
413
+ center: { value: /* @__PURE__ */ new A(.5, .5) },
414
414
  rotation: { value: 0 },
415
415
  map: { value: null },
416
- mapTransform: { value: /* @__PURE__ */ new V() },
416
+ mapTransform: { value: /* @__PURE__ */ new H() },
417
417
  alphaMap: { value: null },
418
- alphaMapTransform: { value: /* @__PURE__ */ new V() },
418
+ alphaMapTransform: { value: /* @__PURE__ */ new H() },
419
419
  alphaTest: { value: 0 }
420
420
  }
421
421
  }, q = {
422
422
  basic: {
423
- uniforms: /* @__PURE__ */ a([
423
+ uniforms: /* @__PURE__ */ F([
424
424
  K.common,
425
425
  K.specularmap,
426
426
  K.envmap,
@@ -432,7 +432,7 @@ var G = {
432
432
  fragmentShader: G.meshbasic_frag
433
433
  },
434
434
  lambert: {
435
- uniforms: /* @__PURE__ */ a([
435
+ uniforms: /* @__PURE__ */ F([
436
436
  K.common,
437
437
  K.specularmap,
438
438
  K.envmap,
@@ -453,7 +453,7 @@ var G = {
453
453
  fragmentShader: G.meshlambert_frag
454
454
  },
455
455
  phong: {
456
- uniforms: /* @__PURE__ */ a([
456
+ uniforms: /* @__PURE__ */ F([
457
457
  K.common,
458
458
  K.specularmap,
459
459
  K.envmap,
@@ -476,7 +476,7 @@ var G = {
476
476
  fragmentShader: G.meshphong_frag
477
477
  },
478
478
  standard: {
479
- uniforms: /* @__PURE__ */ a([
479
+ uniforms: /* @__PURE__ */ F([
480
480
  K.common,
481
481
  K.envmap,
482
482
  K.aomap,
@@ -500,7 +500,7 @@ var G = {
500
500
  fragmentShader: G.meshphysical_frag
501
501
  },
502
502
  toon: {
503
- uniforms: /* @__PURE__ */ a([
503
+ uniforms: /* @__PURE__ */ F([
504
504
  K.common,
505
505
  K.aomap,
506
506
  K.lightmap,
@@ -517,7 +517,7 @@ var G = {
517
517
  fragmentShader: G.meshtoon_frag
518
518
  },
519
519
  matcap: {
520
- uniforms: /* @__PURE__ */ a([
520
+ uniforms: /* @__PURE__ */ F([
521
521
  K.common,
522
522
  K.bumpmap,
523
523
  K.normalmap,
@@ -529,12 +529,12 @@ var G = {
529
529
  fragmentShader: G.meshmatcap_frag
530
530
  },
531
531
  points: {
532
- uniforms: /* @__PURE__ */ a([K.points, K.fog]),
532
+ uniforms: /* @__PURE__ */ F([K.points, K.fog]),
533
533
  vertexShader: G.points_vert,
534
534
  fragmentShader: G.points_frag
535
535
  },
536
536
  dashed: {
537
- uniforms: /* @__PURE__ */ a([
537
+ uniforms: /* @__PURE__ */ F([
538
538
  K.common,
539
539
  K.fog,
540
540
  {
@@ -547,12 +547,12 @@ var G = {
547
547
  fragmentShader: G.linedashed_frag
548
548
  },
549
549
  depth: {
550
- uniforms: /* @__PURE__ */ a([K.common, K.displacementmap]),
550
+ uniforms: /* @__PURE__ */ F([K.common, K.displacementmap]),
551
551
  vertexShader: G.depth_vert,
552
552
  fragmentShader: G.depth_frag
553
553
  },
554
554
  normal: {
555
- uniforms: /* @__PURE__ */ a([
555
+ uniforms: /* @__PURE__ */ F([
556
556
  K.common,
557
557
  K.bumpmap,
558
558
  K.normalmap,
@@ -563,13 +563,13 @@ var G = {
563
563
  fragmentShader: G.meshnormal_frag
564
564
  },
565
565
  sprite: {
566
- uniforms: /* @__PURE__ */ a([K.sprite, K.fog]),
566
+ uniforms: /* @__PURE__ */ F([K.sprite, K.fog]),
567
567
  vertexShader: G.sprite_vert,
568
568
  fragmentShader: G.sprite_frag
569
569
  },
570
570
  background: {
571
571
  uniforms: {
572
- uvTransform: { value: /* @__PURE__ */ new V() },
572
+ uvTransform: { value: /* @__PURE__ */ new H() },
573
573
  t2D: { value: null },
574
574
  backgroundIntensity: { value: 1 }
575
575
  },
@@ -581,7 +581,7 @@ var G = {
581
581
  envMap: { value: null },
582
582
  backgroundBlurriness: { value: 0 },
583
583
  backgroundIntensity: { value: 1 },
584
- backgroundRotation: { value: /* @__PURE__ */ new V() }
584
+ backgroundRotation: { value: /* @__PURE__ */ new H() }
585
585
  },
586
586
  vertexShader: G.backgroundCube_vert,
587
587
  fragmentShader: G.backgroundCube_frag
@@ -601,11 +601,11 @@ var G = {
601
601
  fragmentShader: G.equirect_frag
602
602
  },
603
603
  distance: {
604
- uniforms: /* @__PURE__ */ a([
604
+ uniforms: /* @__PURE__ */ F([
605
605
  K.common,
606
606
  K.displacementmap,
607
607
  {
608
- referencePosition: { value: /* @__PURE__ */ new k() },
608
+ referencePosition: { value: /* @__PURE__ */ new s() },
609
609
  nearDistance: { value: 1 },
610
610
  farDistance: { value: 1e3 }
611
611
  }
@@ -614,7 +614,7 @@ var G = {
614
614
  fragmentShader: G.distance_frag
615
615
  },
616
616
  shadow: {
617
- uniforms: /* @__PURE__ */ a([
617
+ uniforms: /* @__PURE__ */ F([
618
618
  K.lights,
619
619
  K.fog,
620
620
  {
@@ -627,51 +627,51 @@ var G = {
627
627
  }
628
628
  };
629
629
  q.physical = {
630
- uniforms: /* @__PURE__ */ a([q.standard.uniforms, {
630
+ uniforms: /* @__PURE__ */ F([q.standard.uniforms, {
631
631
  clearcoat: { value: 0 },
632
632
  clearcoatMap: { value: null },
633
- clearcoatMapTransform: { value: /* @__PURE__ */ new V() },
633
+ clearcoatMapTransform: { value: /* @__PURE__ */ new H() },
634
634
  clearcoatNormalMap: { value: null },
635
- clearcoatNormalMapTransform: { value: /* @__PURE__ */ new V() },
636
- clearcoatNormalScale: { value: /* @__PURE__ */ new je(1, 1) },
635
+ clearcoatNormalMapTransform: { value: /* @__PURE__ */ new H() },
636
+ clearcoatNormalScale: { value: /* @__PURE__ */ new A(1, 1) },
637
637
  clearcoatRoughness: { value: 0 },
638
638
  clearcoatRoughnessMap: { value: null },
639
- clearcoatRoughnessMapTransform: { value: /* @__PURE__ */ new V() },
639
+ clearcoatRoughnessMapTransform: { value: /* @__PURE__ */ new H() },
640
640
  dispersion: { value: 0 },
641
641
  iridescence: { value: 0 },
642
642
  iridescenceMap: { value: null },
643
- iridescenceMapTransform: { value: /* @__PURE__ */ new V() },
643
+ iridescenceMapTransform: { value: /* @__PURE__ */ new H() },
644
644
  iridescenceIOR: { value: 1.3 },
645
645
  iridescenceThicknessMinimum: { value: 100 },
646
646
  iridescenceThicknessMaximum: { value: 400 },
647
647
  iridescenceThicknessMap: { value: null },
648
- iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new V() },
648
+ iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new H() },
649
649
  sheen: { value: 0 },
650
650
  sheenColor: { value: /* @__PURE__ */ new U(0) },
651
651
  sheenColorMap: { value: null },
652
- sheenColorMapTransform: { value: /* @__PURE__ */ new V() },
652
+ sheenColorMapTransform: { value: /* @__PURE__ */ new H() },
653
653
  sheenRoughness: { value: 1 },
654
654
  sheenRoughnessMap: { value: null },
655
- sheenRoughnessMapTransform: { value: /* @__PURE__ */ new V() },
655
+ sheenRoughnessMapTransform: { value: /* @__PURE__ */ new H() },
656
656
  transmission: { value: 0 },
657
657
  transmissionMap: { value: null },
658
- transmissionMapTransform: { value: /* @__PURE__ */ new V() },
659
- transmissionSamplerSize: { value: /* @__PURE__ */ new je() },
658
+ transmissionMapTransform: { value: /* @__PURE__ */ new H() },
659
+ transmissionSamplerSize: { value: /* @__PURE__ */ new A() },
660
660
  transmissionSamplerMap: { value: null },
661
661
  thickness: { value: 0 },
662
662
  thicknessMap: { value: null },
663
- thicknessMapTransform: { value: /* @__PURE__ */ new V() },
663
+ thicknessMapTransform: { value: /* @__PURE__ */ new H() },
664
664
  attenuationDistance: { value: 0 },
665
665
  attenuationColor: { value: /* @__PURE__ */ new U(0) },
666
666
  specularColor: { value: /* @__PURE__ */ new U(1, 1, 1) },
667
667
  specularColorMap: { value: null },
668
- specularColorMapTransform: { value: /* @__PURE__ */ new V() },
668
+ specularColorMapTransform: { value: /* @__PURE__ */ new H() },
669
669
  specularIntensity: { value: 1 },
670
670
  specularIntensityMap: { value: null },
671
- specularIntensityMapTransform: { value: /* @__PURE__ */ new V() },
672
- anisotropyVector: { value: /* @__PURE__ */ new je() },
671
+ specularIntensityMapTransform: { value: /* @__PURE__ */ new H() },
672
+ anisotropyVector: { value: /* @__PURE__ */ new A() },
673
673
  anisotropyMap: { value: null },
674
- anisotropyMapTransform: { value: /* @__PURE__ */ new V() }
674
+ anisotropyMapTransform: { value: /* @__PURE__ */ new H() }
675
675
  }]),
676
676
  vertexShader: G.meshphysical_vert,
677
677
  fragmentShader: G.meshphysical_frag
@@ -680,10 +680,10 @@ var J = {
680
680
  r: 0,
681
681
  b: 0,
682
682
  g: 0
683
- }, Re = /* @__PURE__ */ new Te(), Y = /* @__PURE__ */ new V();
683
+ }, Re = /* @__PURE__ */ new Ee(), Y = /* @__PURE__ */ new H();
684
684
  Y.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);
685
685
  function ze(e, t, r, i, a, o) {
686
- let s = new U(0), c = a === !0 ? 0 : 1, u, d, f = null, p = 0, m = null;
686
+ let s = new U(0), c = a === !0 ? 0 : 1, l, d, f = null, p = 0, m = null;
687
687
  function h(e) {
688
688
  let n = e.isScene === !0 ? e.background : null;
689
689
  if (n && n.isTexture) {
@@ -694,15 +694,15 @@ function ze(e, t, r, i, a, o) {
694
694
  }
695
695
  function g(t) {
696
696
  let n = !1, i = h(t);
697
- i === null ? y(s, c) : i && i.isColor && (y(i, 1), n = !0);
697
+ i === null ? v(s, c) : i && i.isColor && (v(i, 1), n = !0);
698
698
  let a = e.xr.getEnvironmentBlendMode();
699
699
  a === "additive" ? r.buffers.color.setClear(0, 0, 0, 1, o) : a === "alpha-blend" && r.buffers.color.setClear(0, 0, 0, 0, o), (e.autoClear || n) && (r.buffers.depth.setTest(!0), r.buffers.depth.setMask(!0), r.buffers.color.setMask(!0), e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil));
700
700
  }
701
701
  function _(t, r) {
702
702
  let a = h(r);
703
- a && (a.isCubeTexture || a.mapping === 306) ? (d === void 0 && (d = new R(new xe(1, 1, 1), new N({
703
+ a && (a.isCubeTexture || a.mapping === 306) ? (d === void 0 && (d = new z(new xe(1, 1, 1), new N({
704
704
  name: "BackgroundCubeMaterial",
705
- uniforms: b(q.backgroundCube.uniforms),
705
+ uniforms: w(q.backgroundCube.uniforms),
706
706
  vertexShader: q.backgroundCube.vertexShader,
707
707
  fragmentShader: q.backgroundCube.fragmentShader,
708
708
  side: 1,
@@ -714,9 +714,9 @@ function ze(e, t, r, i, a, o) {
714
714
  this.matrixWorld.copyPosition(n.matrixWorld);
715
715
  }, Object.defineProperty(d.material, "envMap", { get: function() {
716
716
  return this.uniforms.envMap.value;
717
- } }), i.update(d)), d.material.uniforms.envMap.value = a, d.material.uniforms.backgroundBlurriness.value = r.backgroundBlurriness, d.material.uniforms.backgroundIntensity.value = r.backgroundIntensity, d.material.uniforms.backgroundRotation.value.setFromMatrix4(Re.makeRotationFromEuler(r.backgroundRotation)).transpose(), a.isCubeTexture && a.isRenderTargetTexture === !1 && d.material.uniforms.backgroundRotation.value.premultiply(Y), d.material.toneMapped = l.getTransfer(a.colorSpace) !== ne, (f !== a || p !== a.version || m !== e.toneMapping) && (d.material.needsUpdate = !0, f = a, p = a.version, m = e.toneMapping), d.layers.enableAll(), t.unshift(d, d.geometry, d.material, 0, 0, null)) : a && a.isTexture && (u === void 0 && (u = new R(new n(2, 2), new N({
717
+ } }), i.update(d)), d.material.uniforms.envMap.value = a, d.material.uniforms.backgroundBlurriness.value = r.backgroundBlurriness, d.material.uniforms.backgroundIntensity.value = r.backgroundIntensity, d.material.uniforms.backgroundRotation.value.setFromMatrix4(Re.makeRotationFromEuler(r.backgroundRotation)).transpose(), a.isCubeTexture && a.isRenderTargetTexture === !1 && d.material.uniforms.backgroundRotation.value.premultiply(Y), d.material.toneMapped = u.getTransfer(a.colorSpace) !== I, (f !== a || p !== a.version || m !== e.toneMapping) && (d.material.needsUpdate = !0, f = a, p = a.version, m = e.toneMapping), d.layers.enableAll(), t.unshift(d, d.geometry, d.material, 0, 0, null)) : a && a.isTexture && (l === void 0 && (l = new z(new n(2, 2), new N({
718
718
  name: "BackgroundMaterial",
719
- uniforms: b(q.background.uniforms),
719
+ uniforms: w(q.background.uniforms),
720
720
  vertexShader: q.background.vertexShader,
721
721
  fragmentShader: q.background.fragmentShader,
722
722
  side: 0,
@@ -724,32 +724,32 @@ function ze(e, t, r, i, a, o) {
724
724
  depthWrite: !1,
725
725
  fog: !1,
726
726
  allowOverride: !1
727
- })), u.geometry.deleteAttribute("normal"), Object.defineProperty(u.material, "map", { get: function() {
727
+ })), l.geometry.deleteAttribute("normal"), Object.defineProperty(l.material, "map", { get: function() {
728
728
  return this.uniforms.t2D.value;
729
- } }), i.update(u)), u.material.uniforms.t2D.value = a, u.material.uniforms.backgroundIntensity.value = r.backgroundIntensity, u.material.toneMapped = l.getTransfer(a.colorSpace) !== ne, a.matrixAutoUpdate === !0 && a.updateMatrix(), u.material.uniforms.uvTransform.value.copy(a.matrix), (f !== a || p !== a.version || m !== e.toneMapping) && (u.material.needsUpdate = !0, f = a, p = a.version, m = e.toneMapping), u.layers.enableAll(), t.unshift(u, u.geometry, u.material, 0, 0, null));
729
+ } }), i.update(l)), l.material.uniforms.t2D.value = a, l.material.uniforms.backgroundIntensity.value = r.backgroundIntensity, l.material.toneMapped = u.getTransfer(a.colorSpace) !== I, a.matrixAutoUpdate === !0 && a.updateMatrix(), l.material.uniforms.uvTransform.value.copy(a.matrix), (f !== a || p !== a.version || m !== e.toneMapping) && (l.material.needsUpdate = !0, f = a, p = a.version, m = e.toneMapping), l.layers.enableAll(), t.unshift(l, l.geometry, l.material, 0, 0, null));
730
730
  }
731
- function y(t, n) {
732
- t.getRGB(J, v(e)), r.buffers.color.setClear(J.r, J.g, J.b, n, o);
731
+ function v(t, n) {
732
+ t.getRGB(J, k(e)), r.buffers.color.setClear(J.r, J.g, J.b, n, o);
733
733
  }
734
- function x() {
735
- d !== void 0 && (d.geometry.dispose(), d.material.dispose(), d = void 0), u !== void 0 && (u.geometry.dispose(), u.material.dispose(), u = void 0);
734
+ function y() {
735
+ d !== void 0 && (d.geometry.dispose(), d.material.dispose(), d = void 0), l !== void 0 && (l.geometry.dispose(), l.material.dispose(), l = void 0);
736
736
  }
737
737
  return {
738
738
  getClearColor: function() {
739
739
  return s;
740
740
  },
741
741
  setClearColor: function(e, t = 1) {
742
- s.set(e), c = t, y(s, c);
742
+ s.set(e), c = t, v(s, c);
743
743
  },
744
744
  getClearAlpha: function() {
745
745
  return c;
746
746
  },
747
747
  setClearAlpha: function(e) {
748
- c = e, y(s, c);
748
+ c = e, v(s, c);
749
749
  },
750
750
  render: g,
751
751
  addToRenderList: _,
752
- dispose: x
752
+ dispose: y
753
753
  };
754
754
  }
755
755
  function Be(e, t) {
@@ -992,9 +992,9 @@ function He(e, t, n, r) {
992
992
  return t === "mediump" && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp";
993
993
  }
994
994
  let l = n.precision === void 0 ? "highp" : n.precision, u = c(l);
995
- u !== l && (M("WebGLRenderer:", l, "not supported, using", u, "instead."), l = u);
995
+ u !== l && (L("WebGLRenderer:", l, "not supported, using", u, "instead."), l = u);
996
996
  let d = n.logarithmicDepthBuffer === !0, f = n.reversedDepthBuffer === !0 && t.has("EXT_clip_control");
997
- n.reversedDepthBuffer === !0 && f === !1 && M("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");
997
+ n.reversedDepthBuffer === !0 && f === !1 && L("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");
998
998
  let p = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), m = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS), h = e.getParameter(e.MAX_TEXTURE_SIZE), g = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE), _ = e.getParameter(e.MAX_VERTEX_ATTRIBS), v = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS), y = e.getParameter(e.MAX_VARYING_VECTORS), b = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS), x = e.getParameter(e.MAX_SAMPLES), S = e.getParameter(e.SAMPLES);
999
999
  return {
1000
1000
  isWebGL2: !0,
@@ -1018,7 +1018,7 @@ function He(e, t, n, r) {
1018
1018
  };
1019
1019
  }
1020
1020
  function Ue(e) {
1021
- let t = this, n = null, r = 0, i = !1, a = !1, o = new B(), s = new V(), c = {
1021
+ let t = this, n = null, r = 0, i = !1, a = !1, o = new ge(), s = new H(), c = {
1022
1022
  value: null,
1023
1023
  needsUpdate: !1
1024
1024
  };
@@ -1064,7 +1064,7 @@ var X = 4, We = [
1064
1064
  .446,
1065
1065
  .526,
1066
1066
  .582
1067
- ], Ge = 20, Ke = 256, qe = /* @__PURE__ */ new d(), Je = /* @__PURE__ */ new U(), Ye = null, Xe = 0, Ze = 0, Qe = !1, $e = /* @__PURE__ */ new k(), et = class {
1067
+ ], Ge = 20, Ke = 256, qe = /* @__PURE__ */ new f(), Je = /* @__PURE__ */ new U(), Ye = null, Xe = 0, Ze = 0, Qe = !1, $e = /* @__PURE__ */ new s(), et = class {
1068
1068
  constructor(e) {
1069
1069
  this._renderer = e, this._pingPongRenderTarget = null, this._lodMax = 0, this._cubeSize = 0, this._sizeLods = [], this._sigmas = [], this._lodMeshes = [], this._backgroundBox = null, this._cubemapMaterial = null, this._equirectMaterial = null, this._blurMaterial = null, this._ggxMaterial = null;
1070
1070
  }
@@ -1106,12 +1106,12 @@ var X = 4, We = [
1106
1106
  }
1107
1107
  _allocateTargets() {
1108
1108
  let e = 3 * Math.max(this._cubeSize, 112), t = 4 * this._cubeSize, n = {
1109
- magFilter: H,
1110
- minFilter: H,
1109
+ magFilter: we,
1110
+ minFilter: we,
1111
1111
  generateMipmaps: !1,
1112
- type: he,
1113
- format: p,
1114
- colorSpace: D,
1112
+ type: pe,
1113
+ format: h,
1114
+ colorSpace: O,
1115
1115
  depthBuffer: !1
1116
1116
  }, r = nt(e, t, n);
1117
1117
  if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
@@ -1122,11 +1122,11 @@ var X = 4, We = [
1122
1122
  return r;
1123
1123
  }
1124
1124
  _compileMaterial(e) {
1125
- let t = new R(new pe(), e);
1125
+ let t = new z(new fe(), e);
1126
1126
  this._renderer.compile(t, qe);
1127
1127
  }
1128
1128
  _sceneToCubeUV(e, t, n, r, i) {
1129
- let a = new w(90, 1, t, n), o = [
1129
+ let a = new T(90, 1, t, n), o = [
1130
1130
  1,
1131
1131
  -1,
1132
1132
  1,
@@ -1141,7 +1141,7 @@ var X = 4, We = [
1141
1141
  -1,
1142
1142
  -1
1143
1143
  ], c = this._renderer, l = c.autoClear, u = c.toneMapping;
1144
- c.getClearColor(Je), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new R(new xe(), new ve({
1144
+ c.getClearColor(Je), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new z(new xe(), new _e({
1145
1145
  name: "PMREM.Background",
1146
1146
  side: 1,
1147
1147
  depthWrite: !1,
@@ -1186,20 +1186,20 @@ var X = 4, We = [
1186
1186
  }
1187
1187
  _halfBlur(e, t, n, r, i, a, o) {
1188
1188
  let s = this._renderer, c = this._blurMaterial;
1189
- a !== "latitudinal" && a !== "longitudinal" && f("blur direction must be either latitudinal or longitudinal!");
1189
+ a !== "latitudinal" && a !== "longitudinal" && _("blur direction must be either latitudinal or longitudinal!");
1190
1190
  let l = this._lodMeshes[r];
1191
1191
  l.material = c;
1192
- let u = c.uniforms, d = this._sizeLods[n] - 1, p = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / (2 * Ge - 1), m = i / p, h = isFinite(i) ? 1 + Math.floor(3 * m) : Ge;
1193
- h > Ge && M(`sigmaRadians, ${i}, is too large and will clip, as it requested ${h} samples when the maximum is set to ${Ge}`);
1194
- let g = [], _ = 0;
1192
+ let u = c.uniforms, d = this._sizeLods[n] - 1, f = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / (2 * Ge - 1), p = i / f, m = isFinite(i) ? 1 + Math.floor(3 * p) : Ge;
1193
+ m > Ge && L(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Ge}`);
1194
+ let h = [], g = 0;
1195
1195
  for (let e = 0; e < Ge; ++e) {
1196
- let t = e / m, n = Math.exp(-t * t / 2);
1197
- g.push(n), e === 0 ? _ += n : e < h && (_ += 2 * n);
1196
+ let t = e / p, n = Math.exp(-t * t / 2);
1197
+ h.push(n), e === 0 ? g += n : e < m && (g += 2 * n);
1198
1198
  }
1199
- for (let e = 0; e < g.length; e++) g[e] = g[e] / _;
1200
- u.envMap.value = e.texture, u.samples.value = h, u.weights.value = g, u.latitudinal.value = a === "latitudinal", o && (u.poleAxis.value = o);
1199
+ for (let e = 0; e < h.length; e++) h[e] = h[e] / g;
1200
+ u.envMap.value = e.texture, u.samples.value = m, u.weights.value = h, u.latitudinal.value = a === "latitudinal", o && (u.poleAxis.value = o);
1201
1201
  let { _lodMax: v } = this;
1202
- u.dTheta.value = p, u.mipInt.value = v - n;
1202
+ u.dTheta.value = f, u.mipInt.value = v - n;
1203
1203
  let y = this._sizeLods[r];
1204
1204
  rt(t, 3 * y * (r > v - X ? r - v + X : 0), 4 * (this._cubeSize - y), 3 * y, 2 * y), s.setRenderTarget(t), s.render(l, qe);
1205
1205
  }
@@ -1257,8 +1257,8 @@ function tt(e) {
1257
1257
  ];
1258
1258
  m.set(i, 6 * e);
1259
1259
  }
1260
- let h = new pe();
1261
- h.setAttribute("position", new ye(f, 3)), h.setAttribute("uv", new ye(p, 2)), h.setAttribute("faceIndex", new ye(m, 1)), r.push(new R(h, null)), i > X && i--;
1260
+ let h = new fe();
1261
+ h.setAttribute("position", new ve(f, 3)), h.setAttribute("uv", new ve(p, 2)), h.setAttribute("faceIndex", new ve(m, 1)), r.push(new z(h, null)), i > X && i--;
1262
1262
  }
1263
1263
  return {
1264
1264
  lodMeshes: r,
@@ -1267,7 +1267,7 @@ function tt(e) {
1267
1267
  };
1268
1268
  }
1269
1269
  function nt(e, t, n) {
1270
- let r = new u(e, t, n);
1270
+ let r = new l(e, t, n);
1271
1271
  return r.texture.mapping = 306, r.texture.name = "PMREM.cubeUv", r.scissorTest = !0, r;
1272
1272
  }
1273
1273
  function rt(e, t, n, r, i) {
@@ -1295,7 +1295,7 @@ function it(e, t, n) {
1295
1295
  });
1296
1296
  }
1297
1297
  function at(e, t, n) {
1298
- let r = new Float32Array(Ge), i = new k(0, 1, 0);
1298
+ let r = new Float32Array(Ge), i = new s(0, 1, 0);
1299
1299
  return new N({
1300
1300
  name: "SphericalGaussianBlur",
1301
1301
  defines: {
@@ -1348,7 +1348,7 @@ function st() {
1348
1348
  function Z() {
1349
1349
  return "\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n ";
1350
1350
  }
1351
- var ct = class extends u {
1351
+ var ct = class extends l {
1352
1352
  constructor(e = 1, t = {}) {
1353
1353
  super(e, e, t), this.isWebGLCubeRenderTarget = !0;
1354
1354
  let n = {
@@ -1356,7 +1356,7 @@ var ct = class extends u {
1356
1356
  height: e,
1357
1357
  depth: 1
1358
1358
  };
1359
- this.texture = new y([
1359
+ this.texture = new S([
1360
1360
  n,
1361
1361
  n,
1362
1362
  n,
@@ -1373,15 +1373,15 @@ var ct = class extends u {
1373
1373
  fragmentShader: "\n\n uniform sampler2D tEquirect;\n\n varying vec3 vWorldDirection;\n\n #include <common>\n\n void main() {\n\n vec3 direction = normalize( vWorldDirection );\n\n vec2 sampleUV = equirectUv( direction );\n\n gl_FragColor = texture2D( tEquirect, sampleUV );\n\n }\n "
1374
1374
  }, i = new xe(5, 5, 5), a = new N({
1375
1375
  name: "CubemapFromEquirect",
1376
- uniforms: b(r.uniforms),
1376
+ uniforms: w(r.uniforms),
1377
1377
  vertexShader: r.vertexShader,
1378
1378
  fragmentShader: r.fragmentShader,
1379
1379
  side: 1,
1380
1380
  blending: 0
1381
1381
  });
1382
1382
  a.uniforms.tEquirect.value = n;
1383
- let o = new R(i, a), s = n.minFilter;
1384
- return n.minFilter === 1008 && (n.minFilter = H), new t(1, 10, this).update(e, o), n.minFilter = s, o.geometry.dispose(), o.material.dispose(), this;
1383
+ let o = new z(i, a), s = n.minFilter;
1384
+ return n.minFilter === 1008 && (n.minFilter = we), new t(1, 10, this).update(e, o), n.minFilter = s, o.geometry.dispose(), o.material.dispose(), this;
1385
1385
  }
1386
1386
  clear(e, t = !0, n = !0, r = !0) {
1387
1387
  let i = e.getRenderTarget();
@@ -1469,7 +1469,7 @@ function ut(e) {
1469
1469
  },
1470
1470
  get: function(e) {
1471
1471
  let t = n(e);
1472
- return t === null && I("WebGLRenderer: " + e + " extension not supported."), t;
1472
+ return t === null && m("WebGLRenderer: " + e + " extension not supported."), t;
1473
1473
  }
1474
1474
  };
1475
1475
  }
@@ -1508,7 +1508,7 @@ function dt(e, t, n, r) {
1508
1508
  n.push(e, r, r, i, i, e);
1509
1509
  }
1510
1510
  }
1511
- let s = new (i.count >= 65535 ? le : De)(n, 1);
1511
+ let s = new (i.count >= 65535 ? ue : se)(n, 1);
1512
1512
  s.version = o;
1513
1513
  let c = a.get(e);
1514
1514
  c && t.remove(c), a.set(e, s);
@@ -1580,7 +1580,7 @@ function pt(e) {
1580
1580
  n.points += i * t;
1581
1581
  break;
1582
1582
  default:
1583
- f("WebGLInfo: Unknown draw mode:", r);
1583
+ _("WebGLInfo: Unknown draw mode:", r);
1584
1584
  break;
1585
1585
  }
1586
1586
  }
@@ -1597,7 +1597,7 @@ function pt(e) {
1597
1597
  };
1598
1598
  }
1599
1599
  function mt(e, t, n) {
1600
- let r = /* @__PURE__ */ new WeakMap(), a = new s();
1600
+ let r = /* @__PURE__ */ new WeakMap(), a = new Ae();
1601
1601
  function o(o, s, c) {
1602
1602
  let l = o.morphTargetInfluences, u = s.morphAttributes.position || s.morphAttributes.normal || s.morphAttributes.color, d = u === void 0 ? 0 : u.length, f = r.get(s);
1603
1603
  if (f === void 0 || f.count !== d) {
@@ -1607,7 +1607,7 @@ function mt(e, t, n) {
1607
1607
  let m = s.attributes.position.count * p, h = 1;
1608
1608
  m > t.maxTextureSize && (h = Math.ceil(m / t.maxTextureSize), m = t.maxTextureSize);
1609
1609
  let g = new Float32Array(m * h * 4 * d), _ = new i(g, m, h, d);
1610
- _.type = z, _.needsUpdate = !0;
1610
+ _.type = B, _.needsUpdate = !0;
1611
1611
  let v = p * 4;
1612
1612
  for (let t = 0; t < d; t++) {
1613
1613
  let r = c[t], i = l[t], s = u[t], d = m * h * 4 * t;
@@ -1619,7 +1619,7 @@ function mt(e, t, n) {
1619
1619
  f = {
1620
1620
  count: d,
1621
1621
  texture: _,
1622
- size: new je(m, h)
1622
+ size: new A(m, h)
1623
1623
  }, r.set(s, f);
1624
1624
  function y() {
1625
1625
  _.dispose(), r.delete(s), s.removeEventListener("dispose", y);
@@ -1669,17 +1669,17 @@ var gt = {
1669
1669
  5: "CUSTOM_TONE_MAPPING"
1670
1670
  };
1671
1671
  function _t(e, t, n, r, i) {
1672
- let a = new u(t, n, {
1672
+ let a = new l(t, n, {
1673
1673
  type: e,
1674
1674
  depthBuffer: r,
1675
1675
  stencilBuffer: i,
1676
- depthTexture: r ? new ie(t, n) : void 0
1677
- }), o = new u(t, n, {
1678
- type: he,
1676
+ depthTexture: r ? new re(t, n) : void 0
1677
+ }), o = new l(t, n, {
1678
+ type: pe,
1679
1679
  depthBuffer: !1,
1680
1680
  stencilBuffer: !1
1681
- }), s = new pe();
1682
- s.setAttribute("position", new Ee([
1681
+ }), s = new fe();
1682
+ s.setAttribute("position", new De([
1683
1683
  -1,
1684
1684
  3,
1685
1685
  0,
@@ -1689,7 +1689,7 @@ function _t(e, t, n, r, i) {
1689
1689
  3,
1690
1690
  -1,
1691
1691
  0
1692
- ], 3)), s.setAttribute("uv", new Ee([
1692
+ ], 3)), s.setAttribute("uv", new De([
1693
1693
  0,
1694
1694
  2,
1695
1695
  0,
@@ -1697,13 +1697,13 @@ function _t(e, t, n, r, i) {
1697
1697
  2,
1698
1698
  0
1699
1699
  ], 2));
1700
- let c = new j({
1700
+ let c = new M({
1701
1701
  uniforms: { tDiffuse: { value: null } },
1702
1702
  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 vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",
1703
1703
  fragmentShader: "\n precision highp float;\n\n uniform sampler2D tDiffuse;\n\n varying vec2 vUv;\n\n #include <tonemapping_pars_fragment>\n #include <colorspace_pars_fragment>\n\n void main() {\n gl_FragColor = texture2D( tDiffuse, vUv );\n\n #ifdef LINEAR_TONE_MAPPING\n gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );\n #elif defined( REINHARD_TONE_MAPPING )\n gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );\n #elif defined( CINEON_TONE_MAPPING )\n gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );\n #elif defined( ACES_FILMIC_TONE_MAPPING )\n gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );\n #elif defined( AGX_TONE_MAPPING )\n gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );\n #elif defined( NEUTRAL_TONE_MAPPING )\n gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );\n #elif defined( CUSTOM_TONE_MAPPING )\n gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );\n #endif\n\n #ifdef SRGB_TRANSFER\n gl_FragColor = sRGBTransferOETF( gl_FragColor );\n #endif\n }",
1704
1704
  depthTest: !1,
1705
1705
  depthWrite: !1
1706
- }), f = new R(s, c), p = new d(-1, 1, 1, -1, 0, 1), m = null, h = null, g = !1, _, v = null, y = [], b = !1;
1706
+ }), d = new z(s, c), p = new f(-1, 1, 1, -1, 0, 1), m = null, h = null, g = !1, _, v = null, y = [], b = !1;
1707
1707
  this.setSize = function(e, t) {
1708
1708
  a.setSize(e, t), o.setSize(e, t);
1709
1709
  for (let n = 0; n < y.length; n++) {
@@ -1737,18 +1737,18 @@ function _t(e, t, n, r, i) {
1737
1737
  }
1738
1738
  }
1739
1739
  if (m !== e.outputColorSpace || h !== e.toneMapping) {
1740
- m = e.outputColorSpace, h = e.toneMapping, c.defines = {}, l.getTransfer(m) === "srgb" && (c.defines.SRGB_TRANSFER = "");
1740
+ m = e.outputColorSpace, h = e.toneMapping, c.defines = {}, u.getTransfer(m) === "srgb" && (c.defines.SRGB_TRANSFER = "");
1741
1741
  let t = gt[h];
1742
1742
  t && (c.defines[t] = ""), c.needsUpdate = !0;
1743
1743
  }
1744
- c.uniforms.tDiffuse.value = n.texture, e.setRenderTarget(v), e.render(f, p), v = null, g = !1;
1744
+ c.uniforms.tDiffuse.value = n.texture, e.setRenderTarget(v), e.render(d, p), v = null, g = !1;
1745
1745
  }, this.isCompositing = function() {
1746
1746
  return g;
1747
1747
  }, this.dispose = function() {
1748
1748
  a.depthTexture && a.depthTexture.dispose(), a.dispose(), o.dispose(), s.dispose(), c.dispose();
1749
1749
  };
1750
1750
  }
1751
- var vt = /* @__PURE__ */ new be(), yt = /* @__PURE__ */ new ie(1, 1), bt = /* @__PURE__ */ new i(), xt = /* @__PURE__ */ new W(), St = /* @__PURE__ */ new y(), Ct = [], wt = [], Tt = new Float32Array(16), Et = new Float32Array(9), Dt = new Float32Array(4);
1751
+ var vt = /* @__PURE__ */ new be(), yt = /* @__PURE__ */ new re(1, 1), bt = /* @__PURE__ */ new i(), xt = /* @__PURE__ */ new W(), St = /* @__PURE__ */ new S(), Ct = [], wt = [], Tt = new Float32Array(16), Et = new Float32Array(9), Dt = new Float32Array(4);
1752
1752
  function Ot(e, t, n) {
1753
1753
  let r = e[0];
1754
1754
  if (r <= 0 || r > 0) return e;
@@ -2141,14 +2141,14 @@ function Dn(e, t) {
2141
2141
  }
2142
2142
  return r.join("\n");
2143
2143
  }
2144
- var On = /* @__PURE__ */ new V();
2144
+ var On = /* @__PURE__ */ new H();
2145
2145
  function kn(t) {
2146
- l._getMatrix(On, l.workingColorSpace, t);
2146
+ u._getMatrix(On, u.workingColorSpace, t);
2147
2147
  let n = `mat3( ${On.elements.map((e) => e.toFixed(4))} )`;
2148
- switch (l.getTransfer(t)) {
2148
+ switch (u.getTransfer(t)) {
2149
2149
  case e: return [n, "LinearTransferOETF"];
2150
- case ne: return [n, "sRGBTransferOETF"];
2151
- default: return M("WebGLProgram: Unsupported color space: ", t), [n, "LinearTransferOETF"];
2150
+ case I: return [n, "sRGBTransferOETF"];
2151
+ default: return L("WebGLProgram: Unsupported color space: ", t), [n, "LinearTransferOETF"];
2152
2152
  }
2153
2153
  }
2154
2154
  function An(e, t, n) {
@@ -2179,11 +2179,11 @@ var Mn = {
2179
2179
  };
2180
2180
  function Nn(e, t) {
2181
2181
  let n = Mn[t];
2182
- return n === void 0 ? (M("WebGLProgram: Unsupported toneMapping:", t), "vec3 " + e + "( vec3 color ) { return LinearToneMapping( color ); }") : "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }";
2182
+ return n === void 0 ? (L("WebGLProgram: Unsupported toneMapping:", t), "vec3 " + e + "( vec3 color ) { return LinearToneMapping( color ); }") : "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }";
2183
2183
  }
2184
- var Pn = /* @__PURE__ */ new k();
2184
+ var Pn = /* @__PURE__ */ new s();
2185
2185
  function Fn() {
2186
- return l.getLuminanceCoefficients(Pn), [
2186
+ return u.getLuminanceCoefficients(Pn), [
2187
2187
  "float luminance( const in vec3 rgb ) {",
2188
2188
  ` const vec3 weights = vec3( ${Pn.x.toFixed(4)}, ${Pn.y.toFixed(4)}, ${Pn.z.toFixed(4)} );`,
2189
2189
  " return dot( weights, rgb );",
@@ -2232,7 +2232,7 @@ function Gn(e, t) {
2232
2232
  let n = G[t];
2233
2233
  if (n === void 0) {
2234
2234
  let e = Wn.get(t);
2235
- if (e !== void 0) n = G[e], M("WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.", t, e);
2235
+ if (e !== void 0) n = G[e], L("WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.", t, e);
2236
2236
  else throw Error("Can not resolve #include <" + t + ">");
2237
2237
  }
2238
2238
  return Un(n);
@@ -2305,20 +2305,20 @@ function ir(e) {
2305
2305
  };
2306
2306
  }
2307
2307
  function ar(e, t, n, r) {
2308
- let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = Zn(n), l = $n(n), u = tr(n), d = rr(n), p = ir(n), m = In(n), h = Ln(a), g = i.createProgram(), _, v, y = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
2309
- n.isRawShaderMaterial ? (_ = [
2308
+ let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = Zn(n), l = $n(n), u = tr(n), d = rr(n), f = ir(n), p = In(n), m = Ln(a), h = i.createProgram(), g, v, y = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
2309
+ n.isRawShaderMaterial ? (g = [
2310
2310
  "#define SHADER_TYPE " + n.shaderType,
2311
2311
  "#define SHADER_NAME " + n.shaderName,
2312
- h
2313
- ].filter(zn).join("\n"), _.length > 0 && (_ += "\n"), v = [
2312
+ m
2313
+ ].filter(zn).join("\n"), g.length > 0 && (g += "\n"), v = [
2314
2314
  "#define SHADER_TYPE " + n.shaderType,
2315
2315
  "#define SHADER_NAME " + n.shaderName,
2316
- h
2317
- ].filter(zn).join("\n"), v.length > 0 && (v += "\n")) : (_ = [
2316
+ m
2317
+ ].filter(zn).join("\n"), v.length > 0 && (v += "\n")) : (g = [
2318
2318
  Yn(n),
2319
2319
  "#define SHADER_TYPE " + n.shaderType,
2320
2320
  "#define SHADER_NAME " + n.shaderName,
2321
- h,
2321
+ m,
2322
2322
  n.extensionClipCullDistance ? "#define USE_CLIP_DISTANCE" : "",
2323
2323
  n.batching ? "#define USE_BATCHING" : "",
2324
2324
  n.batchingColor ? "#define USE_BATCHING_COLOR" : "",
@@ -2448,7 +2448,7 @@ function ar(e, t, n, r) {
2448
2448
  Yn(n),
2449
2449
  "#define SHADER_TYPE " + n.shaderType,
2450
2450
  "#define SHADER_NAME " + n.shaderName,
2451
- h,
2451
+ m,
2452
2452
  n.useFog && n.fog ? "#define USE_FOG" : "",
2453
2453
  n.useFog && n.fogExp2 ? "#define FOG_EXP2" : "",
2454
2454
  n.alphaToCoverage ? "#define ALPHA_TO_COVERAGE" : "",
@@ -2458,9 +2458,9 @@ function ar(e, t, n, r) {
2458
2458
  n.envMap ? "#define " + l : "",
2459
2459
  n.envMap ? "#define " + u : "",
2460
2460
  n.envMap ? "#define " + d : "",
2461
- p ? "#define CUBEUV_TEXEL_WIDTH " + p.texelWidth : "",
2462
- p ? "#define CUBEUV_TEXEL_HEIGHT " + p.texelHeight : "",
2463
- p ? "#define CUBEUV_MAX_MIP " + p.maxMip + ".0" : "",
2461
+ f ? "#define CUBEUV_TEXEL_WIDTH " + f.texelWidth : "",
2462
+ f ? "#define CUBEUV_TEXEL_HEIGHT " + f.texelHeight : "",
2463
+ f ? "#define CUBEUV_MAX_MIP " + f.maxMip + ".0" : "",
2464
2464
  n.lightMap ? "#define USE_LIGHTMAP" : "",
2465
2465
  n.aoMap ? "#define USE_AOMAP" : "",
2466
2466
  n.bumpMap ? "#define USE_BUMPMAP" : "",
@@ -2526,12 +2526,12 @@ function ar(e, t, n, r) {
2526
2526
  Fn(),
2527
2527
  n.useDepthPacking ? "#define DEPTH_PACKING " + n.depthPacking : "",
2528
2528
  "\n"
2529
- ].filter(zn).join("\n")), o = Un(o), o = Bn(o, n), o = Vn(o, n), s = Un(s), s = Bn(s, n), s = Vn(s, n), o = qn(o), s = qn(s), n.isRawShaderMaterial !== !0 && (y = "#version 300 es\n", _ = [
2530
- m,
2529
+ ].filter(zn).join("\n")), o = Un(o), o = Bn(o, n), o = Vn(o, n), s = Un(s), s = Bn(s, n), s = Vn(s, n), o = qn(o), s = qn(s), n.isRawShaderMaterial !== !0 && (y = "#version 300 es\n", g = [
2530
+ p,
2531
2531
  "#define attribute in",
2532
2532
  "#define varying out",
2533
2533
  "#define texture2D texture"
2534
- ].join("\n") + "\n" + _, v = [
2534
+ ].join("\n") + "\n" + g, v = [
2535
2535
  "#define varying in",
2536
2536
  n.glslVersion === "300 es" ? "" : "layout(location = 0) out highp vec4 pc_fragColor;",
2537
2537
  n.glslVersion === "300 es" ? "" : "#define gl_FragColor pc_fragColor",
@@ -2546,23 +2546,23 @@ function ar(e, t, n, r) {
2546
2546
  "#define texture2DProjGradEXT textureProjGrad",
2547
2547
  "#define textureCubeGradEXT textureGrad"
2548
2548
  ].join("\n") + "\n" + v);
2549
- let b = y + _ + o, x = y + v + s, S = wn(i, i.VERTEX_SHADER, b), C = wn(i, i.FRAGMENT_SHADER, x);
2550
- i.attachShader(g, S), i.attachShader(g, C), n.index0AttributeName === void 0 ? n.morphTargets === !0 && i.bindAttribLocation(g, 0, "position") : i.bindAttribLocation(g, 0, n.index0AttributeName), i.linkProgram(g);
2549
+ let b = y + g + o, x = y + v + s, S = wn(i, i.VERTEX_SHADER, b), C = wn(i, i.FRAGMENT_SHADER, x);
2550
+ i.attachShader(h, S), i.attachShader(h, C), n.index0AttributeName === void 0 ? n.morphTargets === !0 && i.bindAttribLocation(h, 0, "position") : i.bindAttribLocation(h, 0, n.index0AttributeName), i.linkProgram(h);
2551
2551
  function w(t) {
2552
2552
  if (e.debug.checkShaderErrors) {
2553
- let n = i.getProgramInfoLog(g) || "", r = i.getShaderInfoLog(S) || "", a = i.getShaderInfoLog(C) || "", o = n.trim(), s = r.trim(), c = a.trim(), l = !0, u = !0;
2554
- if (i.getProgramParameter(g, i.LINK_STATUS) === !1) if (l = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i, g, S, C);
2553
+ let n = i.getProgramInfoLog(h) || "", r = i.getShaderInfoLog(S) || "", a = i.getShaderInfoLog(C) || "", o = n.trim(), s = r.trim(), c = a.trim(), l = !0, u = !0;
2554
+ if (i.getProgramParameter(h, i.LINK_STATUS) === !1) if (l = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i, h, S, C);
2555
2555
  else {
2556
2556
  let e = An(i, S, "vertex"), n = An(i, C, "fragment");
2557
- f("THREE.WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(g, i.VALIDATE_STATUS) + "\n\nMaterial Name: " + t.name + "\nMaterial Type: " + t.type + "\n\nProgram Info Log: " + o + "\n" + e + "\n" + n);
2557
+ _("THREE.WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(h, i.VALIDATE_STATUS) + "\n\nMaterial Name: " + t.name + "\nMaterial Type: " + t.type + "\n\nProgram Info Log: " + o + "\n" + e + "\n" + n);
2558
2558
  }
2559
- else o === "" ? (s === "" || c === "") && (u = !1) : M("WebGLProgram: Program Info Log:", o);
2559
+ else o === "" ? (s === "" || c === "") && (u = !1) : L("WebGLProgram: Program Info Log:", o);
2560
2560
  u && (t.diagnostics = {
2561
2561
  runnable: l,
2562
2562
  programLog: o,
2563
2563
  vertexShader: {
2564
2564
  log: s,
2565
- prefix: _
2565
+ prefix: g
2566
2566
  },
2567
2567
  fragmentShader: {
2568
2568
  log: c,
@@ -2570,7 +2570,7 @@ function ar(e, t, n, r) {
2570
2570
  }
2571
2571
  });
2572
2572
  }
2573
- i.deleteShader(S), i.deleteShader(C), T = new Cn(i, g), E = Rn(i, g);
2573
+ i.deleteShader(S), i.deleteShader(C), T = new Cn(i, h), E = Rn(i, h);
2574
2574
  }
2575
2575
  let T;
2576
2576
  this.getUniforms = function() {
@@ -2582,10 +2582,10 @@ function ar(e, t, n, r) {
2582
2582
  };
2583
2583
  let D = n.rendererExtensionParallelShaderCompile === !1;
2584
2584
  return this.isReady = function() {
2585
- return D === !1 && (D = i.getProgramParameter(g, Tn)), D;
2585
+ return D === !1 && (D = i.getProgramParameter(h, Tn)), D;
2586
2586
  }, this.destroy = function() {
2587
- r.releaseStatesOfProgram(this), i.deleteProgram(g), this.program = void 0;
2588
- }, this.type = n.shaderType, this.name = n.shaderName, this.id = En++, this.cacheKey = t, this.usedTimes = 1, this.program = g, this.vertexShader = S, this.fragmentShader = C, this;
2587
+ r.releaseStatesOfProgram(this), i.deleteProgram(h), this.program = void 0;
2588
+ }, this.type = n.shaderType, this.name = n.shaderName, this.id = En++, this.cacheKey = t, this.usedTimes = 1, this.program = h, this.vertexShader = S, this.fragmentShader = C, this;
2589
2589
  }
2590
2590
  var or = 0, sr = class {
2591
2591
  constructor() {
@@ -2626,7 +2626,7 @@ function lr(e) {
2626
2626
  return e === 1030 || e === 37490 || e === 36285;
2627
2627
  }
2628
2628
  function ur(e, t, n, r, i, a) {
2629
- let o = new h(), s = new sr(), c = /* @__PURE__ */ new Set(), u = [], d = /* @__PURE__ */ new Map(), f = r.logarithmicDepthBuffer, p = r.precision, m = {
2629
+ let o = new v(), s = new sr(), c = /* @__PURE__ */ new Set(), l = [], d = /* @__PURE__ */ new Map(), f = r.logarithmicDepthBuffer, p = r.precision, m = {
2630
2630
  MeshDepthMaterial: "depth",
2631
2631
  MeshDistanceMaterial: "distance",
2632
2632
  MeshNormalMaterial: "normal",
@@ -2643,20 +2643,20 @@ function ur(e, t, n, r, i, a) {
2643
2643
  ShadowMaterial: "shadow",
2644
2644
  SpriteMaterial: "sprite"
2645
2645
  };
2646
- function g(e) {
2646
+ function h(e) {
2647
2647
  return c.add(e), e === 0 ? "uv" : `uv${e}`;
2648
2648
  }
2649
- function _(i, o, u, d, h, _) {
2650
- let v = d.fog, y = h.geometry, b = i.isMeshStandardMaterial || i.isMeshLambertMaterial || i.isMeshPhongMaterial ? d.environment : null, x = i.isMeshStandardMaterial || i.isMeshLambertMaterial && !i.envMap || i.isMeshPhongMaterial && !i.envMap, S = t.get(i.envMap || b, x), C = S && S.mapping === 306 ? S.image.height : null, w = m[i.type];
2651
- i.precision !== null && (p = r.getMaxPrecision(i.precision), p !== i.precision && M("WebGLProgram.getParameters:", i.precision, "not supported, using", p, "instead."));
2649
+ function g(i, o, l, d, g, _) {
2650
+ let v = d.fog, y = g.geometry, b = i.isMeshStandardMaterial || i.isMeshLambertMaterial || i.isMeshPhongMaterial ? d.environment : null, x = i.isMeshStandardMaterial || i.isMeshLambertMaterial && !i.envMap || i.isMeshPhongMaterial && !i.envMap, S = t.get(i.envMap || b, x), C = S && S.mapping === 306 ? S.image.height : null, w = m[i.type];
2651
+ i.precision !== null && (p = r.getMaxPrecision(i.precision), p !== i.precision && L("WebGLProgram.getParameters:", i.precision, "not supported, using", p, "instead."));
2652
2652
  let T = y.morphAttributes.position || y.morphAttributes.normal || y.morphAttributes.color, E = T === void 0 ? 0 : T.length, D = 0;
2653
2653
  y.morphAttributes.position !== void 0 && (D = 1), y.morphAttributes.normal !== void 0 && (D = 2), y.morphAttributes.color !== void 0 && (D = 3);
2654
- let O, k, A, ee;
2654
+ let O, k, ee, A;
2655
2655
  if (w) {
2656
2656
  let e = q[w];
2657
2657
  O = e.vertexShader, k = e.fragmentShader;
2658
- } else O = i.vertexShader, k = i.fragmentShader, s.update(i), A = s.getVertexShaderID(i), ee = s.getFragmentShaderID(i);
2659
- let j = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), P = h.isInstancedMesh === !0, te = h.isBatchedMesh === !0, F = !!i.map, ne = !!i.matcap, I = !!S, re = !!i.aoMap, ie = !!i.lightMap, ae = !!i.bumpMap, oe = !!i.normalMap, L = !!i.displacementMap, se = !!i.emissiveMap, ce = !!i.metalnessMap, R = !!i.roughnessMap, z = i.anisotropy > 0, le = i.clearcoat > 0, ue = i.dispersion > 0, de = i.iridescence > 0, fe = i.sheen > 0, pe = i.transmission > 0, me = z && !!i.anisotropyMap, he = le && !!i.clearcoatMap, ge = le && !!i.clearcoatNormalMap, _e = le && !!i.clearcoatRoughnessMap, B = de && !!i.iridescenceMap, ve = de && !!i.iridescenceThicknessMap, ye = fe && !!i.sheenColorMap, be = fe && !!i.sheenRoughnessMap, V = !!i.specularMap, xe = !!i.specularColorMap, Se = !!i.specularIntensityMap, Ce = pe && !!i.transmissionMap, H = pe && !!i.thicknessMap, we = !!i.gradientMap, Te = !!i.alphaMap, Ee = i.alphaTest > 0, De = !!i.alphaHash, Oe = !!i.extensions, ke = 0;
2658
+ } else O = i.vertexShader, k = i.fragmentShader, s.update(i), ee = s.getVertexShaderID(i), A = s.getFragmentShaderID(i);
2659
+ let j = e.getRenderTarget(), M = e.state.buffers.depth.getReversed(), N = g.isInstancedMesh === !0, P = g.isBatchedMesh === !0, F = !!i.map, te = !!i.matcap, I = !!S, ne = !!i.aoMap, re = !!i.lightMap, ie = !!i.bumpMap, R = !!i.normalMap, ae = !!i.displacementMap, oe = !!i.emissiveMap, z = !!i.metalnessMap, B = !!i.roughnessMap, se = i.anisotropy > 0, ce = i.clearcoat > 0, le = i.dispersion > 0, ue = i.iridescence > 0, de = i.sheen > 0, fe = i.transmission > 0, pe = se && !!i.anisotropyMap, me = ce && !!i.clearcoatMap, he = ce && !!i.clearcoatNormalMap, V = ce && !!i.clearcoatRoughnessMap, ge = ue && !!i.iridescenceMap, _e = ue && !!i.iridescenceThicknessMap, ve = de && !!i.sheenColorMap, ye = de && !!i.sheenRoughnessMap, be = !!i.specularMap, H = !!i.specularColorMap, xe = !!i.specularIntensityMap, Se = fe && !!i.transmissionMap, Ce = fe && !!i.thicknessMap, we = !!i.gradientMap, Te = !!i.alphaMap, Ee = i.alphaTest > 0, De = !!i.alphaHash, Oe = !!i.extensions, ke = 0;
2660
2660
  i.toneMapped && (j === null || j.isXRRenderTarget === !0) && (ke = e.toneMapping);
2661
2661
  let U = {
2662
2662
  shaderID: w,
@@ -2665,95 +2665,95 @@ function ur(e, t, n, r, i, a) {
2665
2665
  vertexShader: O,
2666
2666
  fragmentShader: k,
2667
2667
  defines: i.defines,
2668
- customVertexShaderID: A,
2669
- customFragmentShaderID: ee,
2668
+ customVertexShaderID: ee,
2669
+ customFragmentShaderID: A,
2670
2670
  isRawShaderMaterial: i.isRawShaderMaterial === !0,
2671
2671
  glslVersion: i.glslVersion,
2672
2672
  precision: p,
2673
- batching: te,
2674
- batchingColor: te && h._colorsTexture !== null,
2675
- instancing: P,
2676
- instancingColor: P && h.instanceColor !== null,
2677
- instancingMorph: P && h.morphTexture !== null,
2678
- outputColorSpace: j === null ? e.outputColorSpace : j.isXRRenderTarget === !0 ? j.texture.colorSpace : l.workingColorSpace,
2673
+ batching: P,
2674
+ batchingColor: P && g._colorsTexture !== null,
2675
+ instancing: N,
2676
+ instancingColor: N && g.instanceColor !== null,
2677
+ instancingMorph: N && g.morphTexture !== null,
2678
+ outputColorSpace: j === null ? e.outputColorSpace : j.isXRRenderTarget === !0 ? j.texture.colorSpace : u.workingColorSpace,
2679
2679
  alphaToCoverage: !!i.alphaToCoverage,
2680
2680
  map: F,
2681
- matcap: ne,
2681
+ matcap: te,
2682
2682
  envMap: I,
2683
2683
  envMapMode: I && S.mapping,
2684
2684
  envMapCubeUVHeight: C,
2685
- aoMap: re,
2686
- lightMap: ie,
2687
- bumpMap: ae,
2688
- normalMap: oe,
2689
- displacementMap: L,
2690
- emissiveMap: se,
2691
- normalMapObjectSpace: oe && i.normalMapType === 1,
2692
- normalMapTangentSpace: oe && i.normalMapType === 0,
2693
- packedNormalMap: oe && i.normalMapType === 0 && lr(i.normalMap.format),
2694
- metalnessMap: ce,
2695
- roughnessMap: R,
2696
- anisotropy: z,
2697
- anisotropyMap: me,
2698
- clearcoat: le,
2699
- clearcoatMap: he,
2700
- clearcoatNormalMap: ge,
2701
- clearcoatRoughnessMap: _e,
2702
- dispersion: ue,
2703
- iridescence: de,
2704
- iridescenceMap: B,
2705
- iridescenceThicknessMap: ve,
2706
- sheen: fe,
2707
- sheenColorMap: ye,
2708
- sheenRoughnessMap: be,
2709
- specularMap: V,
2710
- specularColorMap: xe,
2711
- specularIntensityMap: Se,
2712
- transmission: pe,
2713
- transmissionMap: Ce,
2714
- thicknessMap: H,
2685
+ aoMap: ne,
2686
+ lightMap: re,
2687
+ bumpMap: ie,
2688
+ normalMap: R,
2689
+ displacementMap: ae,
2690
+ emissiveMap: oe,
2691
+ normalMapObjectSpace: R && i.normalMapType === 1,
2692
+ normalMapTangentSpace: R && i.normalMapType === 0,
2693
+ packedNormalMap: R && i.normalMapType === 0 && lr(i.normalMap.format),
2694
+ metalnessMap: z,
2695
+ roughnessMap: B,
2696
+ anisotropy: se,
2697
+ anisotropyMap: pe,
2698
+ clearcoat: ce,
2699
+ clearcoatMap: me,
2700
+ clearcoatNormalMap: he,
2701
+ clearcoatRoughnessMap: V,
2702
+ dispersion: le,
2703
+ iridescence: ue,
2704
+ iridescenceMap: ge,
2705
+ iridescenceThicknessMap: _e,
2706
+ sheen: de,
2707
+ sheenColorMap: ve,
2708
+ sheenRoughnessMap: ye,
2709
+ specularMap: be,
2710
+ specularColorMap: H,
2711
+ specularIntensityMap: xe,
2712
+ transmission: fe,
2713
+ transmissionMap: Se,
2714
+ thicknessMap: Ce,
2715
2715
  gradientMap: we,
2716
2716
  opaque: i.transparent === !1 && i.blending === 1 && i.alphaToCoverage === !1,
2717
2717
  alphaMap: Te,
2718
2718
  alphaTest: Ee,
2719
2719
  alphaHash: De,
2720
2720
  combine: i.combine,
2721
- mapUv: F && g(i.map.channel),
2722
- aoMapUv: re && g(i.aoMap.channel),
2723
- lightMapUv: ie && g(i.lightMap.channel),
2724
- bumpMapUv: ae && g(i.bumpMap.channel),
2725
- normalMapUv: oe && g(i.normalMap.channel),
2726
- displacementMapUv: L && g(i.displacementMap.channel),
2727
- emissiveMapUv: se && g(i.emissiveMap.channel),
2728
- metalnessMapUv: ce && g(i.metalnessMap.channel),
2729
- roughnessMapUv: R && g(i.roughnessMap.channel),
2730
- anisotropyMapUv: me && g(i.anisotropyMap.channel),
2731
- clearcoatMapUv: he && g(i.clearcoatMap.channel),
2732
- clearcoatNormalMapUv: ge && g(i.clearcoatNormalMap.channel),
2733
- clearcoatRoughnessMapUv: _e && g(i.clearcoatRoughnessMap.channel),
2734
- iridescenceMapUv: B && g(i.iridescenceMap.channel),
2735
- iridescenceThicknessMapUv: ve && g(i.iridescenceThicknessMap.channel),
2736
- sheenColorMapUv: ye && g(i.sheenColorMap.channel),
2737
- sheenRoughnessMapUv: be && g(i.sheenRoughnessMap.channel),
2738
- specularMapUv: V && g(i.specularMap.channel),
2739
- specularColorMapUv: xe && g(i.specularColorMap.channel),
2740
- specularIntensityMapUv: Se && g(i.specularIntensityMap.channel),
2741
- transmissionMapUv: Ce && g(i.transmissionMap.channel),
2742
- thicknessMapUv: H && g(i.thicknessMap.channel),
2743
- alphaMapUv: Te && g(i.alphaMap.channel),
2744
- vertexTangents: !!y.attributes.tangent && (oe || z),
2721
+ mapUv: F && h(i.map.channel),
2722
+ aoMapUv: ne && h(i.aoMap.channel),
2723
+ lightMapUv: re && h(i.lightMap.channel),
2724
+ bumpMapUv: ie && h(i.bumpMap.channel),
2725
+ normalMapUv: R && h(i.normalMap.channel),
2726
+ displacementMapUv: ae && h(i.displacementMap.channel),
2727
+ emissiveMapUv: oe && h(i.emissiveMap.channel),
2728
+ metalnessMapUv: z && h(i.metalnessMap.channel),
2729
+ roughnessMapUv: B && h(i.roughnessMap.channel),
2730
+ anisotropyMapUv: pe && h(i.anisotropyMap.channel),
2731
+ clearcoatMapUv: me && h(i.clearcoatMap.channel),
2732
+ clearcoatNormalMapUv: he && h(i.clearcoatNormalMap.channel),
2733
+ clearcoatRoughnessMapUv: V && h(i.clearcoatRoughnessMap.channel),
2734
+ iridescenceMapUv: ge && h(i.iridescenceMap.channel),
2735
+ iridescenceThicknessMapUv: _e && h(i.iridescenceThicknessMap.channel),
2736
+ sheenColorMapUv: ve && h(i.sheenColorMap.channel),
2737
+ sheenRoughnessMapUv: ye && h(i.sheenRoughnessMap.channel),
2738
+ specularMapUv: be && h(i.specularMap.channel),
2739
+ specularColorMapUv: H && h(i.specularColorMap.channel),
2740
+ specularIntensityMapUv: xe && h(i.specularIntensityMap.channel),
2741
+ transmissionMapUv: Se && h(i.transmissionMap.channel),
2742
+ thicknessMapUv: Ce && h(i.thicknessMap.channel),
2743
+ alphaMapUv: Te && h(i.alphaMap.channel),
2744
+ vertexTangents: !!y.attributes.tangent && (R || se),
2745
2745
  vertexNormals: !!y.attributes.normal,
2746
2746
  vertexColors: i.vertexColors,
2747
2747
  vertexAlphas: i.vertexColors === !0 && !!y.attributes.color && y.attributes.color.itemSize === 4,
2748
- pointsUvs: h.isPoints === !0 && !!y.attributes.uv && (F || Te),
2748
+ pointsUvs: g.isPoints === !0 && !!y.attributes.uv && (F || Te),
2749
2749
  fog: !!v,
2750
2750
  useFog: i.fog === !0,
2751
2751
  fogExp2: !!v && v.isFogExp2,
2752
- flatShading: i.wireframe === !1 && (i.flatShading === !0 || y.attributes.normal === void 0 && oe === !1 && (i.isMeshLambertMaterial || i.isMeshPhongMaterial || i.isMeshStandardMaterial || i.isMeshPhysicalMaterial)),
2752
+ flatShading: i.wireframe === !1 && (i.flatShading === !0 || y.attributes.normal === void 0 && R === !1 && (i.isMeshLambertMaterial || i.isMeshPhongMaterial || i.isMeshStandardMaterial || i.isMeshPhysicalMaterial)),
2753
2753
  sizeAttenuation: i.sizeAttenuation === !0,
2754
2754
  logarithmicDepthBuffer: f,
2755
- reversedDepthBuffer: N,
2756
- skinning: h.isSkinnedMesh === !0,
2755
+ reversedDepthBuffer: M,
2756
+ skinning: g.isSkinnedMesh === !0,
2757
2757
  morphTargets: y.morphAttributes.position !== void 0,
2758
2758
  morphNormals: y.morphAttributes.normal !== void 0,
2759
2759
  morphColors: y.morphAttributes.color !== void 0,
@@ -2774,11 +2774,11 @@ function ur(e, t, n, r, i, a) {
2774
2774
  numClippingPlanes: a.numPlanes,
2775
2775
  numClipIntersection: a.numIntersection,
2776
2776
  dithering: i.dithering,
2777
- shadowMapEnabled: e.shadowMap.enabled && u.length > 0,
2777
+ shadowMapEnabled: e.shadowMap.enabled && l.length > 0,
2778
2778
  shadowMapType: e.shadowMap.type,
2779
2779
  toneMapping: ke,
2780
- decodeVideoTexture: F && i.map.isVideoTexture === !0 && l.getTransfer(i.map.colorSpace) === "srgb",
2781
- decodeVideoTextureEmissive: se && i.emissiveMap.isVideoTexture === !0 && l.getTransfer(i.emissiveMap.colorSpace) === "srgb",
2780
+ decodeVideoTexture: F && i.map.isVideoTexture === !0 && u.getTransfer(i.map.colorSpace) === "srgb",
2781
+ decodeVideoTextureEmissive: oe && i.emissiveMap.isVideoTexture === !0 && u.getTransfer(i.emissiveMap.colorSpace) === "srgb",
2782
2782
  premultipliedAlpha: i.premultipliedAlpha,
2783
2783
  doubleSided: i.side === 2,
2784
2784
  flipSided: i.side === 1,
@@ -2786,13 +2786,13 @@ function ur(e, t, n, r, i, a) {
2786
2786
  depthPacking: i.depthPacking || 0,
2787
2787
  index0AttributeName: i.index0AttributeName,
2788
2788
  extensionClipCullDistance: Oe && i.extensions.clipCullDistance === !0 && n.has("WEBGL_clip_cull_distance"),
2789
- extensionMultiDraw: (Oe && i.extensions.multiDraw === !0 || te) && n.has("WEBGL_multi_draw"),
2789
+ extensionMultiDraw: (Oe && i.extensions.multiDraw === !0 || P) && n.has("WEBGL_multi_draw"),
2790
2790
  rendererExtensionParallelShaderCompile: n.has("KHR_parallel_shader_compile"),
2791
2791
  customProgramCacheKey: i.customProgramCacheKey()
2792
2792
  };
2793
2793
  return U.vertexUv1s = c.has(1), U.vertexUv2s = c.has(2), U.vertexUv3s = c.has(3), c.clear(), U;
2794
2794
  }
2795
- function v(t) {
2795
+ function _(t) {
2796
2796
  let n = [];
2797
2797
  if (t.shaderID ? n.push(t.shaderID) : (n.push(t.customVertexShaderID), n.push(t.customFragmentShaderID)), t.defines !== void 0) for (let e in t.defines) n.push(e), n.push(t.defines[e]);
2798
2798
  return t.isRawShaderMaterial === !1 && (y(n, t), b(n, t), n.push(e.outputColorSpace)), n.push(t.customProgramCacheKey), n.join();
@@ -2807,18 +2807,18 @@ function ur(e, t, n, r, i, a) {
2807
2807
  let t = m[e.type], n;
2808
2808
  if (t) {
2809
2809
  let e = q[t];
2810
- n = fe.clone(e.uniforms);
2810
+ n = Se.clone(e.uniforms);
2811
2811
  } else n = e.uniforms;
2812
2812
  return n;
2813
2813
  }
2814
2814
  function S(t, n) {
2815
2815
  let r = d.get(n);
2816
- return r === void 0 ? (r = new ar(e, n, t, i), u.push(r), d.set(n, r)) : ++r.usedTimes, r;
2816
+ return r === void 0 ? (r = new ar(e, n, t, i), l.push(r), d.set(n, r)) : ++r.usedTimes, r;
2817
2817
  }
2818
2818
  function C(e) {
2819
2819
  if (--e.usedTimes === 0) {
2820
- let t = u.indexOf(e);
2821
- u[t] = u[u.length - 1], u.pop(), d.delete(e.cacheKey), e.destroy();
2820
+ let t = l.indexOf(e);
2821
+ l[t] = l[l.length - 1], l.pop(), d.delete(e.cacheKey), e.destroy();
2822
2822
  }
2823
2823
  }
2824
2824
  function w(e) {
@@ -2828,13 +2828,13 @@ function ur(e, t, n, r, i, a) {
2828
2828
  s.dispose();
2829
2829
  }
2830
2830
  return {
2831
- getParameters: _,
2832
- getProgramCacheKey: v,
2831
+ getParameters: g,
2832
+ getProgramCacheKey: _,
2833
2833
  getUniforms: x,
2834
2834
  acquireProgram: S,
2835
2835
  releaseProgram: C,
2836
2836
  releaseShaderCache: w,
2837
- programs: u,
2837
+ programs: l,
2838
2838
  dispose: T
2839
2839
  };
2840
2840
  }
@@ -2944,14 +2944,14 @@ function gr() {
2944
2944
  switch (t.type) {
2945
2945
  case "DirectionalLight":
2946
2946
  n = {
2947
- direction: new k(),
2947
+ direction: new s(),
2948
2948
  color: new U()
2949
2949
  };
2950
2950
  break;
2951
2951
  case "SpotLight":
2952
2952
  n = {
2953
- position: new k(),
2954
- direction: new k(),
2953
+ position: new s(),
2954
+ direction: new s(),
2955
2955
  color: new U(),
2956
2956
  distance: 0,
2957
2957
  coneCos: 0,
@@ -2961,7 +2961,7 @@ function gr() {
2961
2961
  break;
2962
2962
  case "PointLight":
2963
2963
  n = {
2964
- position: new k(),
2964
+ position: new s(),
2965
2965
  color: new U(),
2966
2966
  distance: 0,
2967
2967
  decay: 0
@@ -2969,7 +2969,7 @@ function gr() {
2969
2969
  break;
2970
2970
  case "HemisphereLight":
2971
2971
  n = {
2972
- direction: new k(),
2972
+ direction: new s(),
2973
2973
  skyColor: new U(),
2974
2974
  groundColor: new U()
2975
2975
  };
@@ -2977,9 +2977,9 @@ function gr() {
2977
2977
  case "RectAreaLight":
2978
2978
  n = {
2979
2979
  color: new U(),
2980
- position: new k(),
2981
- halfWidth: new k(),
2982
- halfHeight: new k()
2980
+ position: new s(),
2981
+ halfWidth: new s(),
2982
+ halfHeight: new s()
2983
2983
  };
2984
2984
  break;
2985
2985
  }
@@ -2998,7 +2998,7 @@ function _r() {
2998
2998
  shadowBias: 0,
2999
2999
  shadowNormalBias: 0,
3000
3000
  shadowRadius: 1,
3001
- shadowMapSize: new je()
3001
+ shadowMapSize: new A()
3002
3002
  };
3003
3003
  break;
3004
3004
  case "SpotLight":
@@ -3007,7 +3007,7 @@ function _r() {
3007
3007
  shadowBias: 0,
3008
3008
  shadowNormalBias: 0,
3009
3009
  shadowRadius: 1,
3010
- shadowMapSize: new je()
3010
+ shadowMapSize: new A()
3011
3011
  };
3012
3012
  break;
3013
3013
  case "PointLight":
@@ -3016,7 +3016,7 @@ function _r() {
3016
3016
  shadowBias: 0,
3017
3017
  shadowNormalBias: 0,
3018
3018
  shadowRadius: 1,
3019
- shadowMapSize: new je(),
3019
+ shadowMapSize: new A(),
3020
3020
  shadowCameraNear: 1,
3021
3021
  shadowCameraFar: 1e3
3022
3022
  };
@@ -3070,9 +3070,9 @@ function br(e) {
3070
3070
  numSpotLightShadowsWithMaps: 0,
3071
3071
  numLightProbes: 0
3072
3072
  };
3073
- for (let e = 0; e < 9; e++) r.probe.push(new k());
3074
- let i = new k(), a = new Te(), o = new Te();
3075
- function s(i) {
3073
+ for (let e = 0; e < 9; e++) r.probe.push(new s());
3074
+ let i = new s(), a = new Ee(), o = new Ee();
3075
+ function c(i) {
3076
3076
  let a = 0, o = 0, s = 0;
3077
3077
  for (let e = 0; e < 9; e++) r.probe[e].set(0, 0, 0);
3078
3078
  let c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0;
@@ -3118,7 +3118,7 @@ function br(e) {
3118
3118
  let y = r.hash;
3119
3119
  (y.directionalLength !== c || y.pointLength !== l || y.spotLength !== u || y.rectAreaLength !== d || y.hemiLength !== f || y.numDirectionalShadows !== p || y.numPointShadows !== m || y.numSpotShadows !== h || y.numSpotMaps !== g || y.numLightProbes !== v) && (r.directional.length = c, r.spot.length = u, r.rectArea.length = d, r.point.length = l, r.hemi.length = f, r.directionalShadow.length = p, r.directionalShadowMap.length = p, r.pointShadow.length = m, r.pointShadowMap.length = m, r.spotShadow.length = h, r.spotShadowMap.length = h, r.directionalShadowMatrix.length = p, r.pointShadowMatrix.length = m, r.spotLightMatrix.length = h + g - _, r.spotLightMap.length = g, r.numSpotLightShadowsWithMaps = _, r.numLightProbes = v, y.directionalLength = c, y.pointLength = l, y.spotLength = u, y.rectAreaLength = d, y.hemiLength = f, y.numDirectionalShadows = p, y.numPointShadows = m, y.numSpotShadows = h, y.numSpotMaps = g, y.numLightProbes = v, r.version = vr++);
3120
3120
  }
3121
- function c(e, t) {
3121
+ function l(e, t) {
3122
3122
  let n = 0, s = 0, c = 0, l = 0, u = 0, d = t.matrixWorldInverse;
3123
3123
  for (let t = 0, f = e.length; t < f; t++) {
3124
3124
  let f = e[t];
@@ -3141,8 +3141,8 @@ function br(e) {
3141
3141
  }
3142
3142
  }
3143
3143
  return {
3144
- setup: s,
3145
- setupView: c,
3144
+ setup: c,
3145
+ setupView: l,
3146
3146
  state: r
3147
3147
  };
3148
3148
  }
@@ -3200,38 +3200,38 @@ function Sr(e) {
3200
3200
  };
3201
3201
  }
3202
3202
  var Cr = "void main() {\n gl_Position = vec4( position, 1.0 );\n}", wr = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}", Tr = [
3203
- /* @__PURE__ */ new k(1, 0, 0),
3204
- /* @__PURE__ */ new k(-1, 0, 0),
3205
- /* @__PURE__ */ new k(0, 1, 0),
3206
- /* @__PURE__ */ new k(0, -1, 0),
3207
- /* @__PURE__ */ new k(0, 0, 1),
3208
- /* @__PURE__ */ new k(0, 0, -1)
3203
+ /* @__PURE__ */ new s(1, 0, 0),
3204
+ /* @__PURE__ */ new s(-1, 0, 0),
3205
+ /* @__PURE__ */ new s(0, 1, 0),
3206
+ /* @__PURE__ */ new s(0, -1, 0),
3207
+ /* @__PURE__ */ new s(0, 0, 1),
3208
+ /* @__PURE__ */ new s(0, 0, -1)
3209
3209
  ], Er = [
3210
- /* @__PURE__ */ new k(0, -1, 0),
3211
- /* @__PURE__ */ new k(0, -1, 0),
3212
- /* @__PURE__ */ new k(0, 0, 1),
3213
- /* @__PURE__ */ new k(0, 0, -1),
3214
- /* @__PURE__ */ new k(0, -1, 0),
3215
- /* @__PURE__ */ new k(0, -1, 0)
3216
- ], Dr = /* @__PURE__ */ new Te(), Or = /* @__PURE__ */ new k(), kr = /* @__PURE__ */ new k();
3210
+ /* @__PURE__ */ new s(0, -1, 0),
3211
+ /* @__PURE__ */ new s(0, -1, 0),
3212
+ /* @__PURE__ */ new s(0, 0, 1),
3213
+ /* @__PURE__ */ new s(0, 0, -1),
3214
+ /* @__PURE__ */ new s(0, -1, 0),
3215
+ /* @__PURE__ */ new s(0, -1, 0)
3216
+ ], Dr = /* @__PURE__ */ new Ee(), Or = /* @__PURE__ */ new s(), kr = /* @__PURE__ */ new s();
3217
3217
  function Ar(e, t, n) {
3218
- let r = new de(), i = new je(), a = new je(), o = new s(), l = new Oe(), d = new ue(), f = {}, p = n.maxTextureSize, m = {
3218
+ let r = new le(), i = new A(), a = new A(), o = new Ae(), s = new Oe(), u = new ce(), d = {}, f = n.maxTextureSize, p = {
3219
3219
  0: 1,
3220
3220
  1: 0,
3221
3221
  2: 2
3222
- }, h = new N({
3222
+ }, m = new N({
3223
3223
  defines: { VSM_SAMPLES: 8 },
3224
3224
  uniforms: {
3225
3225
  shadow_pass: { value: null },
3226
- resolution: { value: new je() },
3226
+ resolution: { value: new A() },
3227
3227
  radius: { value: 4 }
3228
3228
  },
3229
3229
  vertexShader: Cr,
3230
3230
  fragmentShader: wr
3231
- }), g = h.clone();
3232
- g.defines.HORIZONTAL_PASS = 1;
3233
- let _ = new pe();
3234
- _.setAttribute("position", new ye(new Float32Array([
3231
+ }), h = m.clone();
3232
+ h.defines.HORIZONTAL_PASS = 1;
3233
+ let g = new fe();
3234
+ g.setAttribute("position", new ve(new Float32Array([
3235
3235
  -1,
3236
3236
  -1,
3237
3237
  .5,
@@ -3242,86 +3242,86 @@ function Ar(e, t, n) {
3242
3242
  3,
3243
3243
  .5
3244
3244
  ]), 3));
3245
- let v = new R(_, h), y = this;
3245
+ let _ = new z(g, m), v = this;
3246
3246
  this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = 1;
3247
- let b = this.type;
3247
+ let y = this.type;
3248
3248
  this.render = function(t, n, s) {
3249
- if (y.enabled === !1 || y.autoUpdate === !1 && y.needsUpdate === !1 || t.length === 0) return;
3250
- this.type === 2 && (M("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), this.type = 1);
3251
- let l = e.getRenderTarget(), d = e.getActiveCubeFace(), f = e.getActiveMipmapLevel(), m = e.state;
3249
+ if (v.enabled === !1 || v.autoUpdate === !1 && v.needsUpdate === !1 || t.length === 0) return;
3250
+ this.type === 2 && (L("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), this.type = 1);
3251
+ let u = e.getRenderTarget(), d = e.getActiveCubeFace(), p = e.getActiveMipmapLevel(), m = e.state;
3252
3252
  m.setBlending(0), m.buffers.depth.getReversed() === !0 ? m.buffers.color.setClear(0, 0, 0, 0) : m.buffers.color.setClear(1, 1, 1, 1), m.buffers.depth.setTest(!0), m.setScissorTest(!1);
3253
- let h = b !== this.type;
3253
+ let h = y !== this.type;
3254
3254
  h && n.traverse(function(e) {
3255
3255
  e.material && (Array.isArray(e.material) ? e.material.forEach((e) => e.needsUpdate = !0) : e.material.needsUpdate = !0);
3256
3256
  });
3257
- for (let l = 0, d = t.length; l < d; l++) {
3258
- let d = t[l], f = d.shadow;
3259
- if (f === void 0) {
3260
- M("WebGLShadowMap:", d, "has no shadow.");
3257
+ for (let u = 0, d = t.length; u < d; u++) {
3258
+ let d = t[u], p = d.shadow;
3259
+ if (p === void 0) {
3260
+ L("WebGLShadowMap:", d, "has no shadow.");
3261
3261
  continue;
3262
3262
  }
3263
- if (f.autoUpdate === !1 && f.needsUpdate === !1) continue;
3264
- i.copy(f.mapSize);
3265
- let g = f.getFrameExtents();
3266
- i.multiply(g), a.copy(f.mapSize), (i.x > p || i.y > p) && (i.x > p && (a.x = Math.floor(p / g.x), i.x = a.x * g.x, f.mapSize.x = a.x), i.y > p && (a.y = Math.floor(p / g.y), i.y = a.y * g.y, f.mapSize.y = a.y));
3263
+ if (p.autoUpdate === !1 && p.needsUpdate === !1) continue;
3264
+ i.copy(p.mapSize);
3265
+ let g = p.getFrameExtents();
3266
+ i.multiply(g), a.copy(p.mapSize), (i.x > f || i.y > f) && (i.x > f && (a.x = Math.floor(f / g.x), i.x = a.x * g.x, p.mapSize.x = a.x), i.y > f && (a.y = Math.floor(f / g.y), i.y = a.y * g.y, p.mapSize.y = a.y));
3267
3267
  let _ = e.state.buffers.depth.getReversed();
3268
- if (f.camera._reversedDepth = _, f.map === null || h === !0) {
3269
- if (f.map !== null && (f.map.depthTexture !== null && (f.map.depthTexture.dispose(), f.map.depthTexture = null), f.map.dispose()), this.type === 3) {
3268
+ if (p.camera._reversedDepth = _, p.map === null || h === !0) {
3269
+ if (p.map !== null && (p.map.depthTexture !== null && (p.map.depthTexture.dispose(), p.map.depthTexture = null), p.map.dispose()), this.type === 3) {
3270
3270
  if (d.isPointLight) {
3271
- M("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");
3271
+ L("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");
3272
3272
  continue;
3273
3273
  }
3274
- f.map = new u(i.x, i.y, {
3274
+ p.map = new l(i.x, i.y, {
3275
3275
  format: c,
3276
- type: he,
3277
- minFilter: H,
3278
- magFilter: H,
3276
+ type: pe,
3277
+ minFilter: we,
3278
+ magFilter: we,
3279
3279
  generateMipmaps: !1
3280
- }), f.map.texture.name = d.name + ".shadowMap", f.map.depthTexture = new ie(i.x, i.y, z), f.map.depthTexture.name = d.name + ".shadowMapDepth", f.map.depthTexture.format = Ce, f.map.depthTexture.compareFunction = null, f.map.depthTexture.minFilter = ce, f.map.depthTexture.magFilter = ce;
3281
- } else d.isPointLight ? (f.map = new ct(i.x), f.map.depthTexture = new _e(i.x, oe)) : (f.map = new u(i.x, i.y), f.map.depthTexture = new ie(i.x, i.y, oe)), f.map.depthTexture.name = d.name + ".shadowMap", f.map.depthTexture.format = Ce, this.type === 1 ? (f.map.depthTexture.compareFunction = _ ? 518 : 515, f.map.depthTexture.minFilter = H, f.map.depthTexture.magFilter = H) : (f.map.depthTexture.compareFunction = null, f.map.depthTexture.minFilter = ce, f.map.depthTexture.magFilter = ce);
3282
- f.camera.updateProjectionMatrix();
3280
+ }), p.map.texture.name = d.name + ".shadowMap", p.map.depthTexture = new re(i.x, i.y, B), p.map.depthTexture.name = d.name + ".shadowMapDepth", p.map.depthTexture.format = Ce, p.map.depthTexture.compareFunction = null, p.map.depthTexture.minFilter = oe, p.map.depthTexture.magFilter = oe;
3281
+ } else d.isPointLight ? (p.map = new ct(i.x), p.map.depthTexture = new he(i.x, ke)) : (p.map = new l(i.x, i.y), p.map.depthTexture = new re(i.x, i.y, ke)), p.map.depthTexture.name = d.name + ".shadowMap", p.map.depthTexture.format = Ce, this.type === 1 ? (p.map.depthTexture.compareFunction = _ ? 518 : 515, p.map.depthTexture.minFilter = we, p.map.depthTexture.magFilter = we) : (p.map.depthTexture.compareFunction = null, p.map.depthTexture.minFilter = oe, p.map.depthTexture.magFilter = oe);
3282
+ p.camera.updateProjectionMatrix();
3283
3283
  }
3284
- let v = f.map.isWebGLCubeRenderTarget ? 6 : 1;
3284
+ let v = p.map.isWebGLCubeRenderTarget ? 6 : 1;
3285
3285
  for (let t = 0; t < v; t++) {
3286
- if (f.map.isWebGLCubeRenderTarget) e.setRenderTarget(f.map, t), e.clear();
3286
+ if (p.map.isWebGLCubeRenderTarget) e.setRenderTarget(p.map, t), e.clear();
3287
3287
  else {
3288
- t === 0 && (e.setRenderTarget(f.map), e.clear());
3289
- let n = f.getViewport(t);
3288
+ t === 0 && (e.setRenderTarget(p.map), e.clear());
3289
+ let n = p.getViewport(t);
3290
3290
  o.set(a.x * n.x, a.y * n.y, a.x * n.z, a.y * n.w), m.viewport(o);
3291
3291
  }
3292
3292
  if (d.isPointLight) {
3293
- let e = f.camera, n = f.matrix, r = d.distance || e.far;
3294
- r !== e.far && (e.far = r, e.updateProjectionMatrix()), Or.setFromMatrixPosition(d.matrixWorld), e.position.copy(Or), kr.copy(e.position), kr.add(Tr[t]), e.up.copy(Er[t]), e.lookAt(kr), e.updateMatrixWorld(), n.makeTranslation(-Or.x, -Or.y, -Or.z), Dr.multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse), f._frustum.setFromProjectionMatrix(Dr, e.coordinateSystem, e.reversedDepth);
3295
- } else f.updateMatrices(d);
3296
- r = f.getFrustum(), C(n, s, f.camera, d, this.type);
3293
+ let e = p.camera, n = p.matrix, r = d.distance || e.far;
3294
+ r !== e.far && (e.far = r, e.updateProjectionMatrix()), Or.setFromMatrixPosition(d.matrixWorld), e.position.copy(Or), kr.copy(e.position), kr.add(Tr[t]), e.up.copy(Er[t]), e.lookAt(kr), e.updateMatrixWorld(), n.makeTranslation(-Or.x, -Or.y, -Or.z), Dr.multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse), p._frustum.setFromProjectionMatrix(Dr, e.coordinateSystem, e.reversedDepth);
3295
+ } else p.updateMatrices(d);
3296
+ r = p.getFrustum(), S(n, s, p.camera, d, this.type);
3297
3297
  }
3298
- f.isPointLightShadow !== !0 && this.type === 3 && x(f, s), f.needsUpdate = !1;
3298
+ p.isPointLightShadow !== !0 && this.type === 3 && b(p, s), p.needsUpdate = !1;
3299
3299
  }
3300
- b = this.type, y.needsUpdate = !1, e.setRenderTarget(l, d, f);
3300
+ y = this.type, v.needsUpdate = !1, e.setRenderTarget(u, d, p);
3301
3301
  };
3302
- function x(n, r) {
3303
- let a = t.update(v);
3304
- h.defines.VSM_SAMPLES !== n.blurSamples && (h.defines.VSM_SAMPLES = n.blurSamples, g.defines.VSM_SAMPLES = n.blurSamples, h.needsUpdate = !0, g.needsUpdate = !0), n.mapPass === null && (n.mapPass = new u(i.x, i.y, {
3302
+ function b(n, r) {
3303
+ let a = t.update(_);
3304
+ m.defines.VSM_SAMPLES !== n.blurSamples && (m.defines.VSM_SAMPLES = n.blurSamples, h.defines.VSM_SAMPLES = n.blurSamples, m.needsUpdate = !0, h.needsUpdate = !0), n.mapPass === null && (n.mapPass = new l(i.x, i.y, {
3305
3305
  format: c,
3306
- type: he
3307
- })), h.uniforms.shadow_pass.value = n.map.depthTexture, h.uniforms.resolution.value = n.mapSize, h.uniforms.radius.value = n.radius, e.setRenderTarget(n.mapPass), e.clear(), e.renderBufferDirect(r, null, a, h, v, null), g.uniforms.shadow_pass.value = n.mapPass.texture, g.uniforms.resolution.value = n.mapSize, g.uniforms.radius.value = n.radius, e.setRenderTarget(n.map), e.clear(), e.renderBufferDirect(r, null, a, g, v, null);
3306
+ type: pe
3307
+ })), m.uniforms.shadow_pass.value = n.map.depthTexture, m.uniforms.resolution.value = n.mapSize, m.uniforms.radius.value = n.radius, e.setRenderTarget(n.mapPass), e.clear(), e.renderBufferDirect(r, null, a, m, _, null), h.uniforms.shadow_pass.value = n.mapPass.texture, h.uniforms.resolution.value = n.mapSize, h.uniforms.radius.value = n.radius, e.setRenderTarget(n.map), e.clear(), e.renderBufferDirect(r, null, a, h, _, null);
3308
3308
  }
3309
- function S(t, n, r, i) {
3309
+ function x(t, n, r, i) {
3310
3310
  let a = null, o = r.isPointLight === !0 ? t.customDistanceMaterial : t.customDepthMaterial;
3311
3311
  if (o !== void 0) a = o;
3312
- else if (a = r.isPointLight === !0 ? d : l, e.localClippingEnabled && n.clipShadows === !0 && Array.isArray(n.clippingPlanes) && n.clippingPlanes.length !== 0 || n.displacementMap && n.displacementScale !== 0 || n.alphaMap && n.alphaTest > 0 || n.map && n.alphaTest > 0 || n.alphaToCoverage === !0) {
3313
- let e = a.uuid, t = n.uuid, r = f[e];
3314
- r === void 0 && (r = {}, f[e] = r);
3312
+ else if (a = r.isPointLight === !0 ? u : s, e.localClippingEnabled && n.clipShadows === !0 && Array.isArray(n.clippingPlanes) && n.clippingPlanes.length !== 0 || n.displacementMap && n.displacementScale !== 0 || n.alphaMap && n.alphaTest > 0 || n.map && n.alphaTest > 0 || n.alphaToCoverage === !0) {
3313
+ let e = a.uuid, t = n.uuid, r = d[e];
3314
+ r === void 0 && (r = {}, d[e] = r);
3315
3315
  let i = r[t];
3316
- i === void 0 && (i = a.clone(), r[t] = i, n.addEventListener("dispose", w)), a = i;
3316
+ i === void 0 && (i = a.clone(), r[t] = i, n.addEventListener("dispose", C)), a = i;
3317
3317
  }
3318
- if (a.visible = n.visible, a.wireframe = n.wireframe, i === 3 ? a.side = n.shadowSide === null ? n.side : n.shadowSide : a.side = n.shadowSide === null ? m[n.side] : n.shadowSide, a.alphaMap = n.alphaMap, a.alphaTest = n.alphaToCoverage === !0 ? .5 : n.alphaTest, a.map = n.map, a.clipShadows = n.clipShadows, a.clippingPlanes = n.clippingPlanes, a.clipIntersection = n.clipIntersection, a.displacementMap = n.displacementMap, a.displacementScale = n.displacementScale, a.displacementBias = n.displacementBias, a.wireframeLinewidth = n.wireframeLinewidth, a.linewidth = n.linewidth, r.isPointLight === !0 && a.isMeshDistanceMaterial === !0) {
3318
+ if (a.visible = n.visible, a.wireframe = n.wireframe, i === 3 ? a.side = n.shadowSide === null ? n.side : n.shadowSide : a.side = n.shadowSide === null ? p[n.side] : n.shadowSide, a.alphaMap = n.alphaMap, a.alphaTest = n.alphaToCoverage === !0 ? .5 : n.alphaTest, a.map = n.map, a.clipShadows = n.clipShadows, a.clippingPlanes = n.clippingPlanes, a.clipIntersection = n.clipIntersection, a.displacementMap = n.displacementMap, a.displacementScale = n.displacementScale, a.displacementBias = n.displacementBias, a.wireframeLinewidth = n.wireframeLinewidth, a.linewidth = n.linewidth, r.isPointLight === !0 && a.isMeshDistanceMaterial === !0) {
3319
3319
  let t = e.properties.get(a);
3320
3320
  t.light = r;
3321
3321
  }
3322
3322
  return a;
3323
3323
  }
3324
- function C(n, i, a, o, s) {
3324
+ function S(n, i, a, o, s) {
3325
3325
  if (n.visible === !1) return;
3326
3326
  if (n.layers.test(i.layers) && (n.isMesh || n.isLine || n.isPoints) && (n.castShadow || n.receiveShadow && s === 3) && (!n.frustumCulled || r.intersectsObject(n))) {
3327
3327
  n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse, n.matrixWorld);
@@ -3331,29 +3331,29 @@ function Ar(e, t, n) {
3331
3331
  for (let l = 0, u = t.length; l < u; l++) {
3332
3332
  let u = t[l], d = c[u.materialIndex];
3333
3333
  if (d && d.visible) {
3334
- let t = S(n, d, o, s);
3334
+ let t = x(n, d, o, s);
3335
3335
  n.onBeforeShadow(e, n, i, a, r, t, u), e.renderBufferDirect(a, null, r, t, n, u), n.onAfterShadow(e, n, i, a, r, t, u);
3336
3336
  }
3337
3337
  }
3338
3338
  } else if (c.visible) {
3339
- let t = S(n, c, o, s);
3339
+ let t = x(n, c, o, s);
3340
3340
  n.onBeforeShadow(e, n, i, a, r, t, null), e.renderBufferDirect(a, null, r, t, n, null), n.onAfterShadow(e, n, i, a, r, t, null);
3341
3341
  }
3342
3342
  }
3343
3343
  let c = n.children;
3344
- for (let e = 0, t = c.length; e < t; e++) C(c[e], i, a, o, s);
3344
+ for (let e = 0, t = c.length; e < t; e++) S(c[e], i, a, o, s);
3345
3345
  }
3346
- function w(e) {
3347
- e.target.removeEventListener("dispose", w);
3348
- for (let t in f) {
3349
- let n = f[t], r = e.target.uuid;
3346
+ function C(e) {
3347
+ e.target.removeEventListener("dispose", C);
3348
+ for (let t in d) {
3349
+ let n = d[t], r = e.target.uuid;
3350
3350
  r in n && (n[r].dispose(), delete n[r]);
3351
3351
  }
3352
3352
  }
3353
3353
  }
3354
3354
  function jr(e, t) {
3355
3355
  function n() {
3356
- let t = !1, n = new s(), r = null, i = new s(0, 0, 0, 0);
3356
+ let t = !1, n = new Ae(), r = null, i = new Ae(0, 0, 0, 0);
3357
3357
  return {
3358
3358
  setMask: function(n) {
3359
3359
  r !== n && !t && (e.colorMask(n, n, n, n), r = n);
@@ -3384,13 +3384,13 @@ function jr(e, t) {
3384
3384
  return r;
3385
3385
  },
3386
3386
  setTest: function(t) {
3387
- t ? R(e.DEPTH_TEST) : z(e.DEPTH_TEST);
3387
+ t ? z(e.DEPTH_TEST) : B(e.DEPTH_TEST);
3388
3388
  },
3389
3389
  setMask: function(t) {
3390
3390
  i !== t && !n && (e.depthMask(t), i = t);
3391
3391
  },
3392
3392
  setFunc: function(t) {
3393
- if (r && (t = E[t]), a !== t) {
3393
+ if (r && (t = D[t]), a !== t) {
3394
3394
  switch (t) {
3395
3395
  case 0:
3396
3396
  e.depthFunc(e.NEVER);
@@ -3436,7 +3436,7 @@ function jr(e, t) {
3436
3436
  let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
3437
3437
  return {
3438
3438
  setTest: function(n) {
3439
- t || (n ? R(e.STENCIL_TEST) : z(e.STENCIL_TEST));
3439
+ t || (n ? z(e.STENCIL_TEST) : B(e.STENCIL_TEST));
3440
3440
  },
3441
3441
  setMask: function(r) {
3442
3442
  n !== r && !t && (e.stencilMask(r), n = r);
@@ -3458,30 +3458,30 @@ function jr(e, t) {
3458
3458
  }
3459
3459
  };
3460
3460
  }
3461
- let a = new n(), o = new r(), c = new i(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = {}, p = {}, m = {}, h = /* @__PURE__ */ new WeakMap(), g = [], _ = null, v = !1, y = null, b = null, x = null, S = null, C = null, w = null, T = null, D = new U(0, 0, 0), O = 0, k = !1, A = null, ee = null, j = null, M = null, N = null, P = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), te = !1, F = 0, ne = e.getParameter(e.VERSION);
3462
- ne.indexOf("WebGL") === -1 ? ne.indexOf("OpenGL ES") !== -1 && (F = parseFloat(/^OpenGL ES (\d)/.exec(ne)[1]), te = F >= 2) : (F = parseFloat(/^WebGL (\d)/.exec(ne)[1]), te = F >= 1);
3463
- let I = null, re = {}, ie = e.getParameter(e.SCISSOR_BOX), ae = e.getParameter(e.VIEWPORT), oe = new s().fromArray(ie), L = new s().fromArray(ae);
3464
- function se(t, n, r, i) {
3461
+ let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, v = null, y = null, b = null, x = null, S = null, C = null, w = null, T = new U(0, 0, 0), E = 0, O = !1, k = null, ee = null, A = null, j = null, M = null, N = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), P = !1, F = 0, te = e.getParameter(e.VERSION);
3462
+ te.indexOf("WebGL") === -1 ? te.indexOf("OpenGL ES") !== -1 && (F = parseFloat(/^OpenGL ES (\d)/.exec(te)[1]), P = F >= 2) : (F = parseFloat(/^WebGL (\d)/.exec(te)[1]), P = F >= 1);
3463
+ let I = null, L = {}, ne = e.getParameter(e.SCISSOR_BOX), re = e.getParameter(e.VIEWPORT), ie = new Ae().fromArray(ne), R = new Ae().fromArray(re);
3464
+ function ae(t, n, r, i) {
3465
3465
  let a = new Uint8Array(4), o = e.createTexture();
3466
3466
  e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
3467
3467
  for (let o = 0; o < r; o++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + o, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);
3468
3468
  return o;
3469
3469
  }
3470
- let ce = {};
3471
- ce[e.TEXTURE_2D] = se(e.TEXTURE_2D, e.TEXTURE_2D, 1), ce[e.TEXTURE_CUBE_MAP] = se(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), ce[e.TEXTURE_2D_ARRAY] = se(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), ce[e.TEXTURE_3D] = se(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), c.setClear(0), R(e.DEPTH_TEST), o.setFunc(3), ge(!1), _e(1), R(e.CULL_FACE), me(0);
3472
- function R(t) {
3473
- d[t] !== !0 && (e.enable(t), d[t] = !0);
3474
- }
3470
+ let oe = {};
3471
+ oe[e.TEXTURE_2D] = ae(e.TEXTURE_2D, e.TEXTURE_2D, 1), oe[e.TEXTURE_CUBE_MAP] = ae(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), oe[e.TEXTURE_2D_ARRAY] = ae(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), oe[e.TEXTURE_3D] = ae(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), z(e.DEPTH_TEST), o.setFunc(3), me(!1), he(1), z(e.CULL_FACE), fe(0);
3475
3472
  function z(t) {
3476
- d[t] !== !1 && (e.disable(t), d[t] = !1);
3473
+ u[t] !== !0 && (e.enable(t), u[t] = !0);
3477
3474
  }
3478
- function le(t, n) {
3479
- return m[t] === n ? !1 : (e.bindFramebuffer(t, n), m[t] = n, t === e.DRAW_FRAMEBUFFER && (m[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (m[e.DRAW_FRAMEBUFFER] = n), !0);
3475
+ function B(t) {
3476
+ u[t] !== !1 && (e.disable(t), u[t] = !1);
3480
3477
  }
3481
- function ue(t, n) {
3482
- let r = g, i = !1;
3478
+ function se(t, n) {
3479
+ return f[t] === n ? !1 : (e.bindFramebuffer(t, n), f[t] = n, t === e.DRAW_FRAMEBUFFER && (f[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (f[e.DRAW_FRAMEBUFFER] = n), !0);
3480
+ }
3481
+ function ce(t, n) {
3482
+ let r = m, i = !1;
3483
3483
  if (t) {
3484
- r = h.get(n), r === void 0 && (r = [], h.set(n, r));
3484
+ r = p.get(n), r === void 0 && (r = [], p.set(n, r));
3485
3485
  let a = t.textures;
3486
3486
  if (r.length !== a.length || r[0] !== e.COLOR_ATTACHMENT0) {
3487
3487
  for (let t = 0, n = a.length; t < n; t++) r[t] = e.COLOR_ATTACHMENT0 + t;
@@ -3490,16 +3490,16 @@ function jr(e, t) {
3490
3490
  } else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
3491
3491
  i && e.drawBuffers(r);
3492
3492
  }
3493
- function de(t) {
3494
- return _ === t ? !1 : (e.useProgram(t), _ = t, !0);
3493
+ function le(t) {
3494
+ return h === t ? !1 : (e.useProgram(t), h = t, !0);
3495
3495
  }
3496
- let fe = {
3496
+ let ue = {
3497
3497
  100: e.FUNC_ADD,
3498
3498
  101: e.FUNC_SUBTRACT,
3499
3499
  102: e.FUNC_REVERSE_SUBTRACT
3500
3500
  };
3501
- fe[103] = e.MIN, fe[104] = e.MAX;
3502
- let pe = {
3501
+ ue[103] = e.MIN, ue[104] = e.MAX;
3502
+ let de = {
3503
3503
  200: e.ZERO,
3504
3504
  201: e.ONE,
3505
3505
  202: e.SRC_COLOR,
@@ -3516,14 +3516,14 @@ function jr(e, t) {
3516
3516
  213: e.CONSTANT_ALPHA,
3517
3517
  214: e.ONE_MINUS_CONSTANT_ALPHA
3518
3518
  };
3519
- function me(t, n, r, i, a, o, s, c, l, u) {
3519
+ function fe(t, n, r, i, a, o, s, c, l, u) {
3520
3520
  if (t === 0) {
3521
- v === !0 && (z(e.BLEND), v = !1);
3521
+ g === !0 && (B(e.BLEND), g = !1);
3522
3522
  return;
3523
3523
  }
3524
- if (v === !1 && (R(e.BLEND), v = !0), t !== 5) {
3525
- if (t !== y || u !== k) {
3526
- if ((b !== 100 || C !== 100) && (e.blendEquation(e.FUNC_ADD), b = 100, C = 100), u) switch (t) {
3524
+ if (g === !1 && (z(e.BLEND), g = !0), t !== 5) {
3525
+ if (t !== v || u !== O) {
3526
+ if ((y !== 100 || S !== 100) && (e.blendEquation(e.FUNC_ADD), y = 100, S = 100), u) switch (t) {
3527
3527
  case 1:
3528
3528
  e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA);
3529
3529
  break;
@@ -3537,7 +3537,7 @@ function jr(e, t) {
3537
3537
  e.blendFuncSeparate(e.DST_COLOR, e.ONE_MINUS_SRC_ALPHA, e.ZERO, e.ONE);
3538
3538
  break;
3539
3539
  default:
3540
- f("WebGLState: Invalid blending: ", t);
3540
+ _("WebGLState: Invalid blending: ", t);
3541
3541
  break;
3542
3542
  }
3543
3543
  else switch (t) {
@@ -3548,215 +3548,215 @@ function jr(e, t) {
3548
3548
  e.blendFuncSeparate(e.SRC_ALPHA, e.ONE, e.ONE, e.ONE);
3549
3549
  break;
3550
3550
  case 3:
3551
- f("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");
3551
+ _("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");
3552
3552
  break;
3553
3553
  case 4:
3554
- f("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");
3554
+ _("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");
3555
3555
  break;
3556
3556
  default:
3557
- f("WebGLState: Invalid blending: ", t);
3557
+ _("WebGLState: Invalid blending: ", t);
3558
3558
  break;
3559
3559
  }
3560
- x = null, S = null, w = null, T = null, D.set(0, 0, 0), O = 0, y = t, k = u;
3560
+ b = null, x = null, C = null, w = null, T.set(0, 0, 0), E = 0, v = t, O = u;
3561
3561
  }
3562
3562
  return;
3563
3563
  }
3564
- a ||= n, o ||= r, s ||= i, (n !== b || a !== C) && (e.blendEquationSeparate(fe[n], fe[a]), b = n, C = a), (r !== x || i !== S || o !== w || s !== T) && (e.blendFuncSeparate(pe[r], pe[i], pe[o], pe[s]), x = r, S = i, w = o, T = s), (c.equals(D) === !1 || l !== O) && (e.blendColor(c.r, c.g, c.b, l), D.copy(c), O = l), y = t, k = !1;
3564
+ a ||= n, o ||= r, s ||= i, (n !== y || a !== S) && (e.blendEquationSeparate(ue[n], ue[a]), y = n, S = a), (r !== b || i !== x || o !== C || s !== w) && (e.blendFuncSeparate(de[r], de[i], de[o], de[s]), b = r, x = i, C = o, w = s), (c.equals(T) === !1 || l !== E) && (e.blendColor(c.r, c.g, c.b, l), T.copy(c), E = l), v = t, O = !1;
3565
3565
  }
3566
- function he(t, n) {
3567
- t.side === 2 ? z(e.CULL_FACE) : R(e.CULL_FACE);
3566
+ function pe(t, n) {
3567
+ t.side === 2 ? B(e.CULL_FACE) : z(e.CULL_FACE);
3568
3568
  let r = t.side === 1;
3569
- n && (r = !r), ge(r), t.blending === 1 && t.transparent === !1 ? me(0) : me(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
3569
+ n && (r = !r), me(r), t.blending === 1 && t.transparent === !1 ? fe(0) : fe(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
3570
3570
  let i = t.stencilWrite;
3571
- c.setTest(i), i && (c.setMask(t.stencilWriteMask), c.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), c.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), ve(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? R(e.SAMPLE_ALPHA_TO_COVERAGE) : z(e.SAMPLE_ALPHA_TO_COVERAGE);
3571
+ s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), ge(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? z(e.SAMPLE_ALPHA_TO_COVERAGE) : B(e.SAMPLE_ALPHA_TO_COVERAGE);
3572
3572
  }
3573
- function ge(t) {
3574
- A !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), A = t);
3573
+ function me(t) {
3574
+ k !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), k = t);
3575
3575
  }
3576
- function _e(t) {
3577
- t === 0 ? z(e.CULL_FACE) : (R(e.CULL_FACE), t !== ee && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), ee = t;
3576
+ function he(t) {
3577
+ t === 0 ? B(e.CULL_FACE) : (z(e.CULL_FACE), t !== ee && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), ee = t;
3578
3578
  }
3579
- function B(t) {
3580
- t !== j && (te && e.lineWidth(t), j = t);
3579
+ function V(t) {
3580
+ t !== A && (P && e.lineWidth(t), A = t);
3581
3581
  }
3582
- function ve(t, n, r) {
3583
- t ? (R(e.POLYGON_OFFSET_FILL), (M !== n || N !== r) && (M = n, N = r, o.getReversed() && (n = -n), e.polygonOffset(n, r))) : z(e.POLYGON_OFFSET_FILL);
3582
+ function ge(t, n, r) {
3583
+ t ? (z(e.POLYGON_OFFSET_FILL), (j !== n || M !== r) && (j = n, M = r, o.getReversed() && (n = -n), e.polygonOffset(n, r))) : B(e.POLYGON_OFFSET_FILL);
3584
3584
  }
3585
- function ye(t) {
3586
- t ? R(e.SCISSOR_TEST) : z(e.SCISSOR_TEST);
3585
+ function _e(t) {
3586
+ t ? z(e.SCISSOR_TEST) : B(e.SCISSOR_TEST);
3587
3587
  }
3588
- function be(t) {
3589
- t === void 0 && (t = e.TEXTURE0 + P - 1), I !== t && (e.activeTexture(t), I = t);
3588
+ function ve(t) {
3589
+ t === void 0 && (t = e.TEXTURE0 + N - 1), I !== t && (e.activeTexture(t), I = t);
3590
3590
  }
3591
- function V(t, n, r) {
3592
- r === void 0 && (r = I === null ? e.TEXTURE0 + P - 1 : I);
3593
- let i = re[r];
3591
+ function ye(t, n, r) {
3592
+ r === void 0 && (r = I === null ? e.TEXTURE0 + N - 1 : I);
3593
+ let i = L[r];
3594
3594
  i === void 0 && (i = {
3595
3595
  type: void 0,
3596
3596
  texture: void 0
3597
- }, re[r] = i), (i.type !== t || i.texture !== n) && (I !== r && (e.activeTexture(r), I = r), e.bindTexture(t, n || ce[t]), i.type = t, i.texture = n);
3597
+ }, L[r] = i), (i.type !== t || i.texture !== n) && (I !== r && (e.activeTexture(r), I = r), e.bindTexture(t, n || oe[t]), i.type = t, i.texture = n);
3598
3598
  }
3599
- function xe() {
3600
- let t = re[I];
3599
+ function be() {
3600
+ let t = L[I];
3601
3601
  t !== void 0 && t.type !== void 0 && (e.bindTexture(t.type, null), t.type = void 0, t.texture = void 0);
3602
3602
  }
3603
- function Se() {
3603
+ function H() {
3604
3604
  try {
3605
3605
  e.compressedTexImage2D(...arguments);
3606
3606
  } catch (e) {
3607
- f("WebGLState:", e);
3607
+ _("WebGLState:", e);
3608
3608
  }
3609
3609
  }
3610
- function Ce() {
3610
+ function xe() {
3611
3611
  try {
3612
3612
  e.compressedTexImage3D(...arguments);
3613
3613
  } catch (e) {
3614
- f("WebGLState:", e);
3614
+ _("WebGLState:", e);
3615
3615
  }
3616
3616
  }
3617
- function H() {
3617
+ function Se() {
3618
3618
  try {
3619
3619
  e.texSubImage2D(...arguments);
3620
3620
  } catch (e) {
3621
- f("WebGLState:", e);
3621
+ _("WebGLState:", e);
3622
3622
  }
3623
3623
  }
3624
- function we() {
3624
+ function Ce() {
3625
3625
  try {
3626
3626
  e.texSubImage3D(...arguments);
3627
3627
  } catch (e) {
3628
- f("WebGLState:", e);
3628
+ _("WebGLState:", e);
3629
3629
  }
3630
3630
  }
3631
- function Te() {
3631
+ function we() {
3632
3632
  try {
3633
3633
  e.compressedTexSubImage2D(...arguments);
3634
3634
  } catch (e) {
3635
- f("WebGLState:", e);
3635
+ _("WebGLState:", e);
3636
3636
  }
3637
3637
  }
3638
- function Ee() {
3638
+ function Te() {
3639
3639
  try {
3640
3640
  e.compressedTexSubImage3D(...arguments);
3641
3641
  } catch (e) {
3642
- f("WebGLState:", e);
3642
+ _("WebGLState:", e);
3643
3643
  }
3644
3644
  }
3645
- function De() {
3645
+ function Ee() {
3646
3646
  try {
3647
3647
  e.texStorage2D(...arguments);
3648
3648
  } catch (e) {
3649
- f("WebGLState:", e);
3649
+ _("WebGLState:", e);
3650
3650
  }
3651
3651
  }
3652
- function Oe() {
3652
+ function De() {
3653
3653
  try {
3654
3654
  e.texStorage3D(...arguments);
3655
3655
  } catch (e) {
3656
- f("WebGLState:", e);
3656
+ _("WebGLState:", e);
3657
3657
  }
3658
3658
  }
3659
- function ke() {
3659
+ function Oe() {
3660
3660
  try {
3661
3661
  e.texImage2D(...arguments);
3662
3662
  } catch (e) {
3663
- f("WebGLState:", e);
3663
+ _("WebGLState:", e);
3664
3664
  }
3665
3665
  }
3666
- function Ae() {
3666
+ function ke() {
3667
3667
  try {
3668
3668
  e.texImage3D(...arguments);
3669
3669
  } catch (e) {
3670
- f("WebGLState:", e);
3670
+ _("WebGLState:", e);
3671
3671
  }
3672
3672
  }
3673
3673
  function je(t) {
3674
- return p[t] === void 0 ? e.getParameter(t) : p[t];
3674
+ return d[t] === void 0 ? e.getParameter(t) : d[t];
3675
3675
  }
3676
3676
  function Me(t, n) {
3677
- p[t] !== n && (e.pixelStorei(t, n), p[t] = n);
3677
+ d[t] !== n && (e.pixelStorei(t, n), d[t] = n);
3678
3678
  }
3679
3679
  function Ne(t) {
3680
- oe.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), oe.copy(t));
3680
+ ie.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), ie.copy(t));
3681
3681
  }
3682
3682
  function Pe(t) {
3683
- L.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), L.copy(t));
3683
+ R.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), R.copy(t));
3684
3684
  }
3685
- function W(t, n) {
3686
- let r = u.get(n);
3687
- r === void 0 && (r = /* @__PURE__ */ new WeakMap(), u.set(n, r));
3685
+ function Fe(t, n) {
3686
+ let r = l.get(n);
3687
+ r === void 0 && (r = /* @__PURE__ */ new WeakMap(), l.set(n, r));
3688
3688
  let i = r.get(t);
3689
3689
  i === void 0 && (i = e.getUniformBlockIndex(n, t.name), r.set(t, i));
3690
3690
  }
3691
- function Fe(t, n) {
3692
- let r = u.get(n).get(t);
3693
- l.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), l.set(n, r));
3691
+ function W(t, n) {
3692
+ let r = l.get(n).get(t);
3693
+ c.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));
3694
3694
  }
3695
3695
  function Ie() {
3696
- e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), e.pixelStorei(e.PACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !1), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), e.pixelStorei(e.PACK_ROW_LENGTH, 0), e.pixelStorei(e.PACK_SKIP_PIXELS, 0), e.pixelStorei(e.PACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_ROW_LENGTH, 0), e.pixelStorei(e.UNPACK_IMAGE_HEIGHT, 0), e.pixelStorei(e.UNPACK_SKIP_PIXELS, 0), e.pixelStorei(e.UNPACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_SKIP_IMAGES, 0), d = {}, p = {}, I = null, re = {}, m = {}, h = /* @__PURE__ */ new WeakMap(), g = [], _ = null, v = !1, y = null, b = null, x = null, S = null, C = null, w = null, T = null, D = new U(0, 0, 0), O = 0, k = !1, A = null, ee = null, j = null, M = null, N = null, oe.set(0, 0, e.canvas.width, e.canvas.height), L.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), c.reset();
3696
+ e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), e.pixelStorei(e.PACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !1), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), e.pixelStorei(e.PACK_ROW_LENGTH, 0), e.pixelStorei(e.PACK_SKIP_PIXELS, 0), e.pixelStorei(e.PACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_ROW_LENGTH, 0), e.pixelStorei(e.UNPACK_IMAGE_HEIGHT, 0), e.pixelStorei(e.UNPACK_SKIP_PIXELS, 0), e.pixelStorei(e.UNPACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_SKIP_IMAGES, 0), u = {}, d = {}, I = null, L = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, v = null, y = null, b = null, x = null, S = null, C = null, w = null, T = new U(0, 0, 0), E = 0, O = !1, k = null, ee = null, A = null, j = null, M = null, ie.set(0, 0, e.canvas.width, e.canvas.height), R.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
3697
3697
  }
3698
3698
  return {
3699
3699
  buffers: {
3700
3700
  color: a,
3701
3701
  depth: o,
3702
- stencil: c
3702
+ stencil: s
3703
3703
  },
3704
- enable: R,
3705
- disable: z,
3706
- bindFramebuffer: le,
3707
- drawBuffers: ue,
3708
- useProgram: de,
3709
- setBlending: me,
3710
- setMaterial: he,
3711
- setFlipSided: ge,
3712
- setCullFace: _e,
3713
- setLineWidth: B,
3714
- setPolygonOffset: ve,
3715
- setScissorTest: ye,
3716
- activeTexture: be,
3717
- bindTexture: V,
3718
- unbindTexture: xe,
3719
- compressedTexImage2D: Se,
3720
- compressedTexImage3D: Ce,
3721
- texImage2D: ke,
3722
- texImage3D: Ae,
3704
+ enable: z,
3705
+ disable: B,
3706
+ bindFramebuffer: se,
3707
+ drawBuffers: ce,
3708
+ useProgram: le,
3709
+ setBlending: fe,
3710
+ setMaterial: pe,
3711
+ setFlipSided: me,
3712
+ setCullFace: he,
3713
+ setLineWidth: V,
3714
+ setPolygonOffset: ge,
3715
+ setScissorTest: _e,
3716
+ activeTexture: ve,
3717
+ bindTexture: ye,
3718
+ unbindTexture: be,
3719
+ compressedTexImage2D: H,
3720
+ compressedTexImage3D: xe,
3721
+ texImage2D: Oe,
3722
+ texImage3D: ke,
3723
3723
  pixelStorei: Me,
3724
3724
  getParameter: je,
3725
- updateUBOMapping: W,
3726
- uniformBlockBinding: Fe,
3727
- texStorage2D: De,
3728
- texStorage3D: Oe,
3729
- texSubImage2D: H,
3730
- texSubImage3D: we,
3731
- compressedTexSubImage2D: Te,
3732
- compressedTexSubImage3D: Ee,
3725
+ updateUBOMapping: Fe,
3726
+ uniformBlockBinding: W,
3727
+ texStorage2D: Ee,
3728
+ texStorage3D: De,
3729
+ texSubImage2D: Se,
3730
+ texSubImage3D: Ce,
3731
+ compressedTexSubImage2D: we,
3732
+ compressedTexSubImage3D: Te,
3733
3733
  scissor: Ne,
3734
3734
  viewport: Pe,
3735
3735
  reset: Ie
3736
3736
  };
3737
3737
  }
3738
3738
  function Mr(t, n, r, i, a, o, s) {
3739
- let c = n.has("WEBGL_multisampled_render_to_texture") ? n.get("WEBGL_multisampled_render_to_texture") : null, u = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), d = new je(), p = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new Set(), _, v = /* @__PURE__ */ new WeakMap(), y = !1;
3739
+ let c = n.has("WEBGL_multisampled_render_to_texture") ? n.get("WEBGL_multisampled_render_to_texture") : null, l = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), d = new A(), f = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new Set(), h, g = /* @__PURE__ */ new WeakMap(), v = !1;
3740
3740
  try {
3741
- y = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
3741
+ v = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
3742
3742
  } catch {}
3743
3743
  function b(e, t) {
3744
- return y ? new OffscreenCanvas(e, t) : T("canvas");
3744
+ return v ? new OffscreenCanvas(e, t) : p("canvas");
3745
3745
  }
3746
3746
  function S(e, t, n) {
3747
- let r = 1, i = Ne(e);
3747
+ let r = 1, i = Me(e);
3748
3748
  if ((i.width > n || i.height > n) && (r = n / Math.max(i.width, i.height)), r < 1) if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof VideoFrame < "u" && e instanceof VideoFrame) {
3749
3749
  let n = Math.floor(r * i.width), a = Math.floor(r * i.height);
3750
- _ === void 0 && (_ = b(n, a));
3751
- let o = t ? b(n, a) : _;
3752
- return o.width = n, o.height = a, o.getContext("2d").drawImage(e, 0, 0, n, a), M("WebGLRenderer: Texture has been resized from (" + i.width + "x" + i.height + ") to (" + n + "x" + a + ")."), o;
3753
- } else return "data" in e && M("WebGLRenderer: Image in DataTexture is too big (" + i.width + "x" + i.height + ")."), e;
3750
+ h === void 0 && (h = b(n, a));
3751
+ let o = t ? b(n, a) : h;
3752
+ return o.width = n, o.height = a, o.getContext("2d").drawImage(e, 0, 0, n, a), L("WebGLRenderer: Texture has been resized from (" + i.width + "x" + i.height + ") to (" + n + "x" + a + ")."), o;
3753
+ } else return "data" in e && L("WebGLRenderer: Image in DataTexture is too big (" + i.width + "x" + i.height + ")."), e;
3754
3754
  return e;
3755
3755
  }
3756
- function C(e) {
3756
+ function w(e) {
3757
3757
  return e.generateMipmaps;
3758
3758
  }
3759
- function w(e) {
3759
+ function T(e) {
3760
3760
  t.generateMipmap(e);
3761
3761
  }
3762
3762
  function E(e) {
@@ -3765,49 +3765,49 @@ function Mr(t, n, r, i, a, o, s) {
3765
3765
  function D(r, i, a, o, s, c = !1) {
3766
3766
  if (r !== null) {
3767
3767
  if (t[r] !== void 0) return t[r];
3768
- M("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + r + "'");
3768
+ L("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + r + "'");
3769
3769
  }
3770
- let u;
3771
- o && (u = n.get("EXT_texture_norm16"), u || M("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));
3770
+ let l;
3771
+ o && (l = n.get("EXT_texture_norm16"), l || L("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));
3772
3772
  let d = i;
3773
- if (i === t.RED && (a === t.FLOAT && (d = t.R32F), a === t.HALF_FLOAT && (d = t.R16F), a === t.UNSIGNED_BYTE && (d = t.R8), a === t.UNSIGNED_SHORT && u && (d = u.R16_EXT), a === t.SHORT && u && (d = u.R16_SNORM_EXT)), i === t.RED_INTEGER && (a === t.UNSIGNED_BYTE && (d = t.R8UI), a === t.UNSIGNED_SHORT && (d = t.R16UI), a === t.UNSIGNED_INT && (d = t.R32UI), a === t.BYTE && (d = t.R8I), a === t.SHORT && (d = t.R16I), a === t.INT && (d = t.R32I)), i === t.RG && (a === t.FLOAT && (d = t.RG32F), a === t.HALF_FLOAT && (d = t.RG16F), a === t.UNSIGNED_BYTE && (d = t.RG8), a === t.UNSIGNED_SHORT && u && (d = u.RG16_EXT), a === t.SHORT && u && (d = u.RG16_SNORM_EXT)), i === t.RG_INTEGER && (a === t.UNSIGNED_BYTE && (d = t.RG8UI), a === t.UNSIGNED_SHORT && (d = t.RG16UI), a === t.UNSIGNED_INT && (d = t.RG32UI), a === t.BYTE && (d = t.RG8I), a === t.SHORT && (d = t.RG16I), a === t.INT && (d = t.RG32I)), i === t.RGB_INTEGER && (a === t.UNSIGNED_BYTE && (d = t.RGB8UI), a === t.UNSIGNED_SHORT && (d = t.RGB16UI), a === t.UNSIGNED_INT && (d = t.RGB32UI), a === t.BYTE && (d = t.RGB8I), a === t.SHORT && (d = t.RGB16I), a === t.INT && (d = t.RGB32I)), i === t.RGBA_INTEGER && (a === t.UNSIGNED_BYTE && (d = t.RGBA8UI), a === t.UNSIGNED_SHORT && (d = t.RGBA16UI), a === t.UNSIGNED_INT && (d = t.RGBA32UI), a === t.BYTE && (d = t.RGBA8I), a === t.SHORT && (d = t.RGBA16I), a === t.INT && (d = t.RGBA32I)), i === t.RGB && (a === t.UNSIGNED_SHORT && u && (d = u.RGB16_EXT), a === t.SHORT && u && (d = u.RGB16_SNORM_EXT), a === t.UNSIGNED_INT_5_9_9_9_REV && (d = t.RGB9_E5), a === t.UNSIGNED_INT_10F_11F_11F_REV && (d = t.R11F_G11F_B10F)), i === t.RGBA) {
3774
- let n = c ? e : l.getTransfer(s);
3775
- a === t.FLOAT && (d = t.RGBA32F), a === t.HALF_FLOAT && (d = t.RGBA16F), a === t.UNSIGNED_BYTE && (d = n === "srgb" ? t.SRGB8_ALPHA8 : t.RGBA8), a === t.UNSIGNED_SHORT && u && (d = u.RGBA16_EXT), a === t.SHORT && u && (d = u.RGBA16_SNORM_EXT), a === t.UNSIGNED_SHORT_4_4_4_4 && (d = t.RGBA4), a === t.UNSIGNED_SHORT_5_5_5_1 && (d = t.RGB5_A1);
3773
+ if (i === t.RED && (a === t.FLOAT && (d = t.R32F), a === t.HALF_FLOAT && (d = t.R16F), a === t.UNSIGNED_BYTE && (d = t.R8), a === t.UNSIGNED_SHORT && l && (d = l.R16_EXT), a === t.SHORT && l && (d = l.R16_SNORM_EXT)), i === t.RED_INTEGER && (a === t.UNSIGNED_BYTE && (d = t.R8UI), a === t.UNSIGNED_SHORT && (d = t.R16UI), a === t.UNSIGNED_INT && (d = t.R32UI), a === t.BYTE && (d = t.R8I), a === t.SHORT && (d = t.R16I), a === t.INT && (d = t.R32I)), i === t.RG && (a === t.FLOAT && (d = t.RG32F), a === t.HALF_FLOAT && (d = t.RG16F), a === t.UNSIGNED_BYTE && (d = t.RG8), a === t.UNSIGNED_SHORT && l && (d = l.RG16_EXT), a === t.SHORT && l && (d = l.RG16_SNORM_EXT)), i === t.RG_INTEGER && (a === t.UNSIGNED_BYTE && (d = t.RG8UI), a === t.UNSIGNED_SHORT && (d = t.RG16UI), a === t.UNSIGNED_INT && (d = t.RG32UI), a === t.BYTE && (d = t.RG8I), a === t.SHORT && (d = t.RG16I), a === t.INT && (d = t.RG32I)), i === t.RGB_INTEGER && (a === t.UNSIGNED_BYTE && (d = t.RGB8UI), a === t.UNSIGNED_SHORT && (d = t.RGB16UI), a === t.UNSIGNED_INT && (d = t.RGB32UI), a === t.BYTE && (d = t.RGB8I), a === t.SHORT && (d = t.RGB16I), a === t.INT && (d = t.RGB32I)), i === t.RGBA_INTEGER && (a === t.UNSIGNED_BYTE && (d = t.RGBA8UI), a === t.UNSIGNED_SHORT && (d = t.RGBA16UI), a === t.UNSIGNED_INT && (d = t.RGBA32UI), a === t.BYTE && (d = t.RGBA8I), a === t.SHORT && (d = t.RGBA16I), a === t.INT && (d = t.RGBA32I)), i === t.RGB && (a === t.UNSIGNED_SHORT && l && (d = l.RGB16_EXT), a === t.SHORT && l && (d = l.RGB16_SNORM_EXT), a === t.UNSIGNED_INT_5_9_9_9_REV && (d = t.RGB9_E5), a === t.UNSIGNED_INT_10F_11F_11F_REV && (d = t.R11F_G11F_B10F)), i === t.RGBA) {
3774
+ let n = c ? e : u.getTransfer(s);
3775
+ a === t.FLOAT && (d = t.RGBA32F), a === t.HALF_FLOAT && (d = t.RGBA16F), a === t.UNSIGNED_BYTE && (d = n === "srgb" ? t.SRGB8_ALPHA8 : t.RGBA8), a === t.UNSIGNED_SHORT && l && (d = l.RGBA16_EXT), a === t.SHORT && l && (d = l.RGBA16_SNORM_EXT), a === t.UNSIGNED_SHORT_4_4_4_4 && (d = t.RGBA4), a === t.UNSIGNED_SHORT_5_5_5_1 && (d = t.RGB5_A1);
3776
3776
  }
3777
3777
  return (d === t.R16F || d === t.R32F || d === t.RG16F || d === t.RG32F || d === t.RGBA16F || d === t.RGBA32F) && n.get("EXT_color_buffer_float"), d;
3778
3778
  }
3779
- function k(e, n) {
3779
+ function O(e, n) {
3780
3780
  let r;
3781
- return e ? n === null || n === 1014 || n === 1020 ? r = t.DEPTH24_STENCIL8 : n === 1015 ? r = t.DEPTH32F_STENCIL8 : n === 1012 && (r = t.DEPTH24_STENCIL8, M("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : n === null || n === 1014 || n === 1020 ? r = t.DEPTH_COMPONENT24 : n === 1015 ? r = t.DEPTH_COMPONENT32F : n === 1012 && (r = t.DEPTH_COMPONENT16), r;
3781
+ return e ? n === null || n === 1014 || n === 1020 ? r = t.DEPTH24_STENCIL8 : n === 1015 ? r = t.DEPTH32F_STENCIL8 : n === 1012 && (r = t.DEPTH24_STENCIL8, L("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : n === null || n === 1014 || n === 1020 ? r = t.DEPTH_COMPONENT24 : n === 1015 ? r = t.DEPTH_COMPONENT32F : n === 1012 && (r = t.DEPTH_COMPONENT16), r;
3782
3782
  }
3783
- function ee(e, t) {
3784
- return C(e) === !0 || e.isFramebufferTexture && e.minFilter !== 1003 && e.minFilter !== 1006 ? Math.log2(Math.max(t.width, t.height)) + 1 : e.mipmaps !== void 0 && e.mipmaps.length > 0 ? e.mipmaps.length : e.isCompressedTexture && Array.isArray(e.image) ? t.mipmaps.length : 1;
3783
+ function k(e, t) {
3784
+ return w(e) === !0 || e.isFramebufferTexture && e.minFilter !== 1003 && e.minFilter !== 1006 ? Math.log2(Math.max(t.width, t.height)) + 1 : e.mipmaps !== void 0 && e.mipmaps.length > 0 ? e.mipmaps.length : e.isCompressedTexture && Array.isArray(e.image) ? t.mipmaps.length : 1;
3785
3785
  }
3786
- function j(e) {
3786
+ function M(e) {
3787
3787
  let t = e.target;
3788
- t.removeEventListener("dispose", j), P(t), t.isVideoTexture && p.delete(t), t.isHTMLTexture && h.delete(t);
3788
+ t.removeEventListener("dispose", M), P(t), t.isVideoTexture && f.delete(t), t.isHTMLTexture && m.delete(t);
3789
3789
  }
3790
3790
  function N(e) {
3791
3791
  let t = e.target;
3792
- t.removeEventListener("dispose", N), F(t);
3792
+ t.removeEventListener("dispose", N), te(t);
3793
3793
  }
3794
3794
  function P(e) {
3795
3795
  let t = i.get(e);
3796
3796
  if (t.__webglInit === void 0) return;
3797
- let n = e.source, r = v.get(n);
3797
+ let n = e.source, r = g.get(n);
3798
3798
  if (r) {
3799
3799
  let i = r[t.__cacheKey];
3800
- i.usedTimes--, i.usedTimes === 0 && te(e), Object.keys(r).length === 0 && v.delete(n);
3800
+ i.usedTimes--, i.usedTimes === 0 && F(e), Object.keys(r).length === 0 && g.delete(n);
3801
3801
  }
3802
3802
  i.remove(e);
3803
3803
  }
3804
- function te(e) {
3804
+ function F(e) {
3805
3805
  let n = i.get(e);
3806
3806
  t.deleteTexture(n.__webglTexture);
3807
- let r = e.source, a = v.get(r);
3807
+ let r = e.source, a = g.get(r);
3808
3808
  delete a[n.__cacheKey], s.memory.textures--;
3809
3809
  }
3810
- function F(e) {
3810
+ function te(e) {
3811
3811
  let n = i.get(e);
3812
3812
  if (e.depthTexture && (e.depthTexture.dispose(), i.remove(e.depthTexture)), e.isWebGLCubeRenderTarget) for (let e = 0; e < 6; e++) {
3813
3813
  if (Array.isArray(n.__webglFramebuffer[e])) for (let r = 0; r < n.__webglFramebuffer[e].length; r++) t.deleteFramebuffer(n.__webglFramebuffer[e][r]);
@@ -3827,41 +3827,41 @@ function Mr(t, n, r, i, a, o, s) {
3827
3827
  }
3828
3828
  i.remove(e);
3829
3829
  }
3830
- let ne = 0;
3831
- function I() {
3832
- ne = 0;
3830
+ let I = 0;
3831
+ function re() {
3832
+ I = 0;
3833
3833
  }
3834
- function ie() {
3835
- return ne;
3834
+ function R() {
3835
+ return I;
3836
3836
  }
3837
- function oe(e) {
3838
- ne = e;
3837
+ function ae(e) {
3838
+ I = e;
3839
3839
  }
3840
- function L() {
3841
- let e = ne;
3842
- return e >= a.maxTextures && M("WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + a.maxTextures), ne += 1, e;
3840
+ function z() {
3841
+ let e = I;
3842
+ return e >= a.maxTextures && L("WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + a.maxTextures), I += 1, e;
3843
3843
  }
3844
- function se(e) {
3844
+ function B(e) {
3845
3845
  let t = [];
3846
3846
  return t.push(e.wrapS), t.push(e.wrapT), t.push(e.wrapR || 0), t.push(e.magFilter), t.push(e.minFilter), t.push(e.anisotropy), t.push(e.internalFormat), t.push(e.format), t.push(e.type), t.push(e.generateMipmaps), t.push(e.premultiplyAlpha), t.push(e.flipY), t.push(e.unpackAlignment), t.push(e.colorSpace), t.join();
3847
3847
  }
3848
- function R(e, n) {
3848
+ function se(e, n) {
3849
3849
  let a = i.get(e);
3850
- if (e.isVideoTexture && U(e), e.isRenderTargetTexture === !1 && e.isExternalTexture !== !0 && e.version > 0 && a.__version !== e.version) {
3850
+ if (e.isVideoTexture && Ae(e), e.isRenderTargetTexture === !1 && e.isExternalTexture !== !0 && e.version > 0 && a.__version !== e.version) {
3851
3851
  let t = e.image;
3852
- if (t === null) M("WebGLRenderer: Texture marked for update but no image data found.");
3853
- else if (t.complete === !1) M("WebGLRenderer: Texture marked for update but image is incomplete");
3852
+ if (t === null) L("WebGLRenderer: Texture marked for update but no image data found.");
3853
+ else if (t.complete === !1) L("WebGLRenderer: Texture marked for update but image is incomplete");
3854
3854
  else {
3855
- B(a, e, n);
3855
+ _e(a, e, n);
3856
3856
  return;
3857
3857
  }
3858
3858
  } else e.isExternalTexture && (a.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
3859
3859
  r.bindTexture(t.TEXTURE_2D, a.__webglTexture, t.TEXTURE0 + n);
3860
3860
  }
3861
- function z(e, n) {
3861
+ function ce(e, n) {
3862
3862
  let a = i.get(e);
3863
3863
  if (e.isRenderTargetTexture === !1 && e.version > 0 && a.__version !== e.version) {
3864
- B(a, e, n);
3864
+ _e(a, e, n);
3865
3865
  return;
3866
3866
  } else e.isExternalTexture && (a.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
3867
3867
  r.bindTexture(t.TEXTURE_2D_ARRAY, a.__webglTexture, t.TEXTURE0 + n);
@@ -3869,7 +3869,7 @@ function Mr(t, n, r, i, a, o, s) {
3869
3869
  function le(e, n) {
3870
3870
  let a = i.get(e);
3871
3871
  if (e.isRenderTargetTexture === !1 && e.version > 0 && a.__version !== e.version) {
3872
- B(a, e, n);
3872
+ _e(a, e, n);
3873
3873
  return;
3874
3874
  }
3875
3875
  r.bindTexture(t.TEXTURE_3D, a.__webglTexture, t.TEXTURE0 + n);
@@ -3883,16 +3883,16 @@ function Mr(t, n, r, i, a, o, s) {
3883
3883
  r.bindTexture(t.TEXTURE_CUBE_MAP, a.__webglTexture, t.TEXTURE0 + n);
3884
3884
  }
3885
3885
  let de = {
3886
- [x]: t.REPEAT,
3887
- [O]: t.CLAMP_TO_EDGE,
3888
- [Pe]: t.MIRRORED_REPEAT
3886
+ [C]: t.REPEAT,
3887
+ [ee]: t.CLAMP_TO_EDGE,
3888
+ [Fe]: t.MIRRORED_REPEAT
3889
3889
  }, fe = {
3890
- [ce]: t.NEAREST,
3891
- [A]: t.NEAREST_MIPMAP_NEAREST,
3892
- [Me]: t.NEAREST_MIPMAP_LINEAR,
3893
- [H]: t.LINEAR,
3894
- [ae]: t.LINEAR_MIPMAP_NEAREST,
3895
- [re]: t.LINEAR_MIPMAP_LINEAR
3890
+ [oe]: t.NEAREST,
3891
+ [j]: t.NEAREST_MIPMAP_NEAREST,
3892
+ [Ne]: t.NEAREST_MIPMAP_LINEAR,
3893
+ [we]: t.LINEAR,
3894
+ [ie]: t.LINEAR_MIPMAP_NEAREST,
3895
+ [ne]: t.LINEAR_MIPMAP_LINEAR
3896
3896
  }, pe = {
3897
3897
  512: t.NEVER,
3898
3898
  519: t.ALWAYS,
@@ -3904,7 +3904,7 @@ function Mr(t, n, r, i, a, o, s) {
3904
3904
  517: t.NOTEQUAL
3905
3905
  };
3906
3906
  function me(e, r) {
3907
- if (r.type === 1015 && n.has("OES_texture_float_linear") === !1 && (r.magFilter === 1006 || r.magFilter === 1007 || r.magFilter === 1005 || r.magFilter === 1008 || r.minFilter === 1006 || r.minFilter === 1007 || r.minFilter === 1005 || r.minFilter === 1008) && M("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), t.texParameteri(e, t.TEXTURE_WRAP_S, de[r.wrapS]), t.texParameteri(e, t.TEXTURE_WRAP_T, de[r.wrapT]), (e === t.TEXTURE_3D || e === t.TEXTURE_2D_ARRAY) && t.texParameteri(e, t.TEXTURE_WRAP_R, de[r.wrapR]), t.texParameteri(e, t.TEXTURE_MAG_FILTER, fe[r.magFilter]), t.texParameteri(e, t.TEXTURE_MIN_FILTER, fe[r.minFilter]), r.compareFunction && (t.texParameteri(e, t.TEXTURE_COMPARE_MODE, t.COMPARE_REF_TO_TEXTURE), t.texParameteri(e, t.TEXTURE_COMPARE_FUNC, pe[r.compareFunction])), n.has("EXT_texture_filter_anisotropic") === !0) {
3907
+ if (r.type === 1015 && n.has("OES_texture_float_linear") === !1 && (r.magFilter === 1006 || r.magFilter === 1007 || r.magFilter === 1005 || r.magFilter === 1008 || r.minFilter === 1006 || r.minFilter === 1007 || r.minFilter === 1005 || r.minFilter === 1008) && L("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), t.texParameteri(e, t.TEXTURE_WRAP_S, de[r.wrapS]), t.texParameteri(e, t.TEXTURE_WRAP_T, de[r.wrapT]), (e === t.TEXTURE_3D || e === t.TEXTURE_2D_ARRAY) && t.texParameteri(e, t.TEXTURE_WRAP_R, de[r.wrapR]), t.texParameteri(e, t.TEXTURE_MAG_FILTER, fe[r.magFilter]), t.texParameteri(e, t.TEXTURE_MIN_FILTER, fe[r.minFilter]), r.compareFunction && (t.texParameteri(e, t.TEXTURE_COMPARE_MODE, t.COMPARE_REF_TO_TEXTURE), t.texParameteri(e, t.TEXTURE_COMPARE_FUNC, pe[r.compareFunction])), n.has("EXT_texture_filter_anisotropic") === !0) {
3908
3908
  if (r.magFilter === 1003 || r.minFilter !== 1005 && r.minFilter !== 1008 || r.type === 1015 && n.has("OES_texture_float_linear") === !1) return;
3909
3909
  if (r.anisotropy > 1 || i.get(r).__currentAnisotropy) {
3910
3910
  let o = n.get("EXT_texture_filter_anisotropic");
@@ -3914,32 +3914,32 @@ function Mr(t, n, r, i, a, o, s) {
3914
3914
  }
3915
3915
  function he(e, n) {
3916
3916
  let r = !1;
3917
- e.__webglInit === void 0 && (e.__webglInit = !0, n.addEventListener("dispose", j));
3918
- let i = n.source, a = v.get(i);
3919
- a === void 0 && (a = {}, v.set(i, a));
3920
- let o = se(n);
3917
+ e.__webglInit === void 0 && (e.__webglInit = !0, n.addEventListener("dispose", M));
3918
+ let i = n.source, a = g.get(i);
3919
+ a === void 0 && (a = {}, g.set(i, a));
3920
+ let o = B(n);
3921
3921
  if (o !== e.__cacheKey) {
3922
3922
  a[o] === void 0 && (a[o] = {
3923
3923
  texture: t.createTexture(),
3924
3924
  usedTimes: 0
3925
3925
  }, s.memory.textures++, r = !0), a[o].usedTimes++;
3926
3926
  let i = a[e.__cacheKey];
3927
- i !== void 0 && (a[e.__cacheKey].usedTimes--, i.usedTimes === 0 && te(n)), e.__cacheKey = o, e.__webglTexture = a[o].texture;
3927
+ i !== void 0 && (a[e.__cacheKey].usedTimes--, i.usedTimes === 0 && F(n)), e.__cacheKey = o, e.__webglTexture = a[o].texture;
3928
3928
  }
3929
3929
  return r;
3930
3930
  }
3931
- function ge(e, t, n) {
3931
+ function V(e, t, n) {
3932
3932
  return Math.floor(Math.floor(e / n) / t);
3933
3933
  }
3934
- function _e(e, n, i, a) {
3934
+ function ge(e, n, i, a) {
3935
3935
  let o = e.updateRanges;
3936
3936
  if (o.length === 0) r.texSubImage2D(t.TEXTURE_2D, 0, 0, 0, n.width, n.height, i, a, n.data);
3937
3937
  else {
3938
3938
  o.sort((e, t) => e.start - t.start);
3939
3939
  let s = 0;
3940
3940
  for (let e = 1; e < o.length; e++) {
3941
- let t = o[s], r = o[e], i = t.start + t.count, a = ge(r.start, n.width, 4), c = ge(t.start, n.width, 4);
3942
- r.start <= i + 1 && a === c && ge(r.start + r.count - 1, n.width, 4) === a ? t.count = Math.max(t.count, r.start + r.count - t.start) : (++s, o[s] = r);
3941
+ let t = o[s], r = o[e], i = t.start + t.count, a = V(r.start, n.width, 4), c = V(t.start, n.width, 4);
3942
+ r.start <= i + 1 && a === c && V(r.start + r.count - 1, n.width, 4) === a ? t.count = Math.max(t.count, r.start + r.count - t.start) : (++s, o[s] = r);
3943
3943
  }
3944
3944
  o.length = s + 1;
3945
3945
  let c = r.getParameter(t.UNPACK_ROW_LENGTH), l = r.getParameter(t.UNPACK_SKIP_PIXELS), u = r.getParameter(t.UNPACK_SKIP_ROWS);
@@ -3951,107 +3951,107 @@ function Mr(t, n, r, i, a, o, s) {
3951
3951
  e.clearUpdateRanges(), r.pixelStorei(t.UNPACK_ROW_LENGTH, c), r.pixelStorei(t.UNPACK_SKIP_PIXELS, l), r.pixelStorei(t.UNPACK_SKIP_ROWS, u);
3952
3952
  }
3953
3953
  }
3954
- function B(e, n, s) {
3954
+ function _e(e, n, s) {
3955
3955
  let c = t.TEXTURE_2D;
3956
3956
  (n.isDataArrayTexture || n.isCompressedArrayTexture) && (c = t.TEXTURE_2D_ARRAY), n.isData3DTexture && (c = t.TEXTURE_3D);
3957
- let u = he(e, n), d = n.source;
3957
+ let l = he(e, n), d = n.source;
3958
3958
  r.bindTexture(c, e.__webglTexture, t.TEXTURE0 + s);
3959
3959
  let f = i.get(d);
3960
- if (d.version !== f.__version || u === !0) {
3960
+ if (d.version !== f.__version || l === !0) {
3961
3961
  if (r.activeTexture(t.TEXTURE0 + s), !(typeof ImageBitmap < "u" && n.image instanceof ImageBitmap)) {
3962
- let e = l.getPrimaries(l.workingColorSpace), i = n.colorSpace === "" ? null : l.getPrimaries(n.colorSpace), a = n.colorSpace === "" || e === i ? t.NONE : t.BROWSER_DEFAULT_WEBGL;
3962
+ let e = u.getPrimaries(u.workingColorSpace), i = n.colorSpace === "" ? null : u.getPrimaries(n.colorSpace), a = n.colorSpace === "" || e === i ? t.NONE : t.BROWSER_DEFAULT_WEBGL;
3963
3963
  r.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, n.flipY), r.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, n.premultiplyAlpha), r.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL, a);
3964
3964
  }
3965
3965
  r.pixelStorei(t.UNPACK_ALIGNMENT, n.unpackAlignment);
3966
3966
  let e = S(n.image, !1, a.maxTextureSize);
3967
- e = Ae(n, e);
3968
- let i = o.convert(n.format, n.colorSpace), p = o.convert(n.type), _ = D(n.internalFormat, i, p, n.normalized, n.colorSpace, n.isVideoTexture);
3967
+ e = je(n, e);
3968
+ let i = o.convert(n.format, n.colorSpace), p = o.convert(n.type), h = D(n.internalFormat, i, p, n.normalized, n.colorSpace, n.isVideoTexture);
3969
3969
  me(c, n);
3970
- let v, y = n.mipmaps, b = n.isVideoTexture !== !0, x = f.__version === void 0 || u === !0, T = d.dataReady, E = ee(n, e);
3971
- if (n.isDepthTexture) _ = k(n.format === g, n.type), x && (b ? r.texStorage2D(t.TEXTURE_2D, 1, _, e.width, e.height) : r.texImage2D(t.TEXTURE_2D, 0, _, e.width, e.height, 0, i, p, null));
3972
- else if (n.isDataTexture) if (y.length > 0) {
3973
- b && x && r.texStorage2D(t.TEXTURE_2D, E, _, y[0].width, y[0].height);
3974
- for (let e = 0, n = y.length; e < n; e++) v = y[e], b ? T && r.texSubImage2D(t.TEXTURE_2D, e, 0, 0, v.width, v.height, i, p, v.data) : r.texImage2D(t.TEXTURE_2D, e, _, v.width, v.height, 0, i, p, v.data);
3970
+ let g, _ = n.mipmaps, v = n.isVideoTexture !== !0, b = f.__version === void 0 || l === !0, C = d.dataReady, E = k(n, e);
3971
+ if (n.isDepthTexture) h = O(n.format === y, n.type), b && (v ? r.texStorage2D(t.TEXTURE_2D, 1, h, e.width, e.height) : r.texImage2D(t.TEXTURE_2D, 0, h, e.width, e.height, 0, i, p, null));
3972
+ else if (n.isDataTexture) if (_.length > 0) {
3973
+ v && b && r.texStorage2D(t.TEXTURE_2D, E, h, _[0].width, _[0].height);
3974
+ for (let e = 0, n = _.length; e < n; e++) g = _[e], v ? C && r.texSubImage2D(t.TEXTURE_2D, e, 0, 0, g.width, g.height, i, p, g.data) : r.texImage2D(t.TEXTURE_2D, e, h, g.width, g.height, 0, i, p, g.data);
3975
3975
  n.generateMipmaps = !1;
3976
- } else b ? (x && r.texStorage2D(t.TEXTURE_2D, E, _, e.width, e.height), T && _e(n, e, i, p)) : r.texImage2D(t.TEXTURE_2D, 0, _, e.width, e.height, 0, i, p, e.data);
3976
+ } else v ? (b && r.texStorage2D(t.TEXTURE_2D, E, h, e.width, e.height), C && ge(n, e, i, p)) : r.texImage2D(t.TEXTURE_2D, 0, h, e.width, e.height, 0, i, p, e.data);
3977
3977
  else if (n.isCompressedTexture) if (n.isCompressedArrayTexture) {
3978
- b && x && r.texStorage3D(t.TEXTURE_2D_ARRAY, E, _, y[0].width, y[0].height, e.depth);
3979
- for (let a = 0, o = y.length; a < o; a++) if (v = y[a], n.format !== 1023) if (i !== null) if (b) {
3980
- if (T) if (n.layerUpdates.size > 0) {
3981
- let e = m(v.width, v.height, n.format, n.type);
3978
+ v && b && r.texStorage3D(t.TEXTURE_2D_ARRAY, E, h, _[0].width, _[0].height, e.depth);
3979
+ for (let a = 0, o = _.length; a < o; a++) if (g = _[a], n.format !== 1023) if (i !== null) if (v) {
3980
+ if (C) if (n.layerUpdates.size > 0) {
3981
+ let e = x(g.width, g.height, n.format, n.type);
3982
3982
  for (let o of n.layerUpdates) {
3983
- let n = v.data.subarray(o * e / v.data.BYTES_PER_ELEMENT, (o + 1) * e / v.data.BYTES_PER_ELEMENT);
3984
- r.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY, a, 0, 0, o, v.width, v.height, 1, i, n);
3983
+ let n = g.data.subarray(o * e / g.data.BYTES_PER_ELEMENT, (o + 1) * e / g.data.BYTES_PER_ELEMENT);
3984
+ r.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY, a, 0, 0, o, g.width, g.height, 1, i, n);
3985
3985
  }
3986
3986
  n.clearLayerUpdates();
3987
- } else r.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY, a, 0, 0, 0, v.width, v.height, e.depth, i, v.data);
3988
- } else r.compressedTexImage3D(t.TEXTURE_2D_ARRAY, a, _, v.width, v.height, e.depth, 0, v.data, 0, 0);
3989
- else M("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");
3990
- else b ? T && r.texSubImage3D(t.TEXTURE_2D_ARRAY, a, 0, 0, 0, v.width, v.height, e.depth, i, p, v.data) : r.texImage3D(t.TEXTURE_2D_ARRAY, a, _, v.width, v.height, e.depth, 0, i, p, v.data);
3987
+ } else r.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY, a, 0, 0, 0, g.width, g.height, e.depth, i, g.data);
3988
+ } else r.compressedTexImage3D(t.TEXTURE_2D_ARRAY, a, h, g.width, g.height, e.depth, 0, g.data, 0, 0);
3989
+ else L("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");
3990
+ else v ? C && r.texSubImage3D(t.TEXTURE_2D_ARRAY, a, 0, 0, 0, g.width, g.height, e.depth, i, p, g.data) : r.texImage3D(t.TEXTURE_2D_ARRAY, a, h, g.width, g.height, e.depth, 0, i, p, g.data);
3991
3991
  } else {
3992
- b && x && r.texStorage2D(t.TEXTURE_2D, E, _, y[0].width, y[0].height);
3993
- for (let e = 0, a = y.length; e < a; e++) v = y[e], n.format === 1023 ? b ? T && r.texSubImage2D(t.TEXTURE_2D, e, 0, 0, v.width, v.height, i, p, v.data) : r.texImage2D(t.TEXTURE_2D, e, _, v.width, v.height, 0, i, p, v.data) : i === null ? M("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : b ? T && r.compressedTexSubImage2D(t.TEXTURE_2D, e, 0, 0, v.width, v.height, i, v.data) : r.compressedTexImage2D(t.TEXTURE_2D, e, _, v.width, v.height, 0, v.data);
3992
+ v && b && r.texStorage2D(t.TEXTURE_2D, E, h, _[0].width, _[0].height);
3993
+ for (let e = 0, a = _.length; e < a; e++) g = _[e], n.format === 1023 ? v ? C && r.texSubImage2D(t.TEXTURE_2D, e, 0, 0, g.width, g.height, i, p, g.data) : r.texImage2D(t.TEXTURE_2D, e, h, g.width, g.height, 0, i, p, g.data) : i === null ? L("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : v ? C && r.compressedTexSubImage2D(t.TEXTURE_2D, e, 0, 0, g.width, g.height, i, g.data) : r.compressedTexImage2D(t.TEXTURE_2D, e, h, g.width, g.height, 0, g.data);
3994
3994
  }
3995
- else if (n.isDataArrayTexture) if (b) {
3996
- if (x && r.texStorage3D(t.TEXTURE_2D_ARRAY, E, _, e.width, e.height, e.depth), T) if (n.layerUpdates.size > 0) {
3997
- let a = m(e.width, e.height, n.format, n.type);
3995
+ else if (n.isDataArrayTexture) if (v) {
3996
+ if (b && r.texStorage3D(t.TEXTURE_2D_ARRAY, E, h, e.width, e.height, e.depth), C) if (n.layerUpdates.size > 0) {
3997
+ let a = x(e.width, e.height, n.format, n.type);
3998
3998
  for (let o of n.layerUpdates) {
3999
3999
  let n = e.data.subarray(o * a / e.data.BYTES_PER_ELEMENT, (o + 1) * a / e.data.BYTES_PER_ELEMENT);
4000
4000
  r.texSubImage3D(t.TEXTURE_2D_ARRAY, 0, 0, 0, o, e.width, e.height, 1, i, p, n);
4001
4001
  }
4002
4002
  n.clearLayerUpdates();
4003
4003
  } else r.texSubImage3D(t.TEXTURE_2D_ARRAY, 0, 0, 0, 0, e.width, e.height, e.depth, i, p, e.data);
4004
- } else r.texImage3D(t.TEXTURE_2D_ARRAY, 0, _, e.width, e.height, e.depth, 0, i, p, e.data);
4005
- else if (n.isData3DTexture) b ? (x && r.texStorage3D(t.TEXTURE_3D, E, _, e.width, e.height, e.depth), T && r.texSubImage3D(t.TEXTURE_3D, 0, 0, 0, 0, e.width, e.height, e.depth, i, p, e.data)) : r.texImage3D(t.TEXTURE_3D, 0, _, e.width, e.height, e.depth, 0, i, p, e.data);
4004
+ } else r.texImage3D(t.TEXTURE_2D_ARRAY, 0, h, e.width, e.height, e.depth, 0, i, p, e.data);
4005
+ else if (n.isData3DTexture) v ? (b && r.texStorage3D(t.TEXTURE_3D, E, h, e.width, e.height, e.depth), C && r.texSubImage3D(t.TEXTURE_3D, 0, 0, 0, 0, e.width, e.height, e.depth, i, p, e.data)) : r.texImage3D(t.TEXTURE_3D, 0, h, e.width, e.height, e.depth, 0, i, p, e.data);
4006
4006
  else if (n.isFramebufferTexture) {
4007
- if (x) if (b) r.texStorage2D(t.TEXTURE_2D, E, _, e.width, e.height);
4007
+ if (b) if (v) r.texStorage2D(t.TEXTURE_2D, E, h, e.width, e.height);
4008
4008
  else {
4009
4009
  let n = e.width, a = e.height;
4010
- for (let e = 0; e < E; e++) r.texImage2D(t.TEXTURE_2D, e, _, n, a, 0, i, p, null), n >>= 1, a >>= 1;
4010
+ for (let e = 0; e < E; e++) r.texImage2D(t.TEXTURE_2D, e, h, n, a, 0, i, p, null), n >>= 1, a >>= 1;
4011
4011
  }
4012
4012
  } else if (n.isHTMLTexture) {
4013
4013
  if ("texElementImage2D" in t) {
4014
4014
  let r = t.canvas;
4015
4015
  if (r.hasAttribute("layoutsubtree") || r.setAttribute("layoutsubtree", "true"), e.parentNode !== r) {
4016
- r.appendChild(e), h.add(n), r.onpaint = (e) => {
4016
+ r.appendChild(e), m.add(n), r.onpaint = (e) => {
4017
4017
  let t = e.changedElements;
4018
- for (let e of h) t.includes(e.image) && (e.needsUpdate = !0);
4018
+ for (let e of m) t.includes(e.image) && (e.needsUpdate = !0);
4019
4019
  }, r.requestPaint();
4020
4020
  return;
4021
4021
  }
4022
4022
  let i = t.RGBA, a = t.RGBA, o = t.UNSIGNED_BYTE;
4023
4023
  t.texElementImage2D(t.TEXTURE_2D, 0, i, a, o, e), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE);
4024
4024
  }
4025
- } else if (y.length > 0) {
4026
- if (b && x) {
4027
- let e = Ne(y[0]);
4028
- r.texStorage2D(t.TEXTURE_2D, E, _, e.width, e.height);
4025
+ } else if (_.length > 0) {
4026
+ if (v && b) {
4027
+ let e = Me(_[0]);
4028
+ r.texStorage2D(t.TEXTURE_2D, E, h, e.width, e.height);
4029
4029
  }
4030
- for (let e = 0, n = y.length; e < n; e++) v = y[e], b ? T && r.texSubImage2D(t.TEXTURE_2D, e, 0, 0, i, p, v) : r.texImage2D(t.TEXTURE_2D, e, _, i, p, v);
4030
+ for (let e = 0, n = _.length; e < n; e++) g = _[e], v ? C && r.texSubImage2D(t.TEXTURE_2D, e, 0, 0, i, p, g) : r.texImage2D(t.TEXTURE_2D, e, h, i, p, g);
4031
4031
  n.generateMipmaps = !1;
4032
- } else if (b) {
4033
- if (x) {
4034
- let n = Ne(e);
4035
- r.texStorage2D(t.TEXTURE_2D, E, _, n.width, n.height);
4032
+ } else if (v) {
4033
+ if (b) {
4034
+ let n = Me(e);
4035
+ r.texStorage2D(t.TEXTURE_2D, E, h, n.width, n.height);
4036
4036
  }
4037
- T && r.texSubImage2D(t.TEXTURE_2D, 0, 0, 0, i, p, e);
4038
- } else r.texImage2D(t.TEXTURE_2D, 0, _, i, p, e);
4039
- C(n) && w(c), f.__version = d.version, n.onUpdate && n.onUpdate(n);
4037
+ C && r.texSubImage2D(t.TEXTURE_2D, 0, 0, 0, i, p, e);
4038
+ } else r.texImage2D(t.TEXTURE_2D, 0, h, i, p, e);
4039
+ w(n) && T(c), f.__version = d.version, n.onUpdate && n.onUpdate(n);
4040
4040
  }
4041
4041
  e.__version = n.version;
4042
4042
  }
4043
4043
  function ve(e, n, s) {
4044
4044
  if (n.image.length !== 6) return;
4045
- let c = he(e, n), u = n.source;
4045
+ let c = he(e, n), l = n.source;
4046
4046
  r.bindTexture(t.TEXTURE_CUBE_MAP, e.__webglTexture, t.TEXTURE0 + s);
4047
- let d = i.get(u);
4048
- if (u.version !== d.__version || c === !0) {
4047
+ let d = i.get(l);
4048
+ if (l.version !== d.__version || c === !0) {
4049
4049
  r.activeTexture(t.TEXTURE0 + s);
4050
- let e = l.getPrimaries(l.workingColorSpace), i = n.colorSpace === "" ? null : l.getPrimaries(n.colorSpace), f = n.colorSpace === "" || e === i ? t.NONE : t.BROWSER_DEFAULT_WEBGL;
4050
+ let e = u.getPrimaries(u.workingColorSpace), i = n.colorSpace === "" ? null : u.getPrimaries(n.colorSpace), f = n.colorSpace === "" || e === i ? t.NONE : t.BROWSER_DEFAULT_WEBGL;
4051
4051
  r.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, n.flipY), r.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, n.premultiplyAlpha), r.pixelStorei(t.UNPACK_ALIGNMENT, n.unpackAlignment), r.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL, f);
4052
4052
  let p = n.isCompressedTexture || n.image[0].isCompressedTexture, m = n.image[0] && n.image[0].isDataTexture, h = [];
4053
- for (let e = 0; e < 6; e++) !p && !m ? h[e] = S(n.image[e], !0, a.maxCubemapSize) : h[e] = m ? n.image[e].image : n.image[e], h[e] = Ae(n, h[e]);
4054
- let g = h[0], _ = o.convert(n.format, n.colorSpace), v = o.convert(n.type), y = D(n.internalFormat, _, v, n.normalized, n.colorSpace), b = n.isVideoTexture !== !0, x = d.__version === void 0 || c === !0, T = u.dataReady, E = ee(n, g);
4053
+ for (let e = 0; e < 6; e++) !p && !m ? h[e] = S(n.image[e], !0, a.maxCubemapSize) : h[e] = m ? n.image[e].image : n.image[e], h[e] = je(n, h[e]);
4054
+ let g = h[0], _ = o.convert(n.format, n.colorSpace), v = o.convert(n.type), y = D(n.internalFormat, _, v, n.normalized, n.colorSpace), b = n.isVideoTexture !== !0, x = d.__version === void 0 || c === !0, C = l.dataReady, E = k(n, g);
4055
4055
  me(t.TEXTURE_CUBE_MAP, n);
4056
4056
  let O;
4057
4057
  if (p) {
@@ -4060,30 +4060,30 @@ function Mr(t, n, r, i, a, o, s) {
4060
4060
  O = h[e].mipmaps;
4061
4061
  for (let i = 0; i < O.length; i++) {
4062
4062
  let a = O[i];
4063
- n.format === 1023 ? b ? T && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, i, 0, 0, a.width, a.height, _, v, a.data) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, i, y, a.width, a.height, 0, _, v, a.data) : _ === null ? M("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : b ? T && r.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, i, 0, 0, a.width, a.height, _, a.data) : r.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, i, y, a.width, a.height, 0, a.data);
4063
+ n.format === 1023 ? b ? C && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, i, 0, 0, a.width, a.height, _, v, a.data) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, i, y, a.width, a.height, 0, _, v, a.data) : _ === null ? L("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : b ? C && r.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, i, 0, 0, a.width, a.height, _, a.data) : r.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, i, y, a.width, a.height, 0, a.data);
4064
4064
  }
4065
4065
  }
4066
4066
  } else {
4067
4067
  if (O = n.mipmaps, b && x) {
4068
4068
  O.length > 0 && E++;
4069
- let e = Ne(h[0]);
4069
+ let e = Me(h[0]);
4070
4070
  r.texStorage2D(t.TEXTURE_CUBE_MAP, E, y, e.width, e.height);
4071
4071
  }
4072
4072
  for (let e = 0; e < 6; e++) if (m) {
4073
- b ? T && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, 0, 0, 0, h[e].width, h[e].height, _, v, h[e].data) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, 0, y, h[e].width, h[e].height, 0, _, v, h[e].data);
4073
+ b ? C && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, 0, 0, 0, h[e].width, h[e].height, _, v, h[e].data) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, 0, y, h[e].width, h[e].height, 0, _, v, h[e].data);
4074
4074
  for (let n = 0; n < O.length; n++) {
4075
4075
  let i = O[n].image[e].image;
4076
- b ? T && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, n + 1, 0, 0, i.width, i.height, _, v, i.data) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, n + 1, y, i.width, i.height, 0, _, v, i.data);
4076
+ b ? C && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, n + 1, 0, 0, i.width, i.height, _, v, i.data) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, n + 1, y, i.width, i.height, 0, _, v, i.data);
4077
4077
  }
4078
4078
  } else {
4079
- b ? T && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, 0, 0, 0, _, v, h[e]) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, 0, y, _, v, h[e]);
4079
+ b ? C && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, 0, 0, 0, _, v, h[e]) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, 0, y, _, v, h[e]);
4080
4080
  for (let n = 0; n < O.length; n++) {
4081
4081
  let i = O[n];
4082
- b ? T && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, n + 1, 0, 0, _, v, i.image[e]) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, n + 1, y, _, v, i.image[e]);
4082
+ b ? C && r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, n + 1, 0, 0, _, v, i.image[e]) : r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + e, n + 1, y, _, v, i.image[e]);
4083
4083
  }
4084
4084
  }
4085
4085
  }
4086
- C(n) && w(t.TEXTURE_CUBE_MAP), d.__version = u.version, n.onUpdate && n.onUpdate(n);
4086
+ w(n) && T(t.TEXTURE_CUBE_MAP), d.__version = l.version, n.onUpdate && n.onUpdate(n);
4087
4087
  }
4088
4088
  e.__version = n.version;
4089
4089
  }
@@ -4093,36 +4093,36 @@ function Mr(t, n, r, i, a, o, s) {
4093
4093
  let e = Math.max(1, n.width >> u), i = Math.max(1, n.height >> u);
4094
4094
  l === t.TEXTURE_3D || l === t.TEXTURE_2D_ARRAY ? r.texImage3D(l, u, p, e, i, n.depth, 0, d, f, null) : r.texImage2D(l, u, p, e, i, 0, d, f, null);
4095
4095
  }
4096
- r.bindFramebuffer(t.FRAMEBUFFER, e), ke(n) ? c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER, s, l, h.__webglTexture, 0, Oe(n)) : (l === t.TEXTURE_2D || l >= t.TEXTURE_CUBE_MAP_POSITIVE_X && l <= t.TEXTURE_CUBE_MAP_NEGATIVE_Z) && t.framebufferTexture2D(t.FRAMEBUFFER, s, l, h.__webglTexture, u), r.bindFramebuffer(t.FRAMEBUFFER, null);
4096
+ r.bindFramebuffer(t.FRAMEBUFFER, e), U(n) ? c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER, s, l, h.__webglTexture, 0, ke(n)) : (l === t.TEXTURE_2D || l >= t.TEXTURE_CUBE_MAP_POSITIVE_X && l <= t.TEXTURE_CUBE_MAP_NEGATIVE_Z) && t.framebufferTexture2D(t.FRAMEBUFFER, s, l, h.__webglTexture, u), r.bindFramebuffer(t.FRAMEBUFFER, null);
4097
4097
  }
4098
4098
  function be(e, n, r) {
4099
4099
  if (t.bindRenderbuffer(t.RENDERBUFFER, e), n.depthBuffer) {
4100
- let i = n.depthTexture, a = i && i.isDepthTexture ? i.type : null, o = k(n.stencilBuffer, a), s = n.stencilBuffer ? t.DEPTH_STENCIL_ATTACHMENT : t.DEPTH_ATTACHMENT;
4101
- ke(n) ? c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER, Oe(n), o, n.width, n.height) : r ? t.renderbufferStorageMultisample(t.RENDERBUFFER, Oe(n), o, n.width, n.height) : t.renderbufferStorage(t.RENDERBUFFER, o, n.width, n.height), t.framebufferRenderbuffer(t.FRAMEBUFFER, s, t.RENDERBUFFER, e);
4100
+ let i = n.depthTexture, a = i && i.isDepthTexture ? i.type : null, o = O(n.stencilBuffer, a), s = n.stencilBuffer ? t.DEPTH_STENCIL_ATTACHMENT : t.DEPTH_ATTACHMENT;
4101
+ U(n) ? c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER, ke(n), o, n.width, n.height) : r ? t.renderbufferStorageMultisample(t.RENDERBUFFER, ke(n), o, n.width, n.height) : t.renderbufferStorage(t.RENDERBUFFER, o, n.width, n.height), t.framebufferRenderbuffer(t.FRAMEBUFFER, s, t.RENDERBUFFER, e);
4102
4102
  } else {
4103
4103
  let e = n.textures;
4104
4104
  for (let i = 0; i < e.length; i++) {
4105
4105
  let a = e[i], s = o.convert(a.format, a.colorSpace), l = o.convert(a.type), u = D(a.internalFormat, s, l, a.normalized, a.colorSpace);
4106
- ke(n) ? c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER, Oe(n), u, n.width, n.height) : r ? t.renderbufferStorageMultisample(t.RENDERBUFFER, Oe(n), u, n.width, n.height) : t.renderbufferStorage(t.RENDERBUFFER, u, n.width, n.height);
4106
+ U(n) ? c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER, ke(n), u, n.width, n.height) : r ? t.renderbufferStorageMultisample(t.RENDERBUFFER, ke(n), u, n.width, n.height) : t.renderbufferStorage(t.RENDERBUFFER, u, n.width, n.height);
4107
4107
  }
4108
4108
  }
4109
4109
  t.bindRenderbuffer(t.RENDERBUFFER, null);
4110
4110
  }
4111
- function V(e, n, a) {
4111
+ function H(e, n, a) {
4112
4112
  let s = n.isWebGLCubeRenderTarget === !0;
4113
4113
  if (r.bindFramebuffer(t.FRAMEBUFFER, e), !(n.depthTexture && n.depthTexture.isDepthTexture)) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
4114
4114
  let l = i.get(n.depthTexture);
4115
4115
  if (l.__renderTarget = n, (!l.__webglTexture || n.depthTexture.image.width !== n.width || n.depthTexture.image.height !== n.height) && (n.depthTexture.image.width = n.width, n.depthTexture.image.height = n.height, n.depthTexture.needsUpdate = !0), s) {
4116
- if (l.__webglInit === void 0 && (l.__webglInit = !0, n.depthTexture.addEventListener("dispose", j)), l.__webglTexture === void 0) {
4116
+ if (l.__webglInit === void 0 && (l.__webglInit = !0, n.depthTexture.addEventListener("dispose", M)), l.__webglTexture === void 0) {
4117
4117
  l.__webglTexture = t.createTexture(), r.bindTexture(t.TEXTURE_CUBE_MAP, l.__webglTexture), me(t.TEXTURE_CUBE_MAP, n.depthTexture);
4118
4118
  let e = o.convert(n.depthTexture.format), i = o.convert(n.depthTexture.type), a;
4119
4119
  n.depthTexture.format === 1026 ? a = t.DEPTH_COMPONENT24 : n.depthTexture.format === 1027 && (a = t.DEPTH24_STENCIL8);
4120
4120
  for (let r = 0; r < 6; r++) t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0, a, n.width, n.height, 0, e, i, null);
4121
4121
  }
4122
- } else R(n.depthTexture, 0);
4123
- let u = l.__webglTexture, d = Oe(n), f = s ? t.TEXTURE_CUBE_MAP_POSITIVE_X + a : t.TEXTURE_2D, p = n.depthTexture.format === 1027 ? t.DEPTH_STENCIL_ATTACHMENT : t.DEPTH_ATTACHMENT;
4124
- if (n.depthTexture.format === 1026) ke(n) ? c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER, p, f, u, 0, d) : t.framebufferTexture2D(t.FRAMEBUFFER, p, f, u, 0);
4125
- else if (n.depthTexture.format === 1027) ke(n) ? c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER, p, f, u, 0, d) : t.framebufferTexture2D(t.FRAMEBUFFER, p, f, u, 0);
4122
+ } else se(n.depthTexture, 0);
4123
+ let u = l.__webglTexture, d = ke(n), f = s ? t.TEXTURE_CUBE_MAP_POSITIVE_X + a : t.TEXTURE_2D, p = n.depthTexture.format === 1027 ? t.DEPTH_STENCIL_ATTACHMENT : t.DEPTH_ATTACHMENT;
4124
+ if (n.depthTexture.format === 1026) U(n) ? c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER, p, f, u, 0, d) : t.framebufferTexture2D(t.FRAMEBUFFER, p, f, u, 0);
4125
+ else if (n.depthTexture.format === 1027) U(n) ? c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER, p, f, u, 0, d) : t.framebufferTexture2D(t.FRAMEBUFFER, p, f, u, 0);
4126
4126
  else throw Error("Unknown depthTexture format");
4127
4127
  }
4128
4128
  function xe(e) {
@@ -4137,10 +4137,10 @@ function Mr(t, n, r, i, a, o, s) {
4137
4137
  }
4138
4138
  n.__boundDepthTexture = t;
4139
4139
  }
4140
- if (e.depthTexture && !n.__autoAllocateDepthBuffer) if (a) for (let t = 0; t < 6; t++) V(n.__webglFramebuffer[t], e, t);
4140
+ if (e.depthTexture && !n.__autoAllocateDepthBuffer) if (a) for (let t = 0; t < 6; t++) H(n.__webglFramebuffer[t], e, t);
4141
4141
  else {
4142
4142
  let t = e.texture.mipmaps;
4143
- t && t.length > 0 ? V(n.__webglFramebuffer[0], e, 0) : V(n.__webglFramebuffer, e, 0);
4143
+ t && t.length > 0 ? H(n.__webglFramebuffer[0], e, 0) : H(n.__webglFramebuffer, e, 0);
4144
4144
  }
4145
4145
  else if (a) {
4146
4146
  n.__webglDepthbuffer = [];
@@ -4182,12 +4182,12 @@ function Mr(t, n, r, i, a, o, s) {
4182
4182
  let n = i.get(l[e]);
4183
4183
  n.__webglTexture === void 0 && (n.__webglTexture = t.createTexture(), s.memory.textures++);
4184
4184
  }
4185
- if (e.samples > 0 && ke(e) === !1) {
4185
+ if (e.samples > 0 && U(e) === !1) {
4186
4186
  a.__webglMultisampledFramebuffer = t.createFramebuffer(), a.__webglColorRenderbuffer = [], r.bindFramebuffer(t.FRAMEBUFFER, a.__webglMultisampledFramebuffer);
4187
4187
  for (let n = 0; n < l.length; n++) {
4188
4188
  let r = l[n];
4189
4189
  a.__webglColorRenderbuffer[n] = t.createRenderbuffer(), t.bindRenderbuffer(t.RENDERBUFFER, a.__webglColorRenderbuffer[n]);
4190
- let i = o.convert(r.format, r.colorSpace), s = o.convert(r.type), c = D(r.internalFormat, i, s, r.normalized, r.colorSpace, e.isXRRenderTarget === !0), u = Oe(e);
4190
+ let i = o.convert(r.format, r.colorSpace), s = o.convert(r.type), c = D(r.internalFormat, i, s, r.normalized, r.colorSpace, e.isXRRenderTarget === !0), u = ke(e);
4191
4191
  t.renderbufferStorageMultisample(t.RENDERBUFFER, u, c, e.width, e.height), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0 + n, t.RENDERBUFFER, a.__webglColorRenderbuffer[n]);
4192
4192
  }
4193
4193
  t.bindRenderbuffer(t.RENDERBUFFER, null), e.depthBuffer && (a.__webglDepthRenderbuffer = t.createRenderbuffer(), be(a.__webglDepthRenderbuffer, e, !0)), r.bindFramebuffer(t.FRAMEBUFFER, null);
@@ -4197,85 +4197,85 @@ function Mr(t, n, r, i, a, o, s) {
4197
4197
  r.bindTexture(t.TEXTURE_CUBE_MAP, c.__webglTexture), me(t.TEXTURE_CUBE_MAP, n);
4198
4198
  for (let r = 0; r < 6; r++) if (n.mipmaps && n.mipmaps.length > 0) for (let i = 0; i < n.mipmaps.length; i++) ye(a.__webglFramebuffer[r][i], e, n, t.COLOR_ATTACHMENT0, t.TEXTURE_CUBE_MAP_POSITIVE_X + r, i);
4199
4199
  else ye(a.__webglFramebuffer[r], e, n, t.COLOR_ATTACHMENT0, t.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0);
4200
- C(n) && w(t.TEXTURE_CUBE_MAP), r.unbindTexture();
4200
+ w(n) && T(t.TEXTURE_CUBE_MAP), r.unbindTexture();
4201
4201
  } else if (d) {
4202
4202
  for (let n = 0, o = l.length; n < o; n++) {
4203
4203
  let o = l[n], s = i.get(o), c = t.TEXTURE_2D;
4204
- (e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (c = e.isWebGL3DRenderTarget ? t.TEXTURE_3D : t.TEXTURE_2D_ARRAY), r.bindTexture(c, s.__webglTexture), me(c, o), ye(a.__webglFramebuffer, e, o, t.COLOR_ATTACHMENT0 + n, c, 0), C(o) && w(c);
4204
+ (e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (c = e.isWebGL3DRenderTarget ? t.TEXTURE_3D : t.TEXTURE_2D_ARRAY), r.bindTexture(c, s.__webglTexture), me(c, o), ye(a.__webglFramebuffer, e, o, t.COLOR_ATTACHMENT0 + n, c, 0), w(o) && T(c);
4205
4205
  }
4206
4206
  r.unbindTexture();
4207
4207
  } else {
4208
4208
  let i = t.TEXTURE_2D;
4209
4209
  if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? t.TEXTURE_3D : t.TEXTURE_2D_ARRAY), r.bindTexture(i, c.__webglTexture), me(i, n), n.mipmaps && n.mipmaps.length > 0) for (let r = 0; r < n.mipmaps.length; r++) ye(a.__webglFramebuffer[r], e, n, t.COLOR_ATTACHMENT0, i, r);
4210
4210
  else ye(a.__webglFramebuffer, e, n, t.COLOR_ATTACHMENT0, i, 0);
4211
- C(n) && w(i), r.unbindTexture();
4211
+ w(n) && T(i), r.unbindTexture();
4212
4212
  }
4213
4213
  e.depthBuffer && xe(e);
4214
4214
  }
4215
- function we(e) {
4215
+ function Te(e) {
4216
4216
  let t = e.textures;
4217
4217
  for (let n = 0, a = t.length; n < a; n++) {
4218
4218
  let a = t[n];
4219
- if (C(a)) {
4219
+ if (w(a)) {
4220
4220
  let t = E(e), n = i.get(a).__webglTexture;
4221
- r.bindTexture(t, n), w(t), r.unbindTexture();
4221
+ r.bindTexture(t, n), T(t), r.unbindTexture();
4222
4222
  }
4223
4223
  }
4224
4224
  }
4225
- let Te = [], Ee = [];
4226
- function De(e) {
4225
+ let Ee = [], De = [];
4226
+ function Oe(e) {
4227
4227
  if (e.samples > 0) {
4228
- if (ke(e) === !1) {
4229
- let n = e.textures, a = e.width, o = e.height, s = t.COLOR_BUFFER_BIT, c = e.stencilBuffer ? t.DEPTH_STENCIL_ATTACHMENT : t.DEPTH_ATTACHMENT, l = i.get(e), d = n.length > 1;
4230
- if (d) for (let e = 0; e < n.length; e++) r.bindFramebuffer(t.FRAMEBUFFER, l.__webglMultisampledFramebuffer), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0 + e, t.RENDERBUFFER, null), r.bindFramebuffer(t.FRAMEBUFFER, l.__webglFramebuffer), t.framebufferTexture2D(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0 + e, t.TEXTURE_2D, null, 0);
4231
- r.bindFramebuffer(t.READ_FRAMEBUFFER, l.__webglMultisampledFramebuffer);
4228
+ if (U(e) === !1) {
4229
+ let n = e.textures, a = e.width, o = e.height, s = t.COLOR_BUFFER_BIT, c = e.stencilBuffer ? t.DEPTH_STENCIL_ATTACHMENT : t.DEPTH_ATTACHMENT, u = i.get(e), d = n.length > 1;
4230
+ if (d) for (let e = 0; e < n.length; e++) r.bindFramebuffer(t.FRAMEBUFFER, u.__webglMultisampledFramebuffer), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0 + e, t.RENDERBUFFER, null), r.bindFramebuffer(t.FRAMEBUFFER, u.__webglFramebuffer), t.framebufferTexture2D(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0 + e, t.TEXTURE_2D, null, 0);
4231
+ r.bindFramebuffer(t.READ_FRAMEBUFFER, u.__webglMultisampledFramebuffer);
4232
4232
  let f = e.texture.mipmaps;
4233
- f && f.length > 0 ? r.bindFramebuffer(t.DRAW_FRAMEBUFFER, l.__webglFramebuffer[0]) : r.bindFramebuffer(t.DRAW_FRAMEBUFFER, l.__webglFramebuffer);
4233
+ f && f.length > 0 ? r.bindFramebuffer(t.DRAW_FRAMEBUFFER, u.__webglFramebuffer[0]) : r.bindFramebuffer(t.DRAW_FRAMEBUFFER, u.__webglFramebuffer);
4234
4234
  for (let r = 0; r < n.length; r++) {
4235
4235
  if (e.resolveDepthBuffer && (e.depthBuffer && (s |= t.DEPTH_BUFFER_BIT), e.stencilBuffer && e.resolveStencilBuffer && (s |= t.STENCIL_BUFFER_BIT)), d) {
4236
- t.framebufferRenderbuffer(t.READ_FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.RENDERBUFFER, l.__webglColorRenderbuffer[r]);
4236
+ t.framebufferRenderbuffer(t.READ_FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.RENDERBUFFER, u.__webglColorRenderbuffer[r]);
4237
4237
  let e = i.get(n[r]).__webglTexture;
4238
4238
  t.framebufferTexture2D(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, e, 0);
4239
4239
  }
4240
- t.blitFramebuffer(0, 0, a, o, 0, 0, a, o, s, t.NEAREST), u === !0 && (Te.length = 0, Ee.length = 0, Te.push(t.COLOR_ATTACHMENT0 + r), e.depthBuffer && e.resolveDepthBuffer === !1 && (Te.push(c), Ee.push(c), t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER, Ee)), t.invalidateFramebuffer(t.READ_FRAMEBUFFER, Te));
4240
+ t.blitFramebuffer(0, 0, a, o, 0, 0, a, o, s, t.NEAREST), l === !0 && (Ee.length = 0, De.length = 0, Ee.push(t.COLOR_ATTACHMENT0 + r), e.depthBuffer && e.resolveDepthBuffer === !1 && (Ee.push(c), De.push(c), t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER, De)), t.invalidateFramebuffer(t.READ_FRAMEBUFFER, Ee));
4241
4241
  }
4242
4242
  if (r.bindFramebuffer(t.READ_FRAMEBUFFER, null), r.bindFramebuffer(t.DRAW_FRAMEBUFFER, null), d) for (let e = 0; e < n.length; e++) {
4243
- r.bindFramebuffer(t.FRAMEBUFFER, l.__webglMultisampledFramebuffer), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0 + e, t.RENDERBUFFER, l.__webglColorRenderbuffer[e]);
4243
+ r.bindFramebuffer(t.FRAMEBUFFER, u.__webglMultisampledFramebuffer), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0 + e, t.RENDERBUFFER, u.__webglColorRenderbuffer[e]);
4244
4244
  let a = i.get(n[e]).__webglTexture;
4245
- r.bindFramebuffer(t.FRAMEBUFFER, l.__webglFramebuffer), t.framebufferTexture2D(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0 + e, t.TEXTURE_2D, a, 0);
4245
+ r.bindFramebuffer(t.FRAMEBUFFER, u.__webglFramebuffer), t.framebufferTexture2D(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0 + e, t.TEXTURE_2D, a, 0);
4246
4246
  }
4247
- r.bindFramebuffer(t.DRAW_FRAMEBUFFER, l.__webglMultisampledFramebuffer);
4248
- } else if (e.depthBuffer && e.resolveDepthBuffer === !1 && u) {
4247
+ r.bindFramebuffer(t.DRAW_FRAMEBUFFER, u.__webglMultisampledFramebuffer);
4248
+ } else if (e.depthBuffer && e.resolveDepthBuffer === !1 && l) {
4249
4249
  let n = e.stencilBuffer ? t.DEPTH_STENCIL_ATTACHMENT : t.DEPTH_ATTACHMENT;
4250
4250
  t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER, [n]);
4251
4251
  }
4252
4252
  }
4253
4253
  }
4254
- function Oe(e) {
4254
+ function ke(e) {
4255
4255
  return Math.min(a.maxSamples, e.samples);
4256
4256
  }
4257
- function ke(e) {
4257
+ function U(e) {
4258
4258
  let t = i.get(e);
4259
4259
  return e.samples > 0 && n.has("WEBGL_multisampled_render_to_texture") === !0 && t.__useRenderToTexture !== !1;
4260
4260
  }
4261
- function U(e) {
4261
+ function Ae(e) {
4262
4262
  let t = s.render.frame;
4263
- p.get(e) !== t && (p.set(e, t), e.update());
4263
+ f.get(e) !== t && (f.set(e, t), e.update());
4264
4264
  }
4265
- function Ae(e, t) {
4265
+ function je(e, t) {
4266
4266
  let n = e.colorSpace, r = e.format, i = e.type;
4267
- return e.isCompressedTexture === !0 || e.isVideoTexture === !0 || n !== "srgb-linear" && n !== "" && (l.getTransfer(n) === "srgb" ? (r !== 1023 || i !== 1009) && M("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : f("WebGLTextures: Unsupported texture color space:", n)), t;
4267
+ return e.isCompressedTexture === !0 || e.isVideoTexture === !0 || n !== "srgb-linear" && n !== "" && (u.getTransfer(n) === "srgb" ? (r !== 1023 || i !== 1009) && L("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : _("WebGLTextures: Unsupported texture color space:", n)), t;
4268
4268
  }
4269
- function Ne(e) {
4269
+ function Me(e) {
4270
4270
  return typeof HTMLImageElement < "u" && e instanceof HTMLImageElement ? (d.width = e.naturalWidth || e.width, d.height = e.naturalHeight || e.height) : typeof VideoFrame < "u" && e instanceof VideoFrame ? (d.width = e.displayWidth, d.height = e.displayHeight) : (d.width = e.width, d.height = e.height), d;
4271
4271
  }
4272
- this.allocateTextureUnit = L, this.resetTextureUnits = I, this.getTextureUnits = ie, this.setTextureUnits = oe, this.setTexture2D = R, this.setTexture2DArray = z, this.setTexture3D = le, this.setTextureCube = ue, this.rebindTextures = Se, this.setupRenderTarget = Ce, this.updateRenderTargetMipmap = we, this.updateMultisampleRenderTarget = De, this.setupDepthRenderbuffer = xe, this.setupFrameBufferTexture = ye, this.useMultisampledRTT = ke, this.isReversedDepthBuffer = function() {
4272
+ this.allocateTextureUnit = z, this.resetTextureUnits = re, this.getTextureUnits = R, this.setTextureUnits = ae, this.setTexture2D = se, this.setTexture2DArray = ce, this.setTexture3D = le, this.setTextureCube = ue, this.rebindTextures = Se, this.setupRenderTarget = Ce, this.updateRenderTargetMipmap = Te, this.updateMultisampleRenderTarget = Oe, this.setupDepthRenderbuffer = xe, this.setupFrameBufferTexture = ye, this.useMultisampledRTT = U, this.isReversedDepthBuffer = function() {
4273
4273
  return r.buffers.depth.getReversed();
4274
4274
  };
4275
4275
  }
4276
4276
  function Nr(e, t) {
4277
4277
  function n(n, r = "") {
4278
- let i, a = l.getTransfer(r);
4278
+ let i, a = u.getTransfer(r);
4279
4279
  if (n === 1009) return e.UNSIGNED_BYTE;
4280
4280
  if (n === 1017) return e.UNSIGNED_SHORT_4_4_4_4;
4281
4281
  if (n === 1018) return e.UNSIGNED_SHORT_5_5_5_1;
@@ -4361,7 +4361,7 @@ var Pr = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Fr = "
4361
4361
  }
4362
4362
  init(e, t) {
4363
4363
  if (this.texture === null) {
4364
- let n = new ge(e.texture);
4364
+ let n = new me(e.texture);
4365
4365
  (e.depthNear !== t.depthNear || e.depthFar !== t.depthFar) && (this.depthNear = e.depthNear, this.depthFar = e.depthFar), this.texture = n;
4366
4366
  }
4367
4367
  }
@@ -4376,7 +4376,7 @@ var Pr = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Fr = "
4376
4376
  depthHeight: { value: t.w }
4377
4377
  }
4378
4378
  });
4379
- this.mesh = new R(new n(20, 20), r);
4379
+ this.mesh = new z(new n(20, 20), r);
4380
4380
  }
4381
4381
  return this.mesh;
4382
4382
  }
@@ -4386,78 +4386,78 @@ var Pr = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Fr = "
4386
4386
  getDepthTexture() {
4387
4387
  return this.texture;
4388
4388
  }
4389
- }, Lr = class extends we {
4389
+ }, Lr = class extends Te {
4390
4390
  constructor(e, t) {
4391
4391
  super();
4392
- let n = this, r = null, i = 1, a = null, o = "local-floor", c = 1, l = null, d = null, f = null, m = null, h = null, _ = null, v = typeof XRWebGLBinding < "u", y = new Ir(), b = {}, x = t.getContextAttributes(), S = null, T = null, E = [], D = [], O = new je(), A = null, ee = new w();
4393
- ee.viewport = new s();
4394
- let j = new w();
4395
- j.viewport = new s();
4396
- let N = [ee, j], P = new L(), te = null, ne = null;
4392
+ let n = this, r = null, i = 1, a = null, o = "local-floor", c = 1, u = null, d = null, f = null, p = null, m = null, g = null, _ = typeof XRWebGLBinding < "u", v = new Ir(), b = {}, x = t.getContextAttributes(), S = null, C = null, w = [], E = [], D = new A(), O = null, k = new T();
4393
+ k.viewport = new Ae();
4394
+ let ee = new T();
4395
+ ee.viewport = new Ae();
4396
+ let j = [k, ee], M = new R(), N = null, P = null;
4397
4397
  this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {
4398
- let t = E[e];
4399
- return t === void 0 && (t = new C(), E[e] = t), t.getTargetRaySpace();
4398
+ let t = w[e];
4399
+ return t === void 0 && (t = new V(), w[e] = t), t.getTargetRaySpace();
4400
4400
  }, this.getControllerGrip = function(e) {
4401
- let t = E[e];
4402
- return t === void 0 && (t = new C(), E[e] = t), t.getGripSpace();
4401
+ let t = w[e];
4402
+ return t === void 0 && (t = new V(), w[e] = t), t.getGripSpace();
4403
4403
  }, this.getHand = function(e) {
4404
- let t = E[e];
4405
- return t === void 0 && (t = new C(), E[e] = t), t.getHandSpace();
4404
+ let t = w[e];
4405
+ return t === void 0 && (t = new V(), w[e] = t), t.getHandSpace();
4406
4406
  };
4407
- function I(e) {
4408
- let t = D.indexOf(e.inputSource);
4407
+ function F(e) {
4408
+ let t = E.indexOf(e.inputSource);
4409
4409
  if (t === -1) return;
4410
- let n = E[t];
4411
- n !== void 0 && (n.update(e.inputSource, e.frame, l || a), n.dispatchEvent({
4410
+ let n = w[t];
4411
+ n !== void 0 && (n.update(e.inputSource, e.frame, u || a), n.dispatchEvent({
4412
4412
  type: e.type,
4413
4413
  data: e.inputSource
4414
4414
  }));
4415
4415
  }
4416
- function re() {
4417
- r.removeEventListener("select", I), r.removeEventListener("selectstart", I), r.removeEventListener("selectend", I), r.removeEventListener("squeeze", I), r.removeEventListener("squeezestart", I), r.removeEventListener("squeezeend", I), r.removeEventListener("end", re), r.removeEventListener("inputsourceschange", ae);
4418
- for (let e = 0; e < E.length; e++) {
4419
- let t = D[e];
4420
- t !== null && (D[e] = null, E[e].disconnect(t));
4416
+ function I() {
4417
+ r.removeEventListener("select", F), r.removeEventListener("selectstart", F), r.removeEventListener("selectend", F), r.removeEventListener("squeeze", F), r.removeEventListener("squeezestart", F), r.removeEventListener("squeezeend", F), r.removeEventListener("end", I), r.removeEventListener("inputsourceschange", ne);
4418
+ for (let e = 0; e < w.length; e++) {
4419
+ let t = E[e];
4420
+ t !== null && (E[e] = null, w[e].disconnect(t));
4421
4421
  }
4422
- te = null, ne = null, y.reset();
4422
+ N = null, P = null, v.reset();
4423
4423
  for (let e in b) delete b[e];
4424
- e.setRenderTarget(S), h = null, m = null, f = null, r = null, T = null, fe.stop(), n.isPresenting = !1, e.setPixelRatio(A), e.setSize(O.width, O.height, !1), n.dispatchEvent({ type: "sessionend" });
4424
+ e.setRenderTarget(S), m = null, p = null, f = null, r = null, C = null, le.stop(), n.isPresenting = !1, e.setPixelRatio(O), e.setSize(D.width, D.height, !1), n.dispatchEvent({ type: "sessionend" });
4425
4425
  }
4426
4426
  this.setFramebufferScaleFactor = function(e) {
4427
- i = e, n.isPresenting === !0 && M("WebXRManager: Cannot change framebuffer scale while presenting.");
4427
+ i = e, n.isPresenting === !0 && L("WebXRManager: Cannot change framebuffer scale while presenting.");
4428
4428
  }, this.setReferenceSpaceType = function(e) {
4429
- o = e, n.isPresenting === !0 && M("WebXRManager: Cannot change reference space type while presenting.");
4429
+ o = e, n.isPresenting === !0 && L("WebXRManager: Cannot change reference space type while presenting.");
4430
4430
  }, this.getReferenceSpace = function() {
4431
- return l || a;
4431
+ return u || a;
4432
4432
  }, this.setReferenceSpace = function(e) {
4433
- l = e;
4433
+ u = e;
4434
4434
  }, this.getBaseLayer = function() {
4435
- return m === null ? h : m;
4435
+ return p === null ? m : p;
4436
4436
  }, this.getBinding = function() {
4437
- return f === null && v && (f = new XRWebGLBinding(r, t)), f;
4437
+ return f === null && _ && (f = new XRWebGLBinding(r, t)), f;
4438
4438
  }, this.getFrame = function() {
4439
- return _;
4439
+ return g;
4440
4440
  }, this.getSession = function() {
4441
4441
  return r;
4442
4442
  }, this.setSession = async function(s) {
4443
4443
  if (r = s, r !== null) {
4444
- if (S = e.getRenderTarget(), r.addEventListener("select", I), r.addEventListener("selectstart", I), r.addEventListener("selectend", I), r.addEventListener("squeeze", I), r.addEventListener("squeezestart", I), r.addEventListener("squeezeend", I), r.addEventListener("end", re), r.addEventListener("inputsourceschange", ae), x.xrCompatible !== !0 && await t.makeXRCompatible(), A = e.getPixelRatio(), e.getSize(O), v && "createProjectionLayer" in XRWebGLBinding.prototype) {
4444
+ if (S = e.getRenderTarget(), r.addEventListener("select", F), r.addEventListener("selectstart", F), r.addEventListener("selectend", F), r.addEventListener("squeeze", F), r.addEventListener("squeezestart", F), r.addEventListener("squeezeend", F), r.addEventListener("end", I), r.addEventListener("inputsourceschange", ne), x.xrCompatible !== !0 && await t.makeXRCompatible(), O = e.getPixelRatio(), e.getSize(D), _ && "createProjectionLayer" in XRWebGLBinding.prototype) {
4445
4445
  let n = null, a = null, o = null;
4446
- x.depth && (o = x.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = x.stencil ? g : Ce, a = x.stencil ? me : oe);
4446
+ x.depth && (o = x.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = x.stencil ? y : Ce, a = x.stencil ? de : ke);
4447
4447
  let s = {
4448
4448
  colorFormat: t.RGBA8,
4449
4449
  depthFormat: o,
4450
4450
  scaleFactor: i
4451
4451
  };
4452
- f = this.getBinding(), m = f.createProjectionLayer(s), r.updateRenderState({ layers: [m] }), e.setPixelRatio(1), e.setSize(m.textureWidth, m.textureHeight, !1), T = new u(m.textureWidth, m.textureHeight, {
4453
- format: p,
4454
- type: Se,
4455
- depthTexture: new ie(m.textureWidth, m.textureHeight, a, void 0, void 0, void 0, void 0, void 0, void 0, n),
4452
+ f = this.getBinding(), p = f.createProjectionLayer(s), r.updateRenderState({ layers: [p] }), e.setPixelRatio(1), e.setSize(p.textureWidth, p.textureHeight, !1), C = new l(p.textureWidth, p.textureHeight, {
4453
+ format: h,
4454
+ type: ye,
4455
+ depthTexture: new re(p.textureWidth, p.textureHeight, a, void 0, void 0, void 0, void 0, void 0, void 0, n),
4456
4456
  stencilBuffer: x.stencil,
4457
4457
  colorSpace: e.outputColorSpace,
4458
4458
  samples: x.antialias ? 4 : 0,
4459
- resolveDepthBuffer: m.ignoreDepthValues === !1,
4460
- resolveStencilBuffer: m.ignoreDepthValues === !1
4459
+ resolveDepthBuffer: p.ignoreDepthValues === !1,
4460
+ resolveStencilBuffer: p.ignoreDepthValues === !1
4461
4461
  });
4462
4462
  } else {
4463
4463
  let n = {
@@ -4467,47 +4467,47 @@ var Pr = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Fr = "
4467
4467
  stencil: x.stencil,
4468
4468
  framebufferScaleFactor: i
4469
4469
  };
4470
- h = new XRWebGLLayer(r, t, n), r.updateRenderState({ baseLayer: h }), e.setPixelRatio(1), e.setSize(h.framebufferWidth, h.framebufferHeight, !1), T = new u(h.framebufferWidth, h.framebufferHeight, {
4471
- format: p,
4472
- type: Se,
4470
+ m = new XRWebGLLayer(r, t, n), r.updateRenderState({ baseLayer: m }), e.setPixelRatio(1), e.setSize(m.framebufferWidth, m.framebufferHeight, !1), C = new l(m.framebufferWidth, m.framebufferHeight, {
4471
+ format: h,
4472
+ type: ye,
4473
4473
  colorSpace: e.outputColorSpace,
4474
4474
  stencilBuffer: x.stencil,
4475
- resolveDepthBuffer: h.ignoreDepthValues === !1,
4476
- resolveStencilBuffer: h.ignoreDepthValues === !1
4475
+ resolveDepthBuffer: m.ignoreDepthValues === !1,
4476
+ resolveStencilBuffer: m.ignoreDepthValues === !1
4477
4477
  });
4478
4478
  }
4479
- T.isXRRenderTarget = !0, this.setFoveation(c), l = null, a = await r.requestReferenceSpace(o), fe.setContext(r), fe.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
4479
+ C.isXRRenderTarget = !0, this.setFoveation(c), u = null, a = await r.requestReferenceSpace(o), le.setContext(r), le.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
4480
4480
  }
4481
4481
  }, this.getEnvironmentBlendMode = function() {
4482
4482
  if (r !== null) return r.environmentBlendMode;
4483
4483
  }, this.getDepthTexture = function() {
4484
- return y.getDepthTexture();
4484
+ return v.getDepthTexture();
4485
4485
  };
4486
- function ae(e) {
4486
+ function ne(e) {
4487
4487
  for (let t = 0; t < e.removed.length; t++) {
4488
- let n = e.removed[t], r = D.indexOf(n);
4489
- r >= 0 && (D[r] = null, E[r].disconnect(n));
4488
+ let n = e.removed[t], r = E.indexOf(n);
4489
+ r >= 0 && (E[r] = null, w[r].disconnect(n));
4490
4490
  }
4491
4491
  for (let t = 0; t < e.added.length; t++) {
4492
- let n = e.added[t], r = D.indexOf(n);
4492
+ let n = e.added[t], r = E.indexOf(n);
4493
4493
  if (r === -1) {
4494
- for (let e = 0; e < E.length; e++) if (e >= D.length) {
4495
- D.push(n), r = e;
4494
+ for (let e = 0; e < w.length; e++) if (e >= E.length) {
4495
+ E.push(n), r = e;
4496
4496
  break;
4497
- } else if (D[e] === null) {
4498
- D[e] = n, r = e;
4497
+ } else if (E[e] === null) {
4498
+ E[e] = n, r = e;
4499
4499
  break;
4500
4500
  }
4501
4501
  if (r === -1) break;
4502
4502
  }
4503
- let i = E[r];
4503
+ let i = w[r];
4504
4504
  i && i.connect(n);
4505
4505
  }
4506
4506
  }
4507
- let se = new k(), ce = new k();
4508
- function R(e, t, n) {
4509
- se.setFromMatrixPosition(t.matrixWorld), ce.setFromMatrixPosition(n.matrixWorld);
4510
- let r = se.distanceTo(ce), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;
4507
+ let ie = new s(), ae = new s();
4508
+ function oe(e, t, n) {
4509
+ ie.setFromMatrixPosition(t.matrixWorld), ae.setFromMatrixPosition(n.matrixWorld);
4510
+ let r = ie.distanceTo(ae), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;
4511
4511
  if (t.matrixWorld.decompose(e.position, e.quaternion, e.scale), e.translateX(h), e.translateZ(m), e.matrixWorld.compose(e.position, e.quaternion, e.scale), e.matrixWorldInverse.copy(e.matrixWorld).invert(), i[10] === -1) e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse);
4512
4512
  else {
4513
4513
  let t = o + m, n = s + m, i = f - h, a = p + (r - h), u = c * s / n * t, d = l * s / n * t;
@@ -4520,89 +4520,89 @@ var Pr = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Fr = "
4520
4520
  this.updateCamera = function(e) {
4521
4521
  if (r === null) return;
4522
4522
  let t = e.near, n = e.far;
4523
- y.texture !== null && (y.depthNear > 0 && (t = y.depthNear), y.depthFar > 0 && (n = y.depthFar)), P.near = j.near = ee.near = t, P.far = j.far = ee.far = n, (te !== P.near || ne !== P.far) && (r.updateRenderState({
4524
- depthNear: P.near,
4525
- depthFar: P.far
4526
- }), te = P.near, ne = P.far), P.layers.mask = e.layers.mask | 6, ee.layers.mask = P.layers.mask & -5, j.layers.mask = P.layers.mask & -3;
4527
- let i = e.parent, a = P.cameras;
4528
- z(P, i);
4523
+ v.texture !== null && (v.depthNear > 0 && (t = v.depthNear), v.depthFar > 0 && (n = v.depthFar)), M.near = ee.near = k.near = t, M.far = ee.far = k.far = n, (N !== M.near || P !== M.far) && (r.updateRenderState({
4524
+ depthNear: M.near,
4525
+ depthFar: M.far
4526
+ }), N = M.near, P = M.far), M.layers.mask = e.layers.mask | 6, k.layers.mask = M.layers.mask & -5, ee.layers.mask = M.layers.mask & -3;
4527
+ let i = e.parent, a = M.cameras;
4528
+ z(M, i);
4529
4529
  for (let e = 0; e < a.length; e++) z(a[e], i);
4530
- a.length === 2 ? R(P, ee, j) : P.projectionMatrix.copy(ee.projectionMatrix), le(e, P, i);
4530
+ a.length === 2 ? oe(M, k, ee) : M.projectionMatrix.copy(k.projectionMatrix), B(e, M, i);
4531
4531
  };
4532
- function le(e, t, n) {
4533
- n === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov = F * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);
4532
+ function B(e, t, n) {
4533
+ n === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov = te * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);
4534
4534
  }
4535
4535
  this.getCamera = function() {
4536
- return P;
4536
+ return M;
4537
4537
  }, this.getFoveation = function() {
4538
- if (!(m === null && h === null)) return c;
4538
+ if (!(p === null && m === null)) return c;
4539
4539
  }, this.setFoveation = function(e) {
4540
- c = e, m !== null && (m.fixedFoveation = e), h !== null && h.fixedFoveation !== void 0 && (h.fixedFoveation = e);
4540
+ c = e, p !== null && (p.fixedFoveation = e), m !== null && m.fixedFoveation !== void 0 && (m.fixedFoveation = e);
4541
4541
  }, this.hasDepthSensing = function() {
4542
- return y.texture !== null;
4542
+ return v.texture !== null;
4543
4543
  }, this.getDepthSensingMesh = function() {
4544
- return y.getMesh(P);
4544
+ return v.getMesh(M);
4545
4545
  }, this.getCameraTexture = function(e) {
4546
4546
  return b[e];
4547
4547
  };
4548
- let ue = null;
4549
- function de(t, i) {
4550
- if (d = i.getViewerPose(l || a), _ = i, d !== null) {
4548
+ let se = null;
4549
+ function ce(t, i) {
4550
+ if (d = i.getViewerPose(u || a), g = i, d !== null) {
4551
4551
  let t = d.views;
4552
- h !== null && (e.setRenderTargetFramebuffer(T, h.framebuffer), e.setRenderTarget(T));
4552
+ m !== null && (e.setRenderTargetFramebuffer(C, m.framebuffer), e.setRenderTarget(C));
4553
4553
  let i = !1;
4554
- t.length !== P.cameras.length && (P.cameras.length = 0, i = !0);
4554
+ t.length !== M.cameras.length && (M.cameras.length = 0, i = !0);
4555
4555
  for (let n = 0; n < t.length; n++) {
4556
4556
  let r = t[n], a = null;
4557
- if (h !== null) a = h.getViewport(r);
4557
+ if (m !== null) a = m.getViewport(r);
4558
4558
  else {
4559
- let t = f.getViewSubImage(m, r);
4560
- a = t.viewport, n === 0 && (e.setRenderTargetTextures(T, t.colorTexture, t.depthStencilTexture), e.setRenderTarget(T));
4559
+ let t = f.getViewSubImage(p, r);
4560
+ a = t.viewport, n === 0 && (e.setRenderTargetTextures(C, t.colorTexture, t.depthStencilTexture), e.setRenderTarget(C));
4561
4561
  }
4562
- let o = N[n];
4563
- o === void 0 && (o = new w(), o.layers.enable(n), o.viewport = new s(), N[n] = o), o.matrix.fromArray(r.transform.matrix), o.matrix.decompose(o.position, o.quaternion, o.scale), o.projectionMatrix.fromArray(r.projectionMatrix), o.projectionMatrixInverse.copy(o.projectionMatrix).invert(), o.viewport.set(a.x, a.y, a.width, a.height), n === 0 && (P.matrix.copy(o.matrix), P.matrix.decompose(P.position, P.quaternion, P.scale)), i === !0 && P.cameras.push(o);
4562
+ let o = j[n];
4563
+ o === void 0 && (o = new T(), o.layers.enable(n), o.viewport = new Ae(), j[n] = o), o.matrix.fromArray(r.transform.matrix), o.matrix.decompose(o.position, o.quaternion, o.scale), o.projectionMatrix.fromArray(r.projectionMatrix), o.projectionMatrixInverse.copy(o.projectionMatrix).invert(), o.viewport.set(a.x, a.y, a.width, a.height), n === 0 && (M.matrix.copy(o.matrix), M.matrix.decompose(M.position, M.quaternion, M.scale)), i === !0 && M.cameras.push(o);
4564
4564
  }
4565
4565
  let a = r.enabledFeatures;
4566
- if (a && a.includes("depth-sensing") && r.depthUsage == "gpu-optimized" && v) {
4566
+ if (a && a.includes("depth-sensing") && r.depthUsage == "gpu-optimized" && _) {
4567
4567
  f = n.getBinding();
4568
4568
  let e = f.getDepthInformation(t[0]);
4569
- e && e.isValid && e.texture && y.init(e, r.renderState);
4569
+ e && e.isValid && e.texture && v.init(e, r.renderState);
4570
4570
  }
4571
- if (a && a.includes("camera-access") && v) {
4571
+ if (a && a.includes("camera-access") && _) {
4572
4572
  e.state.unbindTexture(), f = n.getBinding();
4573
4573
  for (let e = 0; e < t.length; e++) {
4574
4574
  let n = t[e].camera;
4575
4575
  if (n) {
4576
4576
  let e = b[n];
4577
- e || (e = new ge(), b[n] = e);
4577
+ e || (e = new me(), b[n] = e);
4578
4578
  let t = f.getCameraImage(n);
4579
4579
  e.sourceTexture = t;
4580
4580
  }
4581
4581
  }
4582
4582
  }
4583
4583
  }
4584
- for (let e = 0; e < E.length; e++) {
4585
- let t = D[e], n = E[e];
4586
- t !== null && n !== void 0 && n.update(t, i, l || a);
4584
+ for (let e = 0; e < w.length; e++) {
4585
+ let t = E[e], n = w[e];
4586
+ t !== null && n !== void 0 && n.update(t, i, u || a);
4587
4587
  }
4588
- ue && ue(t, i), i.detectedPlanes && n.dispatchEvent({
4588
+ se && se(t, i), i.detectedPlanes && n.dispatchEvent({
4589
4589
  type: "planesdetected",
4590
4590
  data: i
4591
- }), _ = null;
4591
+ }), g = null;
4592
4592
  }
4593
- let fe = new Ie();
4594
- fe.setAnimationLoop(de), this.setAnimationLoop = function(e) {
4595
- ue = e;
4593
+ let le = new Ie();
4594
+ le.setAnimationLoop(ce), this.setAnimationLoop = function(e) {
4595
+ se = e;
4596
4596
  }, this.dispose = function() {};
4597
4597
  }
4598
- }, Rr = /* @__PURE__ */ new Te(), zr = /* @__PURE__ */ new V();
4598
+ }, Rr = /* @__PURE__ */ new Ee(), zr = /* @__PURE__ */ new H();
4599
4599
  zr.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);
4600
4600
  function Br(e, t) {
4601
4601
  function n(e, t) {
4602
4602
  e.matrixAutoUpdate === !0 && e.updateMatrix(), t.value.copy(e.matrix);
4603
4603
  }
4604
4604
  function r(t, n) {
4605
- n.color.getRGB(t.fogColor.value, v(e)), n.isFog ? (t.fogNear.value = n.near, t.fogFar.value = n.far) : n.isFogExp2 && (t.fogDensity.value = n.density);
4605
+ n.color.getRGB(t.fogColor.value, k(e)), n.isFog ? (t.fogNear.value = n.near, t.fogFar.value = n.far) : n.isFogExp2 && (t.fogDensity.value = n.density);
4606
4606
  }
4607
4607
  function i(e, t, n, r, i) {
4608
4608
  t.isNodeMaterial ? t.uniformsNeedUpdate = !1 : t.isMeshBasicMaterial ? a(e, t) : t.isMeshLambertMaterial ? (a(e, t), t.envMap && (e.envMapIntensity.value = t.envMapIntensity)) : t.isMeshToonMaterial ? (a(e, t), d(e, t)) : t.isMeshPhongMaterial ? (a(e, t), u(e, t), t.envMap && (e.envMapIntensity.value = t.envMapIntensity)) : t.isMeshStandardMaterial ? (a(e, t), f(e, t), t.isMeshPhysicalMaterial && p(e, t, i)) : t.isMeshMatcapMaterial ? (a(e, t), m(e, t)) : t.isMeshDepthMaterial ? a(e, t) : t.isMeshDistanceMaterial ? (a(e, t), h(e, t)) : t.isMeshNormalMaterial ? a(e, t) : t.isLineBasicMaterial ? (o(e, t), t.isLineDashedMaterial && s(e, t)) : t.isPointsMaterial ? c(e, t, n, r) : t.isSpriteMaterial ? l(e, t) : t.isShadowMaterial ? (e.color.value.copy(t.color), e.opacity.value = t.opacity) : t.isShaderMaterial && (t.uniformsNeedUpdate = !1);
@@ -4656,11 +4656,11 @@ function Vr(e, t, n, r) {
4656
4656
  }
4657
4657
  function l(e, n) {
4658
4658
  let o = i[e.id];
4659
- o === void 0 && (h(e), o = u(e), i[e.id] = o, e.addEventListener("dispose", _));
4659
+ o === void 0 && (m(e), o = u(e), i[e.id] = o, e.addEventListener("dispose", g));
4660
4660
  let s = n.program;
4661
4661
  r.updateUBOMapping(e, s);
4662
4662
  let c = t.render.frame;
4663
- a[e.id] !== c && (p(e), a[e.id] = c);
4663
+ a[e.id] !== c && (f(e), a[e.id] = c);
4664
4664
  }
4665
4665
  function u(t) {
4666
4666
  let n = d();
@@ -4670,19 +4670,19 @@ function Vr(e, t, n, r) {
4670
4670
  }
4671
4671
  function d() {
4672
4672
  for (let e = 0; e < s; e++) if (o.indexOf(e) === -1) return o.push(e), e;
4673
- return f("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."), 0;
4673
+ return _("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."), 0;
4674
4674
  }
4675
- function p(t) {
4675
+ function f(t) {
4676
4676
  let n = i[t.id], r = t.uniforms, a = t.__cache;
4677
4677
  e.bindBuffer(e.UNIFORM_BUFFER, n);
4678
4678
  for (let t = 0, n = r.length; t < n; t++) {
4679
4679
  let n = Array.isArray(r[t]) ? r[t] : [r[t]];
4680
4680
  for (let r = 0, i = n.length; r < i; r++) {
4681
4681
  let i = n[r];
4682
- if (m(i, t, r, a) === !0) {
4682
+ if (p(i, t, r, a) === !0) {
4683
4683
  let t = i.__offset, n = Array.isArray(i.value) ? i.value : [i.value], r = 0;
4684
4684
  for (let a = 0; a < n.length; a++) {
4685
- let o = n[a], s = g(o);
4685
+ let o = n[a], s = h(o);
4686
4686
  typeof o == "number" || typeof o == "boolean" ? (i.__data[0] = o, e.bufferSubData(e.UNIFORM_BUFFER, t + r, i.__data)) : o.isMatrix3 ? (i.__data[0] = o.elements[0], i.__data[1] = o.elements[1], i.__data[2] = o.elements[2], i.__data[3] = 0, i.__data[4] = o.elements[3], i.__data[5] = o.elements[4], i.__data[6] = o.elements[5], i.__data[7] = 0, i.__data[8] = o.elements[6], i.__data[9] = o.elements[7], i.__data[10] = o.elements[8], i.__data[11] = 0) : ArrayBuffer.isView(o) ? i.__data.set(new o.constructor(o.buffer, o.byteOffset, i.__data.length)) : (o.toArray(i.__data, r), r += s.storage / Float32Array.BYTES_PER_ELEMENT);
4687
4687
  }
4688
4688
  e.bufferSubData(e.UNIFORM_BUFFER, t, i.__data);
@@ -4691,7 +4691,7 @@ function Vr(e, t, n, r) {
4691
4691
  }
4692
4692
  e.bindBuffer(e.UNIFORM_BUFFER, null);
4693
4693
  }
4694
- function m(e, t, n, r) {
4694
+ function p(e, t, n, r) {
4695
4695
  let i = e.value, a = t + "_" + n;
4696
4696
  if (r[a] === void 0) return typeof i == "number" || typeof i == "boolean" ? r[a] = i : ArrayBuffer.isView(i) ? r[a] = i.slice() : r[a] = i.clone(), !0;
4697
4697
  {
@@ -4703,14 +4703,14 @@ function Vr(e, t, n, r) {
4703
4703
  }
4704
4704
  return !1;
4705
4705
  }
4706
- function h(e) {
4706
+ function m(e) {
4707
4707
  let t = e.uniforms, n = 0;
4708
4708
  for (let e = 0, r = t.length; e < r; e++) {
4709
4709
  let r = Array.isArray(t[e]) ? t[e] : [t[e]];
4710
4710
  for (let e = 0, t = r.length; e < t; e++) {
4711
4711
  let t = r[e], i = Array.isArray(t.value) ? t.value : [t.value];
4712
4712
  for (let e = 0, r = i.length; e < r; e++) {
4713
- let r = i[e], a = g(r), o = n % 16, s = o % a.boundary, c = o + s;
4713
+ let r = i[e], a = h(r), o = n % 16, s = o % a.boundary, c = o + s;
4714
4714
  n += s, c !== 0 && 16 - c < a.storage && (n += 16 - c), t.__data = new Float32Array(a.storage / Float32Array.BYTES_PER_ELEMENT), t.__offset = n, n += a.storage;
4715
4715
  }
4716
4716
  }
@@ -4718,16 +4718,16 @@ function Vr(e, t, n, r) {
4718
4718
  let r = n % 16;
4719
4719
  return r > 0 && (n += 16 - r), e.__size = n, e.__cache = {}, this;
4720
4720
  }
4721
- function g(e) {
4721
+ function h(e) {
4722
4722
  let t = {
4723
4723
  boundary: 0,
4724
4724
  storage: 0
4725
4725
  };
4726
- return typeof e == "number" || typeof e == "boolean" ? (t.boundary = 4, t.storage = 4) : e.isVector2 ? (t.boundary = 8, t.storage = 8) : e.isVector3 || e.isColor ? (t.boundary = 16, t.storage = 12) : e.isVector4 ? (t.boundary = 16, t.storage = 16) : e.isMatrix3 ? (t.boundary = 48, t.storage = 48) : e.isMatrix4 ? (t.boundary = 64, t.storage = 64) : e.isTexture ? M("WebGLRenderer: Texture samplers can not be part of an uniforms group.") : ArrayBuffer.isView(e) ? (t.boundary = 16, t.storage = e.byteLength) : M("WebGLRenderer: Unsupported uniform value type.", e), t;
4726
+ return typeof e == "number" || typeof e == "boolean" ? (t.boundary = 4, t.storage = 4) : e.isVector2 ? (t.boundary = 8, t.storage = 8) : e.isVector3 || e.isColor ? (t.boundary = 16, t.storage = 12) : e.isVector4 ? (t.boundary = 16, t.storage = 16) : e.isMatrix3 ? (t.boundary = 48, t.storage = 48) : e.isMatrix4 ? (t.boundary = 64, t.storage = 64) : e.isTexture ? L("WebGLRenderer: Texture samplers can not be part of an uniforms group.") : ArrayBuffer.isView(e) ? (t.boundary = 16, t.storage = e.byteLength) : L("WebGLRenderer: Unsupported uniform value type.", e), t;
4727
4727
  }
4728
- function _(t) {
4728
+ function g(t) {
4729
4729
  let n = t.target;
4730
- n.removeEventListener("dispose", _);
4730
+ n.removeEventListener("dispose", g);
4731
4731
  let r = o.indexOf(n.__bindingPointIndex);
4732
4732
  o.splice(r, 1), e.deleteBuffer(i[n.id]), delete i[n.id], delete a[n.id];
4733
4733
  }
@@ -5256,44 +5256,44 @@ var Hr = new Uint16Array([
5256
5256
  1183
5257
5257
  ]), Ur = null;
5258
5258
  function Wr() {
5259
- return Ur === null && (Ur = new P(Hr, 16, 16, c, he), Ur.name = "DFG_LUT", Ur.minFilter = H, Ur.magFilter = H, Ur.wrapS = O, Ur.wrapT = O, Ur.generateMipmaps = !1, Ur.needsUpdate = !0), Ur;
5259
+ return Ur === null && (Ur = new P(Hr, 16, 16, c, pe), Ur.name = "DFG_LUT", Ur.minFilter = we, Ur.magFilter = we, Ur.wrapS = ee, Ur.wrapT = ee, Ur.generateMipmaps = !1, Ur.needsUpdate = !0), Ur;
5260
5260
  }
5261
5261
  var Gr = class {
5262
5262
  constructor(e = {}) {
5263
- let { canvas: t = S(), context: n = null, depth: i = !0, stencil: a = !1, alpha: c = !1, antialias: d = !1, premultipliedAlpha: p = !0, preserveDrawingBuffer: m = !1, powerPreference: h = "default", failIfMajorPerformanceCaveat: g = !1, reversedDepthBuffer: v = !1, outputBufferType: y = Se } = e;
5263
+ let { canvas: t = E(), context: n = null, depth: i = !0, stencil: c = !1, alpha: f = !1, antialias: p = !1, premultipliedAlpha: m = !0, preserveDrawingBuffer: h = !1, powerPreference: v = "default", failIfMajorPerformanceCaveat: y = !1, reversedDepthBuffer: x = !1, outputBufferType: S = ye } = e;
5264
5264
  this.isWebGLRenderer = !0;
5265
- let b;
5265
+ let C;
5266
5266
  if (n !== null) {
5267
5267
  if (typeof WebGLRenderingContext < "u" && n instanceof WebGLRenderingContext) throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");
5268
- b = n.getContextAttributes().alpha;
5269
- } else b = c;
5270
- let x = y, C = new Set([
5271
- _,
5272
- Ae,
5268
+ C = n.getContextAttributes().alpha;
5269
+ } else C = f;
5270
+ let w = S, T = new Set([
5271
+ b,
5272
+ je,
5273
5273
  r
5274
- ]), w = new Set([
5275
- Se,
5276
- oe,
5277
- se,
5278
- me,
5274
+ ]), D = new Set([
5275
+ ye,
5279
5276
  ke,
5280
- Ne
5281
- ]), T = new Uint32Array(4), E = new Int32Array(4), D = new k(), O = null, A = null, j = [], N = [], P = null;
5277
+ Me,
5278
+ de,
5279
+ Pe,
5280
+ ae
5281
+ ]), O = new Uint32Array(4), k = new Int32Array(4), ee = new s(), A = null, j = null, M = [], N = [], P = null;
5282
5282
  this.domElement = t, this.debug = {
5283
5283
  checkShaderErrors: !0,
5284
5284
  onShaderError: null
5285
5285
  }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = 0, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
5286
- let F = this, ne = !1, I = null;
5286
+ let F = this, te = !1, I = null;
5287
5287
  this._outputColorSpace = o;
5288
- let ie = 0, ae = 0, L = null, ce = -1, R = null, z = new s(), le = new s(), ue = null, fe = new U(0), pe = 0, ge = t.width, _e = t.height, B = 1, ve = null, ye = null, be = new s(0, 0, ge, _e), V = new s(0, 0, ge, _e), xe = !1, Ce = new de(), H = !1, we = !1, Ee = new Te(), De = new k(), Oe = new s(), je = {
5288
+ let re = 0, ie = 0, R = null, oe = -1, z = null, B = new Ae(), se = new Ae(), ce = null, ue = new U(0), fe = 0, me = t.width, he = t.height, V = 1, ge = null, _e = null, ve = new Ae(0, 0, me, he), be = new Ae(0, 0, me, he), H = !1, xe = new le(), Se = !1, Ce = !1, we = new Ee(), Te = new s(), De = new Ae(), Oe = {
5289
5289
  background: null,
5290
5290
  fog: null,
5291
5291
  environment: null,
5292
5292
  overrideMaterial: null,
5293
5293
  isScene: !0
5294
- }, Me = !1;
5295
- function Pe() {
5296
- return L === null ? B : 1;
5294
+ }, Ne = !1;
5295
+ function Fe() {
5296
+ return R === null ? V : 1;
5297
5297
  }
5298
5298
  let W = n;
5299
5299
  function G(e, n) {
@@ -5303,25 +5303,25 @@ var Gr = class {
5303
5303
  let e = {
5304
5304
  alpha: !0,
5305
5305
  depth: i,
5306
- stencil: a,
5307
- antialias: d,
5308
- premultipliedAlpha: p,
5309
- preserveDrawingBuffer: m,
5310
- powerPreference: h,
5311
- failIfMajorPerformanceCaveat: g
5306
+ stencil: c,
5307
+ antialias: p,
5308
+ premultipliedAlpha: m,
5309
+ preserveDrawingBuffer: h,
5310
+ powerPreference: v,
5311
+ failIfMajorPerformanceCaveat: y
5312
5312
  };
5313
5313
  if ("setAttribute" in t && t.setAttribute("data-engine", "three.js r184"), t.addEventListener("webglcontextlost", ct, !1), t.addEventListener("webglcontextrestored", gt, !1), t.addEventListener("webglcontextcreationerror", vt, !1), W === null) {
5314
5314
  let t = "webgl2";
5315
5315
  if (W = G(t, e), W === null) throw G(t) ? Error("Error creating WebGL context with your selected attributes.") : Error("Error creating WebGL context.");
5316
5316
  }
5317
5317
  } catch (e) {
5318
- throw f("WebGLRenderer: " + e.message), e;
5318
+ throw _("WebGLRenderer: " + e.message), e;
5319
5319
  }
5320
5320
  let K, q, J, Re, Y, X, We, Ge, Ke, qe, Je, Ye, Xe, Ze, Qe, $e, et, tt, nt, rt, it, at, ot;
5321
5321
  function st() {
5322
- K = new ut(W), K.init(), it = new Nr(W, K), q = new He(W, K, e, it), J = new jr(W, K), q.reversedDepthBuffer && v && J.buffers.depth.setReversed(!0), Re = new pt(W), Y = new dr(), X = new Mr(W, K, J, Y, q, it, Re), We = new lt(F), Ge = new Le(W), at = new Be(W, Ge), Ke = new dt(W, Ge, Re, at), qe = new ht(W, Ke, Ge, at, Re), tt = new mt(W, q, X), Qe = new Ue(Y), Je = new ur(F, We, K, q, at, Qe), Ye = new Br(F, Y), Xe = new hr(), Ze = new Sr(K), et = new ze(F, We, J, qe, b, p), $e = new Ar(F, qe, q), ot = new Vr(W, Re, q, J), nt = new Ve(W, K, Re), rt = new ft(W, K, Re), Re.programs = Je.programs, F.capabilities = q, F.extensions = K, F.properties = Y, F.renderLists = Xe, F.shadowMap = $e, F.state = J, F.info = Re;
5322
+ K = new ut(W), K.init(), it = new Nr(W, K), q = new He(W, K, e, it), J = new jr(W, K), q.reversedDepthBuffer && x && J.buffers.depth.setReversed(!0), Re = new pt(W), Y = new dr(), X = new Mr(W, K, J, Y, q, it, Re), We = new lt(F), Ge = new Le(W), at = new Be(W, Ge), Ke = new dt(W, Ge, Re, at), qe = new ht(W, Ke, Ge, at, Re), tt = new mt(W, q, X), Qe = new Ue(Y), Je = new ur(F, We, K, q, at, Qe), Ye = new Br(F, Y), Xe = new hr(), Ze = new Sr(K), et = new ze(F, We, J, qe, C, m), $e = new Ar(F, qe, q), ot = new Vr(W, Re, q, J), nt = new Ve(W, K, Re), rt = new ft(W, K, Re), Re.programs = Je.programs, F.capabilities = q, F.extensions = K, F.properties = Y, F.renderLists = Xe, F.shadowMap = $e, F.state = J, F.info = Re;
5323
5323
  }
5324
- st(), x !== 1009 && (P = new _t(x, t.width, t.height, i, a));
5324
+ st(), w !== 1009 && (P = new _t(w, t.width, t.height, i, c));
5325
5325
  let Z = new Lr(F, W);
5326
5326
  this.xr = Z, this.getContext = function() {
5327
5327
  return W;
@@ -5334,51 +5334,51 @@ var Gr = class {
5334
5334
  let e = K.get("WEBGL_lose_context");
5335
5335
  e && e.restoreContext();
5336
5336
  }, this.getPixelRatio = function() {
5337
- return B;
5337
+ return V;
5338
5338
  }, this.setPixelRatio = function(e) {
5339
- e !== void 0 && (B = e, this.setSize(ge, _e, !1));
5339
+ e !== void 0 && (V = e, this.setSize(me, he, !1));
5340
5340
  }, this.getSize = function(e) {
5341
- return e.set(ge, _e);
5341
+ return e.set(me, he);
5342
5342
  }, this.setSize = function(e, n, r = !0) {
5343
5343
  if (Z.isPresenting) {
5344
- M("WebGLRenderer: Can't change size while VR device is presenting.");
5344
+ L("WebGLRenderer: Can't change size while VR device is presenting.");
5345
5345
  return;
5346
5346
  }
5347
- ge = e, _e = n, t.width = Math.floor(e * B), t.height = Math.floor(n * B), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), P !== null && P.setSize(t.width, t.height), this.setViewport(0, 0, e, n);
5347
+ me = e, he = n, t.width = Math.floor(e * V), t.height = Math.floor(n * V), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), P !== null && P.setSize(t.width, t.height), this.setViewport(0, 0, e, n);
5348
5348
  }, this.getDrawingBufferSize = function(e) {
5349
- return e.set(ge * B, _e * B).floor();
5349
+ return e.set(me * V, he * V).floor();
5350
5350
  }, this.setDrawingBufferSize = function(e, n, r) {
5351
- ge = e, _e = n, B = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
5351
+ me = e, he = n, V = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
5352
5352
  }, this.setEffects = function(e) {
5353
- if (x === 1009) {
5354
- f("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
5353
+ if (w === 1009) {
5354
+ _("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
5355
5355
  return;
5356
5356
  }
5357
5357
  if (e) {
5358
5358
  for (let t = 0; t < e.length; t++) if (e[t].isOutputPass === !0) {
5359
- M("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");
5359
+ L("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");
5360
5360
  break;
5361
5361
  }
5362
5362
  }
5363
5363
  P.setEffects(e || []);
5364
5364
  }, this.getCurrentViewport = function(e) {
5365
- return e.copy(z);
5365
+ return e.copy(B);
5366
5366
  }, this.getViewport = function(e) {
5367
- return e.copy(be);
5367
+ return e.copy(ve);
5368
5368
  }, this.setViewport = function(e, t, n, r) {
5369
- e.isVector4 ? be.set(e.x, e.y, e.z, e.w) : be.set(e, t, n, r), J.viewport(z.copy(be).multiplyScalar(B).round());
5369
+ e.isVector4 ? ve.set(e.x, e.y, e.z, e.w) : ve.set(e, t, n, r), J.viewport(B.copy(ve).multiplyScalar(V).round());
5370
5370
  }, this.getScissor = function(e) {
5371
- return e.copy(V);
5371
+ return e.copy(be);
5372
5372
  }, this.setScissor = function(e, t, n, r) {
5373
- e.isVector4 ? V.set(e.x, e.y, e.z, e.w) : V.set(e, t, n, r), J.scissor(le.copy(V).multiplyScalar(B).round());
5373
+ e.isVector4 ? be.set(e.x, e.y, e.z, e.w) : be.set(e, t, n, r), J.scissor(se.copy(be).multiplyScalar(V).round());
5374
5374
  }, this.getScissorTest = function() {
5375
- return xe;
5375
+ return H;
5376
5376
  }, this.setScissorTest = function(e) {
5377
- J.setScissorTest(xe = e);
5377
+ J.setScissorTest(H = e);
5378
5378
  }, this.setOpaqueSort = function(e) {
5379
- ve = e;
5379
+ ge = e;
5380
5380
  }, this.setTransparentSort = function(e) {
5381
- ye = e;
5381
+ _e = e;
5382
5382
  }, this.getClearColor = function(e) {
5383
5383
  return e.copy(et.getClearColor());
5384
5384
  }, this.setClearColor = function() {
@@ -5391,13 +5391,13 @@ var Gr = class {
5391
5391
  let r = 0;
5392
5392
  if (e) {
5393
5393
  let e = !1;
5394
- if (L !== null) {
5395
- let t = L.texture.format;
5396
- e = C.has(t);
5394
+ if (R !== null) {
5395
+ let t = R.texture.format;
5396
+ e = T.has(t);
5397
5397
  }
5398
5398
  if (e) {
5399
- let e = L.texture.type, t = w.has(e), n = et.getClearColor(), r = et.getClearAlpha(), i = n.r, a = n.g, o = n.b;
5400
- t ? (T[0] = i, T[1] = a, T[2] = o, T[3] = r, W.clearBufferuiv(W.COLOR, 0, T)) : (E[0] = i, E[1] = a, E[2] = o, E[3] = r, W.clearBufferiv(W.COLOR, 0, E));
5399
+ let e = R.texture.type, t = D.has(e), n = et.getClearColor(), r = et.getClearAlpha(), i = n.r, a = n.g, o = n.b;
5400
+ t ? (O[0] = i, O[1] = a, O[2] = o, O[3] = r, W.clearBufferuiv(W.COLOR, 0, O)) : (k[0] = i, k[1] = a, k[2] = o, k[3] = r, W.clearBufferiv(W.COLOR, 0, k));
5401
5401
  } else r |= W.COLOR_BUFFER_BIT;
5402
5402
  }
5403
5403
  t && (r |= W.DEPTH_BUFFER_BIT, this.state.buffers.depth.setMask(!0)), n && (r |= W.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), r !== 0 && W.clear(r);
@@ -5413,15 +5413,15 @@ var Gr = class {
5413
5413
  t.removeEventListener("webglcontextlost", ct, !1), t.removeEventListener("webglcontextrestored", gt, !1), t.removeEventListener("webglcontextcreationerror", vt, !1), et.dispose(), Xe.dispose(), Ze.dispose(), Y.dispose(), We.dispose(), qe.dispose(), at.dispose(), ot.dispose(), Je.dispose(), Z.dispose(), Z.removeEventListener("sessionstart", Tt), Z.removeEventListener("sessionend", Et), Dt.stop();
5414
5414
  };
5415
5415
  function ct(e) {
5416
- e.preventDefault(), Fe("WebGLRenderer: Context Lost."), ne = !0;
5416
+ e.preventDefault(), a("WebGLRenderer: Context Lost."), te = !0;
5417
5417
  }
5418
5418
  function gt() {
5419
- Fe("WebGLRenderer: Context Restored."), ne = !1;
5419
+ a("WebGLRenderer: Context Restored."), te = !1;
5420
5420
  let e = Re.autoReset, t = $e.enabled, n = $e.autoUpdate, r = $e.needsUpdate, i = $e.type;
5421
5421
  st(), Re.autoReset = e, $e.enabled = t, $e.autoUpdate = n, $e.needsUpdate = r, $e.type = i;
5422
5422
  }
5423
5423
  function vt(e) {
5424
- f("WebGLRenderer: A WebGL context could not be created. Reason: ", e.statusMessage);
5424
+ _("WebGLRenderer: A WebGL context could not be created. Reason: ", e.statusMessage);
5425
5425
  }
5426
5426
  function yt(e) {
5427
5427
  let t = e.target;
@@ -5437,7 +5437,7 @@ var Gr = class {
5437
5437
  }), e.isShaderMaterial && Je.releaseShaderCache(e));
5438
5438
  }
5439
5439
  this.renderBufferDirect = function(e, t, n, r, i, a) {
5440
- t === null && (t = je);
5440
+ t === null && (t = Oe);
5441
5441
  let o = i.isMesh && i.matrixWorld.determinant() < 0, s = Ft(e, t, n, r, i);
5442
5442
  J.setMaterial(r, o);
5443
5443
  let c = n.index, l = 1;
@@ -5451,10 +5451,10 @@ var Gr = class {
5451
5451
  if (m < 0 || m === Infinity) return;
5452
5452
  at.setup(i, r, s, n, c);
5453
5453
  let h, g = nt;
5454
- if (c !== null && (h = Ge.get(c), g = rt, g.setIndex(h)), i.isMesh) r.wireframe === !0 ? (J.setLineWidth(r.wireframeLinewidth * Pe()), g.setMode(W.LINES)) : g.setMode(W.TRIANGLES);
5454
+ if (c !== null && (h = Ge.get(c), g = rt, g.setIndex(h)), i.isMesh) r.wireframe === !0 ? (J.setLineWidth(r.wireframeLinewidth * Fe()), g.setMode(W.LINES)) : g.setMode(W.TRIANGLES);
5455
5455
  else if (i.isLine) {
5456
5456
  let e = r.linewidth;
5457
- e === void 0 && (e = 1), J.setLineWidth(e * Pe()), i.isLineSegments ? g.setMode(W.LINES) : i.isLineLoop ? g.setMode(W.LINE_LOOP) : g.setMode(W.LINE_STRIP);
5457
+ e === void 0 && (e = 1), J.setLineWidth(e * Fe()), i.isLineSegments ? g.setMode(W.LINES) : i.isLineLoop ? g.setMode(W.LINE_LOOP) : g.setMode(W.LINE_STRIP);
5458
5458
  } else i.isPoints ? g.setMode(W.POINTS) : i.isSprite && g.setMode(W.TRIANGLES);
5459
5459
  if (i.isBatchedMesh) if (K.get("WEBGL_multi_draw")) g.renderMultiDraw(i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount);
5460
5460
  else {
@@ -5471,11 +5471,11 @@ var Gr = class {
5471
5471
  e.transparent === !0 && e.side === 2 && e.forceSinglePass === !1 ? (e.side = 1, e.needsUpdate = !0, jt(e, t, n), e.side = 0, e.needsUpdate = !0, jt(e, t, n), e.side = 2) : jt(e, t, n);
5472
5472
  }
5473
5473
  this.compile = function(e, t, n = null) {
5474
- n === null && (n = e), A = Ze.get(n), A.init(t), N.push(A), n.traverseVisible(function(e) {
5475
- e.isLight && e.layers.test(t.layers) && (A.pushLight(e), e.castShadow && A.pushShadow(e));
5474
+ n === null && (n = e), j = Ze.get(n), j.init(t), N.push(j), n.traverseVisible(function(e) {
5475
+ e.isLight && e.layers.test(t.layers) && (j.pushLight(e), e.castShadow && j.pushShadow(e));
5476
5476
  }), e !== n && e.traverseVisible(function(e) {
5477
- e.isLight && e.layers.test(t.layers) && (A.pushLight(e), e.castShadow && A.pushShadow(e));
5478
- }), A.setupLights();
5477
+ e.isLight && e.layers.test(t.layers) && (j.pushLight(e), e.castShadow && j.pushShadow(e));
5478
+ }), j.setupLights();
5479
5479
  let r = /* @__PURE__ */ new Set();
5480
5480
  return e.traverse(function(e) {
5481
5481
  if (!(e.isMesh || e.isPoints || e.isLine || e.isSprite)) return;
@@ -5485,7 +5485,7 @@ var Gr = class {
5485
5485
  St(a, n, e), r.add(a);
5486
5486
  }
5487
5487
  else St(t, n, e), r.add(t);
5488
- }), A = N.pop(), r;
5488
+ }), j = N.pop(), r;
5489
5489
  }, this.compileAsync = function(e, t, n = null) {
5490
5490
  let r = this.compile(e, t, n);
5491
5491
  return new Promise((t) => {
@@ -5516,57 +5516,57 @@ var Gr = class {
5516
5516
  Ct = e, Z.setAnimationLoop(e), e === null ? Dt.stop() : Dt.start();
5517
5517
  }, Z.addEventListener("sessionstart", Tt), Z.addEventListener("sessionend", Et), this.render = function(e, t) {
5518
5518
  if (t !== void 0 && t.isCamera !== !0) {
5519
- f("WebGLRenderer.render: camera is not an instance of THREE.Camera.");
5519
+ _("WebGLRenderer.render: camera is not an instance of THREE.Camera.");
5520
5520
  return;
5521
5521
  }
5522
- if (ne === !0) return;
5522
+ if (te === !0) return;
5523
5523
  I !== null && I.renderStart(e, t);
5524
- let n = Z.enabled === !0 && Z.isPresenting === !0, r = P !== null && (L === null || n) && P.begin(F, L);
5525
- if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Z.enabled === !0 && Z.isPresenting === !0 && (P === null || P.isCompositing() === !1) && (Z.cameraAutoUpdate === !0 && Z.updateCamera(t), t = Z.getCamera()), e.isScene === !0 && e.onBeforeRender(F, e, t, L), A = Ze.get(e, N.length), A.init(t), A.state.textureUnits = X.getTextureUnits(), N.push(A), Ee.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), Ce.setFromProjectionMatrix(Ee, ee, t.reversedDepth), we = this.localClippingEnabled, H = Qe.init(this.clippingPlanes, we), O = Xe.get(e, j.length), O.init(), j.push(O), Z.enabled === !0 && Z.isPresenting === !0) {
5524
+ let n = Z.enabled === !0 && Z.isPresenting === !0, r = P !== null && (R === null || n) && P.begin(F, R);
5525
+ if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Z.enabled === !0 && Z.isPresenting === !0 && (P === null || P.isCompositing() === !1) && (Z.cameraAutoUpdate === !0 && Z.updateCamera(t), t = Z.getCamera()), e.isScene === !0 && e.onBeforeRender(F, e, t, R), j = Ze.get(e, N.length), j.init(t), j.state.textureUnits = X.getTextureUnits(), N.push(j), we.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), xe.setFromProjectionMatrix(we, d, t.reversedDepth), Ce = this.localClippingEnabled, Se = Qe.init(this.clippingPlanes, Ce), A = Xe.get(e, M.length), A.init(), M.push(A), Z.enabled === !0 && Z.isPresenting === !0) {
5526
5526
  let e = F.xr.getDepthSensingMesh();
5527
5527
  e !== null && Ot(e, t, -Infinity, F.sortObjects);
5528
5528
  }
5529
- Ot(e, t, 0, F.sortObjects), O.finish(), F.sortObjects === !0 && O.sort(ve, ye), Me = Z.enabled === !1 || Z.isPresenting === !1 || Z.hasDepthSensing() === !1, Me && et.addToRenderList(O, e), this.info.render.frame++, H === !0 && Qe.beginShadows();
5530
- let i = A.state.shadowsArray;
5531
- if ($e.render(i, e, t), H === !0 && Qe.endShadows(), this.info.autoReset === !0 && this.info.reset(), (r && P.hasRenderPass()) === !1) {
5532
- let n = O.opaque, r = O.transmissive;
5533
- if (A.setupLights(), t.isArrayCamera) {
5529
+ Ot(e, t, 0, F.sortObjects), A.finish(), F.sortObjects === !0 && A.sort(ge, _e), Ne = Z.enabled === !1 || Z.isPresenting === !1 || Z.hasDepthSensing() === !1, Ne && et.addToRenderList(A, e), this.info.render.frame++, Se === !0 && Qe.beginShadows();
5530
+ let i = j.state.shadowsArray;
5531
+ if ($e.render(i, e, t), Se === !0 && Qe.endShadows(), this.info.autoReset === !0 && this.info.reset(), (r && P.hasRenderPass()) === !1) {
5532
+ let n = A.opaque, r = A.transmissive;
5533
+ if (j.setupLights(), t.isArrayCamera) {
5534
5534
  let i = t.cameras;
5535
5535
  if (r.length > 0) for (let t = 0, a = i.length; t < a; t++) {
5536
5536
  let a = i[t];
5537
5537
  $(n, r, e, a);
5538
5538
  }
5539
- Me && et.render(e);
5539
+ Ne && et.render(e);
5540
5540
  for (let t = 0, n = i.length; t < n; t++) {
5541
5541
  let n = i[t];
5542
- Q(O, e, n, n.viewport);
5542
+ Q(A, e, n, n.viewport);
5543
5543
  }
5544
- } else r.length > 0 && $(n, r, e, t), Me && et.render(e), Q(O, e, t);
5544
+ } else r.length > 0 && $(n, r, e, t), Ne && et.render(e), Q(A, e, t);
5545
5545
  }
5546
- L !== null && ae === 0 && (X.updateMultisampleRenderTarget(L), X.updateRenderTargetMipmap(L)), r && P.end(F), e.isScene === !0 && e.onAfterRender(F, e, t), at.resetDefaultState(), ce = -1, R = null, N.pop(), N.length > 0 ? (A = N[N.length - 1], X.setTextureUnits(A.state.textureUnits), H === !0 && Qe.setGlobalState(F.clippingPlanes, A.state.camera)) : A = null, j.pop(), O = j.length > 0 ? j[j.length - 1] : null, I !== null && I.renderEnd();
5546
+ R !== null && ie === 0 && (X.updateMultisampleRenderTarget(R), X.updateRenderTargetMipmap(R)), r && P.end(F), e.isScene === !0 && e.onAfterRender(F, e, t), at.resetDefaultState(), oe = -1, z = null, N.pop(), N.length > 0 ? (j = N[N.length - 1], X.setTextureUnits(j.state.textureUnits), Se === !0 && Qe.setGlobalState(F.clippingPlanes, j.state.camera)) : j = null, M.pop(), A = M.length > 0 ? M[M.length - 1] : null, I !== null && I.renderEnd();
5547
5547
  };
5548
5548
  function Ot(e, t, n, r) {
5549
5549
  if (e.visible === !1) return;
5550
5550
  if (e.layers.test(t.layers)) {
5551
5551
  if (e.isGroup) n = e.renderOrder;
5552
5552
  else if (e.isLOD) e.autoUpdate === !0 && e.update(t);
5553
- else if (e.isLightProbeGrid) A.pushLightProbeGrid(e);
5554
- else if (e.isLight) A.pushLight(e), e.castShadow && A.pushShadow(e);
5553
+ else if (e.isLightProbeGrid) j.pushLightProbeGrid(e);
5554
+ else if (e.isLight) j.pushLight(e), e.castShadow && j.pushShadow(e);
5555
5555
  else if (e.isSprite) {
5556
- if (!e.frustumCulled || Ce.intersectsSprite(e)) {
5557
- r && Oe.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Ee);
5556
+ if (!e.frustumCulled || xe.intersectsSprite(e)) {
5557
+ r && De.setFromMatrixPosition(e.matrixWorld).applyMatrix4(we);
5558
5558
  let t = qe.update(e), i = e.material;
5559
- i.visible && O.push(e, t, i, n, Oe.z, null);
5559
+ i.visible && A.push(e, t, i, n, De.z, null);
5560
5560
  }
5561
- } else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || Ce.intersectsObject(e))) {
5561
+ } else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || xe.intersectsObject(e))) {
5562
5562
  let t = qe.update(e), i = e.material;
5563
- if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), Oe.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), Oe.copy(e.boundingSphere.center)), Oe.applyMatrix4(e.matrixWorld).applyMatrix4(Ee)), Array.isArray(i)) {
5563
+ if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), De.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), De.copy(e.boundingSphere.center)), De.applyMatrix4(e.matrixWorld).applyMatrix4(we)), Array.isArray(i)) {
5564
5564
  let r = t.groups;
5565
5565
  for (let a = 0, o = r.length; a < o; a++) {
5566
5566
  let o = r[a], s = i[o.materialIndex];
5567
- s && s.visible && O.push(e, t, s, n, Oe.z, o);
5567
+ s && s.visible && A.push(e, t, s, n, De.z, o);
5568
5568
  }
5569
- } else i.visible && O.push(e, t, i, n, Oe.z, null);
5569
+ } else i.visible && A.push(e, t, i, n, De.z, null);
5570
5570
  }
5571
5571
  }
5572
5572
  let i = e.children;
@@ -5574,31 +5574,31 @@ var Gr = class {
5574
5574
  }
5575
5575
  function Q(e, t, n, r) {
5576
5576
  let { opaque: i, transmissive: a, transparent: o } = e;
5577
- A.setupLightsView(n), H === !0 && Qe.setGlobalState(F.clippingPlanes, n), r && J.viewport(z.copy(r)), i.length > 0 && kt(i, t, n), a.length > 0 && kt(a, t, n), o.length > 0 && kt(o, t, n), J.buffers.depth.setTest(!0), J.buffers.depth.setMask(!0), J.buffers.color.setMask(!0), J.setPolygonOffset(!1);
5577
+ j.setupLightsView(n), Se === !0 && Qe.setGlobalState(F.clippingPlanes, n), r && J.viewport(B.copy(r)), i.length > 0 && kt(i, t, n), a.length > 0 && kt(a, t, n), o.length > 0 && kt(o, t, n), J.buffers.depth.setTest(!0), J.buffers.depth.setMask(!0), J.buffers.color.setMask(!0), J.setPolygonOffset(!1);
5578
5578
  }
5579
5579
  function $(e, t, n, r) {
5580
5580
  if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
5581
- if (A.state.transmissionRenderTarget[r.id] === void 0) {
5581
+ if (j.state.transmissionRenderTarget[r.id] === void 0) {
5582
5582
  let e = K.has("EXT_color_buffer_half_float") || K.has("EXT_color_buffer_float");
5583
- A.state.transmissionRenderTarget[r.id] = new u(1, 1, {
5583
+ j.state.transmissionRenderTarget[r.id] = new l(1, 1, {
5584
5584
  generateMipmaps: !0,
5585
- type: e ? he : Se,
5586
- minFilter: re,
5585
+ type: e ? pe : ye,
5586
+ minFilter: ne,
5587
5587
  samples: Math.max(4, q.samples),
5588
- stencilBuffer: a,
5588
+ stencilBuffer: c,
5589
5589
  resolveDepthBuffer: !1,
5590
5590
  resolveStencilBuffer: !1,
5591
- colorSpace: l.workingColorSpace
5591
+ colorSpace: u.workingColorSpace
5592
5592
  });
5593
5593
  }
5594
- let i = A.state.transmissionRenderTarget[r.id], o = r.viewport || z;
5595
- i.setSize(o.z * F.transmissionResolutionScale, o.w * F.transmissionResolutionScale);
5596
- let s = F.getRenderTarget(), c = F.getActiveCubeFace(), d = F.getActiveMipmapLevel();
5597
- F.setRenderTarget(i), F.getClearColor(fe), pe = F.getClearAlpha(), pe < 1 && F.setClearColor(16777215, .5), F.clear(), Me && et.render(n);
5594
+ let i = j.state.transmissionRenderTarget[r.id], a = r.viewport || B;
5595
+ i.setSize(a.z * F.transmissionResolutionScale, a.w * F.transmissionResolutionScale);
5596
+ let o = F.getRenderTarget(), s = F.getActiveCubeFace(), d = F.getActiveMipmapLevel();
5597
+ F.setRenderTarget(i), F.getClearColor(ue), fe = F.getClearAlpha(), fe < 1 && F.setClearColor(16777215, .5), F.clear(), Ne && et.render(n);
5598
5598
  let f = F.toneMapping;
5599
5599
  F.toneMapping = 0;
5600
5600
  let p = r.viewport;
5601
- if (r.viewport !== void 0 && (r.viewport = void 0), A.setupLightsView(r), H === !0 && Qe.setGlobalState(F.clippingPlanes, r), kt(e, n, r), X.updateMultisampleRenderTarget(i), X.updateRenderTargetMipmap(i), K.has("WEBGL_multisampled_render_to_texture") === !1) {
5601
+ if (r.viewport !== void 0 && (r.viewport = void 0), j.setupLightsView(r), Se === !0 && Qe.setGlobalState(F.clippingPlanes, r), kt(e, n, r), X.updateMultisampleRenderTarget(i), X.updateRenderTargetMipmap(i), K.has("WEBGL_multisampled_render_to_texture") === !1) {
5602
5602
  let e = !1;
5603
5603
  for (let i = 0, a = t.length; i < a; i++) {
5604
5604
  let { object: a, geometry: o, material: s, group: c } = t[i];
@@ -5609,7 +5609,7 @@ var Gr = class {
5609
5609
  }
5610
5610
  e === !0 && (X.updateMultisampleRenderTarget(i), X.updateRenderTargetMipmap(i));
5611
5611
  }
5612
- F.setRenderTarget(s, c, d), F.setClearColor(fe, pe), p !== void 0 && (r.viewport = p), F.toneMapping = f;
5612
+ F.setRenderTarget(o, s, d), F.setClearColor(ue, fe), p !== void 0 && (r.viewport = p), F.toneMapping = f;
5613
5613
  }
5614
5614
  function kt(e, t, n) {
5615
5615
  let r = t.isScene === !0 ? t.overrideMaterial : null;
@@ -5622,8 +5622,8 @@ var Gr = class {
5622
5622
  e.onBeforeRender(F, t, n, r, i, a), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), i.onBeforeRender(F, t, n, r, e, a), i.transparent === !0 && i.side === 2 && i.forceSinglePass === !1 ? (i.side = 1, i.needsUpdate = !0, F.renderBufferDirect(n, t, r, i, e, a), i.side = 0, i.needsUpdate = !0, F.renderBufferDirect(n, t, r, i, e, a), i.side = 2) : F.renderBufferDirect(n, t, r, i, e, a), e.onAfterRender(F, t, n, r, i, a);
5623
5623
  }
5624
5624
  function jt(e, t, n) {
5625
- t.isScene !== !0 && (t = je);
5626
- let r = Y.get(e), i = A.state.lights, a = A.state.shadowsArray, o = i.state.version, s = Je.getParameters(e, i.state, a, t, n, A.state.lightProbeGridArray), c = Je.getProgramCacheKey(s), l = r.programs;
5625
+ t.isScene !== !0 && (t = Oe);
5626
+ let r = Y.get(e), i = j.state.lights, a = j.state.shadowsArray, o = i.state.version, s = Je.getParameters(e, i.state, a, t, n, j.state.lightProbeGridArray), c = Je.getProgramCacheKey(s), l = r.programs;
5627
5627
  r.environment = e.isMeshStandardMaterial || e.isMeshLambertMaterial || e.isMeshPhongMaterial ? t.environment : null, r.fog = t.fog;
5628
5628
  let u = e.isMeshStandardMaterial || e.isMeshLambertMaterial && !e.envMap || e.isMeshPhongMaterial && !e.envMap;
5629
5629
  r.envMap = We.get(e.envMap || r.environment, u), r.envMapRotation = r.environment !== null && e.envMap === null ? t.environmentRotation : e.envMapRotation, l === void 0 && (e.addEventListener("dispose", yt), l = /* @__PURE__ */ new Map(), r.programs = l);
@@ -5632,7 +5632,7 @@ var Gr = class {
5632
5632
  if (r.currentProgram === d && r.lightsStateVersion === o) return Nt(e, s), d;
5633
5633
  } else s.uniforms = Je.getUniforms(e), I !== null && e.isNodeMaterial && I.build(e, n, s), e.onBeforeCompile(s, F), d = Je.acquireProgram(s, c), l.set(c, d), r.uniforms = s.uniforms;
5634
5634
  let f = r.uniforms;
5635
- return (!e.isShaderMaterial && !e.isRawShaderMaterial || e.clipping === !0) && (f.clippingPlanes = Qe.uniform), Nt(e, s), r.needsLights = Lt(e), r.lightsStateVersion = o, r.needsLights && (f.ambientLightColor.value = i.state.ambient, f.lightProbe.value = i.state.probe, f.directionalLights.value = i.state.directional, f.directionalLightShadows.value = i.state.directionalShadow, f.spotLights.value = i.state.spot, f.spotLightShadows.value = i.state.spotShadow, f.rectAreaLights.value = i.state.rectArea, f.ltc_1.value = i.state.rectAreaLTC1, f.ltc_2.value = i.state.rectAreaLTC2, f.pointLights.value = i.state.point, f.pointLightShadows.value = i.state.pointShadow, f.hemisphereLights.value = i.state.hemi, f.directionalShadowMatrix.value = i.state.directionalShadowMatrix, f.spotLightMatrix.value = i.state.spotLightMatrix, f.spotLightMap.value = i.state.spotLightMap, f.pointShadowMatrix.value = i.state.pointShadowMatrix), r.lightProbeGrid = A.state.lightProbeGridArray.length > 0, r.currentProgram = d, r.uniformsList = null, d;
5635
+ return (!e.isShaderMaterial && !e.isRawShaderMaterial || e.clipping === !0) && (f.clippingPlanes = Qe.uniform), Nt(e, s), r.needsLights = Lt(e), r.lightsStateVersion = o, r.needsLights && (f.ambientLightColor.value = i.state.ambient, f.lightProbe.value = i.state.probe, f.directionalLights.value = i.state.directional, f.directionalLightShadows.value = i.state.directionalShadow, f.spotLights.value = i.state.spot, f.spotLightShadows.value = i.state.spotShadow, f.rectAreaLights.value = i.state.rectArea, f.ltc_1.value = i.state.rectAreaLTC1, f.ltc_2.value = i.state.rectAreaLTC2, f.pointLights.value = i.state.point, f.pointLightShadows.value = i.state.pointShadow, f.hemisphereLights.value = i.state.hemi, f.directionalShadowMatrix.value = i.state.directionalShadowMatrix, f.spotLightMatrix.value = i.state.spotLightMatrix, f.spotLightMap.value = i.state.spotLightMap, f.pointShadowMatrix.value = i.state.pointShadowMatrix), r.lightProbeGrid = j.state.lightProbeGridArray.length > 0, r.currentProgram = d, r.uniformsList = null, d;
5636
5636
  }
5637
5637
  function Mt(e) {
5638
5638
  if (e.uniformsList === null) {
@@ -5648,35 +5648,35 @@ var Gr = class {
5648
5648
  function Pt(e, t) {
5649
5649
  if (e.length === 0) return null;
5650
5650
  if (e.length === 1) return e[0].texture === null ? null : e[0];
5651
- D.setFromMatrixPosition(t.matrixWorld);
5651
+ ee.setFromMatrixPosition(t.matrixWorld);
5652
5652
  for (let t = 0, n = e.length; t < n; t++) {
5653
5653
  let n = e[t];
5654
- if (n.texture !== null && n.boundingBox.containsPoint(D)) return n;
5654
+ if (n.texture !== null && n.boundingBox.containsPoint(ee)) return n;
5655
5655
  }
5656
5656
  return null;
5657
5657
  }
5658
5658
  function Ft(e, t, n, r, i) {
5659
- t.isScene !== !0 && (t = je), X.resetTextureUnits();
5660
- let a = t.fog, o = r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial ? t.environment : null, s = L === null ? F.outputColorSpace : L.isXRRenderTarget === !0 ? L.texture.colorSpace : l.workingColorSpace, c = r.isMeshStandardMaterial || r.isMeshLambertMaterial && !r.envMap || r.isMeshPhongMaterial && !r.envMap, u = We.get(r.envMap || o, c), d = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, f = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), p = !!n.morphAttributes.position, m = !!n.morphAttributes.normal, h = !!n.morphAttributes.color, g = 0;
5661
- r.toneMapped && (L === null || L.isXRRenderTarget === !0) && (g = F.toneMapping);
5662
- let _ = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, v = _ === void 0 ? 0 : _.length, y = Y.get(r), b = A.state.lights;
5663
- if (H === !0 && (we === !0 || e !== R)) {
5664
- let t = e === R && r.id === ce;
5659
+ t.isScene !== !0 && (t = Oe), X.resetTextureUnits();
5660
+ let a = t.fog, o = r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial ? t.environment : null, s = R === null ? F.outputColorSpace : R.isXRRenderTarget === !0 ? R.texture.colorSpace : u.workingColorSpace, c = r.isMeshStandardMaterial || r.isMeshLambertMaterial && !r.envMap || r.isMeshPhongMaterial && !r.envMap, l = We.get(r.envMap || o, c), d = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, f = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), p = !!n.morphAttributes.position, m = !!n.morphAttributes.normal, h = !!n.morphAttributes.color, g = 0;
5661
+ r.toneMapped && (R === null || R.isXRRenderTarget === !0) && (g = F.toneMapping);
5662
+ let _ = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, v = _ === void 0 ? 0 : _.length, y = Y.get(r), b = j.state.lights;
5663
+ if (Se === !0 && (Ce === !0 || e !== z)) {
5664
+ let t = e === z && r.id === oe;
5665
5665
  Qe.setState(r, e, t);
5666
5666
  }
5667
5667
  let x = !1;
5668
- r.version === y.__version ? y.needsLights && y.lightsStateVersion !== b.state.version ? x = !0 : y.outputColorSpace === s ? i.isBatchedMesh && y.batching === !1 || !i.isBatchedMesh && y.batching === !0 || i.isBatchedMesh && y.batchingColor === !0 && i.colorTexture === null || i.isBatchedMesh && y.batchingColor === !1 && i.colorTexture !== null || i.isInstancedMesh && y.instancing === !1 || !i.isInstancedMesh && y.instancing === !0 || i.isSkinnedMesh && y.skinning === !1 || !i.isSkinnedMesh && y.skinning === !0 || i.isInstancedMesh && y.instancingColor === !0 && i.instanceColor === null || i.isInstancedMesh && y.instancingColor === !1 && i.instanceColor !== null || i.isInstancedMesh && y.instancingMorph === !0 && i.morphTexture === null || i.isInstancedMesh && y.instancingMorph === !1 && i.morphTexture !== null ? x = !0 : y.envMap === u ? r.fog === !0 && y.fog !== a || y.numClippingPlanes !== void 0 && (y.numClippingPlanes !== Qe.numPlanes || y.numIntersection !== Qe.numIntersection) ? x = !0 : y.vertexAlphas === d && y.vertexTangents === f && y.morphTargets === p && y.morphNormals === m && y.morphColors === h && y.toneMapping === g && y.morphTargetsCount === v ? !!y.lightProbeGrid != A.state.lightProbeGridArray.length > 0 && (x = !0) : x = !0 : x = !0 : x = !0 : (x = !0, y.__version = r.version);
5668
+ r.version === y.__version ? y.needsLights && y.lightsStateVersion !== b.state.version ? x = !0 : y.outputColorSpace === s ? i.isBatchedMesh && y.batching === !1 || !i.isBatchedMesh && y.batching === !0 || i.isBatchedMesh && y.batchingColor === !0 && i.colorTexture === null || i.isBatchedMesh && y.batchingColor === !1 && i.colorTexture !== null || i.isInstancedMesh && y.instancing === !1 || !i.isInstancedMesh && y.instancing === !0 || i.isSkinnedMesh && y.skinning === !1 || !i.isSkinnedMesh && y.skinning === !0 || i.isInstancedMesh && y.instancingColor === !0 && i.instanceColor === null || i.isInstancedMesh && y.instancingColor === !1 && i.instanceColor !== null || i.isInstancedMesh && y.instancingMorph === !0 && i.morphTexture === null || i.isInstancedMesh && y.instancingMorph === !1 && i.morphTexture !== null ? x = !0 : y.envMap === l ? r.fog === !0 && y.fog !== a || y.numClippingPlanes !== void 0 && (y.numClippingPlanes !== Qe.numPlanes || y.numIntersection !== Qe.numIntersection) ? x = !0 : y.vertexAlphas === d && y.vertexTangents === f && y.morphTargets === p && y.morphNormals === m && y.morphColors === h && y.toneMapping === g && y.morphTargetsCount === v ? !!y.lightProbeGrid != j.state.lightProbeGridArray.length > 0 && (x = !0) : x = !0 : x = !0 : x = !0 : (x = !0, y.__version = r.version);
5669
5669
  let S = y.currentProgram;
5670
5670
  x === !0 && (S = jt(r, t, i), I && r.isNodeMaterial && I.onUpdateProgram(r, S, y));
5671
5671
  let C = !1, w = !1, T = !1, E = S.getUniforms(), D = y.uniforms;
5672
- if (J.useProgram(S.program) && (C = !0, w = !0, T = !0), r.id !== ce && (ce = r.id, w = !0), y.needsLights) {
5673
- let e = Pt(A.state.lightProbeGridArray, i);
5672
+ if (J.useProgram(S.program) && (C = !0, w = !0, T = !0), r.id !== oe && (oe = r.id, w = !0), y.needsLights) {
5673
+ let e = Pt(j.state.lightProbeGridArray, i);
5674
5674
  y.lightProbeGrid !== e && (y.lightProbeGrid = e, w = !0);
5675
5675
  }
5676
- if (C || R !== e) {
5676
+ if (C || z !== e) {
5677
5677
  J.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), E.setValue(W, "projectionMatrix", e.projectionMatrix), E.setValue(W, "viewMatrix", e.matrixWorldInverse);
5678
5678
  let t = E.map.cameraPosition;
5679
- t !== void 0 && t.setValue(W, De.setFromMatrixPosition(e.matrixWorld)), q.logarithmicDepthBuffer && E.setValue(W, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && E.setValue(W, "isOrthographic", e.isOrthographicCamera === !0), R !== e && (R = e, w = !0, T = !0);
5679
+ t !== void 0 && t.setValue(W, Te.setFromMatrixPosition(e.matrixWorld)), q.logarithmicDepthBuffer && E.setValue(W, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && E.setValue(W, "isOrthographic", e.isOrthographicCamera === !0), z !== e && (z = e, w = !0, T = !0);
5680
5680
  }
5681
5681
  if (y.needsLights && (b.state.directionalShadowMap.length > 0 && E.setValue(W, "directionalShadowMap", b.state.directionalShadowMap, X), b.state.spotShadowMap.length > 0 && E.setValue(W, "spotShadowMap", b.state.spotShadowMap, X), b.state.pointShadowMap.length > 0 && E.setValue(W, "pointShadowMap", b.state.pointShadowMap, X)), i.isSkinnedMesh) {
5682
5682
  E.setOptional(W, i, "bindMatrix"), E.setOptional(W, i, "bindMatrixInverse");
@@ -5686,7 +5686,7 @@ var Gr = class {
5686
5686
  i.isBatchedMesh && (E.setOptional(W, i, "batchingTexture"), E.setValue(W, "batchingTexture", i._matricesTexture, X), E.setOptional(W, i, "batchingIdTexture"), E.setValue(W, "batchingIdTexture", i._indirectTexture, X), E.setOptional(W, i, "batchingColorTexture"), i._colorsTexture !== null && E.setValue(W, "batchingColorTexture", i._colorsTexture, X));
5687
5687
  let O = n.morphAttributes;
5688
5688
  if ((O.position !== void 0 || O.normal !== void 0 || O.color !== void 0) && tt.update(i, n, S), (w || y.receiveShadow !== i.receiveShadow) && (y.receiveShadow = i.receiveShadow, E.setValue(W, "receiveShadow", i.receiveShadow)), (r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial) && r.envMap === null && t.environment !== null && (D.envMapIntensity.value = t.environmentIntensity), D.dfgLUT !== void 0 && (D.dfgLUT.value = Wr()), w) {
5689
- if (E.setValue(W, "toneMappingExposure", F.toneMappingExposure), y.needsLights && It(D, T), a && r.fog === !0 && Ye.refreshFogUniforms(D, a), Ye.refreshMaterialUniforms(D, r, B, _e, A.state.transmissionRenderTarget[e.id]), y.needsLights && y.lightProbeGrid) {
5689
+ if (E.setValue(W, "toneMappingExposure", F.toneMappingExposure), y.needsLights && It(D, T), a && r.fog === !0 && Ye.refreshFogUniforms(D, a), Ye.refreshMaterialUniforms(D, r, V, he, j.state.transmissionRenderTarget[e.id]), y.needsLights && y.lightProbeGrid) {
5690
5690
  let e = y.lightProbeGrid;
5691
5691
  D.probesSH.value = e.texture, D.probesMin.value.copy(e.boundingBox.min), D.probesMax.value.copy(e.boundingBox.max), D.probesResolution.value.copy(e.resolution);
5692
5692
  }
@@ -5708,11 +5708,11 @@ var Gr = class {
5708
5708
  return e.isMeshLambertMaterial || e.isMeshToonMaterial || e.isMeshPhongMaterial || e.isMeshStandardMaterial || e.isShadowMaterial || e.isShaderMaterial && e.lights === !0;
5709
5709
  }
5710
5710
  this.getActiveCubeFace = function() {
5711
- return ie;
5711
+ return re;
5712
5712
  }, this.getActiveMipmapLevel = function() {
5713
- return ae;
5713
+ return ie;
5714
5714
  }, this.getRenderTarget = function() {
5715
- return L;
5715
+ return R;
5716
5716
  }, this.setRenderTargetTextures = function(e, t, n) {
5717
5717
  let r = Y.get(e);
5718
5718
  r.__autoAllocateDepthBuffer = e.resolveDepthBuffer === !1, r.__autoAllocateDepthBuffer === !1 && (r.__useRenderToTexture = !1), Y.get(e.texture).__webglTexture = t, Y.get(e.depthTexture).__webglTexture = r.__autoAllocateDepthBuffer ? void 0 : n, r.__hasExternalTextures = !0;
@@ -5722,12 +5722,12 @@ var Gr = class {
5722
5722
  };
5723
5723
  let Rt = W.createFramebuffer();
5724
5724
  this.setRenderTarget = function(e, t = 0, n = 0) {
5725
- L = e, ie = t, ae = n;
5725
+ R = e, re = t, ie = n;
5726
5726
  let r = null, i = !1, a = !1;
5727
5727
  if (e) {
5728
5728
  let o = Y.get(e);
5729
5729
  if (o.__useDefaultFramebuffer !== void 0) {
5730
- J.bindFramebuffer(W.FRAMEBUFFER, o.__webglFramebuffer), z.copy(e.viewport), le.copy(e.scissor), ue = e.scissorTest, J.viewport(z), J.scissor(le), J.setScissorTest(ue), ce = -1;
5730
+ J.bindFramebuffer(W.FRAMEBUFFER, o.__webglFramebuffer), B.copy(e.viewport), se.copy(e.scissor), ce = e.scissorTest, J.viewport(B), J.scissor(se), J.setScissorTest(ce), oe = -1;
5731
5731
  return;
5732
5732
  } else if (o.__webglFramebuffer === void 0) X.setupRenderTarget(e);
5733
5733
  else if (o.__hasExternalTextures) X.rebindTextures(e, Y.get(e.texture).__webglTexture, Y.get(e.depthTexture).__webglTexture);
@@ -5741,9 +5741,9 @@ var Gr = class {
5741
5741
  let s = e.texture;
5742
5742
  (s.isData3DTexture || s.isDataArrayTexture || s.isCompressedArrayTexture) && (a = !0);
5743
5743
  let c = Y.get(e).__webglFramebuffer;
5744
- e.isWebGLCubeRenderTarget ? (r = Array.isArray(c[t]) ? c[t][n] : c[t], i = !0) : r = e.samples > 0 && X.useMultisampledRTT(e) === !1 ? Y.get(e).__webglMultisampledFramebuffer : Array.isArray(c) ? c[n] : c, z.copy(e.viewport), le.copy(e.scissor), ue = e.scissorTest;
5745
- } else z.copy(be).multiplyScalar(B).floor(), le.copy(V).multiplyScalar(B).floor(), ue = xe;
5746
- if (n !== 0 && (r = Rt), J.bindFramebuffer(W.FRAMEBUFFER, r) && J.drawBuffers(e, r), J.viewport(z), J.scissor(le), J.setScissorTest(ue), i) {
5744
+ e.isWebGLCubeRenderTarget ? (r = Array.isArray(c[t]) ? c[t][n] : c[t], i = !0) : r = e.samples > 0 && X.useMultisampledRTT(e) === !1 ? Y.get(e).__webglMultisampledFramebuffer : Array.isArray(c) ? c[n] : c, B.copy(e.viewport), se.copy(e.scissor), ce = e.scissorTest;
5745
+ } else B.copy(ve).multiplyScalar(V).floor(), se.copy(be).multiplyScalar(V).floor(), ce = H;
5746
+ if (n !== 0 && (r = Rt), J.bindFramebuffer(W.FRAMEBUFFER, r) && J.drawBuffers(e, r), J.viewport(B), J.scissor(se), J.setScissorTest(ce), i) {
5747
5747
  let r = Y.get(e.texture);
5748
5748
  W.framebufferTexture2D(W.FRAMEBUFFER, W.COLOR_ATTACHMENT0, W.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
5749
5749
  } else if (a) {
@@ -5756,10 +5756,10 @@ var Gr = class {
5756
5756
  let t = Y.get(e.texture);
5757
5757
  W.framebufferTexture2D(W.FRAMEBUFFER, W.COLOR_ATTACHMENT0, W.TEXTURE_2D, t.__webglTexture, n);
5758
5758
  }
5759
- ce = -1;
5759
+ oe = -1;
5760
5760
  }, this.readRenderTargetPixels = function(e, t, n, r, i, a, o, s = 0) {
5761
5761
  if (!(e && e.isWebGLRenderTarget)) {
5762
- f("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
5762
+ _("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
5763
5763
  return;
5764
5764
  }
5765
5765
  let c = Y.get(e).__webglFramebuffer;
@@ -5768,16 +5768,16 @@ var Gr = class {
5768
5768
  try {
5769
5769
  let o = e.textures[s], c = o.format, l = o.type;
5770
5770
  if (e.textures.length > 1 && W.readBuffer(W.COLOR_ATTACHMENT0 + s), !q.textureFormatReadable(c)) {
5771
- f("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
5771
+ _("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
5772
5772
  return;
5773
5773
  }
5774
5774
  if (!q.textureTypeReadable(l)) {
5775
- f("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
5775
+ _("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
5776
5776
  return;
5777
5777
  }
5778
5778
  t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i && W.readPixels(t, n, r, i, it.convert(c), it.convert(l), a);
5779
5779
  } finally {
5780
- let e = L === null ? null : Y.get(L).__webglFramebuffer;
5780
+ let e = R === null ? null : Y.get(R).__webglFramebuffer;
5781
5781
  J.bindFramebuffer(W.FRAMEBUFFER, e);
5782
5782
  }
5783
5783
  }
@@ -5791,10 +5791,10 @@ var Gr = class {
5791
5791
  if (!q.textureTypeReadable(u)) throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");
5792
5792
  let d = W.createBuffer();
5793
5793
  W.bindBuffer(W.PIXEL_PACK_BUFFER, d), W.bufferData(W.PIXEL_PACK_BUFFER, a.byteLength, W.STREAM_READ), W.readPixels(t, n, r, i, it.convert(l), it.convert(u), 0);
5794
- let f = L === null ? null : Y.get(L).__webglFramebuffer;
5794
+ let f = R === null ? null : Y.get(R).__webglFramebuffer;
5795
5795
  J.bindFramebuffer(W.FRAMEBUFFER, f);
5796
5796
  let p = W.fenceSync(W.SYNC_GPU_COMMANDS_COMPLETE, 0);
5797
- return W.flush(), await te(W, p, 4), W.bindBuffer(W.PIXEL_PACK_BUFFER, d), W.getBufferSubData(W.PIXEL_PACK_BUFFER, 0, a), W.deleteBuffer(d), W.deleteSync(p), a;
5797
+ return W.flush(), await g(W, p, 4), W.bindBuffer(W.PIXEL_PACK_BUFFER, d), W.getBufferSubData(W.PIXEL_PACK_BUFFER, 0, a), W.deleteBuffer(d), W.deleteSync(p), a;
5798
5798
  } else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");
5799
5799
  }, this.copyFramebufferToTexture = function(e, t = null, n = 0) {
5800
5800
  let r = 2 ** -n, i = Math.floor(e.image.width * r), a = Math.floor(e.image.height * r), o = t === null ? 0 : t.x, s = t === null ? 0 : t.y;
@@ -5831,11 +5831,11 @@ var Gr = class {
5831
5831
  }, this.initTexture = function(e) {
5832
5832
  e.isCubeTexture ? X.setTextureCube(e, 0) : e.isData3DTexture ? X.setTexture3D(e, 0) : e.isDataArrayTexture || e.isCompressedArrayTexture ? X.setTexture2DArray(e, 0) : X.setTexture2D(e, 0), J.unbindTexture();
5833
5833
  }, this.resetState = function() {
5834
- ie = 0, ae = 0, L = null, J.reset(), at.reset();
5834
+ re = 0, ie = 0, R = null, J.reset(), at.reset();
5835
5835
  }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
5836
5836
  }
5837
5837
  get coordinateSystem() {
5838
- return ee;
5838
+ return d;
5839
5839
  }
5840
5840
  get outputColorSpace() {
5841
5841
  return this._outputColorSpace;
@@ -5843,10 +5843,10 @@ var Gr = class {
5843
5843
  set outputColorSpace(e) {
5844
5844
  this._outputColorSpace = e;
5845
5845
  let t = this.getContext();
5846
- t.drawingBufferColorSpace = l._getDrawingBufferColorSpace(e), t.unpackColorSpace = l._getUnpackColorSpace();
5846
+ t.drawingBufferColorSpace = u._getDrawingBufferColorSpace(e), t.unpackColorSpace = u._getUnpackColorSpace();
5847
5847
  }
5848
5848
  };
5849
5849
  //#endregion
5850
5850
  export { G as n, Gr as r, et as t };
5851
5851
 
5852
- //# sourceMappingURL=three.module-CuRNgijg.mjs.map
5852
+ //# sourceMappingURL=three.module-BkkLbA6n.mjs.map