@roomle/web-sdk 3.7.0-alpha.3 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/lib/{BufferGeometry-C696z6r3.mjs → BufferGeometry-BzmfTBQt.mjs} +1 -1
  2. package/lib/{BufferGeometry-C696z6r3.mjs.map → BufferGeometry-BzmfTBQt.mjs.map} +1 -1
  3. package/lib/ConfiguratorKernel.wasm +0 -0
  4. package/lib/{GLTFExporter-AfQIvZAD.mjs → GLTFExporter-CyhgWPq0.mjs} +2 -2
  5. package/lib/{GLTFExporter-AfQIvZAD.mjs.map → GLTFExporter-CyhgWPq0.mjs.map} +1 -1
  6. package/lib/{PointLightHelper-wVSmrAnD.mjs → PointLightHelper-DwIXACyT.mjs} +2 -2
  7. package/lib/{PointLightHelper-wVSmrAnD.mjs.map → PointLightHelper-DwIXACyT.mjs.map} +1 -1
  8. package/lib/RoomleCore.js +2 -2
  9. package/lib/RoomleCore.wasm +0 -0
  10. package/lib/RoomleToolsCore.wasm +0 -0
  11. package/lib/{SpotLightHelper-C7J95t4f.mjs → SpotLightHelper-CfLHM7LU.mjs} +2 -2
  12. package/lib/{SpotLightHelper-C7J95t4f.mjs.map → SpotLightHelper-CfLHM7LU.mjs.map} +1 -1
  13. package/lib/{USDZExporter-BBk0APeK.mjs → USDZExporter-kmxcTvnQ.mjs} +2 -2
  14. package/lib/{USDZExporter-BBk0APeK.mjs.map → USDZExporter-kmxcTvnQ.mjs.map} +1 -1
  15. package/lib/{api-DgXsyN04.mjs → api-X1dDTDvL.mjs} +2 -2
  16. package/lib/{api-DgXsyN04.mjs.map → api-X1dDTDvL.mjs.map} +1 -1
  17. package/lib/asset-loader.worker-A7nEeQB4.mjs.map +1 -1
  18. package/lib/{banana-for-scale-D8t2dmc7.mjs → banana-for-scale-Bpf8RfLi.mjs} +4 -4
  19. package/lib/{banana-for-scale-D8t2dmc7.mjs.map → banana-for-scale-Bpf8RfLi.mjs.map} +1 -1
  20. package/lib/budgeteer.sw-CQWYbQSc.mjs.map +1 -1
  21. package/lib/budgeteer.sw.js +1 -1
  22. package/lib/{common-utils-qErzZAiR.mjs → common-utils-DMI8Yuhe.mjs} +5 -3
  23. package/lib/common-utils-DMI8Yuhe.mjs.map +1 -0
  24. package/lib/{component-dimensioning-DlB7-9Om.mjs → component-dimensioning-MtS9xiY-.mjs} +15 -15
  25. package/lib/{component-dimensioning-DlB7-9Om.mjs.map → component-dimensioning-MtS9xiY-.mjs.map} +1 -1
  26. package/lib/{component-raycast-helper-C6ptEb0K.mjs → component-raycast-helper-C1qWqpRH.mjs} +13 -9
  27. package/lib/component-raycast-helper-C1qWqpRH.mjs.map +1 -0
  28. package/lib/configurator-C5t3clCx.mjs +2 -0
  29. package/lib/{configurator-CmMBHkyd.mjs → configurator-Cg1a9XSL.mjs} +4 -4
  30. package/lib/{configurator-CmMBHkyd.mjs.map → configurator-Cg1a9XSL.mjs.map} +1 -1
  31. package/lib/{continuous-drawing-helper-BwulJHKj.mjs → continuous-drawing-helper-CQx5Sbns.mjs} +3 -3
  32. package/lib/{continuous-drawing-helper-BwulJHKj.mjs.map → continuous-drawing-helper-CQx5Sbns.mjs.map} +1 -1
  33. package/lib/{dat.gui.module-CZHqOVGq.mjs → dat.gui.module-CZ-DIWHM.mjs} +1 -1
  34. package/lib/{dat.gui.module-CZHqOVGq.mjs.map → dat.gui.module-CZ-DIWHM.mjs.map} +1 -1
  35. package/lib/{decorate-BAtqSPNS.mjs → decorate-Bck1_lG8.mjs} +1 -1
  36. package/lib/{decorate-BAtqSPNS.mjs.map → decorate-Bck1_lG8.mjs.map} +1 -1
  37. package/lib/dimensioning-helper-Bfe0fImX.mjs +2 -0
  38. package/lib/{dimensioning-helper--Y0Y-Wr1.mjs → dimensioning-helper-GPn7Z8GE.mjs} +7 -7
  39. package/lib/{dimensioning-helper--Y0Y-Wr1.mjs.map → dimensioning-helper-GPn7Z8GE.mjs.map} +1 -1
  40. package/lib/glb-viewer-DIEpkrvY.mjs +2 -0
  41. package/lib/{glb-viewer-Cs3i0yb8.mjs → glb-viewer-tgKOPCaI.mjs} +44 -45
  42. package/lib/glb-viewer-tgKOPCaI.mjs.map +1 -0
  43. package/lib/highlight-coordinator-DRHeEU-E.mjs +116 -0
  44. package/lib/highlight-coordinator-DRHeEU-E.mjs.map +1 -0
  45. package/lib/{homag-intelligence-CBZujG1I.mjs → homag-intelligence-D5mCTWgG.mjs} +19 -11
  46. package/lib/homag-intelligence-D5mCTWgG.mjs.map +1 -0
  47. package/lib/{imos-ix-poc-export-helper-CW7QZhhn.mjs → imos-ix-poc-export-helper-BKFs_Yhm.mjs} +5 -5
  48. package/lib/{imos-ix-poc-export-helper-CW7QZhhn.mjs.map → imos-ix-poc-export-helper-BKFs_Yhm.mjs.map} +1 -1
  49. package/lib/kernel-C7YDLxq8.mjs.map +1 -1
  50. package/lib/{kernel-utils-DCnHzW4n.mjs → kernel-utils-B80amC-l.mjs} +2 -2
  51. package/lib/{kernel-utils-DCnHzW4n.mjs.map → kernel-utils-B80amC-l.mjs.map} +1 -1
  52. package/lib/{layer-CFAr2mK_.mjs → layer-BfckfWZz.mjs} +1 -1
  53. package/lib/{layer-CFAr2mK_.mjs.map → layer-BfckfWZz.mjs.map} +1 -1
  54. package/lib/{main-_HtiLIhS.mjs → main-CJ5TNhBt.mjs} +2484 -2533
  55. package/lib/main-CJ5TNhBt.mjs.map +1 -0
  56. package/lib/{material-viewer-BCjg687R.mjs → material-viewer-DCqZzMZN.mjs} +40 -35
  57. package/lib/material-viewer-DCqZzMZN.mjs.map +1 -0
  58. package/lib/packages-DuOz6rk6.mjs +4 -0
  59. package/lib/{planner-OYwMFSWo.mjs → planner-CSboZram.mjs} +3 -3
  60. package/lib/{planner-OYwMFSWo.mjs.map → planner-CSboZram.mjs.map} +1 -1
  61. package/lib/planner-CWPqJktz.mjs +2 -0
  62. package/lib/{plugin-system-DInww4H_.mjs → plugin-system-DD0Z9Jvt.mjs} +3 -3
  63. package/lib/{plugin-system-DInww4H_.mjs.map → plugin-system-DD0Z9Jvt.mjs.map} +1 -1
  64. package/lib/{roomle-headless-setup-LoBO7UJe.mjs → roomle-headless-setup-nsoGENQV.mjs} +1 -1
  65. package/lib/{roomle-headless-setup-LoBO7UJe.mjs.map → roomle-headless-setup-nsoGENQV.mjs.map} +1 -1
  66. package/lib/roomle-headless.d.ts +185 -63
  67. package/lib/roomle-headless.js +9 -9
  68. package/lib/{roomle-renderer-DVlJsHYn.mjs → roomle-renderer-BEJNPCKx.mjs} +2 -2
  69. package/lib/roomle-renderer-BEJNPCKx.mjs.map +1 -0
  70. package/lib/roomle-sdk.d.ts +185 -63
  71. package/lib/roomle-sdk.js +6 -6
  72. package/lib/roomle-webgpu-renderer-D5flithq.mjs +1502 -0
  73. package/lib/roomle-webgpu-renderer-D5flithq.mjs.map +1 -0
  74. package/lib/{scene-renderer-BHZrQYAH.mjs → scene-renderer-Dm1kij1z.mjs} +26 -26
  75. package/lib/scene-renderer-Dm1kij1z.mjs.map +1 -0
  76. package/lib/{script-loader-X4I-gQl2.mjs → script-loader-DqaDm1FG.mjs} +3 -3
  77. package/lib/{script-loader-X4I-gQl2.mjs.map → script-loader-DqaDm1FG.mjs.map} +1 -1
  78. package/lib/static/packages/workers/generated/budgeteer.sw.js +1 -1
  79. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  80. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts +2 -2
  81. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js +1 -1
  82. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map +1 -1
  83. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +18 -6
  84. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorUtils.js +15 -11
  85. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorUtils.js.map +1 -1
  86. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +1 -1
  87. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js +1 -1
  88. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -1
  89. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +21 -12
  90. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/planElementManager.js +1 -1
  91. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/planElementManager.js.map +1 -1
  92. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  93. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js +2 -2
  94. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  95. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  96. package/lib/{stats-helper-Cv5SoEWT.mjs → stats-helper-D7a7oxnj.mjs} +3 -3
  97. package/lib/{stats-helper-Cv5SoEWT.mjs.map → stats-helper-D7a7oxnj.mjs.map} +1 -1
  98. package/lib/{three.core-mM-jZdgg.mjs → three.core-BmQnspOL.mjs} +819 -816
  99. package/lib/{three.core-mM-jZdgg.mjs.map → three.core-BmQnspOL.mjs.map} +1 -1
  100. package/lib/{three.module-Bmy3sVQ-.mjs → three.module-DkrZwaid.mjs} +455 -455
  101. package/lib/{three.module-Bmy3sVQ-.mjs.map → three.module-DkrZwaid.mjs.map} +1 -1
  102. package/lib/{three.webgpu-BbVYfCDp.mjs → three.webgpu-DLZjhIYv.mjs} +1517 -1517
  103. package/lib/{three.webgpu-BbVYfCDp.mjs.map → three.webgpu-DLZjhIYv.mjs.map} +1 -1
  104. package/lib/three.webgpu-RkQxSIwG.mjs +3 -0
  105. package/lib/{threejs-utils-Bq4pVWBA.mjs → threejs-utils-CrK_gp1x.mjs} +67 -63
  106. package/lib/{threejs-utils-Bq4pVWBA.mjs.map → threejs-utils-CrK_gp1x.mjs.map} +1 -1
  107. package/lib/{tools-core-BRzDdhLJ.mjs → tools-core-CZWgXTFV.mjs} +3 -3
  108. package/lib/{tools-core-BRzDdhLJ.mjs.map → tools-core-CZWgXTFV.mjs.map} +1 -1
  109. package/package.json +1 -1
  110. package/lib/common-utils-qErzZAiR.mjs.map +0 -1
  111. package/lib/component-raycast-helper-C6ptEb0K.mjs.map +0 -1
  112. package/lib/component-raycast-helper-LrhRpeDD.mjs +0 -2
  113. package/lib/configurator-DtvX4JqP.mjs +0 -2
  114. package/lib/dimensioning-helper-BpUreWo2.mjs +0 -2
  115. package/lib/glb-viewer-Cs3i0yb8.mjs.map +0 -1
  116. package/lib/glb-viewer-Dcllu_oG.mjs +0 -2
  117. package/lib/homag-intelligence-CBZujG1I.mjs.map +0 -1
  118. package/lib/main-_HtiLIhS.mjs.map +0 -1
  119. package/lib/material-viewer-BCjg687R.mjs.map +0 -1
  120. package/lib/packages-BhrPUb9k.mjs +0 -4
  121. package/lib/planner-CDJtTG3g.mjs +0 -2
  122. package/lib/roomle-renderer-DVlJsHYn.mjs.map +0 -1
  123. package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs +0 -217
  124. package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs.map +0 -1
  125. package/lib/scene-renderer-BHZrQYAH.mjs.map +0 -1
  126. package/lib/three.webgpu-Bnp8Whu8.mjs +0 -3
@@ -1,4 +1,4 @@
1
- import { A as e, B as t, Bi as n, Bn as r, Br as i, C as a, Cr as o, Di as s, Dn as c, Fi as l, Ft as u, Gn as d, Hi as f, Hr as p, Ii as m, J as h, K as g, Kt as _, Mi as v, Ni as y, Nr as b, On as x, Pi as S, Qt as C, R as w, Ri as T, Si as E, Sr as D, T as O, Ti as k, Tn as A, Vi as j, Wn as M, Xt as N, Yt as ee, Zt as te, _i as P, a as ne, ai as F, an as I, bi as L, bn as R, cn as re, di as z, f as ie, fi as ae, gi as oe, j as B, ji as V, jr as se, k as ce, kn as le, kr as ue, li as de, ln as fe, m as pe, mi as me, mt as he, nt as H, on as ge, ot as _e, p as ve, q as ye, rt as be, sn as U, st as xe, tt as Se, ui as Ce, un as we, ut as Te, vi as Ee, vn as De, wi as Oe, wr as ke, x as Ae, xi as W, xn as je, yi as Me, yn as Ne, z as G, zi as Pe, zr as Fe } from "./three.core-mM-jZdgg.mjs";
1
+ import { A as e, B as t, Bi as n, Bn as r, Br as i, C as a, Cr as o, Di as s, Dn as c, Fi as l, Ft as u, Gn as d, Hi as f, Hr as p, Ii as m, J as h, K as g, Kt as _, Mi as v, Ni as y, Nr as b, On as x, Pi as S, Qt as C, R as w, Ri as T, Si as E, Sr as D, T as O, Ti as k, Tn as A, Ui as j, Wn as M, Xt as ee, Yt as te, Zt as ne, _i as N, a as P, ai as F, an as I, bi as L, bn as R, cn as re, di as z, f as ie, fi as ae, gi as oe, j as B, ji as V, jr as se, k as ce, kn as le, kr as ue, li as de, ln as fe, m as pe, mi as me, mt as he, nt as H, on as ge, ot as _e, p as ve, q as ye, rt as be, sn as U, st as xe, tt as Se, ui as Ce, un as we, ut as Te, vi as Ee, vn as De, wi as Oe, wr as ke, x as Ae, xi as W, xn as je, yi as Me, yn as Ne, z as G, zi as Pe, zr as Fe } from "./three.core-BmQnspOL.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;
@@ -999,8 +999,8 @@ function He(e, t, n, r) {
999
999
  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";
1000
1000
  }
1001
1001
  let l = n.precision === void 0 ? "highp" : n.precision, u = c(l);
1002
- u !== l && (j("WebGLRenderer:", l, "not supported, using", u, "instead."), l = u);
1003
- let d = n.logarithmicDepthBuffer === !0, f = n.reversedDepthBuffer === !0 && t.has("EXT_clip_control"), 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);
1002
+ u !== l && (f("WebGLRenderer:", l, "not supported, using", u, "instead."), l = u);
1003
+ let d = n.logarithmicDepthBuffer === !0, p = n.reversedDepthBuffer === !0 && t.has("EXT_clip_control"), m = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), h = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS), g = e.getParameter(e.MAX_TEXTURE_SIZE), _ = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE), v = e.getParameter(e.MAX_VERTEX_ATTRIBS), y = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS), b = e.getParameter(e.MAX_VARYING_VECTORS), x = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS), S = e.getParameter(e.MAX_SAMPLES), C = e.getParameter(e.SAMPLES);
1004
1004
  return {
1005
1005
  isWebGL2: !0,
1006
1006
  getMaxAnisotropy: a,
@@ -1009,17 +1009,17 @@ function He(e, t, n, r) {
1009
1009
  textureTypeReadable: s,
1010
1010
  precision: l,
1011
1011
  logarithmicDepthBuffer: d,
1012
- reversedDepthBuffer: f,
1013
- maxTextures: p,
1014
- maxVertexTextures: m,
1015
- maxTextureSize: h,
1016
- maxCubemapSize: g,
1017
- maxAttributes: _,
1018
- maxVertexUniforms: v,
1019
- maxVaryings: y,
1020
- maxFragmentUniforms: b,
1021
- maxSamples: x,
1022
- samples: S
1012
+ reversedDepthBuffer: p,
1013
+ maxTextures: m,
1014
+ maxVertexTextures: h,
1015
+ maxTextureSize: g,
1016
+ maxCubemapSize: _,
1017
+ maxAttributes: v,
1018
+ maxVertexUniforms: y,
1019
+ maxVaryings: b,
1020
+ maxFragmentUniforms: x,
1021
+ maxSamples: S,
1022
+ samples: C
1023
1023
  };
1024
1024
  }
1025
1025
  function Ue(e) {
@@ -1116,7 +1116,7 @@ var We = 4, Ge = [
1116
1116
  generateMipmaps: !1,
1117
1117
  type: he,
1118
1118
  format: M,
1119
- colorSpace: te,
1119
+ colorSpace: ne,
1120
1120
  depthBuffer: !1
1121
1121
  }, r = rt(e, t, n);
1122
1122
  if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
@@ -1194,19 +1194,19 @@ var We = 4, Ge = [
1194
1194
  a !== "latitudinal" && a !== "longitudinal" && S("blur direction must be either latitudinal or longitudinal!");
1195
1195
  let l = this._lodMeshes[r];
1196
1196
  l.material = c;
1197
- let u = c.uniforms, d = this._sizeLods[n] - 1, f = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / (2 * Ke - 1), p = i / f, m = isFinite(i) ? 1 + Math.floor(3 * p) : Ke;
1198
- m > Ke && j(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Ke}`);
1199
- let h = [], g = 0;
1197
+ let u = c.uniforms, d = this._sizeLods[n] - 1, p = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / (2 * Ke - 1), m = i / p, h = isFinite(i) ? 1 + Math.floor(3 * m) : Ke;
1198
+ h > Ke && f(`sigmaRadians, ${i}, is too large and will clip, as it requested ${h} samples when the maximum is set to ${Ke}`);
1199
+ let g = [], _ = 0;
1200
1200
  for (let e = 0; e < Ke; ++e) {
1201
- let t = e / p, n = Math.exp(-t * t / 2);
1202
- h.push(n), e === 0 ? g += n : e < m && (g += 2 * n);
1201
+ let t = e / m, n = Math.exp(-t * t / 2);
1202
+ g.push(n), e === 0 ? _ += n : e < h && (_ += 2 * n);
1203
1203
  }
1204
- for (let e = 0; e < h.length; e++) h[e] = h[e] / g;
1205
- u.envMap.value = e.texture, u.samples.value = m, u.weights.value = h, u.latitudinal.value = a === "latitudinal", o && (u.poleAxis.value = o);
1206
- let { _lodMax: _ } = this;
1207
- u.dTheta.value = f, u.mipInt.value = _ - n;
1208
- let v = this._sizeLods[r];
1209
- it(t, 3 * v * (r > _ - We ? r - _ + We : 0), 4 * (this._cubeSize - v), 3 * v, 2 * v), s.setRenderTarget(t), s.render(l, Je);
1204
+ for (let e = 0; e < g.length; e++) g[e] = g[e] / _;
1205
+ u.envMap.value = e.texture, u.samples.value = h, u.weights.value = g, u.latitudinal.value = a === "latitudinal", o && (u.poleAxis.value = o);
1206
+ let { _lodMax: v } = this;
1207
+ u.dTheta.value = p, u.mipInt.value = v - n;
1208
+ let y = this._sizeLods[r];
1209
+ it(t, 3 * y * (r > v - We ? r - v + We : 0), 4 * (this._cubeSize - y), 3 * y, 2 * y), s.setRenderTarget(t), s.render(l, Je);
1210
1210
  }
1211
1211
  };
1212
1212
  function nt(e) {
@@ -1474,7 +1474,7 @@ function dt(e) {
1474
1474
  },
1475
1475
  get: function(e) {
1476
1476
  let t = n(e);
1477
- return t === null && f("WebGLRenderer: " + e + " extension not supported."), t;
1477
+ return t === null && j("WebGLRenderer: " + e + " extension not supported."), t;
1478
1478
  }
1479
1479
  };
1480
1480
  }
@@ -2163,7 +2163,7 @@ function An(e) {
2163
2163
  switch (O.getTransfer(e)) {
2164
2164
  case C: return [t, "LinearTransferOETF"];
2165
2165
  case i: return [t, "sRGBTransferOETF"];
2166
- default: return j("WebGLProgram: Unsupported color space: ", e), [t, "LinearTransferOETF"];
2166
+ default: return f("WebGLProgram: Unsupported color space: ", e), [t, "LinearTransferOETF"];
2167
2167
  }
2168
2168
  }
2169
2169
  function jn(e, t, n) {
@@ -2194,7 +2194,7 @@ var Nn = {
2194
2194
  };
2195
2195
  function Pn(e, t) {
2196
2196
  let n = Nn[t];
2197
- return n === void 0 ? (j("WebGLProgram: Unsupported toneMapping:", t), "vec3 " + e + "( vec3 color ) { return LinearToneMapping( color ); }") : "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }";
2197
+ return n === void 0 ? (f("WebGLProgram: Unsupported toneMapping:", t), "vec3 " + e + "( vec3 color ) { return LinearToneMapping( color ); }") : "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }";
2198
2198
  }
2199
2199
  var Fn = /* @__PURE__ */ new W();
2200
2200
  function In() {
@@ -2247,7 +2247,7 @@ function Kn(e, t) {
2247
2247
  let n = K[t];
2248
2248
  if (n === void 0) {
2249
2249
  let e = Gn.get(t);
2250
- if (e !== void 0) n = K[e], j("WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.", t, e);
2250
+ if (e !== void 0) n = K[e], f("WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.", t, e);
2251
2251
  else throw Error("Can not resolve #include <" + t + ">");
2252
2252
  }
2253
2253
  return Wn(n);
@@ -2320,20 +2320,20 @@ function ar(e) {
2320
2320
  };
2321
2321
  }
2322
2322
  function or(e, t, n, r) {
2323
- let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = Qn(n), l = er(n), u = nr(n), d = ir(n), f = ar(n), p = Ln(n), m = Rn(a), h = i.createProgram(), g, _, v = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
2324
- n.isRawShaderMaterial ? (g = [
2323
+ let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = Qn(n), l = er(n), u = nr(n), d = ir(n), p = ar(n), m = Ln(n), h = Rn(a), g = i.createProgram(), _, v, y = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
2324
+ n.isRawShaderMaterial ? (_ = [
2325
2325
  "#define SHADER_TYPE " + n.shaderType,
2326
2326
  "#define SHADER_NAME " + n.shaderName,
2327
- m
2328
- ].filter(Bn).join("\n"), g.length > 0 && (g += "\n"), _ = [
2327
+ h
2328
+ ].filter(Bn).join("\n"), _.length > 0 && (_ += "\n"), v = [
2329
2329
  "#define SHADER_TYPE " + n.shaderType,
2330
2330
  "#define SHADER_NAME " + n.shaderName,
2331
- m
2332
- ].filter(Bn).join("\n"), _.length > 0 && (_ += "\n")) : (g = [
2331
+ h
2332
+ ].filter(Bn).join("\n"), v.length > 0 && (v += "\n")) : (_ = [
2333
2333
  Xn(n),
2334
2334
  "#define SHADER_TYPE " + n.shaderType,
2335
2335
  "#define SHADER_NAME " + n.shaderName,
2336
- m,
2336
+ h,
2337
2337
  n.extensionClipCullDistance ? "#define USE_CLIP_DISTANCE" : "",
2338
2338
  n.batching ? "#define USE_BATCHING" : "",
2339
2339
  n.batchingColor ? "#define USE_BATCHING_COLOR" : "",
@@ -2458,11 +2458,11 @@ function or(e, t, n, r) {
2458
2458
  " attribute vec4 skinWeight;",
2459
2459
  "#endif",
2460
2460
  "\n"
2461
- ].filter(Bn).join("\n"), _ = [
2461
+ ].filter(Bn).join("\n"), v = [
2462
2462
  Xn(n),
2463
2463
  "#define SHADER_TYPE " + n.shaderType,
2464
2464
  "#define SHADER_NAME " + n.shaderName,
2465
- m,
2465
+ h,
2466
2466
  n.useFog && n.fog ? "#define USE_FOG" : "",
2467
2467
  n.useFog && n.fogExp2 ? "#define FOG_EXP2" : "",
2468
2468
  n.alphaToCoverage ? "#define ALPHA_TO_COVERAGE" : "",
@@ -2472,9 +2472,9 @@ function or(e, t, n, r) {
2472
2472
  n.envMap ? "#define " + l : "",
2473
2473
  n.envMap ? "#define " + u : "",
2474
2474
  n.envMap ? "#define " + d : "",
2475
- f ? "#define CUBEUV_TEXEL_WIDTH " + f.texelWidth : "",
2476
- f ? "#define CUBEUV_TEXEL_HEIGHT " + f.texelHeight : "",
2477
- f ? "#define CUBEUV_MAX_MIP " + f.maxMip + ".0" : "",
2475
+ p ? "#define CUBEUV_TEXEL_WIDTH " + p.texelWidth : "",
2476
+ p ? "#define CUBEUV_TEXEL_HEIGHT " + p.texelHeight : "",
2477
+ p ? "#define CUBEUV_MAX_MIP " + p.maxMip + ".0" : "",
2478
2478
  n.lightMap ? "#define USE_LIGHTMAP" : "",
2479
2479
  n.aoMap ? "#define USE_AOMAP" : "",
2480
2480
  n.bumpMap ? "#define USE_BUMPMAP" : "",
@@ -2538,12 +2538,12 @@ function or(e, t, n, r) {
2538
2538
  In(),
2539
2539
  n.useDepthPacking ? "#define DEPTH_PACKING " + n.depthPacking : "",
2540
2540
  "\n"
2541
- ].filter(Bn).join("\n")), o = Wn(o), o = Vn(o, n), o = Hn(o, n), s = Wn(s), s = Vn(s, n), s = Hn(s, n), o = Jn(o), s = Jn(s), n.isRawShaderMaterial !== !0 && (v = "#version 300 es\n", g = [
2542
- p,
2541
+ ].filter(Bn).join("\n")), o = Wn(o), o = Vn(o, n), o = Hn(o, n), s = Wn(s), s = Vn(s, n), s = Hn(s, n), o = Jn(o), s = Jn(s), n.isRawShaderMaterial !== !0 && (y = "#version 300 es\n", _ = [
2542
+ m,
2543
2543
  "#define attribute in",
2544
2544
  "#define varying out",
2545
2545
  "#define texture2D texture"
2546
- ].join("\n") + "\n" + g, _ = [
2546
+ ].join("\n") + "\n" + _, v = [
2547
2547
  "#define varying in",
2548
2548
  n.glslVersion === "300 es" ? "" : "layout(location = 0) out highp vec4 pc_fragColor;",
2549
2549
  n.glslVersion === "300 es" ? "" : "#define gl_FragColor pc_fragColor",
@@ -2557,47 +2557,47 @@ function or(e, t, n, r) {
2557
2557
  "#define texture2DGradEXT textureGrad",
2558
2558
  "#define texture2DProjGradEXT textureProjGrad",
2559
2559
  "#define textureCubeGradEXT textureGrad"
2560
- ].join("\n") + "\n" + _);
2561
- let y = v + g + o, b = v + _ + s, x = Tn(i, i.VERTEX_SHADER, y), C = Tn(i, i.FRAGMENT_SHADER, b);
2562
- i.attachShader(h, x), 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);
2563
- function w(t) {
2560
+ ].join("\n") + "\n" + v);
2561
+ let b = y + _ + o, x = y + v + s, C = Tn(i, i.VERTEX_SHADER, b), w = Tn(i, i.FRAGMENT_SHADER, x);
2562
+ i.attachShader(g, C), i.attachShader(g, w), n.index0AttributeName === void 0 ? n.morphTargets === !0 && i.bindAttribLocation(g, 0, "position") : i.bindAttribLocation(g, 0, n.index0AttributeName), i.linkProgram(g);
2563
+ function T(t) {
2564
2564
  if (e.debug.checkShaderErrors) {
2565
- let n = i.getProgramInfoLog(h) || "", r = i.getShaderInfoLog(x) || "", a = i.getShaderInfoLog(C) || "", o = n.trim(), s = r.trim(), c = a.trim(), l = !0, u = !0;
2566
- if (i.getProgramParameter(h, i.LINK_STATUS) === !1) if (l = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i, h, x, C);
2565
+ let n = i.getProgramInfoLog(g) || "", r = i.getShaderInfoLog(C) || "", a = i.getShaderInfoLog(w) || "", o = n.trim(), s = r.trim(), c = a.trim(), l = !0, u = !0;
2566
+ if (i.getProgramParameter(g, i.LINK_STATUS) === !1) if (l = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i, g, C, w);
2567
2567
  else {
2568
- let e = jn(i, x, "vertex"), n = jn(i, C, "fragment");
2569
- S("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);
2568
+ let e = jn(i, C, "vertex"), n = jn(i, w, "fragment");
2569
+ S("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);
2570
2570
  }
2571
- else o === "" ? (s === "" || c === "") && (u = !1) : j("WebGLProgram: Program Info Log:", o);
2571
+ else o === "" ? (s === "" || c === "") && (u = !1) : f("WebGLProgram: Program Info Log:", o);
2572
2572
  u && (t.diagnostics = {
2573
2573
  runnable: l,
2574
2574
  programLog: o,
2575
2575
  vertexShader: {
2576
2576
  log: s,
2577
- prefix: g
2577
+ prefix: _
2578
2578
  },
2579
2579
  fragmentShader: {
2580
2580
  log: c,
2581
- prefix: _
2581
+ prefix: v
2582
2582
  }
2583
2583
  });
2584
2584
  }
2585
- i.deleteShader(x), i.deleteShader(C), T = new wn(i, h), E = zn(i, h);
2585
+ i.deleteShader(C), i.deleteShader(w), E = new wn(i, g), D = zn(i, g);
2586
2586
  }
2587
- let T;
2587
+ let E;
2588
2588
  this.getUniforms = function() {
2589
- return T === void 0 && w(this), T;
2589
+ return E === void 0 && T(this), E;
2590
2590
  };
2591
- let E;
2591
+ let D;
2592
2592
  this.getAttributes = function() {
2593
- return E === void 0 && w(this), E;
2593
+ return D === void 0 && T(this), D;
2594
2594
  };
2595
- let D = n.rendererExtensionParallelShaderCompile === !1;
2595
+ let O = n.rendererExtensionParallelShaderCompile === !1;
2596
2596
  return this.isReady = function() {
2597
- return D === !1 && (D = i.getProgramParameter(h, En)), D;
2597
+ return O === !1 && (O = i.getProgramParameter(g, En)), O;
2598
2598
  }, this.destroy = function() {
2599
- r.releaseStatesOfProgram(this), i.deleteProgram(h), this.program = void 0;
2600
- }, this.type = n.shaderType, this.name = n.shaderName, this.id = Dn++, this.cacheKey = t, this.usedTimes = 1, this.program = h, this.vertexShader = x, this.fragmentShader = C, this;
2599
+ r.releaseStatesOfProgram(this), i.deleteProgram(g), this.program = void 0;
2600
+ }, this.type = n.shaderType, this.name = n.shaderName, this.id = Dn++, this.cacheKey = t, this.usedTimes = 1, this.program = g, this.vertexShader = C, this.fragmentShader = w, this;
2601
2601
  }
2602
2602
  var sr = 0, cr = class {
2603
2603
  constructor() {
@@ -2635,7 +2635,7 @@ var sr = 0, cr = class {
2635
2635
  }
2636
2636
  };
2637
2637
  function ur(e, t, n, r, i, a) {
2638
- let o = new u(), s = new cr(), c = /* @__PURE__ */ new Set(), l = [], d = /* @__PURE__ */ new Map(), f = r.logarithmicDepthBuffer, p = r.precision, m = {
2638
+ let o = new u(), s = new cr(), c = /* @__PURE__ */ new Set(), l = [], d = /* @__PURE__ */ new Map(), p = r.logarithmicDepthBuffer, m = r.precision, h = {
2639
2639
  MeshDepthMaterial: "depth",
2640
2640
  MeshDistanceMaterial: "distance",
2641
2641
  MeshNormalMaterial: "normal",
@@ -2652,45 +2652,45 @@ function ur(e, t, n, r, i, a) {
2652
2652
  ShadowMaterial: "shadow",
2653
2653
  SpriteMaterial: "sprite"
2654
2654
  };
2655
- function h(e) {
2655
+ function g(e) {
2656
2656
  return c.add(e), e === 0 ? "uv" : `uv${e}`;
2657
2657
  }
2658
- function g(i, o, l, u, d) {
2659
- let g = u.fog, _ = d.geometry, v = i.isMeshStandardMaterial || i.isMeshLambertMaterial || i.isMeshPhongMaterial ? u.environment : null, y = i.isMeshStandardMaterial || i.isMeshLambertMaterial && !i.envMap || i.isMeshPhongMaterial && !i.envMap, b = t.get(i.envMap || v, y), x = b && b.mapping === 306 ? b.image.height : null, S = m[i.type];
2660
- i.precision !== null && (p = r.getMaxPrecision(i.precision), p !== i.precision && j("WebGLProgram.getParameters:", i.precision, "not supported, using", p, "instead."));
2661
- let C = _.morphAttributes.position || _.morphAttributes.normal || _.morphAttributes.color, w = C === void 0 ? 0 : C.length, T = 0;
2662
- _.morphAttributes.position !== void 0 && (T = 1), _.morphAttributes.normal !== void 0 && (T = 2), _.morphAttributes.color !== void 0 && (T = 3);
2663
- let E, D, k, A;
2664
- if (S) {
2665
- let e = J[S];
2666
- E = e.vertexShader, D = e.fragmentShader;
2667
- } else E = i.vertexShader, D = i.fragmentShader, s.update(i), k = s.getVertexShaderID(i), A = s.getFragmentShaderID(i);
2668
- let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), ee = d.isInstancedMesh === !0, P = d.isBatchedMesh === !0, ne = !!i.map, F = !!i.matcap, I = !!b, L = !!i.aoMap, R = !!i.lightMap, re = !!i.bumpMap, z = !!i.normalMap, ie = !!i.displacementMap, ae = !!i.emissiveMap, oe = !!i.metalnessMap, B = !!i.roughnessMap, V = i.anisotropy > 0, se = i.clearcoat > 0, ce = i.dispersion > 0, le = i.iridescence > 0, ue = i.sheen > 0, de = i.transmission > 0, fe = V && !!i.anisotropyMap, pe = se && !!i.clearcoatMap, me = se && !!i.clearcoatNormalMap, he = se && !!i.clearcoatRoughnessMap, H = le && !!i.iridescenceMap, ge = le && !!i.iridescenceThicknessMap, _e = ue && !!i.sheenColorMap, ve = ue && !!i.sheenRoughnessMap, ye = !!i.specularMap, be = !!i.specularColorMap, U = !!i.specularIntensityMap, xe = de && !!i.transmissionMap, Se = de && !!i.thicknessMap, Ce = !!i.gradientMap, we = !!i.alphaMap, Te = i.alphaTest > 0, Ee = !!i.alphaHash, De = !!i.extensions, Oe = 0;
2658
+ function _(i, o, l, u, d) {
2659
+ let _ = u.fog, v = d.geometry, y = i.isMeshStandardMaterial || i.isMeshLambertMaterial || i.isMeshPhongMaterial ? u.environment : null, b = i.isMeshStandardMaterial || i.isMeshLambertMaterial && !i.envMap || i.isMeshPhongMaterial && !i.envMap, x = t.get(i.envMap || y, b), S = x && x.mapping === 306 ? x.image.height : null, C = h[i.type];
2660
+ i.precision !== null && (m = r.getMaxPrecision(i.precision), m !== i.precision && f("WebGLProgram.getParameters:", i.precision, "not supported, using", m, "instead."));
2661
+ let w = v.morphAttributes.position || v.morphAttributes.normal || v.morphAttributes.color, T = w === void 0 ? 0 : w.length, E = 0;
2662
+ v.morphAttributes.position !== void 0 && (E = 1), v.morphAttributes.normal !== void 0 && (E = 2), v.morphAttributes.color !== void 0 && (E = 3);
2663
+ let D, k, A, j;
2664
+ if (C) {
2665
+ let e = J[C];
2666
+ D = e.vertexShader, k = e.fragmentShader;
2667
+ } else D = i.vertexShader, k = i.fragmentShader, s.update(i), A = s.getVertexShaderID(i), j = s.getFragmentShaderID(i);
2668
+ let M = e.getRenderTarget(), ee = e.state.buffers.depth.getReversed(), te = d.isInstancedMesh === !0, N = d.isBatchedMesh === !0, P = !!i.map, F = !!i.matcap, I = !!x, L = !!i.aoMap, R = !!i.lightMap, re = !!i.bumpMap, z = !!i.normalMap, ie = !!i.displacementMap, ae = !!i.emissiveMap, oe = !!i.metalnessMap, B = !!i.roughnessMap, V = i.anisotropy > 0, se = i.clearcoat > 0, ce = i.dispersion > 0, le = i.iridescence > 0, ue = i.sheen > 0, de = i.transmission > 0, fe = V && !!i.anisotropyMap, pe = se && !!i.clearcoatMap, me = se && !!i.clearcoatNormalMap, he = se && !!i.clearcoatRoughnessMap, H = le && !!i.iridescenceMap, ge = le && !!i.iridescenceThicknessMap, _e = ue && !!i.sheenColorMap, ve = ue && !!i.sheenRoughnessMap, ye = !!i.specularMap, be = !!i.specularColorMap, U = !!i.specularIntensityMap, xe = de && !!i.transmissionMap, Se = de && !!i.thicknessMap, Ce = !!i.gradientMap, we = !!i.alphaMap, Te = i.alphaTest > 0, Ee = !!i.alphaHash, De = !!i.extensions, Oe = 0;
2669
2669
  i.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Oe = e.toneMapping);
2670
2670
  let ke = {
2671
- shaderID: S,
2671
+ shaderID: C,
2672
2672
  shaderType: i.type,
2673
2673
  shaderName: i.name,
2674
- vertexShader: E,
2675
- fragmentShader: D,
2674
+ vertexShader: D,
2675
+ fragmentShader: k,
2676
2676
  defines: i.defines,
2677
- customVertexShaderID: k,
2678
- customFragmentShaderID: A,
2677
+ customVertexShaderID: A,
2678
+ customFragmentShaderID: j,
2679
2679
  isRawShaderMaterial: i.isRawShaderMaterial === !0,
2680
2680
  glslVersion: i.glslVersion,
2681
- precision: p,
2682
- batching: P,
2683
- batchingColor: P && d._colorsTexture !== null,
2684
- instancing: ee,
2685
- instancingColor: ee && d.instanceColor !== null,
2686
- instancingMorph: ee && d.morphTexture !== null,
2687
- outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : te,
2681
+ precision: m,
2682
+ batching: N,
2683
+ batchingColor: N && d._colorsTexture !== null,
2684
+ instancing: te,
2685
+ instancingColor: te && d.instanceColor !== null,
2686
+ instancingMorph: te && d.morphTexture !== null,
2687
+ outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : ne,
2688
2688
  alphaToCoverage: !!i.alphaToCoverage,
2689
- map: ne,
2689
+ map: P,
2690
2690
  matcap: F,
2691
2691
  envMap: I,
2692
- envMapMode: I && b.mapping,
2693
- envMapCubeUVHeight: x,
2692
+ envMapMode: I && x.mapping,
2693
+ envMapCubeUVHeight: S,
2694
2694
  aoMap: L,
2695
2695
  lightMap: R,
2696
2696
  bumpMap: re,
@@ -2726,46 +2726,46 @@ function ur(e, t, n, r, i, a) {
2726
2726
  alphaTest: Te,
2727
2727
  alphaHash: Ee,
2728
2728
  combine: i.combine,
2729
- mapUv: ne && h(i.map.channel),
2730
- aoMapUv: L && h(i.aoMap.channel),
2731
- lightMapUv: R && h(i.lightMap.channel),
2732
- bumpMapUv: re && h(i.bumpMap.channel),
2733
- normalMapUv: z && h(i.normalMap.channel),
2734
- displacementMapUv: ie && h(i.displacementMap.channel),
2735
- emissiveMapUv: ae && h(i.emissiveMap.channel),
2736
- metalnessMapUv: oe && h(i.metalnessMap.channel),
2737
- roughnessMapUv: B && h(i.roughnessMap.channel),
2738
- anisotropyMapUv: fe && h(i.anisotropyMap.channel),
2739
- clearcoatMapUv: pe && h(i.clearcoatMap.channel),
2740
- clearcoatNormalMapUv: me && h(i.clearcoatNormalMap.channel),
2741
- clearcoatRoughnessMapUv: he && h(i.clearcoatRoughnessMap.channel),
2742
- iridescenceMapUv: H && h(i.iridescenceMap.channel),
2743
- iridescenceThicknessMapUv: ge && h(i.iridescenceThicknessMap.channel),
2744
- sheenColorMapUv: _e && h(i.sheenColorMap.channel),
2745
- sheenRoughnessMapUv: ve && h(i.sheenRoughnessMap.channel),
2746
- specularMapUv: ye && h(i.specularMap.channel),
2747
- specularColorMapUv: be && h(i.specularColorMap.channel),
2748
- specularIntensityMapUv: U && h(i.specularIntensityMap.channel),
2749
- transmissionMapUv: xe && h(i.transmissionMap.channel),
2750
- thicknessMapUv: Se && h(i.thicknessMap.channel),
2751
- alphaMapUv: we && h(i.alphaMap.channel),
2752
- vertexTangents: !!_.attributes.tangent && (z || V),
2729
+ mapUv: P && g(i.map.channel),
2730
+ aoMapUv: L && g(i.aoMap.channel),
2731
+ lightMapUv: R && g(i.lightMap.channel),
2732
+ bumpMapUv: re && g(i.bumpMap.channel),
2733
+ normalMapUv: z && g(i.normalMap.channel),
2734
+ displacementMapUv: ie && g(i.displacementMap.channel),
2735
+ emissiveMapUv: ae && g(i.emissiveMap.channel),
2736
+ metalnessMapUv: oe && g(i.metalnessMap.channel),
2737
+ roughnessMapUv: B && g(i.roughnessMap.channel),
2738
+ anisotropyMapUv: fe && g(i.anisotropyMap.channel),
2739
+ clearcoatMapUv: pe && g(i.clearcoatMap.channel),
2740
+ clearcoatNormalMapUv: me && g(i.clearcoatNormalMap.channel),
2741
+ clearcoatRoughnessMapUv: he && g(i.clearcoatRoughnessMap.channel),
2742
+ iridescenceMapUv: H && g(i.iridescenceMap.channel),
2743
+ iridescenceThicknessMapUv: ge && g(i.iridescenceThicknessMap.channel),
2744
+ sheenColorMapUv: _e && g(i.sheenColorMap.channel),
2745
+ sheenRoughnessMapUv: ve && g(i.sheenRoughnessMap.channel),
2746
+ specularMapUv: ye && g(i.specularMap.channel),
2747
+ specularColorMapUv: be && g(i.specularColorMap.channel),
2748
+ specularIntensityMapUv: U && g(i.specularIntensityMap.channel),
2749
+ transmissionMapUv: xe && g(i.transmissionMap.channel),
2750
+ thicknessMapUv: Se && g(i.thicknessMap.channel),
2751
+ alphaMapUv: we && g(i.alphaMap.channel),
2752
+ vertexTangents: !!v.attributes.tangent && (z || V),
2753
2753
  vertexColors: i.vertexColors,
2754
- vertexAlphas: i.vertexColors === !0 && !!_.attributes.color && _.attributes.color.itemSize === 4,
2755
- pointsUvs: d.isPoints === !0 && !!_.attributes.uv && (ne || we),
2756
- fog: !!g,
2754
+ vertexAlphas: i.vertexColors === !0 && !!v.attributes.color && v.attributes.color.itemSize === 4,
2755
+ pointsUvs: d.isPoints === !0 && !!v.attributes.uv && (P || we),
2756
+ fog: !!_,
2757
2757
  useFog: i.fog === !0,
2758
- fogExp2: !!g && g.isFogExp2,
2759
- flatShading: i.wireframe === !1 && (i.flatShading === !0 || _.attributes.normal === void 0 && z === !1 && (i.isMeshLambertMaterial || i.isMeshPhongMaterial || i.isMeshStandardMaterial || i.isMeshPhysicalMaterial)),
2758
+ fogExp2: !!_ && _.isFogExp2,
2759
+ flatShading: i.wireframe === !1 && (i.flatShading === !0 || v.attributes.normal === void 0 && z === !1 && (i.isMeshLambertMaterial || i.isMeshPhongMaterial || i.isMeshStandardMaterial || i.isMeshPhysicalMaterial)),
2760
2760
  sizeAttenuation: i.sizeAttenuation === !0,
2761
- logarithmicDepthBuffer: f,
2762
- reversedDepthBuffer: N,
2761
+ logarithmicDepthBuffer: p,
2762
+ reversedDepthBuffer: ee,
2763
2763
  skinning: d.isSkinnedMesh === !0,
2764
- morphTargets: _.morphAttributes.position !== void 0,
2765
- morphNormals: _.morphAttributes.normal !== void 0,
2766
- morphColors: _.morphAttributes.color !== void 0,
2767
- morphTargetsCount: w,
2768
- morphTextureStride: T,
2764
+ morphTargets: v.morphAttributes.position !== void 0,
2765
+ morphNormals: v.morphAttributes.normal !== void 0,
2766
+ morphColors: v.morphAttributes.color !== void 0,
2767
+ morphTargetsCount: T,
2768
+ morphTextureStride: E,
2769
2769
  numDirLights: o.directional.length,
2770
2770
  numPointLights: o.point.length,
2771
2771
  numSpotLights: o.spot.length,
@@ -2783,7 +2783,7 @@ function ur(e, t, n, r, i, a) {
2783
2783
  shadowMapEnabled: e.shadowMap.enabled && l.length > 0,
2784
2784
  shadowMapType: e.shadowMap.type,
2785
2785
  toneMapping: Oe,
2786
- decodeVideoTexture: ne && i.map.isVideoTexture === !0 && O.getTransfer(i.map.colorSpace) === "srgb",
2786
+ decodeVideoTexture: P && i.map.isVideoTexture === !0 && O.getTransfer(i.map.colorSpace) === "srgb",
2787
2787
  decodeVideoTextureEmissive: ae && i.emissiveMap.isVideoTexture === !0 && O.getTransfer(i.emissiveMap.colorSpace) === "srgb",
2788
2788
  premultipliedAlpha: i.premultipliedAlpha,
2789
2789
  doubleSided: i.side === 2,
@@ -2792,56 +2792,56 @@ function ur(e, t, n, r, i, a) {
2792
2792
  depthPacking: i.depthPacking || 0,
2793
2793
  index0AttributeName: i.index0AttributeName,
2794
2794
  extensionClipCullDistance: De && i.extensions.clipCullDistance === !0 && n.has("WEBGL_clip_cull_distance"),
2795
- extensionMultiDraw: (De && i.extensions.multiDraw === !0 || P) && n.has("WEBGL_multi_draw"),
2795
+ extensionMultiDraw: (De && i.extensions.multiDraw === !0 || N) && n.has("WEBGL_multi_draw"),
2796
2796
  rendererExtensionParallelShaderCompile: n.has("KHR_parallel_shader_compile"),
2797
2797
  customProgramCacheKey: i.customProgramCacheKey()
2798
2798
  };
2799
2799
  return ke.vertexUv1s = c.has(1), ke.vertexUv2s = c.has(2), ke.vertexUv3s = c.has(3), c.clear(), ke;
2800
2800
  }
2801
- function _(t) {
2801
+ function v(t) {
2802
2802
  let n = [];
2803
2803
  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]);
2804
- return t.isRawShaderMaterial === !1 && (v(n, t), y(n, t), n.push(e.outputColorSpace)), n.push(t.customProgramCacheKey), n.join();
2804
+ return t.isRawShaderMaterial === !1 && (y(n, t), b(n, t), n.push(e.outputColorSpace)), n.push(t.customProgramCacheKey), n.join();
2805
2805
  }
2806
- function v(e, t) {
2806
+ function y(e, t) {
2807
2807
  e.push(t.precision), e.push(t.outputColorSpace), e.push(t.envMapMode), e.push(t.envMapCubeUVHeight), e.push(t.mapUv), e.push(t.alphaMapUv), e.push(t.lightMapUv), e.push(t.aoMapUv), e.push(t.bumpMapUv), e.push(t.normalMapUv), e.push(t.displacementMapUv), e.push(t.emissiveMapUv), e.push(t.metalnessMapUv), e.push(t.roughnessMapUv), e.push(t.anisotropyMapUv), e.push(t.clearcoatMapUv), e.push(t.clearcoatNormalMapUv), e.push(t.clearcoatRoughnessMapUv), e.push(t.iridescenceMapUv), e.push(t.iridescenceThicknessMapUv), e.push(t.sheenColorMapUv), e.push(t.sheenRoughnessMapUv), e.push(t.specularMapUv), e.push(t.specularColorMapUv), e.push(t.specularIntensityMapUv), e.push(t.transmissionMapUv), e.push(t.thicknessMapUv), e.push(t.combine), e.push(t.fogExp2), e.push(t.sizeAttenuation), e.push(t.morphTargetsCount), e.push(t.morphAttributeCount), e.push(t.numDirLights), e.push(t.numPointLights), e.push(t.numSpotLights), e.push(t.numSpotLightMaps), e.push(t.numHemiLights), e.push(t.numRectAreaLights), e.push(t.numDirLightShadows), e.push(t.numPointLightShadows), e.push(t.numSpotLightShadows), e.push(t.numSpotLightShadowsWithMaps), e.push(t.numLightProbes), e.push(t.shadowMapType), e.push(t.toneMapping), e.push(t.numClippingPlanes), e.push(t.numClipIntersection), e.push(t.depthPacking);
2808
2808
  }
2809
- function y(e, t) {
2809
+ function b(e, t) {
2810
2810
  o.disableAll(), t.instancing && o.enable(0), t.instancingColor && o.enable(1), t.instancingMorph && o.enable(2), t.matcap && o.enable(3), t.envMap && o.enable(4), t.normalMapObjectSpace && o.enable(5), t.normalMapTangentSpace && o.enable(6), t.clearcoat && o.enable(7), t.iridescence && o.enable(8), t.alphaTest && o.enable(9), t.vertexColors && o.enable(10), t.vertexAlphas && o.enable(11), t.vertexUv1s && o.enable(12), t.vertexUv2s && o.enable(13), t.vertexUv3s && o.enable(14), t.vertexTangents && o.enable(15), t.anisotropy && o.enable(16), t.alphaHash && o.enable(17), t.batching && o.enable(18), t.dispersion && o.enable(19), t.batchingColor && o.enable(20), t.gradientMap && o.enable(21), e.push(o.mask), o.disableAll(), t.fog && o.enable(0), t.useFog && o.enable(1), t.flatShading && o.enable(2), t.logarithmicDepthBuffer && o.enable(3), t.reversedDepthBuffer && o.enable(4), t.skinning && o.enable(5), t.morphTargets && o.enable(6), t.morphNormals && o.enable(7), t.morphColors && o.enable(8), t.premultipliedAlpha && o.enable(9), t.shadowMapEnabled && o.enable(10), t.doubleSided && o.enable(11), t.flipSided && o.enable(12), t.useDepthPacking && o.enable(13), t.dithering && o.enable(14), t.transmission && o.enable(15), t.sheen && o.enable(16), t.opaque && o.enable(17), t.pointsUvs && o.enable(18), t.decodeVideoTexture && o.enable(19), t.decodeVideoTextureEmissive && o.enable(20), t.alphaToCoverage && o.enable(21), e.push(o.mask);
2811
2811
  }
2812
- function b(e) {
2813
- let t = m[e.type], n;
2812
+ function x(e) {
2813
+ let t = h[e.type], n;
2814
2814
  if (t) {
2815
2815
  let e = J[t];
2816
2816
  n = z.clone(e.uniforms);
2817
2817
  } else n = e.uniforms;
2818
2818
  return n;
2819
2819
  }
2820
- function x(t, n) {
2820
+ function S(t, n) {
2821
2821
  let r = d.get(n);
2822
2822
  return r === void 0 ? (r = new or(e, n, t, i), l.push(r), d.set(n, r)) : ++r.usedTimes, r;
2823
2823
  }
2824
- function S(e) {
2824
+ function C(e) {
2825
2825
  if (--e.usedTimes === 0) {
2826
2826
  let t = l.indexOf(e);
2827
2827
  l[t] = l[l.length - 1], l.pop(), d.delete(e.cacheKey), e.destroy();
2828
2828
  }
2829
2829
  }
2830
- function C(e) {
2830
+ function w(e) {
2831
2831
  s.remove(e);
2832
2832
  }
2833
- function w() {
2833
+ function T() {
2834
2834
  s.dispose();
2835
2835
  }
2836
2836
  return {
2837
- getParameters: g,
2838
- getProgramCacheKey: _,
2839
- getUniforms: b,
2840
- acquireProgram: x,
2841
- releaseProgram: S,
2842
- releaseShaderCache: C,
2837
+ getParameters: _,
2838
+ getProgramCacheKey: v,
2839
+ getUniforms: x,
2840
+ acquireProgram: S,
2841
+ releaseProgram: C,
2842
+ releaseShaderCache: w,
2843
2843
  programs: l,
2844
- dispose: w
2844
+ dispose: T
2845
2845
  };
2846
2846
  }
2847
2847
  function dr() {
@@ -3215,11 +3215,11 @@ var Cr = "void main() {\n gl_Position = vec4( position, 1.0 );\n}", wr = "unifor
3215
3215
  /* @__PURE__ */ new W(0, -1, 0)
3216
3216
  ], Dr = /* @__PURE__ */ new ge(), Or = /* @__PURE__ */ new W(), kr = /* @__PURE__ */ new W();
3217
3217
  function Ar(t, n, r) {
3218
- let i = new Te(), a = new L(), o = new L(), s = new E(), c = new fe(), l = new we(), u = {}, d = r.maxTextureSize, f = {
3218
+ let i = new Te(), a = new L(), o = new L(), s = new E(), c = new fe(), l = new we(), u = {}, d = r.maxTextureSize, m = {
3219
3219
  0: 1,
3220
3220
  1: 0,
3221
3221
  2: 2
3222
- }, m = new p({
3222
+ }, v = new p({
3223
3223
  defines: { VSM_SAMPLES: 8 },
3224
3224
  uniforms: {
3225
3225
  shadow_pass: { value: null },
@@ -3228,10 +3228,10 @@ function Ar(t, n, r) {
3228
3228
  },
3229
3229
  vertexShader: Cr,
3230
3230
  fragmentShader: wr
3231
- }), v = m.clone();
3232
- v.defines.HORIZONTAL_PASS = 1;
3233
- let y = new pe();
3234
- y.setAttribute("position", new ve(new Float32Array([
3231
+ }), y = v.clone();
3232
+ y.defines.HORIZONTAL_PASS = 1;
3233
+ let b = new pe();
3234
+ b.setAttribute("position", new ve(new Float32Array([
3235
3235
  -1,
3236
3236
  -1,
3237
3237
  .5,
@@ -3242,86 +3242,86 @@ function Ar(t, n, r) {
3242
3242
  3,
3243
3243
  .5
3244
3244
  ]), 3));
3245
- let b = new U(y, m), x = this;
3245
+ let x = new U(b, v), S = this;
3246
3246
  this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = 1;
3247
- let S = this.type;
3247
+ let C = this.type;
3248
3248
  this.render = function(n, r, c) {
3249
- if (x.enabled === !1 || x.autoUpdate === !1 && x.needsUpdate === !1 || n.length === 0) return;
3250
- this.type === 2 && (j("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), this.type = 1);
3251
- let l = t.getRenderTarget(), u = t.getActiveCubeFace(), f = t.getActiveMipmapLevel(), p = t.state;
3252
- p.setBlending(0), p.buffers.depth.getReversed() === !0 ? p.buffers.color.setClear(0, 0, 0, 0) : p.buffers.color.setClear(1, 1, 1, 1), p.buffers.depth.setTest(!0), p.setScissorTest(!1);
3253
- let m = S !== this.type;
3254
- m && r.traverse(function(e) {
3249
+ if (S.enabled === !1 || S.autoUpdate === !1 && S.needsUpdate === !1 || n.length === 0) return;
3250
+ this.type === 2 && (f("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), this.type = 1);
3251
+ let l = t.getRenderTarget(), u = t.getActiveCubeFace(), p = t.getActiveMipmapLevel(), m = t.state;
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 v = C !== this.type;
3254
+ v && r.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
3257
  for (let l = 0, u = n.length; l < u; l++) {
3258
- let u = n[l], f = u.shadow;
3259
- if (f === void 0) {
3260
- j("WebGLShadowMap:", u, "has no shadow.");
3258
+ let u = n[l], p = u.shadow;
3259
+ if (p === void 0) {
3260
+ f("WebGLShadowMap:", u, "has no shadow.");
3261
3261
  continue;
3262
3262
  }
3263
- if (f.autoUpdate === !1 && f.needsUpdate === !1) continue;
3264
- a.copy(f.mapSize);
3265
- let v = f.getFrameExtents();
3266
- a.multiply(v), o.copy(f.mapSize), (a.x > d || a.y > d) && (a.x > d && (o.x = Math.floor(d / v.x), a.x = o.x * v.x, f.mapSize.x = o.x), a.y > d && (o.y = Math.floor(d / v.y), a.y = o.y * v.y, f.mapSize.y = o.y));
3267
- let y = t.state.buffers.depth.getReversed();
3268
- if (f.camera._reversedDepth = y, f.map === null || m === !0) {
3269
- if (f.map !== null && (f.map.depthTexture !== null && (f.map.depthTexture.dispose(), f.map.depthTexture = null), f.map.dispose()), this.type === 3) {
3263
+ if (p.autoUpdate === !1 && p.needsUpdate === !1) continue;
3264
+ a.copy(p.mapSize);
3265
+ let y = p.getFrameExtents();
3266
+ a.multiply(y), o.copy(p.mapSize), (a.x > d || a.y > d) && (a.x > d && (o.x = Math.floor(d / y.x), a.x = o.x * y.x, p.mapSize.x = o.x), a.y > d && (o.y = Math.floor(d / y.y), a.y = o.y * y.y, p.mapSize.y = o.y));
3267
+ let b = t.state.buffers.depth.getReversed();
3268
+ if (p.camera._reversedDepth = b, p.map === null || v === !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 (u.isPointLight) {
3271
- j("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");
3271
+ f("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");
3272
3272
  continue;
3273
3273
  }
3274
- f.map = new k(a.x, a.y, {
3274
+ p.map = new k(a.x, a.y, {
3275
3275
  format: D,
3276
3276
  type: he,
3277
3277
  minFilter: _,
3278
3278
  magFilter: _,
3279
3279
  generateMipmaps: !1
3280
- }), f.map.texture.name = u.name + ".shadowMap", f.map.depthTexture = new h(a.x, a.y, xe), f.map.depthTexture.name = u.name + ".shadowMapDepth", f.map.depthTexture.format = g, f.map.depthTexture.compareFunction = null, f.map.depthTexture.minFilter = Ne, f.map.depthTexture.magFilter = Ne;
3281
- } else u.isPointLight ? (f.map = new lt(a.x), f.map.depthTexture = new e(a.x, oe)) : (f.map = new k(a.x, a.y), f.map.depthTexture = new h(a.x, a.y, oe)), f.map.depthTexture.name = u.name + ".shadowMap", f.map.depthTexture.format = g, this.type === 1 ? (f.map.depthTexture.compareFunction = y ? 518 : 515, f.map.depthTexture.minFilter = _, f.map.depthTexture.magFilter = _) : (f.map.depthTexture.compareFunction = null, f.map.depthTexture.minFilter = Ne, f.map.depthTexture.magFilter = Ne);
3282
- f.camera.updateProjectionMatrix();
3280
+ }), p.map.texture.name = u.name + ".shadowMap", p.map.depthTexture = new h(a.x, a.y, xe), p.map.depthTexture.name = u.name + ".shadowMapDepth", p.map.depthTexture.format = g, p.map.depthTexture.compareFunction = null, p.map.depthTexture.minFilter = Ne, p.map.depthTexture.magFilter = Ne;
3281
+ } else u.isPointLight ? (p.map = new lt(a.x), p.map.depthTexture = new e(a.x, oe)) : (p.map = new k(a.x, a.y), p.map.depthTexture = new h(a.x, a.y, oe)), p.map.depthTexture.name = u.name + ".shadowMap", p.map.depthTexture.format = g, this.type === 1 ? (p.map.depthTexture.compareFunction = b ? 518 : 515, p.map.depthTexture.minFilter = _, p.map.depthTexture.magFilter = _) : (p.map.depthTexture.compareFunction = null, p.map.depthTexture.minFilter = Ne, p.map.depthTexture.magFilter = Ne);
3282
+ p.camera.updateProjectionMatrix();
3283
3283
  }
3284
- let b = f.map.isWebGLCubeRenderTarget ? 6 : 1;
3285
- for (let e = 0; e < b; e++) {
3286
- if (f.map.isWebGLCubeRenderTarget) t.setRenderTarget(f.map, e), t.clear();
3284
+ let x = p.map.isWebGLCubeRenderTarget ? 6 : 1;
3285
+ for (let e = 0; e < x; e++) {
3286
+ if (p.map.isWebGLCubeRenderTarget) t.setRenderTarget(p.map, e), t.clear();
3287
3287
  else {
3288
- e === 0 && (t.setRenderTarget(f.map), t.clear());
3289
- let n = f.getViewport(e);
3290
- s.set(o.x * n.x, o.y * n.y, o.x * n.z, o.y * n.w), p.viewport(s);
3288
+ e === 0 && (t.setRenderTarget(p.map), t.clear());
3289
+ let n = p.getViewport(e);
3290
+ s.set(o.x * n.x, o.y * n.y, o.x * n.z, o.y * n.w), m.viewport(s);
3291
3291
  }
3292
3292
  if (u.isPointLight) {
3293
- let t = f.camera, n = f.matrix, r = u.distance || t.far;
3294
- r !== t.far && (t.far = r, t.updateProjectionMatrix()), Or.setFromMatrixPosition(u.matrixWorld), t.position.copy(Or), kr.copy(t.position), kr.add(Tr[e]), t.up.copy(Er[e]), t.lookAt(kr), t.updateMatrixWorld(), n.makeTranslation(-Or.x, -Or.y, -Or.z), Dr.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), f._frustum.setFromProjectionMatrix(Dr, t.coordinateSystem, t.reversedDepth);
3295
- } else f.updateMatrices(u);
3296
- i = f.getFrustum(), T(r, c, f.camera, u, this.type);
3293
+ let t = p.camera, n = p.matrix, r = u.distance || t.far;
3294
+ r !== t.far && (t.far = r, t.updateProjectionMatrix()), Or.setFromMatrixPosition(u.matrixWorld), t.position.copy(Or), kr.copy(t.position), kr.add(Tr[e]), t.up.copy(Er[e]), t.lookAt(kr), t.updateMatrixWorld(), n.makeTranslation(-Or.x, -Or.y, -Or.z), Dr.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), p._frustum.setFromProjectionMatrix(Dr, t.coordinateSystem, t.reversedDepth);
3295
+ } else p.updateMatrices(u);
3296
+ i = p.getFrustum(), O(r, c, p.camera, u, this.type);
3297
3297
  }
3298
- f.isPointLightShadow !== !0 && this.type === 3 && C(f, c), f.needsUpdate = !1;
3298
+ p.isPointLightShadow !== !0 && this.type === 3 && w(p, c), p.needsUpdate = !1;
3299
3299
  }
3300
- S = this.type, x.needsUpdate = !1, t.setRenderTarget(l, u, f);
3300
+ C = this.type, S.needsUpdate = !1, t.setRenderTarget(l, u, p);
3301
3301
  };
3302
- function C(e, r) {
3303
- let i = n.update(b);
3304
- m.defines.VSM_SAMPLES !== e.blurSamples && (m.defines.VSM_SAMPLES = e.blurSamples, v.defines.VSM_SAMPLES = e.blurSamples, m.needsUpdate = !0, v.needsUpdate = !0), e.mapPass === null && (e.mapPass = new k(a.x, a.y, {
3302
+ function w(e, r) {
3303
+ let i = n.update(x);
3304
+ v.defines.VSM_SAMPLES !== e.blurSamples && (v.defines.VSM_SAMPLES = e.blurSamples, y.defines.VSM_SAMPLES = e.blurSamples, v.needsUpdate = !0, y.needsUpdate = !0), e.mapPass === null && (e.mapPass = new k(a.x, a.y, {
3305
3305
  format: D,
3306
3306
  type: he
3307
- })), m.uniforms.shadow_pass.value = e.map.depthTexture, m.uniforms.resolution.value = e.mapSize, m.uniforms.radius.value = e.radius, t.setRenderTarget(e.mapPass), t.clear(), t.renderBufferDirect(r, null, i, m, b, null), v.uniforms.shadow_pass.value = e.mapPass.texture, v.uniforms.resolution.value = e.mapSize, v.uniforms.radius.value = e.radius, t.setRenderTarget(e.map), t.clear(), t.renderBufferDirect(r, null, i, v, b, null);
3307
+ })), v.uniforms.shadow_pass.value = e.map.depthTexture, v.uniforms.resolution.value = e.mapSize, v.uniforms.radius.value = e.radius, t.setRenderTarget(e.mapPass), t.clear(), t.renderBufferDirect(r, null, i, v, x, null), y.uniforms.shadow_pass.value = e.mapPass.texture, y.uniforms.resolution.value = e.mapSize, y.uniforms.radius.value = e.radius, t.setRenderTarget(e.map), t.clear(), t.renderBufferDirect(r, null, i, y, x, null);
3308
3308
  }
3309
- function w(e, n, r, i) {
3309
+ function T(e, n, r, i) {
3310
3310
  let a = null, o = r.isPointLight === !0 ? e.customDistanceMaterial : e.customDepthMaterial;
3311
3311
  if (o !== void 0) a = o;
3312
3312
  else if (a = r.isPointLight === !0 ? l : c, t.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
3313
  let e = a.uuid, t = n.uuid, r = u[e];
3314
3314
  r === void 0 && (r = {}, u[e] = r);
3315
3315
  let i = r[t];
3316
- i === void 0 && (i = a.clone(), r[t] = i, n.addEventListener("dispose", O)), a = i;
3316
+ i === void 0 && (i = a.clone(), r[t] = i, n.addEventListener("dispose", A)), 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 ? f[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 ? 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) {
3319
3319
  let e = t.properties.get(a);
3320
3320
  e.light = r;
3321
3321
  }
3322
3322
  return a;
3323
3323
  }
3324
- function T(e, r, a, o, s) {
3324
+ function O(e, r, a, o, s) {
3325
3325
  if (e.visible === !1) return;
3326
3326
  if (e.layers.test(r.layers) && (e.isMesh || e.isLine || e.isPoints) && (e.castShadow || e.receiveShadow && s === 3) && (!e.frustumCulled || i.intersectsObject(e))) {
3327
3327
  e.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse, e.matrixWorld);
@@ -3331,20 +3331,20 @@ function Ar(t, n, r) {
3331
3331
  for (let l = 0, u = n.length; l < u; l++) {
3332
3332
  let u = n[l], d = c[u.materialIndex];
3333
3333
  if (d && d.visible) {
3334
- let n = w(e, d, o, s);
3334
+ let n = T(e, d, o, s);
3335
3335
  e.onBeforeShadow(t, e, r, a, i, n, u), t.renderBufferDirect(a, null, i, n, e, u), e.onAfterShadow(t, e, r, a, i, n, u);
3336
3336
  }
3337
3337
  }
3338
3338
  } else if (c.visible) {
3339
- let n = w(e, c, o, s);
3339
+ let n = T(e, c, o, s);
3340
3340
  e.onBeforeShadow(t, e, r, a, i, n, null), t.renderBufferDirect(a, null, i, n, e, null), e.onAfterShadow(t, e, r, a, i, n, null);
3341
3341
  }
3342
3342
  }
3343
3343
  let c = e.children;
3344
- for (let e = 0, t = c.length; e < t; e++) T(c[e], r, a, o, s);
3344
+ for (let e = 0, t = c.length; e < t; e++) O(c[e], r, a, o, s);
3345
3345
  }
3346
- function O(e) {
3347
- e.target.removeEventListener("dispose", O);
3346
+ function A(e) {
3347
+ e.target.removeEventListener("dispose", A);
3348
3348
  for (let t in u) {
3349
3349
  let n = u[t], r = e.target.uuid;
3350
3350
  r in n && (n[r].dispose(), delete n[r]);
@@ -3458,8 +3458,8 @@ function jr(e, t) {
3458
3458
  }
3459
3459
  };
3460
3460
  }
3461
- let o = new n(), s = new r(), c = new i(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, x = null, C = null, w = null, T = null, D = new a(0, 0, 0), O = 0, k = !1, A = null, j = null, M = null, N = null, ee = null, te = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), P = !1, ne = 0, F = e.getParameter(e.VERSION);
3462
- F.indexOf("WebGL") === -1 ? F.indexOf("OpenGL ES") !== -1 && (ne = parseFloat(/^OpenGL ES (\d)/.exec(F)[1]), P = ne >= 2) : (ne = parseFloat(/^WebGL (\d)/.exec(F)[1]), P = ne >= 1);
3461
+ let o = new n(), s = new r(), c = new i(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, x = null, C = null, w = null, T = null, D = new a(0, 0, 0), O = 0, k = !1, A = null, j = null, M = null, ee = null, te = null, ne = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), N = !1, P = 0, F = e.getParameter(e.VERSION);
3462
+ F.indexOf("WebGL") === -1 ? F.indexOf("OpenGL ES") !== -1 && (P = parseFloat(/^OpenGL ES (\d)/.exec(F)[1]), N = P >= 2) : (P = parseFloat(/^WebGL (\d)/.exec(F)[1]), N = P >= 1);
3463
3463
  let I = null, L = {}, R = e.getParameter(e.SCISSOR_BOX), re = e.getParameter(e.VIEWPORT), z = new E().fromArray(R), ie = new E().fromArray(re);
3464
3464
  function ae(t, n, r, i) {
3465
3465
  let a = new Uint8Array(4), o = e.createTexture();
@@ -3577,19 +3577,19 @@ function jr(e, t) {
3577
3577
  t === 0 ? V(e.CULL_FACE) : (B(e.CULL_FACE), t !== j && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), j = t;
3578
3578
  }
3579
3579
  function H(t) {
3580
- t !== M && (P && e.lineWidth(t), M = t);
3580
+ t !== M && (N && e.lineWidth(t), M = t);
3581
3581
  }
3582
3582
  function ge(t, n, r) {
3583
- t ? (B(e.POLYGON_OFFSET_FILL), (N !== n || ee !== r) && (N = n, ee = r, s.getReversed() && (n = -n), e.polygonOffset(n, r))) : V(e.POLYGON_OFFSET_FILL);
3583
+ t ? (B(e.POLYGON_OFFSET_FILL), (ee !== n || te !== r) && (ee = n, te = r, s.getReversed() && (n = -n), e.polygonOffset(n, r))) : V(e.POLYGON_OFFSET_FILL);
3584
3584
  }
3585
3585
  function _e(t) {
3586
3586
  t ? B(e.SCISSOR_TEST) : V(e.SCISSOR_TEST);
3587
3587
  }
3588
3588
  function ve(t) {
3589
- t === void 0 && (t = e.TEXTURE0 + te - 1), I !== t && (e.activeTexture(t), I = t);
3589
+ t === void 0 && (t = e.TEXTURE0 + ne - 1), I !== t && (e.activeTexture(t), I = t);
3590
3590
  }
3591
3591
  function ye(t, n, r) {
3592
- r === void 0 && (r = I === null ? e.TEXTURE0 + te - 1 : I);
3592
+ r === void 0 && (r = I === null ? e.TEXTURE0 + ne - 1 : I);
3593
3593
  let i = L[r];
3594
3594
  i === void 0 && (i = {
3595
3595
  type: void 0,
@@ -3687,7 +3687,7 @@ function jr(e, t) {
3687
3687
  l.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), l.set(n, r));
3688
3688
  }
3689
3689
  function Ne() {
3690
- 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), s.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), d = {}, I = null, L = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, x = null, C = null, w = null, T = null, D = new a(0, 0, 0), O = 0, k = !1, A = null, j = null, M = null, N = null, ee = null, z.set(0, 0, e.canvas.width, e.canvas.height), ie.set(0, 0, e.canvas.width, e.canvas.height), o.reset(), s.reset(), c.reset();
3690
+ 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), s.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), d = {}, I = null, L = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, x = null, C = null, w = null, T = null, D = new a(0, 0, 0), O = 0, k = !1, A = null, j = null, M = null, ee = null, te = null, z.set(0, 0, e.canvas.width, e.canvas.height), ie.set(0, 0, e.canvas.width, e.canvas.height), o.reset(), s.reset(), c.reset();
3691
3691
  }
3692
3692
  return {
3693
3693
  buffers: {
@@ -3728,36 +3728,36 @@ function jr(e, t) {
3728
3728
  };
3729
3729
  }
3730
3730
  function Mr(e, t, n, r, i, a, o) {
3731
- let s = t.has("WEBGL_multisampled_render_to_texture") ? t.get("WEBGL_multisampled_render_to_texture") : null, c = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), u = new L(), d = /* @__PURE__ */ new WeakMap(), f, p = /* @__PURE__ */ new WeakMap(), m = !1;
3731
+ let s = t.has("WEBGL_multisampled_render_to_texture") ? t.get("WEBGL_multisampled_render_to_texture") : null, c = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), u = new L(), d = /* @__PURE__ */ new WeakMap(), p, m = /* @__PURE__ */ new WeakMap(), h = !1;
3732
3732
  try {
3733
- m = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
3733
+ h = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
3734
3734
  } catch {}
3735
- function h(e, t) {
3736
- return m ? new OffscreenCanvas(e, t) : y("canvas");
3735
+ function g(e, t) {
3736
+ return h ? new OffscreenCanvas(e, t) : y("canvas");
3737
3737
  }
3738
- function g(e, t, n) {
3738
+ function v(e, t, n) {
3739
3739
  let r = 1, i = Oe(e);
3740
3740
  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) {
3741
3741
  let n = Math.floor(r * i.width), a = Math.floor(r * i.height);
3742
- f === void 0 && (f = h(n, a));
3743
- let o = t ? h(n, a) : f;
3744
- return o.width = n, o.height = a, o.getContext("2d").drawImage(e, 0, 0, n, a), j("WebGLRenderer: Texture has been resized from (" + i.width + "x" + i.height + ") to (" + n + "x" + a + ")."), o;
3745
- } else return "data" in e && j("WebGLRenderer: Image in DataTexture is too big (" + i.width + "x" + i.height + ")."), e;
3742
+ p === void 0 && (p = g(n, a));
3743
+ let o = t ? g(n, a) : p;
3744
+ return o.width = n, o.height = a, o.getContext("2d").drawImage(e, 0, 0, n, a), f("WebGLRenderer: Texture has been resized from (" + i.width + "x" + i.height + ") to (" + n + "x" + a + ")."), o;
3745
+ } else return "data" in e && f("WebGLRenderer: Image in DataTexture is too big (" + i.width + "x" + i.height + ")."), e;
3746
3746
  return e;
3747
3747
  }
3748
- function v(e) {
3748
+ function b(e) {
3749
3749
  return e.generateMipmaps;
3750
3750
  }
3751
- function b(t) {
3751
+ function x(t) {
3752
3752
  e.generateMipmap(t);
3753
3753
  }
3754
- function x(t) {
3754
+ function w(t) {
3755
3755
  return t.isWebGLCubeRenderTarget ? e.TEXTURE_CUBE_MAP : t.isWebGL3DRenderTarget ? e.TEXTURE_3D : t.isWebGLArrayRenderTarget || t.isCompressedArrayTexture ? e.TEXTURE_2D_ARRAY : e.TEXTURE_2D;
3756
3756
  }
3757
- function w(n, r, i, a, o = !1) {
3757
+ function T(n, r, i, a, o = !1) {
3758
3758
  if (n !== null) {
3759
3759
  if (e[n] !== void 0) return e[n];
3760
- j("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + n + "'");
3760
+ f("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + n + "'");
3761
3761
  }
3762
3762
  let s = r;
3763
3763
  if (r === e.RED && (i === e.FLOAT && (s = e.R32F), i === e.HALF_FLOAT && (s = e.R16F), i === e.UNSIGNED_BYTE && (s = e.R8)), r === e.RED_INTEGER && (i === e.UNSIGNED_BYTE && (s = e.R8UI), i === e.UNSIGNED_SHORT && (s = e.R16UI), i === e.UNSIGNED_INT && (s = e.R32UI), i === e.BYTE && (s = e.R8I), i === e.SHORT && (s = e.R16I), i === e.INT && (s = e.R32I)), r === e.RG && (i === e.FLOAT && (s = e.RG32F), i === e.HALF_FLOAT && (s = e.RG16F), i === e.UNSIGNED_BYTE && (s = e.RG8)), r === e.RG_INTEGER && (i === e.UNSIGNED_BYTE && (s = e.RG8UI), i === e.UNSIGNED_SHORT && (s = e.RG16UI), i === e.UNSIGNED_INT && (s = e.RG32UI), i === e.BYTE && (s = e.RG8I), i === e.SHORT && (s = e.RG16I), i === e.INT && (s = e.RG32I)), r === e.RGB_INTEGER && (i === e.UNSIGNED_BYTE && (s = e.RGB8UI), i === e.UNSIGNED_SHORT && (s = e.RGB16UI), i === e.UNSIGNED_INT && (s = e.RGB32UI), i === e.BYTE && (s = e.RGB8I), i === e.SHORT && (s = e.RGB16I), i === e.INT && (s = e.RGB32I)), r === e.RGBA_INTEGER && (i === e.UNSIGNED_BYTE && (s = e.RGBA8UI), i === e.UNSIGNED_SHORT && (s = e.RGBA16UI), i === e.UNSIGNED_INT && (s = e.RGBA32UI), i === e.BYTE && (s = e.RGBA8I), i === e.SHORT && (s = e.RGBA16I), i === e.INT && (s = e.RGBA32I)), r === e.RGB && (i === e.UNSIGNED_INT_5_9_9_9_REV && (s = e.RGB9_E5), i === e.UNSIGNED_INT_10F_11F_11F_REV && (s = e.R11F_G11F_B10F)), r === e.RGBA) {
@@ -3766,38 +3766,38 @@ function Mr(e, t, n, r, i, a, o) {
3766
3766
  }
3767
3767
  return (s === e.R16F || s === e.R32F || s === e.RG16F || s === e.RG32F || s === e.RGBA16F || s === e.RGBA32F) && t.get("EXT_color_buffer_float"), s;
3768
3768
  }
3769
- function T(t, n) {
3769
+ function E(t, n) {
3770
3770
  let r;
3771
- return t ? n === null || n === 1014 || n === 1020 ? r = e.DEPTH24_STENCIL8 : n === 1015 ? r = e.DEPTH32F_STENCIL8 : n === 1012 && (r = e.DEPTH24_STENCIL8, j("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : n === null || n === 1014 || n === 1020 ? r = e.DEPTH_COMPONENT24 : n === 1015 ? r = e.DEPTH_COMPONENT32F : n === 1012 && (r = e.DEPTH_COMPONENT16), r;
3771
+ return t ? n === null || n === 1014 || n === 1020 ? r = e.DEPTH24_STENCIL8 : n === 1015 ? r = e.DEPTH32F_STENCIL8 : n === 1012 && (r = e.DEPTH24_STENCIL8, f("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : n === null || n === 1014 || n === 1020 ? r = e.DEPTH_COMPONENT24 : n === 1015 ? r = e.DEPTH_COMPONENT32F : n === 1012 && (r = e.DEPTH_COMPONENT16), r;
3772
3772
  }
3773
- function E(e, t) {
3774
- return v(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;
3775
- }
3776
- function D(e) {
3777
- let t = e.target;
3778
- t.removeEventListener("dispose", D), A(t), t.isVideoTexture && d.delete(t);
3773
+ function D(e, t) {
3774
+ return b(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;
3779
3775
  }
3780
3776
  function k(e) {
3781
3777
  let t = e.target;
3782
- t.removeEventListener("dispose", k), te(t);
3778
+ t.removeEventListener("dispose", k), j(t), t.isVideoTexture && d.delete(t);
3783
3779
  }
3784
3780
  function A(e) {
3781
+ let t = e.target;
3782
+ t.removeEventListener("dispose", A), ne(t);
3783
+ }
3784
+ function j(e) {
3785
3785
  let t = r.get(e);
3786
3786
  if (t.__webglInit === void 0) return;
3787
- let n = e.source, i = p.get(n);
3787
+ let n = e.source, i = m.get(n);
3788
3788
  if (i) {
3789
3789
  let r = i[t.__cacheKey];
3790
- r.usedTimes--, r.usedTimes === 0 && M(e), Object.keys(i).length === 0 && p.delete(n);
3790
+ r.usedTimes--, r.usedTimes === 0 && M(e), Object.keys(i).length === 0 && m.delete(n);
3791
3791
  }
3792
3792
  r.remove(e);
3793
3793
  }
3794
3794
  function M(t) {
3795
3795
  let n = r.get(t);
3796
3796
  e.deleteTexture(n.__webglTexture);
3797
- let i = t.source, a = p.get(i);
3797
+ let i = t.source, a = m.get(i);
3798
3798
  delete a[n.__cacheKey], o.memory.textures--;
3799
3799
  }
3800
- function te(t) {
3800
+ function ne(t) {
3801
3801
  let n = r.get(t);
3802
3802
  if (t.depthTexture && (t.depthTexture.dispose(), r.remove(t.depthTexture)), t.isWebGLCubeRenderTarget) for (let t = 0; t < 6; t++) {
3803
3803
  if (Array.isArray(n.__webglFramebuffer[t])) for (let r = 0; r < n.__webglFramebuffer[t].length; r++) e.deleteFramebuffer(n.__webglFramebuffer[t][r]);
@@ -3817,13 +3817,13 @@ function Mr(e, t, n, r, i, a, o) {
3817
3817
  }
3818
3818
  r.remove(t);
3819
3819
  }
3820
- let P = 0;
3821
- function ne() {
3822
- P = 0;
3820
+ let N = 0;
3821
+ function P() {
3822
+ N = 0;
3823
3823
  }
3824
3824
  function F() {
3825
- let e = P;
3826
- return e >= i.maxTextures && j("WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + i.maxTextures), P += 1, e;
3825
+ let e = N;
3826
+ return e >= i.maxTextures && f("WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + i.maxTextures), N += 1, e;
3827
3827
  }
3828
3828
  function I(e) {
3829
3829
  let t = [];
@@ -3833,8 +3833,8 @@ function Mr(e, t, n, r, i, a, o) {
3833
3833
  let a = r.get(t);
3834
3834
  if (t.isVideoTexture && Te(t), t.isRenderTargetTexture === !1 && t.isExternalTexture !== !0 && t.version > 0 && a.__version !== t.version) {
3835
3835
  let e = t.image;
3836
- if (e === null) j("WebGLRenderer: Texture marked for update but no image data found.");
3837
- else if (e.complete === !1) j("WebGLRenderer: Texture marked for update but image is incomplete");
3836
+ if (e === null) f("WebGLRenderer: Texture marked for update but no image data found.");
3837
+ else if (e.complete === !1) f("WebGLRenderer: Texture marked for update but image is incomplete");
3838
3838
  else {
3839
3839
  fe(a, t, i);
3840
3840
  return;
@@ -3875,8 +3875,8 @@ function Mr(e, t, n, r, i, a, o) {
3875
3875
  [je]: e.NEAREST_MIPMAP_NEAREST,
3876
3876
  [R]: e.NEAREST_MIPMAP_LINEAR,
3877
3877
  [_]: e.LINEAR,
3878
- [N]: e.LINEAR_MIPMAP_NEAREST,
3879
- [ee]: e.LINEAR_MIPMAP_LINEAR
3878
+ [ee]: e.LINEAR_MIPMAP_NEAREST,
3879
+ [te]: e.LINEAR_MIPMAP_LINEAR
3880
3880
  }, V = {
3881
3881
  512: e.NEVER,
3882
3882
  519: e.ALWAYS,
@@ -3888,7 +3888,7 @@ function Mr(e, t, n, r, i, a, o) {
3888
3888
  517: e.NOTEQUAL
3889
3889
  };
3890
3890
  function ce(n, a) {
3891
- if (a.type === 1015 && t.has("OES_texture_float_linear") === !1 && (a.magFilter === 1006 || a.magFilter === 1007 || a.magFilter === 1005 || a.magFilter === 1008 || a.minFilter === 1006 || a.minFilter === 1007 || a.minFilter === 1005 || a.minFilter === 1008) && j("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), e.texParameteri(n, e.TEXTURE_WRAP_S, oe[a.wrapS]), e.texParameteri(n, e.TEXTURE_WRAP_T, oe[a.wrapT]), (n === e.TEXTURE_3D || n === e.TEXTURE_2D_ARRAY) && e.texParameteri(n, e.TEXTURE_WRAP_R, oe[a.wrapR]), e.texParameteri(n, e.TEXTURE_MAG_FILTER, B[a.magFilter]), e.texParameteri(n, e.TEXTURE_MIN_FILTER, B[a.minFilter]), a.compareFunction && (e.texParameteri(n, e.TEXTURE_COMPARE_MODE, e.COMPARE_REF_TO_TEXTURE), e.texParameteri(n, e.TEXTURE_COMPARE_FUNC, V[a.compareFunction])), t.has("EXT_texture_filter_anisotropic") === !0) {
3891
+ if (a.type === 1015 && t.has("OES_texture_float_linear") === !1 && (a.magFilter === 1006 || a.magFilter === 1007 || a.magFilter === 1005 || a.magFilter === 1008 || a.minFilter === 1006 || a.minFilter === 1007 || a.minFilter === 1005 || a.minFilter === 1008) && f("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), e.texParameteri(n, e.TEXTURE_WRAP_S, oe[a.wrapS]), e.texParameteri(n, e.TEXTURE_WRAP_T, oe[a.wrapT]), (n === e.TEXTURE_3D || n === e.TEXTURE_2D_ARRAY) && e.texParameteri(n, e.TEXTURE_WRAP_R, oe[a.wrapR]), e.texParameteri(n, e.TEXTURE_MAG_FILTER, B[a.magFilter]), e.texParameteri(n, e.TEXTURE_MIN_FILTER, B[a.minFilter]), a.compareFunction && (e.texParameteri(n, e.TEXTURE_COMPARE_MODE, e.COMPARE_REF_TO_TEXTURE), e.texParameteri(n, e.TEXTURE_COMPARE_FUNC, V[a.compareFunction])), t.has("EXT_texture_filter_anisotropic") === !0) {
3892
3892
  if (a.magFilter === 1003 || a.minFilter !== 1005 && a.minFilter !== 1008 || a.type === 1015 && t.has("OES_texture_float_linear") === !1) return;
3893
3893
  if (a.anisotropy > 1 || r.get(a).__currentAnisotropy) {
3894
3894
  let o = t.get("EXT_texture_filter_anisotropic");
@@ -3898,9 +3898,9 @@ function Mr(e, t, n, r, i, a, o) {
3898
3898
  }
3899
3899
  function le(t, n) {
3900
3900
  let r = !1;
3901
- t.__webglInit === void 0 && (t.__webglInit = !0, n.addEventListener("dispose", D));
3902
- let i = n.source, a = p.get(i);
3903
- a === void 0 && (a = {}, p.set(i, a));
3901
+ t.__webglInit === void 0 && (t.__webglInit = !0, n.addEventListener("dispose", k));
3902
+ let i = n.source, a = m.get(i);
3903
+ a === void 0 && (a = {}, m.set(i, a));
3904
3904
  let s = I(n);
3905
3905
  if (s !== t.__cacheKey) {
3906
3906
  a[s] === void 0 && (a[s] = {
@@ -3940,72 +3940,72 @@ function Mr(e, t, n, r, i, a, o) {
3940
3940
  (o.isDataArrayTexture || o.isCompressedArrayTexture) && (c = e.TEXTURE_2D_ARRAY), o.isData3DTexture && (c = e.TEXTURE_3D);
3941
3941
  let u = le(t, o), d = o.source;
3942
3942
  n.bindTexture(c, t.__webglTexture, e.TEXTURE0 + s);
3943
- let f = r.get(d);
3944
- if (d.version !== f.__version || u === !0) {
3943
+ let p = r.get(d);
3944
+ if (d.version !== p.__version || u === !0) {
3945
3945
  n.activeTexture(e.TEXTURE0 + s);
3946
- let t = O.getPrimaries(O.workingColorSpace), r = o.colorSpace === "" ? null : O.getPrimaries(o.colorSpace), p = o.colorSpace === "" || t === r ? e.NONE : e.BROWSER_DEFAULT_WEBGL;
3947
- e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), e.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, p);
3948
- let m = g(o.image, !1, i.maxTextureSize);
3949
- m = Ee(o, m);
3950
- let h = a.convert(o.format, o.colorSpace), _ = a.convert(o.type), y = w(o.internalFormat, h, _, o.colorSpace, o.isVideoTexture);
3946
+ let t = O.getPrimaries(O.workingColorSpace), r = o.colorSpace === "" ? null : O.getPrimaries(o.colorSpace), m = o.colorSpace === "" || t === r ? e.NONE : e.BROWSER_DEFAULT_WEBGL;
3947
+ e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), e.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, m);
3948
+ let h = v(o.image, !1, i.maxTextureSize);
3949
+ h = Ee(o, h);
3950
+ let g = a.convert(o.format, o.colorSpace), _ = a.convert(o.type), y = T(o.internalFormat, g, _, o.colorSpace, o.isVideoTexture);
3951
3951
  ce(c, o);
3952
- let x, S = o.mipmaps, C = o.isVideoTexture !== !0, D = f.__version === void 0 || u === !0, k = d.dataReady, A = E(o, m);
3953
- if (o.isDepthTexture) y = T(o.format === ye, o.type), D && (C ? n.texStorage2D(e.TEXTURE_2D, 1, y, m.width, m.height) : n.texImage2D(e.TEXTURE_2D, 0, y, m.width, m.height, 0, h, _, null));
3954
- else if (o.isDataTexture) if (S.length > 0) {
3955
- C && D && n.texStorage2D(e.TEXTURE_2D, A, y, S[0].width, S[0].height);
3956
- for (let t = 0, r = S.length; t < r; t++) x = S[t], C ? k && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, x.width, x.height, h, _, x.data) : n.texImage2D(e.TEXTURE_2D, t, y, x.width, x.height, 0, h, _, x.data);
3952
+ let S, C = o.mipmaps, w = o.isVideoTexture !== !0, k = p.__version === void 0 || u === !0, A = d.dataReady, j = D(o, h);
3953
+ if (o.isDepthTexture) y = E(o.format === ye, o.type), k && (w ? n.texStorage2D(e.TEXTURE_2D, 1, y, h.width, h.height) : n.texImage2D(e.TEXTURE_2D, 0, y, h.width, h.height, 0, g, _, null));
3954
+ else if (o.isDataTexture) if (C.length > 0) {
3955
+ w && k && n.texStorage2D(e.TEXTURE_2D, j, y, C[0].width, C[0].height);
3956
+ for (let t = 0, r = C.length; t < r; t++) S = C[t], w ? A && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, S.width, S.height, g, _, S.data) : n.texImage2D(e.TEXTURE_2D, t, y, S.width, S.height, 0, g, _, S.data);
3957
3957
  o.generateMipmaps = !1;
3958
- } else C ? (D && n.texStorage2D(e.TEXTURE_2D, A, y, m.width, m.height), k && de(o, m, h, _)) : n.texImage2D(e.TEXTURE_2D, 0, y, m.width, m.height, 0, h, _, m.data);
3958
+ } else w ? (k && n.texStorage2D(e.TEXTURE_2D, j, y, h.width, h.height), A && de(o, h, g, _)) : n.texImage2D(e.TEXTURE_2D, 0, y, h.width, h.height, 0, g, _, h.data);
3959
3959
  else if (o.isCompressedTexture) if (o.isCompressedArrayTexture) {
3960
- C && D && n.texStorage3D(e.TEXTURE_2D_ARRAY, A, y, S[0].width, S[0].height, m.depth);
3961
- for (let t = 0, r = S.length; t < r; t++) if (x = S[t], o.format !== 1023) if (h !== null) if (C) {
3962
- if (k) if (o.layerUpdates.size > 0) {
3963
- let r = l(x.width, x.height, o.format, o.type);
3960
+ w && k && n.texStorage3D(e.TEXTURE_2D_ARRAY, j, y, C[0].width, C[0].height, h.depth);
3961
+ for (let t = 0, r = C.length; t < r; t++) if (S = C[t], o.format !== 1023) if (g !== null) if (w) {
3962
+ if (A) if (o.layerUpdates.size > 0) {
3963
+ let r = l(S.width, S.height, o.format, o.type);
3964
3964
  for (let i of o.layerUpdates) {
3965
- let a = x.data.subarray(i * r / x.data.BYTES_PER_ELEMENT, (i + 1) * r / x.data.BYTES_PER_ELEMENT);
3966
- n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, i, x.width, x.height, 1, h, a);
3965
+ let a = S.data.subarray(i * r / S.data.BYTES_PER_ELEMENT, (i + 1) * r / S.data.BYTES_PER_ELEMENT);
3966
+ n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, i, S.width, S.height, 1, g, a);
3967
3967
  }
3968
3968
  o.clearLayerUpdates();
3969
- } else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, 0, x.width, x.height, m.depth, h, x.data);
3970
- } else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY, t, y, x.width, x.height, m.depth, 0, x.data, 0, 0);
3971
- else j("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");
3972
- else C ? k && n.texSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, 0, x.width, x.height, m.depth, h, _, x.data) : n.texImage3D(e.TEXTURE_2D_ARRAY, t, y, x.width, x.height, m.depth, 0, h, _, x.data);
3969
+ } else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, 0, S.width, S.height, h.depth, g, S.data);
3970
+ } else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY, t, y, S.width, S.height, h.depth, 0, S.data, 0, 0);
3971
+ else f("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");
3972
+ else w ? A && n.texSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, 0, S.width, S.height, h.depth, g, _, S.data) : n.texImage3D(e.TEXTURE_2D_ARRAY, t, y, S.width, S.height, h.depth, 0, g, _, S.data);
3973
3973
  } else {
3974
- C && D && n.texStorage2D(e.TEXTURE_2D, A, y, S[0].width, S[0].height);
3975
- for (let t = 0, r = S.length; t < r; t++) x = S[t], o.format === 1023 ? C ? k && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, x.width, x.height, h, _, x.data) : n.texImage2D(e.TEXTURE_2D, t, y, x.width, x.height, 0, h, _, x.data) : h === null ? j("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : C ? k && n.compressedTexSubImage2D(e.TEXTURE_2D, t, 0, 0, x.width, x.height, h, x.data) : n.compressedTexImage2D(e.TEXTURE_2D, t, y, x.width, x.height, 0, x.data);
3974
+ w && k && n.texStorage2D(e.TEXTURE_2D, j, y, C[0].width, C[0].height);
3975
+ for (let t = 0, r = C.length; t < r; t++) S = C[t], o.format === 1023 ? w ? A && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, S.width, S.height, g, _, S.data) : n.texImage2D(e.TEXTURE_2D, t, y, S.width, S.height, 0, g, _, S.data) : g === null ? f("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : w ? A && n.compressedTexSubImage2D(e.TEXTURE_2D, t, 0, 0, S.width, S.height, g, S.data) : n.compressedTexImage2D(e.TEXTURE_2D, t, y, S.width, S.height, 0, S.data);
3976
3976
  }
3977
- else if (o.isDataArrayTexture) if (C) {
3978
- if (D && n.texStorage3D(e.TEXTURE_2D_ARRAY, A, y, m.width, m.height, m.depth), k) if (o.layerUpdates.size > 0) {
3979
- let t = l(m.width, m.height, o.format, o.type);
3977
+ else if (o.isDataArrayTexture) if (w) {
3978
+ if (k && n.texStorage3D(e.TEXTURE_2D_ARRAY, j, y, h.width, h.height, h.depth), A) if (o.layerUpdates.size > 0) {
3979
+ let t = l(h.width, h.height, o.format, o.type);
3980
3980
  for (let r of o.layerUpdates) {
3981
- let i = m.data.subarray(r * t / m.data.BYTES_PER_ELEMENT, (r + 1) * t / m.data.BYTES_PER_ELEMENT);
3982
- n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, r, m.width, m.height, 1, h, _, i);
3981
+ let i = h.data.subarray(r * t / h.data.BYTES_PER_ELEMENT, (r + 1) * t / h.data.BYTES_PER_ELEMENT);
3982
+ n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, r, h.width, h.height, 1, g, _, i);
3983
3983
  }
3984
3984
  o.clearLayerUpdates();
3985
- } else n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, 0, m.width, m.height, m.depth, h, _, m.data);
3986
- } else n.texImage3D(e.TEXTURE_2D_ARRAY, 0, y, m.width, m.height, m.depth, 0, h, _, m.data);
3987
- else if (o.isData3DTexture) C ? (D && n.texStorage3D(e.TEXTURE_3D, A, y, m.width, m.height, m.depth), k && n.texSubImage3D(e.TEXTURE_3D, 0, 0, 0, 0, m.width, m.height, m.depth, h, _, m.data)) : n.texImage3D(e.TEXTURE_3D, 0, y, m.width, m.height, m.depth, 0, h, _, m.data);
3985
+ } else n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, 0, h.width, h.height, h.depth, g, _, h.data);
3986
+ } else n.texImage3D(e.TEXTURE_2D_ARRAY, 0, y, h.width, h.height, h.depth, 0, g, _, h.data);
3987
+ else if (o.isData3DTexture) w ? (k && n.texStorage3D(e.TEXTURE_3D, j, y, h.width, h.height, h.depth), A && n.texSubImage3D(e.TEXTURE_3D, 0, 0, 0, 0, h.width, h.height, h.depth, g, _, h.data)) : n.texImage3D(e.TEXTURE_3D, 0, y, h.width, h.height, h.depth, 0, g, _, h.data);
3988
3988
  else if (o.isFramebufferTexture) {
3989
- if (D) if (C) n.texStorage2D(e.TEXTURE_2D, A, y, m.width, m.height);
3989
+ if (k) if (w) n.texStorage2D(e.TEXTURE_2D, j, y, h.width, h.height);
3990
3990
  else {
3991
- let t = m.width, r = m.height;
3992
- for (let i = 0; i < A; i++) n.texImage2D(e.TEXTURE_2D, i, y, t, r, 0, h, _, null), t >>= 1, r >>= 1;
3991
+ let t = h.width, r = h.height;
3992
+ for (let i = 0; i < j; i++) n.texImage2D(e.TEXTURE_2D, i, y, t, r, 0, g, _, null), t >>= 1, r >>= 1;
3993
3993
  }
3994
- } else if (S.length > 0) {
3995
- if (C && D) {
3996
- let t = Oe(S[0]);
3997
- n.texStorage2D(e.TEXTURE_2D, A, y, t.width, t.height);
3994
+ } else if (C.length > 0) {
3995
+ if (w && k) {
3996
+ let t = Oe(C[0]);
3997
+ n.texStorage2D(e.TEXTURE_2D, j, y, t.width, t.height);
3998
3998
  }
3999
- for (let t = 0, r = S.length; t < r; t++) x = S[t], C ? k && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, h, _, x) : n.texImage2D(e.TEXTURE_2D, t, y, h, _, x);
3999
+ for (let t = 0, r = C.length; t < r; t++) S = C[t], w ? A && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, g, _, S) : n.texImage2D(e.TEXTURE_2D, t, y, g, _, S);
4000
4000
  o.generateMipmaps = !1;
4001
- } else if (C) {
4002
- if (D) {
4003
- let t = Oe(m);
4004
- n.texStorage2D(e.TEXTURE_2D, A, y, t.width, t.height);
4001
+ } else if (w) {
4002
+ if (k) {
4003
+ let t = Oe(h);
4004
+ n.texStorage2D(e.TEXTURE_2D, j, y, t.width, t.height);
4005
4005
  }
4006
- k && n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, h, _, m);
4007
- } else n.texImage2D(e.TEXTURE_2D, 0, y, h, _, m);
4008
- v(o) && b(c), f.__version = d.version, o.onUpdate && o.onUpdate(o);
4006
+ A && n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, g, _, h);
4007
+ } else n.texImage2D(e.TEXTURE_2D, 0, y, g, _, h);
4008
+ b(o) && x(c), p.__version = d.version, o.onUpdate && o.onUpdate(o);
4009
4009
  }
4010
4010
  t.__version = o.version;
4011
4011
  }
@@ -4018,46 +4018,46 @@ function Mr(e, t, n, r, i, a, o) {
4018
4018
  n.activeTexture(e.TEXTURE0 + s);
4019
4019
  let t = O.getPrimaries(O.workingColorSpace), r = o.colorSpace === "" ? null : O.getPrimaries(o.colorSpace), d = o.colorSpace === "" || t === r ? e.NONE : e.BROWSER_DEFAULT_WEBGL;
4020
4020
  e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), e.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, d);
4021
- let f = o.isCompressedTexture || o.image[0].isCompressedTexture, p = o.image[0] && o.image[0].isDataTexture, m = [];
4022
- for (let e = 0; e < 6; e++) !f && !p ? m[e] = g(o.image[e], !0, i.maxCubemapSize) : m[e] = p ? o.image[e].image : o.image[e], m[e] = Ee(o, m[e]);
4023
- let h = m[0], _ = a.convert(o.format, o.colorSpace), y = a.convert(o.type), x = w(o.internalFormat, _, y, o.colorSpace), S = o.isVideoTexture !== !0, C = u.__version === void 0 || c === !0, T = l.dataReady, D = E(o, h);
4021
+ let p = o.isCompressedTexture || o.image[0].isCompressedTexture, m = o.image[0] && o.image[0].isDataTexture, h = [];
4022
+ for (let e = 0; e < 6; e++) !p && !m ? h[e] = v(o.image[e], !0, i.maxCubemapSize) : h[e] = m ? o.image[e].image : o.image[e], h[e] = Ee(o, h[e]);
4023
+ let g = h[0], _ = a.convert(o.format, o.colorSpace), y = a.convert(o.type), S = T(o.internalFormat, _, y, o.colorSpace), C = o.isVideoTexture !== !0, w = u.__version === void 0 || c === !0, E = l.dataReady, k = D(o, g);
4024
4024
  ce(e.TEXTURE_CUBE_MAP, o);
4025
- let k;
4026
- if (f) {
4027
- S && C && n.texStorage2D(e.TEXTURE_CUBE_MAP, D, x, h.width, h.height);
4025
+ let A;
4026
+ if (p) {
4027
+ C && w && n.texStorage2D(e.TEXTURE_CUBE_MAP, k, S, g.width, g.height);
4028
4028
  for (let t = 0; t < 6; t++) {
4029
- k = m[t].mipmaps;
4030
- for (let r = 0; r < k.length; r++) {
4031
- let i = k[r];
4032
- o.format === 1023 ? S ? T && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, 0, 0, i.width, i.height, _, y, i.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, x, i.width, i.height, 0, _, y, i.data) : _ === null ? j("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : S ? T && n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, 0, 0, i.width, i.height, _, i.data) : n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, x, i.width, i.height, 0, i.data);
4029
+ A = h[t].mipmaps;
4030
+ for (let r = 0; r < A.length; r++) {
4031
+ let i = A[r];
4032
+ o.format === 1023 ? C ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, 0, 0, i.width, i.height, _, y, i.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, S, i.width, i.height, 0, _, y, i.data) : _ === null ? f("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : C ? E && n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, 0, 0, i.width, i.height, _, i.data) : n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, S, i.width, i.height, 0, i.data);
4033
4033
  }
4034
4034
  }
4035
4035
  } else {
4036
- if (k = o.mipmaps, S && C) {
4037
- k.length > 0 && D++;
4038
- let t = Oe(m[0]);
4039
- n.texStorage2D(e.TEXTURE_CUBE_MAP, D, x, t.width, t.height);
4036
+ if (A = o.mipmaps, C && w) {
4037
+ A.length > 0 && k++;
4038
+ let t = Oe(h[0]);
4039
+ n.texStorage2D(e.TEXTURE_CUBE_MAP, k, S, t.width, t.height);
4040
4040
  }
4041
- for (let t = 0; t < 6; t++) if (p) {
4042
- S ? T && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, m[t].width, m[t].height, _, y, m[t].data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, x, m[t].width, m[t].height, 0, _, y, m[t].data);
4043
- for (let r = 0; r < k.length; r++) {
4044
- let i = k[r].image[t].image;
4045
- S ? T && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, 0, 0, i.width, i.height, _, y, i.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, x, i.width, i.height, 0, _, y, i.data);
4041
+ for (let t = 0; t < 6; t++) if (m) {
4042
+ C ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, h[t].width, h[t].height, _, y, h[t].data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, S, h[t].width, h[t].height, 0, _, y, h[t].data);
4043
+ for (let r = 0; r < A.length; r++) {
4044
+ let i = A[r].image[t].image;
4045
+ C ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, 0, 0, i.width, i.height, _, y, i.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, S, i.width, i.height, 0, _, y, i.data);
4046
4046
  }
4047
4047
  } else {
4048
- S ? T && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, _, y, m[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, x, _, y, m[t]);
4049
- for (let r = 0; r < k.length; r++) {
4050
- let i = k[r];
4051
- S ? T && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, 0, 0, _, y, i.image[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, x, _, y, i.image[t]);
4048
+ C ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, _, y, h[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, S, _, y, h[t]);
4049
+ for (let r = 0; r < A.length; r++) {
4050
+ let i = A[r];
4051
+ C ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, 0, 0, _, y, i.image[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, S, _, y, i.image[t]);
4052
4052
  }
4053
4053
  }
4054
4054
  }
4055
- v(o) && b(e.TEXTURE_CUBE_MAP), u.__version = l.version, o.onUpdate && o.onUpdate(o);
4055
+ b(o) && x(e.TEXTURE_CUBE_MAP), u.__version = l.version, o.onUpdate && o.onUpdate(o);
4056
4056
  }
4057
4057
  t.__version = o.version;
4058
4058
  }
4059
4059
  function me(t, i, o, c, l, u) {
4060
- let d = a.convert(o.format, o.colorSpace), f = a.convert(o.type), p = w(o.internalFormat, d, f, o.colorSpace), m = r.get(i), h = r.get(o);
4060
+ let d = a.convert(o.format, o.colorSpace), f = a.convert(o.type), p = T(o.internalFormat, d, f, o.colorSpace), m = r.get(i), h = r.get(o);
4061
4061
  if (h.__renderTarget = i, !m.__hasExternalTextures) {
4062
4062
  let t = Math.max(1, i.width >> u), r = Math.max(1, i.height >> u);
4063
4063
  l === e.TEXTURE_3D || l === e.TEXTURE_2D_ARRAY ? n.texImage3D(l, u, p, t, r, i.depth, 0, d, f, null) : n.texImage2D(l, u, p, t, r, 0, d, f, null);
@@ -4066,12 +4066,12 @@ function Mr(e, t, n, r, i, a, o) {
4066
4066
  }
4067
4067
  function he(t, n, r) {
4068
4068
  if (e.bindRenderbuffer(e.RENDERBUFFER, t), n.depthBuffer) {
4069
- let i = n.depthTexture, a = i && i.isDepthTexture ? i.type : null, o = T(n.stencilBuffer, a), c = n.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;
4069
+ let i = n.depthTexture, a = i && i.isDepthTexture ? i.type : null, o = E(n.stencilBuffer, a), c = n.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;
4070
4070
  we(n) ? s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, Ce(n), o, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, Ce(n), o, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, o, n.width, n.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, c, e.RENDERBUFFER, t);
4071
4071
  } else {
4072
4072
  let t = n.textures;
4073
4073
  for (let i = 0; i < t.length; i++) {
4074
- let o = t[i], c = a.convert(o.format, o.colorSpace), l = a.convert(o.type), u = w(o.internalFormat, c, l, o.colorSpace);
4074
+ let o = t[i], c = a.convert(o.format, o.colorSpace), l = a.convert(o.type), u = T(o.internalFormat, c, l, o.colorSpace);
4075
4075
  we(n) ? s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, Ce(n), u, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, Ce(n), u, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, u, n.width, n.height);
4076
4076
  }
4077
4077
  }
@@ -4082,7 +4082,7 @@ function Mr(e, t, n, r, i, a, o) {
4082
4082
  if (n.bindFramebuffer(e.FRAMEBUFFER, t), !(i.depthTexture && i.depthTexture.isDepthTexture)) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
4083
4083
  let l = r.get(i.depthTexture);
4084
4084
  if (l.__renderTarget = i, (!l.__webglTexture || i.depthTexture.image.width !== i.width || i.depthTexture.image.height !== i.height) && (i.depthTexture.image.width = i.width, i.depthTexture.image.height = i.height, i.depthTexture.needsUpdate = !0), c) {
4085
- if (l.__webglInit === void 0 && (l.__webglInit = !0, i.depthTexture.addEventListener("dispose", D)), l.__webglTexture === void 0) {
4085
+ if (l.__webglInit === void 0 && (l.__webglInit = !0, i.depthTexture.addEventListener("dispose", k)), l.__webglTexture === void 0) {
4086
4086
  l.__webglTexture = e.createTexture(), n.bindTexture(e.TEXTURE_CUBE_MAP, l.__webglTexture), ce(e.TEXTURE_CUBE_MAP, i.depthTexture);
4087
4087
  let t = a.convert(i.depthTexture.format), r = a.convert(i.depthTexture.type), o;
4088
4088
  i.depthTexture.format === 1026 ? o = e.DEPTH_COMPONENT24 : i.depthTexture.format === 1027 && (o = e.DEPTH24_STENCIL8);
@@ -4134,7 +4134,7 @@ function Mr(e, t, n, r, i, a, o) {
4134
4134
  }
4135
4135
  function ve(t) {
4136
4136
  let i = t.texture, s = r.get(t), c = r.get(i);
4137
- t.addEventListener("dispose", k);
4137
+ t.addEventListener("dispose", A);
4138
4138
  let l = t.textures, u = t.isWebGLCubeRenderTarget === !0, d = l.length > 1;
4139
4139
  if (d || (c.__webglTexture === void 0 && (c.__webglTexture = e.createTexture()), c.__version = i.version, o.memory.textures++), u) {
4140
4140
  s.__webglFramebuffer = [];
@@ -4156,7 +4156,7 @@ function Mr(e, t, n, r, i, a, o) {
4156
4156
  for (let n = 0; n < l.length; n++) {
4157
4157
  let r = l[n];
4158
4158
  s.__webglColorRenderbuffer[n] = e.createRenderbuffer(), e.bindRenderbuffer(e.RENDERBUFFER, s.__webglColorRenderbuffer[n]);
4159
- let i = a.convert(r.format, r.colorSpace), o = a.convert(r.type), c = w(r.internalFormat, i, o, r.colorSpace, t.isXRRenderTarget === !0), u = Ce(t);
4159
+ let i = a.convert(r.format, r.colorSpace), o = a.convert(r.type), c = T(r.internalFormat, i, o, r.colorSpace, t.isXRRenderTarget === !0), u = Ce(t);
4160
4160
  e.renderbufferStorageMultisample(e.RENDERBUFFER, u, c, t.width, t.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + n, e.RENDERBUFFER, s.__webglColorRenderbuffer[n]);
4161
4161
  }
4162
4162
  e.bindRenderbuffer(e.RENDERBUFFER, null), t.depthBuffer && (s.__webglDepthRenderbuffer = e.createRenderbuffer(), he(s.__webglDepthRenderbuffer, t, !0)), n.bindFramebuffer(e.FRAMEBUFFER, null);
@@ -4166,18 +4166,18 @@ function Mr(e, t, n, r, i, a, o) {
4166
4166
  n.bindTexture(e.TEXTURE_CUBE_MAP, c.__webglTexture), ce(e.TEXTURE_CUBE_MAP, i);
4167
4167
  for (let n = 0; n < 6; n++) if (i.mipmaps && i.mipmaps.length > 0) for (let r = 0; r < i.mipmaps.length; r++) me(s.__webglFramebuffer[n][r], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, r);
4168
4168
  else me(s.__webglFramebuffer[n], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0);
4169
- v(i) && b(e.TEXTURE_CUBE_MAP), n.unbindTexture();
4169
+ b(i) && x(e.TEXTURE_CUBE_MAP), n.unbindTexture();
4170
4170
  } else if (d) {
4171
4171
  for (let i = 0, a = l.length; i < a; i++) {
4172
4172
  let a = l[i], o = r.get(a), c = e.TEXTURE_2D;
4173
- (t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (c = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(c, o.__webglTexture), ce(c, a), me(s.__webglFramebuffer, t, a, e.COLOR_ATTACHMENT0 + i, c, 0), v(a) && b(c);
4173
+ (t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (c = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(c, o.__webglTexture), ce(c, a), me(s.__webglFramebuffer, t, a, e.COLOR_ATTACHMENT0 + i, c, 0), b(a) && x(c);
4174
4174
  }
4175
4175
  n.unbindTexture();
4176
4176
  } else {
4177
4177
  let r = e.TEXTURE_2D;
4178
4178
  if ((t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (r = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(r, c.__webglTexture), ce(r, i), i.mipmaps && i.mipmaps.length > 0) for (let n = 0; n < i.mipmaps.length; n++) me(s.__webglFramebuffer[n], t, i, e.COLOR_ATTACHMENT0, r, n);
4179
4179
  else me(s.__webglFramebuffer, t, i, e.COLOR_ATTACHMENT0, r, 0);
4180
- v(i) && b(r), n.unbindTexture();
4180
+ b(i) && x(r), n.unbindTexture();
4181
4181
  }
4182
4182
  t.depthBuffer && ge(t);
4183
4183
  }
@@ -4185,9 +4185,9 @@ function Mr(e, t, n, r, i, a, o) {
4185
4185
  let t = e.textures;
4186
4186
  for (let i = 0, a = t.length; i < a; i++) {
4187
4187
  let a = t[i];
4188
- if (v(a)) {
4189
- let t = x(e), i = r.get(a).__webglTexture;
4190
- n.bindTexture(t, i), b(t), n.unbindTexture();
4188
+ if (b(a)) {
4189
+ let t = w(e), i = r.get(a).__webglTexture;
4190
+ n.bindTexture(t, i), x(t), n.unbindTexture();
4191
4191
  }
4192
4192
  }
4193
4193
  }
@@ -4233,12 +4233,12 @@ function Mr(e, t, n, r, i, a, o) {
4233
4233
  }
4234
4234
  function Ee(e, t) {
4235
4235
  let n = e.colorSpace, r = e.format, i = e.type;
4236
- return e.isCompressedTexture === !0 || e.isVideoTexture === !0 || n !== "srgb-linear" && n !== "" && (O.getTransfer(n) === "srgb" ? (r !== 1023 || i !== 1009) && j("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : S("WebGLTextures: Unsupported texture color space:", n)), t;
4236
+ return e.isCompressedTexture === !0 || e.isVideoTexture === !0 || n !== "srgb-linear" && n !== "" && (O.getTransfer(n) === "srgb" ? (r !== 1023 || i !== 1009) && f("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : S("WebGLTextures: Unsupported texture color space:", n)), t;
4237
4237
  }
4238
4238
  function Oe(e) {
4239
4239
  return typeof HTMLImageElement < "u" && e instanceof HTMLImageElement ? (u.width = e.naturalWidth || e.width, u.height = e.naturalHeight || e.height) : typeof VideoFrame < "u" && e instanceof VideoFrame ? (u.width = e.displayWidth, u.height = e.displayHeight) : (u.width = e.width, u.height = e.height), u;
4240
4240
  }
4241
- this.allocateTextureUnit = F, this.resetTextureUnits = ne, this.setTexture2D = re, this.setTexture2DArray = z, this.setTexture3D = ie, this.setTextureCube = ae, this.rebindTextures = _e, this.setupRenderTarget = ve, this.updateRenderTargetMipmap = be, this.updateMultisampleRenderTarget = Se, this.setupDepthRenderbuffer = ge, this.setupFrameBufferTexture = me, this.useMultisampledRTT = we, this.isReversedDepthBuffer = function() {
4241
+ this.allocateTextureUnit = F, this.resetTextureUnits = P, this.setTexture2D = re, this.setTexture2DArray = z, this.setTexture3D = ie, this.setTextureCube = ae, this.rebindTextures = _e, this.setupRenderTarget = ve, this.updateRenderTargetMipmap = be, this.updateMultisampleRenderTarget = Se, this.setupDepthRenderbuffer = ge, this.setupFrameBufferTexture = me, this.useMultisampledRTT = we, this.isReversedDepthBuffer = function() {
4242
4242
  return n.buffers.depth.getReversed();
4243
4243
  };
4244
4244
  }
@@ -4358,25 +4358,25 @@ var Pr = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Fr = "
4358
4358
  }, Lr = class extends H {
4359
4359
  constructor(e, t) {
4360
4360
  super();
4361
- let n = this, i = null, a = 1, o = null, l = "local-floor", u = 1, d = null, f = null, p = null, m = null, _ = null, v = null, y = typeof XRWebGLBinding < "u", b = new Ir(), x = {}, S = t.getContextAttributes(), C = null, w = null, T = [], D = [], O = new L(), A = null, N = new c();
4362
- N.viewport = new E();
4363
- let ee = new c();
4361
+ let n = this, i = null, a = 1, o = null, l = "local-floor", u = 1, d = null, p = null, m = null, _ = null, v = null, y = null, b = typeof XRWebGLBinding < "u", x = new Ir(), S = {}, C = t.getContextAttributes(), w = null, T = null, D = [], O = [], A = new L(), j = null, ee = new c();
4364
4362
  ee.viewport = new E();
4365
- let te = [N, ee], P = new ne(), F = null, I = null;
4363
+ let te = new c();
4364
+ te.viewport = new E();
4365
+ let ne = [ee, te], N = new P(), F = null, I = null;
4366
4366
  this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {
4367
- let t = T[e];
4368
- return t === void 0 && (t = new s(), T[e] = t), t.getTargetRaySpace();
4367
+ let t = D[e];
4368
+ return t === void 0 && (t = new s(), D[e] = t), t.getTargetRaySpace();
4369
4369
  }, this.getControllerGrip = function(e) {
4370
- let t = T[e];
4371
- return t === void 0 && (t = new s(), T[e] = t), t.getGripSpace();
4370
+ let t = D[e];
4371
+ return t === void 0 && (t = new s(), D[e] = t), t.getGripSpace();
4372
4372
  }, this.getHand = function(e) {
4373
- let t = T[e];
4374
- return t === void 0 && (t = new s(), T[e] = t), t.getHandSpace();
4373
+ let t = D[e];
4374
+ return t === void 0 && (t = new s(), D[e] = t), t.getHandSpace();
4375
4375
  };
4376
4376
  function R(e) {
4377
- let t = D.indexOf(e.inputSource);
4377
+ let t = O.indexOf(e.inputSource);
4378
4378
  if (t === -1) return;
4379
- let n = T[t];
4379
+ let n = D[t];
4380
4380
  n !== void 0 && (n.update(e.inputSource, e.frame, d || o), n.dispatchEvent({
4381
4381
  type: e.type,
4382
4382
  data: e.inputSource
@@ -4384,92 +4384,92 @@ var Pr = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Fr = "
4384
4384
  }
4385
4385
  function re() {
4386
4386
  i.removeEventListener("select", R), i.removeEventListener("selectstart", R), i.removeEventListener("selectend", R), i.removeEventListener("squeeze", R), i.removeEventListener("squeezestart", R), i.removeEventListener("squeezeend", R), i.removeEventListener("end", re), i.removeEventListener("inputsourceschange", z);
4387
- for (let e = 0; e < T.length; e++) {
4388
- let t = D[e];
4389
- t !== null && (D[e] = null, T[e].disconnect(t));
4387
+ for (let e = 0; e < D.length; e++) {
4388
+ let t = O[e];
4389
+ t !== null && (O[e] = null, D[e].disconnect(t));
4390
4390
  }
4391
- F = null, I = null, b.reset();
4392
- for (let e in x) delete x[e];
4393
- e.setRenderTarget(C), _ = null, m = null, p = null, i = null, w = null, de.stop(), n.isPresenting = !1, e.setPixelRatio(A), e.setSize(O.width, O.height, !1), n.dispatchEvent({ type: "sessionend" });
4391
+ F = null, I = null, x.reset();
4392
+ for (let e in S) delete S[e];
4393
+ e.setRenderTarget(w), v = null, _ = null, m = null, i = null, T = null, de.stop(), n.isPresenting = !1, e.setPixelRatio(j), e.setSize(A.width, A.height, !1), n.dispatchEvent({ type: "sessionend" });
4394
4394
  }
4395
4395
  this.setFramebufferScaleFactor = function(e) {
4396
- a = e, n.isPresenting === !0 && j("WebXRManager: Cannot change framebuffer scale while presenting.");
4396
+ a = e, n.isPresenting === !0 && f("WebXRManager: Cannot change framebuffer scale while presenting.");
4397
4397
  }, this.setReferenceSpaceType = function(e) {
4398
- l = e, n.isPresenting === !0 && j("WebXRManager: Cannot change reference space type while presenting.");
4398
+ l = e, n.isPresenting === !0 && f("WebXRManager: Cannot change reference space type while presenting.");
4399
4399
  }, this.getReferenceSpace = function() {
4400
4400
  return d || o;
4401
4401
  }, this.setReferenceSpace = function(e) {
4402
4402
  d = e;
4403
4403
  }, this.getBaseLayer = function() {
4404
- return m === null ? _ : m;
4404
+ return _ === null ? v : _;
4405
4405
  }, this.getBinding = function() {
4406
- return p === null && y && (p = new XRWebGLBinding(i, t)), p;
4406
+ return m === null && b && (m = new XRWebGLBinding(i, t)), m;
4407
4407
  }, this.getFrame = function() {
4408
- return v;
4408
+ return y;
4409
4409
  }, this.getSession = function() {
4410
4410
  return i;
4411
4411
  }, this.setSession = async function(r) {
4412
4412
  if (i = r, i !== null) {
4413
- if (C = e.getRenderTarget(), i.addEventListener("select", R), i.addEventListener("selectstart", R), i.addEventListener("selectend", R), i.addEventListener("squeeze", R), i.addEventListener("squeezestart", R), i.addEventListener("squeezeend", R), i.addEventListener("end", re), i.addEventListener("inputsourceschange", z), S.xrCompatible !== !0 && await t.makeXRCompatible(), A = e.getPixelRatio(), e.getSize(O), y && "createProjectionLayer" in XRWebGLBinding.prototype) {
4413
+ if (w = e.getRenderTarget(), i.addEventListener("select", R), i.addEventListener("selectstart", R), i.addEventListener("selectend", R), i.addEventListener("squeeze", R), i.addEventListener("squeezestart", R), i.addEventListener("squeezeend", R), i.addEventListener("end", re), i.addEventListener("inputsourceschange", z), C.xrCompatible !== !0 && await t.makeXRCompatible(), j = e.getPixelRatio(), e.getSize(A), b && "createProjectionLayer" in XRWebGLBinding.prototype) {
4414
4414
  let n = null, r = null, o = null;
4415
- S.depth && (o = S.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = S.stencil ? ye : g, r = S.stencil ? me : oe);
4415
+ C.depth && (o = C.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = C.stencil ? ye : g, r = C.stencil ? me : oe);
4416
4416
  let s = {
4417
4417
  colorFormat: t.RGBA8,
4418
4418
  depthFormat: o,
4419
4419
  scaleFactor: a
4420
4420
  };
4421
- p = this.getBinding(), m = p.createProjectionLayer(s), i.updateRenderState({ layers: [m] }), e.setPixelRatio(1), e.setSize(m.textureWidth, m.textureHeight, !1), w = new k(m.textureWidth, m.textureHeight, {
4421
+ m = this.getBinding(), _ = m.createProjectionLayer(s), i.updateRenderState({ layers: [_] }), e.setPixelRatio(1), e.setSize(_.textureWidth, _.textureHeight, !1), T = new k(_.textureWidth, _.textureHeight, {
4422
4422
  format: M,
4423
4423
  type: ae,
4424
- depthTexture: new h(m.textureWidth, m.textureHeight, r, void 0, void 0, void 0, void 0, void 0, void 0, n),
4425
- stencilBuffer: S.stencil,
4424
+ depthTexture: new h(_.textureWidth, _.textureHeight, r, void 0, void 0, void 0, void 0, void 0, void 0, n),
4425
+ stencilBuffer: C.stencil,
4426
4426
  colorSpace: e.outputColorSpace,
4427
- samples: S.antialias ? 4 : 0,
4428
- resolveDepthBuffer: m.ignoreDepthValues === !1,
4429
- resolveStencilBuffer: m.ignoreDepthValues === !1
4427
+ samples: C.antialias ? 4 : 0,
4428
+ resolveDepthBuffer: _.ignoreDepthValues === !1,
4429
+ resolveStencilBuffer: _.ignoreDepthValues === !1
4430
4430
  });
4431
4431
  } else {
4432
4432
  let n = {
4433
- antialias: S.antialias,
4433
+ antialias: C.antialias,
4434
4434
  alpha: !0,
4435
- depth: S.depth,
4436
- stencil: S.stencil,
4435
+ depth: C.depth,
4436
+ stencil: C.stencil,
4437
4437
  framebufferScaleFactor: a
4438
4438
  };
4439
- _ = new XRWebGLLayer(i, t, n), i.updateRenderState({ baseLayer: _ }), e.setPixelRatio(1), e.setSize(_.framebufferWidth, _.framebufferHeight, !1), w = new k(_.framebufferWidth, _.framebufferHeight, {
4439
+ v = new XRWebGLLayer(i, t, n), i.updateRenderState({ baseLayer: v }), e.setPixelRatio(1), e.setSize(v.framebufferWidth, v.framebufferHeight, !1), T = new k(v.framebufferWidth, v.framebufferHeight, {
4440
4440
  format: M,
4441
4441
  type: ae,
4442
4442
  colorSpace: e.outputColorSpace,
4443
- stencilBuffer: S.stencil,
4444
- resolveDepthBuffer: _.ignoreDepthValues === !1,
4445
- resolveStencilBuffer: _.ignoreDepthValues === !1
4443
+ stencilBuffer: C.stencil,
4444
+ resolveDepthBuffer: v.ignoreDepthValues === !1,
4445
+ resolveStencilBuffer: v.ignoreDepthValues === !1
4446
4446
  });
4447
4447
  }
4448
- w.isXRRenderTarget = !0, this.setFoveation(u), d = null, o = await i.requestReferenceSpace(l), de.setContext(i), de.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
4448
+ T.isXRRenderTarget = !0, this.setFoveation(u), d = null, o = await i.requestReferenceSpace(l), de.setContext(i), de.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
4449
4449
  }
4450
4450
  }, this.getEnvironmentBlendMode = function() {
4451
4451
  if (i !== null) return i.environmentBlendMode;
4452
4452
  }, this.getDepthTexture = function() {
4453
- return b.getDepthTexture();
4453
+ return x.getDepthTexture();
4454
4454
  };
4455
4455
  function z(e) {
4456
4456
  for (let t = 0; t < e.removed.length; t++) {
4457
- let n = e.removed[t], r = D.indexOf(n);
4458
- r >= 0 && (D[r] = null, T[r].disconnect(n));
4457
+ let n = e.removed[t], r = O.indexOf(n);
4458
+ r >= 0 && (O[r] = null, D[r].disconnect(n));
4459
4459
  }
4460
4460
  for (let t = 0; t < e.added.length; t++) {
4461
- let n = e.added[t], r = D.indexOf(n);
4461
+ let n = e.added[t], r = O.indexOf(n);
4462
4462
  if (r === -1) {
4463
- for (let e = 0; e < T.length; e++) if (e >= D.length) {
4464
- D.push(n), r = e;
4463
+ for (let e = 0; e < D.length; e++) if (e >= O.length) {
4464
+ O.push(n), r = e;
4465
4465
  break;
4466
- } else if (D[e] === null) {
4467
- D[e] = n, r = e;
4466
+ } else if (O[e] === null) {
4467
+ O[e] = n, r = e;
4468
4468
  break;
4469
4469
  }
4470
4470
  if (r === -1) break;
4471
4471
  }
4472
- let i = T[r];
4472
+ let i = D[r];
4473
4473
  i && i.connect(n);
4474
4474
  }
4475
4475
  }
@@ -4489,75 +4489,75 @@ var Pr = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Fr = "
4489
4489
  this.updateCamera = function(e) {
4490
4490
  if (i === null) return;
4491
4491
  let t = e.near, n = e.far;
4492
- b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), P.near = ee.near = N.near = t, P.far = ee.far = N.far = n, (F !== P.near || I !== P.far) && (i.updateRenderState({
4493
- depthNear: P.near,
4494
- depthFar: P.far
4495
- }), F = P.near, I = P.far), P.layers.mask = e.layers.mask | 6, N.layers.mask = P.layers.mask & -5, ee.layers.mask = P.layers.mask & -3;
4496
- let r = e.parent, a = P.cameras;
4497
- se(P, r);
4492
+ x.texture !== null && (x.depthNear > 0 && (t = x.depthNear), x.depthFar > 0 && (n = x.depthFar)), N.near = te.near = ee.near = t, N.far = te.far = ee.far = n, (F !== N.near || I !== N.far) && (i.updateRenderState({
4493
+ depthNear: N.near,
4494
+ depthFar: N.far
4495
+ }), F = N.near, I = N.far), N.layers.mask = e.layers.mask | 6, ee.layers.mask = N.layers.mask & -5, te.layers.mask = N.layers.mask & -3;
4496
+ let r = e.parent, a = N.cameras;
4497
+ se(N, r);
4498
4498
  for (let e = 0; e < a.length; e++) se(a[e], r);
4499
- a.length === 2 ? V(P, N, ee) : P.projectionMatrix.copy(N.projectionMatrix), ce(e, P, r);
4499
+ a.length === 2 ? V(N, ee, te) : N.projectionMatrix.copy(ee.projectionMatrix), ce(e, N, r);
4500
4500
  };
4501
4501
  function ce(e, t, n) {
4502
4502
  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 = r * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);
4503
4503
  }
4504
4504
  this.getCamera = function() {
4505
- return P;
4505
+ return N;
4506
4506
  }, this.getFoveation = function() {
4507
- if (!(m === null && _ === null)) return u;
4507
+ if (!(_ === null && v === null)) return u;
4508
4508
  }, this.setFoveation = function(e) {
4509
- u = e, m !== null && (m.fixedFoveation = e), _ !== null && _.fixedFoveation !== void 0 && (_.fixedFoveation = e);
4509
+ u = e, _ !== null && (_.fixedFoveation = e), v !== null && v.fixedFoveation !== void 0 && (v.fixedFoveation = e);
4510
4510
  }, this.hasDepthSensing = function() {
4511
- return b.texture !== null;
4511
+ return x.texture !== null;
4512
4512
  }, this.getDepthSensingMesh = function() {
4513
- return b.getMesh(P);
4513
+ return x.getMesh(N);
4514
4514
  }, this.getCameraTexture = function(e) {
4515
- return x[e];
4515
+ return S[e];
4516
4516
  };
4517
4517
  let le = null;
4518
4518
  function ue(t, r) {
4519
- if (f = r.getViewerPose(d || o), v = r, f !== null) {
4520
- let t = f.views;
4521
- _ !== null && (e.setRenderTargetFramebuffer(w, _.framebuffer), e.setRenderTarget(w));
4519
+ if (p = r.getViewerPose(d || o), y = r, p !== null) {
4520
+ let t = p.views;
4521
+ v !== null && (e.setRenderTargetFramebuffer(T, v.framebuffer), e.setRenderTarget(T));
4522
4522
  let r = !1;
4523
- t.length !== P.cameras.length && (P.cameras.length = 0, r = !0);
4523
+ t.length !== N.cameras.length && (N.cameras.length = 0, r = !0);
4524
4524
  for (let n = 0; n < t.length; n++) {
4525
4525
  let i = t[n], a = null;
4526
- if (_ !== null) a = _.getViewport(i);
4526
+ if (v !== null) a = v.getViewport(i);
4527
4527
  else {
4528
- let t = p.getViewSubImage(m, i);
4529
- a = t.viewport, n === 0 && (e.setRenderTargetTextures(w, t.colorTexture, t.depthStencilTexture), e.setRenderTarget(w));
4528
+ let t = m.getViewSubImage(_, i);
4529
+ a = t.viewport, n === 0 && (e.setRenderTargetTextures(T, t.colorTexture, t.depthStencilTexture), e.setRenderTarget(T));
4530
4530
  }
4531
- let o = te[n];
4532
- o === void 0 && (o = new c(), o.layers.enable(n), o.viewport = new E(), te[n] = o), o.matrix.fromArray(i.transform.matrix), o.matrix.decompose(o.position, o.quaternion, o.scale), o.projectionMatrix.fromArray(i.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)), r === !0 && P.cameras.push(o);
4531
+ let o = ne[n];
4532
+ o === void 0 && (o = new c(), o.layers.enable(n), o.viewport = new E(), ne[n] = o), o.matrix.fromArray(i.transform.matrix), o.matrix.decompose(o.position, o.quaternion, o.scale), o.projectionMatrix.fromArray(i.projectionMatrix), o.projectionMatrixInverse.copy(o.projectionMatrix).invert(), o.viewport.set(a.x, a.y, a.width, a.height), n === 0 && (N.matrix.copy(o.matrix), N.matrix.decompose(N.position, N.quaternion, N.scale)), r === !0 && N.cameras.push(o);
4533
4533
  }
4534
4534
  let a = i.enabledFeatures;
4535
- if (a && a.includes("depth-sensing") && i.depthUsage == "gpu-optimized" && y) {
4536
- p = n.getBinding();
4537
- let e = p.getDepthInformation(t[0]);
4538
- e && e.isValid && e.texture && b.init(e, i.renderState);
4535
+ if (a && a.includes("depth-sensing") && i.depthUsage == "gpu-optimized" && b) {
4536
+ m = n.getBinding();
4537
+ let e = m.getDepthInformation(t[0]);
4538
+ e && e.isValid && e.texture && x.init(e, i.renderState);
4539
4539
  }
4540
- if (a && a.includes("camera-access") && y) {
4541
- e.state.unbindTexture(), p = n.getBinding();
4540
+ if (a && a.includes("camera-access") && b) {
4541
+ e.state.unbindTexture(), m = n.getBinding();
4542
4542
  for (let e = 0; e < t.length; e++) {
4543
4543
  let n = t[e].camera;
4544
4544
  if (n) {
4545
- let e = x[n];
4546
- e || (e = new be(), x[n] = e);
4547
- let t = p.getCameraImage(n);
4545
+ let e = S[n];
4546
+ e || (e = new be(), S[n] = e);
4547
+ let t = m.getCameraImage(n);
4548
4548
  e.sourceTexture = t;
4549
4549
  }
4550
4550
  }
4551
4551
  }
4552
4552
  }
4553
- for (let e = 0; e < T.length; e++) {
4554
- let t = D[e], n = T[e];
4553
+ for (let e = 0; e < D.length; e++) {
4554
+ let t = O[e], n = D[e];
4555
4555
  t !== null && n !== void 0 && n.update(t, r, d || o);
4556
4556
  }
4557
4557
  le && le(t, r), r.detectedPlanes && n.dispatchEvent({
4558
4558
  type: "planesdetected",
4559
4559
  data: r
4560
- }), v = null;
4560
+ }), y = null;
4561
4561
  }
4562
4562
  let de = new Ie();
4563
4563
  de.setAnimationLoop(ue), this.setAnimationLoop = function(e) {
@@ -4624,11 +4624,11 @@ function Vr(e, t, n, r) {
4624
4624
  }
4625
4625
  function l(e, n) {
4626
4626
  let o = i[e.id];
4627
- o === void 0 && (m(e), o = u(e), i[e.id] = o, e.addEventListener("dispose", g));
4627
+ o === void 0 && (h(e), o = u(e), i[e.id] = o, e.addEventListener("dispose", _));
4628
4628
  let s = n.program;
4629
4629
  r.updateUBOMapping(e, s);
4630
4630
  let c = t.render.frame;
4631
- a[e.id] !== c && (f(e), a[e.id] = c);
4631
+ a[e.id] !== c && (p(e), a[e.id] = c);
4632
4632
  }
4633
4633
  function u(t) {
4634
4634
  let n = d();
@@ -4640,17 +4640,17 @@ function Vr(e, t, n, r) {
4640
4640
  for (let e = 0; e < s; e++) if (o.indexOf(e) === -1) return o.push(e), e;
4641
4641
  return S("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."), 0;
4642
4642
  }
4643
- function f(t) {
4643
+ function p(t) {
4644
4644
  let n = i[t.id], r = t.uniforms, a = t.__cache;
4645
4645
  e.bindBuffer(e.UNIFORM_BUFFER, n);
4646
4646
  for (let t = 0, n = r.length; t < n; t++) {
4647
4647
  let n = Array.isArray(r[t]) ? r[t] : [r[t]];
4648
4648
  for (let r = 0, i = n.length; r < i; r++) {
4649
4649
  let i = n[r];
4650
- if (p(i, t, r, a) === !0) {
4650
+ if (m(i, t, r, a) === !0) {
4651
4651
  let t = i.__offset, n = Array.isArray(i.value) ? i.value : [i.value], r = 0;
4652
4652
  for (let a = 0; a < n.length; a++) {
4653
- let o = n[a], s = h(o);
4653
+ let o = n[a], s = g(o);
4654
4654
  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) : (o.toArray(i.__data, r), r += s.storage / Float32Array.BYTES_PER_ELEMENT);
4655
4655
  }
4656
4656
  e.bufferSubData(e.UNIFORM_BUFFER, t, i.__data);
@@ -4659,7 +4659,7 @@ function Vr(e, t, n, r) {
4659
4659
  }
4660
4660
  e.bindBuffer(e.UNIFORM_BUFFER, null);
4661
4661
  }
4662
- function p(e, t, n, r) {
4662
+ function m(e, t, n, r) {
4663
4663
  let i = e.value, a = t + "_" + n;
4664
4664
  if (r[a] === void 0) return typeof i == "number" || typeof i == "boolean" ? r[a] = i : r[a] = i.clone(), !0;
4665
4665
  {
@@ -4670,14 +4670,14 @@ function Vr(e, t, n, r) {
4670
4670
  }
4671
4671
  return !1;
4672
4672
  }
4673
- function m(e) {
4673
+ function h(e) {
4674
4674
  let t = e.uniforms, n = 0;
4675
4675
  for (let e = 0, r = t.length; e < r; e++) {
4676
4676
  let r = Array.isArray(t[e]) ? t[e] : [t[e]];
4677
4677
  for (let e = 0, t = r.length; e < t; e++) {
4678
4678
  let t = r[e], i = Array.isArray(t.value) ? t.value : [t.value];
4679
4679
  for (let e = 0, r = i.length; e < r; e++) {
4680
- let r = i[e], a = h(r), o = n % 16, s = o % a.boundary, c = o + s;
4680
+ let r = i[e], a = g(r), o = n % 16, s = o % a.boundary, c = o + s;
4681
4681
  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;
4682
4682
  }
4683
4683
  }
@@ -4685,27 +4685,27 @@ function Vr(e, t, n, r) {
4685
4685
  let r = n % 16;
4686
4686
  return r > 0 && (n += 16 - r), e.__size = n, e.__cache = {}, this;
4687
4687
  }
4688
- function h(e) {
4688
+ function g(e) {
4689
4689
  let t = {
4690
4690
  boundary: 0,
4691
4691
  storage: 0
4692
4692
  };
4693
- 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 ? j("WebGLRenderer: Texture samplers can not be part of an uniforms group.") : j("WebGLRenderer: Unsupported uniform value type.", e), t;
4693
+ 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 ? f("WebGLRenderer: Texture samplers can not be part of an uniforms group.") : f("WebGLRenderer: Unsupported uniform value type.", e), t;
4694
4694
  }
4695
- function g(t) {
4695
+ function _(t) {
4696
4696
  let n = t.target;
4697
- n.removeEventListener("dispose", g);
4697
+ n.removeEventListener("dispose", _);
4698
4698
  let r = o.indexOf(n.__bindingPointIndex);
4699
4699
  o.splice(r, 1), e.deleteBuffer(i[n.id]), delete i[n.id], delete a[n.id];
4700
4700
  }
4701
- function _() {
4701
+ function v() {
4702
4702
  for (let t in i) e.deleteBuffer(i[t]);
4703
4703
  o = [], i = {}, a = {};
4704
4704
  }
4705
4705
  return {
4706
4706
  bind: c,
4707
4707
  update: l,
4708
- dispose: _
4708
+ dispose: v
4709
4709
  };
4710
4710
  }
4711
4711
  var Hr = new Uint16Array([
@@ -5243,9 +5243,9 @@ var Gr = class {
5243
5243
  oe,
5244
5244
  Me,
5245
5245
  me,
5246
- P,
5246
+ N,
5247
5247
  Ee
5248
- ]), w = new Uint32Array(4), D = new Int32Array(4), A = null, M = null, N = [], ne = [], F = null;
5248
+ ]), w = new Uint32Array(4), D = new Int32Array(4), A = null, M = null, ee = [], P = [], F = null;
5249
5249
  this.domElement = t, this.debug = {
5250
5250
  checkShaderErrors: !0,
5251
5251
  onShaderError: null
@@ -5308,7 +5308,7 @@ var Gr = class {
5308
5308
  return e.set(fe, pe);
5309
5309
  }, this.setSize = function(e, n, r = !0) {
5310
5310
  if (Z.isPresenting) {
5311
- j("WebGLRenderer: Can't change size while VR device is presenting.");
5311
+ f("WebGLRenderer: Can't change size while VR device is presenting.");
5312
5312
  return;
5313
5313
  }
5314
5314
  fe = e, pe = n, t.width = Math.floor(e * H), t.height = Math.floor(n * H), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), F !== null && F.setSize(t.width, t.height), this.setViewport(0, 0, e, n);
@@ -5410,34 +5410,34 @@ var Gr = class {
5410
5410
  if (c = Ke.getWireframeAttribute(n), c === void 0) return;
5411
5411
  l = 2;
5412
5412
  }
5413
- let u = n.drawRange, d = n.attributes.position, p = u.start * l, m = (u.start + u.count) * l;
5414
- a !== null && (p = Math.max(p, a.start * l), m = Math.min(m, (a.start + a.count) * l)), c === null ? d != null && (p = Math.max(p, 0), m = Math.min(m, d.count)) : (p = Math.max(p, 0), m = Math.min(m, c.count));
5415
- let h = m - p;
5416
- if (h < 0 || h === Infinity) return;
5413
+ let u = n.drawRange, d = n.attributes.position, f = u.start * l, p = (u.start + u.count) * l;
5414
+ a !== null && (f = Math.max(f, a.start * l), p = Math.min(p, (a.start + a.count) * l)), c === null ? d != null && (f = Math.max(f, 0), p = Math.min(p, d.count)) : (f = Math.max(f, 0), p = Math.min(p, c.count));
5415
+ let m = p - f;
5416
+ if (m < 0 || m === Infinity) return;
5417
5417
  at.setup(i, r, s, n, c);
5418
- let g, _ = nt;
5419
- if (c !== null && (g = Ge.get(c), _ = rt, _.setIndex(g)), i.isMesh) r.wireframe === !0 ? (J.setLineWidth(r.wireframeLinewidth * Ne()), _.setMode(G.LINES)) : _.setMode(G.TRIANGLES);
5418
+ let h, g = nt;
5419
+ if (c !== null && (h = Ge.get(c), g = rt, g.setIndex(h)), i.isMesh) r.wireframe === !0 ? (J.setLineWidth(r.wireframeLinewidth * Ne()), g.setMode(G.LINES)) : g.setMode(G.TRIANGLES);
5420
5420
  else if (i.isLine) {
5421
5421
  let e = r.linewidth;
5422
- e === void 0 && (e = 1), J.setLineWidth(e * Ne()), i.isLineSegments ? _.setMode(G.LINES) : i.isLineLoop ? _.setMode(G.LINE_LOOP) : _.setMode(G.LINE_STRIP);
5423
- } else i.isPoints ? _.setMode(G.POINTS) : i.isSprite && _.setMode(G.TRIANGLES);
5424
- if (i.isBatchedMesh) if (i._multiDrawInstances !== null) f("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), _.renderMultiDrawInstances(i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount, i._multiDrawInstances);
5425
- else if (K.get("WEBGL_multi_draw")) _.renderMultiDraw(i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount);
5422
+ e === void 0 && (e = 1), J.setLineWidth(e * Ne()), i.isLineSegments ? g.setMode(G.LINES) : i.isLineLoop ? g.setMode(G.LINE_LOOP) : g.setMode(G.LINE_STRIP);
5423
+ } else i.isPoints ? g.setMode(G.POINTS) : i.isSprite && g.setMode(G.TRIANGLES);
5424
+ if (i.isBatchedMesh) if (i._multiDrawInstances !== null) j("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), g.renderMultiDrawInstances(i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount, i._multiDrawInstances);
5425
+ else if (K.get("WEBGL_multi_draw")) g.renderMultiDraw(i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount);
5426
5426
  else {
5427
5427
  let e = i._multiDrawStarts, t = i._multiDrawCounts, n = i._multiDrawCount, a = c ? Ge.get(c).bytesPerElement : 1, o = Y.get(r).currentProgram.getUniforms();
5428
- for (let r = 0; r < n; r++) o.setValue(G, "_gl_DrawID", r), _.render(e[r] / a, t[r]);
5428
+ for (let r = 0; r < n; r++) o.setValue(G, "_gl_DrawID", r), g.render(e[r] / a, t[r]);
5429
5429
  }
5430
- else if (i.isInstancedMesh) _.renderInstances(p, h, i.count);
5430
+ else if (i.isInstancedMesh) g.renderInstances(f, m, i.count);
5431
5431
  else if (n.isInstancedBufferGeometry) {
5432
5432
  let e = n._maxInstanceCount === void 0 ? Infinity : n._maxInstanceCount, t = Math.min(n.instanceCount, e);
5433
- _.renderInstances(p, h, t);
5434
- } else _.render(p, h);
5433
+ g.renderInstances(f, m, t);
5434
+ } else g.render(f, m);
5435
5435
  };
5436
5436
  function St(e, t, n) {
5437
5437
  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);
5438
5438
  }
5439
5439
  this.compile = function(e, t, n = null) {
5440
- n === null && (n = e), M = Ze.get(n), M.init(t), ne.push(M), n.traverseVisible(function(e) {
5440
+ n === null && (n = e), M = Ze.get(n), M.init(t), P.push(M), n.traverseVisible(function(e) {
5441
5441
  e.isLight && e.layers.test(t.layers) && (M.pushLight(e), e.castShadow && M.pushShadow(e));
5442
5442
  }), e !== n && e.traverseVisible(function(e) {
5443
5443
  e.isLight && e.layers.test(t.layers) && (M.pushLight(e), e.castShadow && M.pushShadow(e));
@@ -5451,7 +5451,7 @@ var Gr = class {
5451
5451
  St(a, n, e), r.add(a);
5452
5452
  }
5453
5453
  else St(t, n, e), r.add(t);
5454
- }), M = ne.pop(), r;
5454
+ }), M = P.pop(), r;
5455
5455
  }, this.compileAsync = function(e, t, n = null) {
5456
5456
  let r = this.compile(e, t, n);
5457
5457
  return new Promise((t) => {
@@ -5487,7 +5487,7 @@ var Gr = class {
5487
5487
  }
5488
5488
  if (L === !0) return;
5489
5489
  let n = Z.enabled === !0 && Z.isPresenting === !0, r = F !== null && (z === null || n) && F.begin(I, z);
5490
- if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Z.enabled === !0 && Z.isPresenting === !0 && (F === null || F.isCompositing() === !1) && (Z.cameraAutoUpdate === !0 && Z.updateCamera(t), t = Z.getCamera()), e.isScene === !0 && e.onBeforeRender(I, e, t, z), M = Ze.get(e, ne.length), M.init(t), ne.push(M), we.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), xe.setFromProjectionMatrix(we, Oe, t.reversedDepth), Ce = this.localClippingEnabled, Se = Qe.init(this.clippingPlanes, Ce), A = Xe.get(e, N.length), A.init(), N.push(A), Z.enabled === !0 && Z.isPresenting === !0) {
5490
+ if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Z.enabled === !0 && Z.isPresenting === !0 && (F === null || F.isCompositing() === !1) && (Z.cameraAutoUpdate === !0 && Z.updateCamera(t), t = Z.getCamera()), e.isScene === !0 && e.onBeforeRender(I, e, t, z), M = Ze.get(e, P.length), M.init(t), P.push(M), we.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), xe.setFromProjectionMatrix(we, Oe, t.reversedDepth), Ce = this.localClippingEnabled, Se = Qe.init(this.clippingPlanes, Ce), A = Xe.get(e, ee.length), A.init(), ee.push(A), Z.enabled === !0 && Z.isPresenting === !0) {
5491
5491
  let e = I.xr.getDepthSensingMesh();
5492
5492
  e !== null && Ot(e, t, -Infinity, I.sortObjects);
5493
5493
  }
@@ -5508,7 +5508,7 @@ var Gr = class {
5508
5508
  }
5509
5509
  } else r.length > 0 && Q(n, r, e, t), je && et.render(e), kt(A, e, t);
5510
5510
  }
5511
- z !== null && re === 0 && (X.updateMultisampleRenderTarget(z), X.updateRenderTargetMipmap(z)), r && F.end(I), e.isScene === !0 && e.onAfterRender(I, e, t), at.resetDefaultState(), ie = -1, B = null, ne.pop(), ne.length > 0 ? (M = ne[ne.length - 1], Se === !0 && Qe.setGlobalState(I.clippingPlanes, M.state.camera)) : M = null, N.pop(), A = N.length > 0 ? N[N.length - 1] : null;
5511
+ z !== null && re === 0 && (X.updateMultisampleRenderTarget(z), X.updateRenderTargetMipmap(z)), r && F.end(I), e.isScene === !0 && e.onAfterRender(I, e, t), at.resetDefaultState(), ie = -1, B = null, P.pop(), P.length > 0 ? (M = P[P.length - 1], Se === !0 && Qe.setGlobalState(I.clippingPlanes, M.state.camera)) : M = null, ee.pop(), A = ee.length > 0 ? ee[ee.length - 1] : null;
5512
5512
  };
5513
5513
  function Ot(e, t, n, r) {
5514
5514
  if (e.visible === !1) return;
@@ -5547,7 +5547,7 @@ var Gr = class {
5547
5547
  M.state.transmissionRenderTarget[r.id] = new k(1, 1, {
5548
5548
  generateMipmaps: !0,
5549
5549
  type: e ? he : ae,
5550
- minFilter: ee,
5550
+ minFilter: te,
5551
5551
  samples: q.samples,
5552
5552
  stencilBuffer: s,
5553
5553
  resolveDepthBuffer: !1,
@@ -5611,7 +5611,7 @@ var Gr = class {
5611
5611
  }
5612
5612
  function Pt(e, t, n, r, i) {
5613
5613
  t.isScene !== !0 && (t = Ae), X.resetTextureUnits();
5614
- let a = t.fog, o = r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial ? t.environment : null, s = z === null ? I.outputColorSpace : z.isXRRenderTarget === !0 ? z.texture.colorSpace : te, c = r.isMeshStandardMaterial || r.isMeshLambertMaterial && !r.envMap || r.isMeshPhongMaterial && !r.envMap, l = We.get(r.envMap || o, c), u = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, d = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), f = !!n.morphAttributes.position, p = !!n.morphAttributes.normal, m = !!n.morphAttributes.color, h = 0;
5614
+ let a = t.fog, o = r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial ? t.environment : null, s = z === null ? I.outputColorSpace : z.isXRRenderTarget === !0 ? z.texture.colorSpace : ne, c = r.isMeshStandardMaterial || r.isMeshLambertMaterial && !r.envMap || r.isMeshPhongMaterial && !r.envMap, l = We.get(r.envMap || o, c), u = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, d = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), f = !!n.morphAttributes.position, p = !!n.morphAttributes.normal, m = !!n.morphAttributes.color, h = 0;
5615
5615
  r.toneMapped && (z === null || z.isXRRenderTarget === !0) && (h = I.toneMapping);
5616
5616
  let g = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, _ = g === void 0 ? 0 : g.length, v = Y.get(r), y = M.state.lights;
5617
5617
  if (Se === !0 && (Ce === !0 || e !== B)) {
@@ -5792,4 +5792,4 @@ var Gr = class {
5792
5792
  //#endregion
5793
5793
  export { K as n, Gr as r, tt as t };
5794
5794
 
5795
- //# sourceMappingURL=three.module-Bmy3sVQ-.mjs.map
5795
+ //# sourceMappingURL=three.module-DkrZwaid.mjs.map