@micjanic/recursive-grid 1.0.2 → 1.0.4

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.
@@ -1,6 +1,6 @@
1
- import { S as U, E as d, B, w as m, D as S, L as K, v as Be, s as F, t as b, a5 as Ae, k as $, a6 as Ne, b as p, Q as H, j as A, i as N, l as O, M as z, a7 as Y, a8 as ye, a9 as Ce, aa as q, ab as De, A as Ie, R as Ge, e as v } from "./PixiApp-D4xu0PT4.js";
1
+ import { S as U, E as d, B, w as m, D as S, N as K, x as Be, s as F, t as b, a7 as Ae, k as $, a8 as Ne, b as p, V as H, j as A, i as N, l as O, M as z, a9 as Y, aa as ye, ab as Ce, ac as q, ad as Ie, A as De, R as Ge, e as T } from "./PixiApp-BHmY2ZMg.js";
2
2
  import { b as Z } from "./colorToUniform-C2jGzNe1.js";
3
- import { e as Ue, G as Fe, c as Oe, b as Pe, U as Me, R as Le, B as Q, d as y, f as He, S as we, a as Ve } from "./SharedSystems-CZFehVPl.js";
3
+ import { e as Ue, G as Fe, c as Oe, b as Pe, U as Me, R as Le, B as Q, d as y, f as He, S as we, a as Ve } from "./SharedSystems-D2AiAlOX.js";
4
4
  class J {
5
5
  constructor() {
6
6
  this._tempState = U.for2d(), this._didUploadHash = {};
@@ -362,38 +362,38 @@ P.defaultOptions = {
362
362
  multiView: !1
363
363
  };
364
364
  let Xe = P;
365
- var I = /* @__PURE__ */ ((t) => (t[t.RGBA = 6408] = "RGBA", t[t.RGB = 6407] = "RGB", t[t.RG = 33319] = "RG", t[t.RED = 6403] = "RED", t[t.RGBA_INTEGER = 36249] = "RGBA_INTEGER", t[t.RGB_INTEGER = 36248] = "RGB_INTEGER", t[t.RG_INTEGER = 33320] = "RG_INTEGER", t[t.RED_INTEGER = 36244] = "RED_INTEGER", t[t.ALPHA = 6406] = "ALPHA", t[t.LUMINANCE = 6409] = "LUMINANCE", t[t.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", t[t.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", t[t.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", t))(I || {}), re = /* @__PURE__ */ ((t) => (t[t.TEXTURE_2D = 3553] = "TEXTURE_2D", t[t.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", t[t.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", t[t.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", t[t.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", t[t.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", t[t.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", t))(re || {}), f = /* @__PURE__ */ ((t) => (t[t.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", t[t.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", t[t.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", t[t.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", t[t.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", t[t.UNSIGNED_INT = 5125] = "UNSIGNED_INT", t[t.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", t[t.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", t[t.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", t[t.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", t[t.BYTE = 5120] = "BYTE", t[t.SHORT = 5122] = "SHORT", t[t.INT = 5124] = "INT", t[t.FLOAT = 5126] = "FLOAT", t[t.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", t[t.HALF_FLOAT = 36193] = "HALF_FLOAT", t))(f || {});
365
+ var D = /* @__PURE__ */ ((t) => (t[t.RGBA = 6408] = "RGBA", t[t.RGB = 6407] = "RGB", t[t.RG = 33319] = "RG", t[t.RED = 6403] = "RED", t[t.RGBA_INTEGER = 36249] = "RGBA_INTEGER", t[t.RGB_INTEGER = 36248] = "RGB_INTEGER", t[t.RG_INTEGER = 33320] = "RG_INTEGER", t[t.RED_INTEGER = 36244] = "RED_INTEGER", t[t.ALPHA = 6406] = "ALPHA", t[t.LUMINANCE = 6409] = "LUMINANCE", t[t.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", t[t.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", t[t.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", t))(D || {}), re = /* @__PURE__ */ ((t) => (t[t.TEXTURE_2D = 3553] = "TEXTURE_2D", t[t.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", t[t.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", t[t.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", t[t.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", t[t.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", t[t.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", t))(re || {}), h = /* @__PURE__ */ ((t) => (t[t.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", t[t.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", t[t.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", t[t.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", t[t.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", t[t.UNSIGNED_INT = 5125] = "UNSIGNED_INT", t[t.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", t[t.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", t[t.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", t[t.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", t[t.BYTE = 5120] = "BYTE", t[t.SHORT = 5122] = "SHORT", t[t.INT = 5124] = "INT", t[t.FLOAT = 5126] = "FLOAT", t[t.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", t[t.HALF_FLOAT = 36193] = "HALF_FLOAT", t))(h || {});
366
366
  const w = {
367
- uint8x2: f.UNSIGNED_BYTE,
368
- uint8x4: f.UNSIGNED_BYTE,
369
- sint8x2: f.BYTE,
370
- sint8x4: f.BYTE,
371
- unorm8x2: f.UNSIGNED_BYTE,
372
- unorm8x4: f.UNSIGNED_BYTE,
373
- snorm8x2: f.BYTE,
374
- snorm8x4: f.BYTE,
375
- uint16x2: f.UNSIGNED_SHORT,
376
- uint16x4: f.UNSIGNED_SHORT,
377
- sint16x2: f.SHORT,
378
- sint16x4: f.SHORT,
379
- unorm16x2: f.UNSIGNED_SHORT,
380
- unorm16x4: f.UNSIGNED_SHORT,
381
- snorm16x2: f.SHORT,
382
- snorm16x4: f.SHORT,
383
- float16x2: f.HALF_FLOAT,
384
- float16x4: f.HALF_FLOAT,
385
- float32: f.FLOAT,
386
- float32x2: f.FLOAT,
387
- float32x3: f.FLOAT,
388
- float32x4: f.FLOAT,
389
- uint32: f.UNSIGNED_INT,
390
- uint32x2: f.UNSIGNED_INT,
391
- uint32x3: f.UNSIGNED_INT,
392
- uint32x4: f.UNSIGNED_INT,
393
- sint32: f.INT,
394
- sint32x2: f.INT,
395
- sint32x3: f.INT,
396
- sint32x4: f.INT
367
+ uint8x2: h.UNSIGNED_BYTE,
368
+ uint8x4: h.UNSIGNED_BYTE,
369
+ sint8x2: h.BYTE,
370
+ sint8x4: h.BYTE,
371
+ unorm8x2: h.UNSIGNED_BYTE,
372
+ unorm8x4: h.UNSIGNED_BYTE,
373
+ snorm8x2: h.BYTE,
374
+ snorm8x4: h.BYTE,
375
+ uint16x2: h.UNSIGNED_SHORT,
376
+ uint16x4: h.UNSIGNED_SHORT,
377
+ sint16x2: h.SHORT,
378
+ sint16x4: h.SHORT,
379
+ unorm16x2: h.UNSIGNED_SHORT,
380
+ unorm16x4: h.UNSIGNED_SHORT,
381
+ snorm16x2: h.SHORT,
382
+ snorm16x4: h.SHORT,
383
+ float16x2: h.HALF_FLOAT,
384
+ float16x4: h.HALF_FLOAT,
385
+ float32: h.FLOAT,
386
+ float32x2: h.FLOAT,
387
+ float32x3: h.FLOAT,
388
+ float32x4: h.FLOAT,
389
+ uint32: h.UNSIGNED_INT,
390
+ uint32x2: h.UNSIGNED_INT,
391
+ uint32x3: h.UNSIGNED_INT,
392
+ uint32x4: h.UNSIGNED_INT,
393
+ sint32: h.INT,
394
+ sint32x2: h.INT,
395
+ sint32x3: h.INT,
396
+ sint32x4: h.INT
397
397
  };
398
398
  function We(t) {
399
399
  return w[t] ?? w.float32;
@@ -495,8 +495,8 @@ class se {
495
495
  const u = e.buffers;
496
496
  c = n.createVertexArray(), n.bindVertexArray(c);
497
497
  for (let _ = 0; _ < u.length; _++) {
498
- const h = u[_];
499
- i.bind(h);
498
+ const f = u[_];
499
+ i.bind(f);
500
500
  }
501
501
  return this.activateVao(e, r), o[r._key] = c, o[a] = c, n.bindVertexArray(null), c;
502
502
  }
@@ -540,29 +540,29 @@ class se {
540
540
  e.indexBuffer && n.bind(e.indexBuffer);
541
541
  let a = null;
542
542
  for (const c in i) {
543
- const u = i[c], _ = u.buffer, h = n.getGlBuffer(_), l = r._attributeData[c];
543
+ const u = i[c], _ = u.buffer, f = n.getGlBuffer(_), l = r._attributeData[c];
544
544
  if (l) {
545
- a !== h && (n.bind(_), a = h);
545
+ a !== f && (n.bind(_), a = f);
546
546
  const E = l.location;
547
547
  s.enableVertexAttribArray(E);
548
- const T = K(u.format), L = We(u.format);
548
+ const v = K(u.format), L = We(u.format);
549
549
  if (((o = l.format) == null ? void 0 : o.substring(1, 4)) === "int" ? s.vertexAttribIPointer(
550
550
  E,
551
- T.size,
551
+ v.size,
552
552
  L,
553
553
  u.stride,
554
554
  u.offset
555
555
  ) : s.vertexAttribPointer(
556
556
  E,
557
- T.size,
557
+ v.size,
558
558
  L,
559
- T.normalised,
559
+ v.normalised,
560
560
  u.stride,
561
561
  u.offset
562
562
  ), u.instance)
563
563
  if (this.hasInstance) {
564
- const Te = u.divisor ?? 1;
565
- s.vertexAttribDivisor(E, Te);
564
+ const ve = u.divisor ?? 1;
565
+ s.vertexAttribDivisor(E, ve);
566
566
  } else
567
567
  throw new Error("geometry error, GPU Instancing is not supported on this device");
568
568
  }
@@ -583,8 +583,8 @@ class se {
583
583
  const { gl: i } = this._renderer, a = this._activeGeometry, o = je[e || a.topology];
584
584
  if (n ?? (n = a.instanceCount), a.indexBuffer) {
585
585
  const c = a.indexBuffer.data.BYTES_PER_ELEMENT, u = c === 2 ? i.UNSIGNED_SHORT : i.UNSIGNED_INT;
586
- n > 1 ? i.drawElementsInstanced(o, r || a.indexBuffer.data.length, u, (s || 0) * c, n) : i.drawElements(o, r || a.indexBuffer.data.length, u, (s || 0) * c);
587
- } else n > 1 ? i.drawArraysInstanced(o, s || 0, r || a.getSize(), n) : i.drawArrays(o, s || 0, r || a.getSize());
586
+ n !== 1 ? i.drawElementsInstanced(o, r || a.indexBuffer.data.length, u, (s || 0) * c, n) : i.drawElements(o, r || a.indexBuffer.data.length, u, (s || 0) * c);
587
+ } else n !== 1 ? i.drawArraysInstanced(o, s || 0, r || a.getSize(), n) : i.drawArrays(o, s || 0, r || a.getSize());
588
588
  return this;
589
589
  }
590
590
  /** Unbind/reset everything. */
@@ -592,7 +592,7 @@ class se {
592
592
  this.gl.bindVertexArray(null), this._activeVao = null, this._activeGeometry = null;
593
593
  }
594
594
  destroy() {
595
- this._renderer = null, this.gl = null, this._activeVao = null, this._activeGeometry = null;
595
+ this._renderer = null, this.gl = null, this._activeVao = null, this._activeGeometry = null, this._geometryVaoHash = null;
596
596
  }
597
597
  }
598
598
  se.extension = {
@@ -755,7 +755,9 @@ class oe {
755
755
  }
756
756
  contextChange() {
757
757
  const e = this._renderer.gl;
758
- this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), this.maxBatchableTextures = Ne(this.maxTextures, e), this.maxUniformBindings = e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);
758
+ this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), this.maxBatchableTextures = Ne(this.maxTextures, e);
759
+ const r = this._renderer.context.webGLVersion === 2;
760
+ this.maxUniformBindings = r ? e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS) : 0;
759
761
  }
760
762
  destroy() {
761
763
  }
@@ -942,8 +944,8 @@ class Qe {
942
944
  startRenderPass(e, r = !0, s, n) {
943
945
  const i = this._renderTargetSystem, a = e.colorTexture, o = i.getGpuRenderTarget(e);
944
946
  let c = n.y;
945
- e.isRoot && (c = a.pixelHeight - n.height), e.colorTextures.forEach((h) => {
946
- this._renderer.texture.unbind(h);
947
+ e.isRoot && (c = a.pixelHeight - n.height), e.colorTextures.forEach((f) => {
948
+ this._renderer.texture.unbind(f);
947
949
  });
948
950
  const u = this._renderer.gl;
949
951
  u.bindFramebuffer(u.FRAMEBUFFER, o.framebuffer);
@@ -1035,14 +1037,14 @@ class Qe {
1035
1037
  i.bindFramebuffer(i.FRAMEBUFFER, a), e.colorTextures.forEach((o, c) => {
1036
1038
  const u = o.source;
1037
1039
  n.texture.bindSource(u, 0);
1038
- const h = n.texture.getGlSource(u).internalFormat, l = r.msaaRenderBuffer[c];
1040
+ const f = n.texture.getGlSource(u).internalFormat, l = r.msaaRenderBuffer[c];
1039
1041
  i.bindRenderbuffer(
1040
1042
  i.RENDERBUFFER,
1041
1043
  l
1042
1044
  ), i.renderbufferStorageMultisample(
1043
1045
  i.RENDERBUFFER,
1044
1046
  4,
1045
- h,
1047
+ f,
1046
1048
  u.pixelWidth,
1047
1049
  u.pixelHeight
1048
1050
  ), i.framebufferRenderbuffer(
@@ -1101,12 +1103,12 @@ class Qe {
1101
1103
  }
1102
1104
  }
1103
1105
  }
1104
- class fe extends Le {
1106
+ class he extends Le {
1105
1107
  constructor(e) {
1106
1108
  super(e), this.adaptor = new Qe(), this.adaptor.init(e, this);
1107
1109
  }
1108
1110
  }
1109
- fe.extension = {
1111
+ he.extension = {
1110
1112
  type: [d.WebGLSystem],
1111
1113
  name: "renderTarget"
1112
1114
  };
@@ -1126,9 +1128,9 @@ function Je(t, e) {
1126
1128
  resources = g[${c}].resources;
1127
1129
  `);
1128
1130
  for (const _ in u.resources) {
1129
- const h = u.resources[_];
1130
- if (h instanceof O)
1131
- if (h.ubo) {
1131
+ const f = u.resources[_];
1132
+ if (f instanceof O)
1133
+ if (f.ubo) {
1132
1134
  const l = t._uniformBindMap[c][Number(_)];
1133
1135
  r.push(`
1134
1136
  sS.bindUniformBlock(
@@ -1141,7 +1143,7 @@ function Je(t, e) {
1141
1143
  r.push(`
1142
1144
  ugS.updateUniformGroup(resources[${_}], p, sD);
1143
1145
  `);
1144
- else if (h instanceof Q) {
1146
+ else if (f instanceof Q) {
1145
1147
  const l = t._uniformBindMap[c][Number(_)];
1146
1148
  r.push(`
1147
1149
  sS.bindUniformBlock(
@@ -1150,7 +1152,7 @@ function Je(t, e) {
1150
1152
  ${t.glProgram._uniformBlockData[l].index}
1151
1153
  );
1152
1154
  `);
1153
- } else if (h instanceof $) {
1155
+ } else if (f instanceof $) {
1154
1156
  const l = t._uniformBindMap[c][_], E = a.uniformData[l];
1155
1157
  E && (n || (n = !0, s.push(`
1156
1158
  var tS = r.texture;
@@ -1188,7 +1190,7 @@ function C(t) {
1188
1190
  e[r] = !1;
1189
1191
  return e;
1190
1192
  }
1191
- function he(t, e) {
1193
+ function fe(t, e) {
1192
1194
  switch (t) {
1193
1195
  case "float":
1194
1196
  return 0;
@@ -1379,7 +1381,7 @@ function it(t, e) {
1379
1381
  type: c,
1380
1382
  size: i.size,
1381
1383
  isArray: o,
1382
- value: he(c, i.size)
1384
+ value: fe(c, i.size)
1383
1385
  };
1384
1386
  }
1385
1387
  return r;
@@ -1416,7 +1418,7 @@ function ot(t, e) {
1416
1418
  const u = e._uniformData[c];
1417
1419
  a[c] = {
1418
1420
  location: t.getUniformLocation(n, c),
1419
- value: he(u.type, u.size)
1421
+ value: fe(u.type, u.size)
1420
1422
  };
1421
1423
  }
1422
1424
  return new et(n, a);
@@ -1463,8 +1465,8 @@ class de {
1463
1465
  a || this._renderer.ubo.updateUniformGroup(e);
1464
1466
  const o = e.buffer, c = n.updateBuffer(o), u = n.freeLocationForBufferBase(c);
1465
1467
  if (a) {
1466
- const { offset: h, size: l } = e;
1467
- h === 0 && l === o.data.byteLength ? n.bindBufferBase(c, u) : n.bindBufferRange(c, u, h);
1468
+ const { offset: f, size: l } = e;
1469
+ f === 0 && l === o.data.byteLength ? n.bindBufferBase(c, u) : n.bindBufferRange(c, u, f);
1468
1470
  } else n.getLastBindBaseLocation(c) !== u && n.bindBufferBase(c, u);
1469
1471
  const _ = this._activeProgram._uniformBlockData[r].index;
1470
1472
  i.uniformBlockBindings[s] !== u && (i.uniformBlockBindings[s] = u, this._renderer.gl.uniformBlockBinding(i.program, _, u));
@@ -1490,7 +1492,7 @@ class de {
1490
1492
  destroy() {
1491
1493
  for (const e of Object.keys(this._programDataHash))
1492
1494
  this._programDataHash[e].destroy(), this._programDataHash[e] = null;
1493
- this._programDataHash = null;
1495
+ this._programDataHash = null, this._shaderSyncFunctions = null, this._activeProgram = null, this._renderer = null, this._gl = null;
1494
1496
  }
1495
1497
  /**
1496
1498
  * Creates a function that can be executed that will sync the shader as efficiently as possible.
@@ -1727,7 +1729,7 @@ me.extension = {
1727
1729
  ],
1728
1730
  name: "uniformGroup"
1729
1731
  };
1730
- function ft(t) {
1732
+ function ht(t) {
1731
1733
  const e = {};
1732
1734
  if (e.normal = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.add = [t.ONE, t.ONE], e.multiply = [t.DST_COLOR, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA], e.screen = [t.ONE, t.ONE_MINUS_SRC_COLOR, t.ONE, t.ONE_MINUS_SRC_ALPHA], e.none = [0, 0], e["normal-npm"] = [t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA], e["add-npm"] = [t.SRC_ALPHA, t.ONE, t.ONE, t.ONE], e["screen-npm"] = [t.SRC_ALPHA, t.ONE_MINUS_SRC_COLOR, t.ONE, t.ONE_MINUS_SRC_ALPHA], e.erase = [t.ZERO, t.ONE_MINUS_SRC_ALPHA], !(t instanceof S.get().getWebGLRenderingContext()))
1733
1735
  e.min = [t.ONE, t.ONE, t.ONE, t.ONE, t.MIN, t.MIN], e.max = [t.ONE, t.ONE, t.ONE, t.ONE, t.MAX, t.MAX];
@@ -1737,15 +1739,15 @@ function ft(t) {
1737
1739
  }
1738
1740
  return e;
1739
1741
  }
1740
- const ht = 0, lt = 1, dt = 2, mt = 3, Et = 4, bt = 5, Ee = class G {
1742
+ const ft = 0, lt = 1, dt = 2, mt = 3, Et = 4, bt = 5, Ee = class G {
1741
1743
  constructor(e) {
1742
- this._invertFrontFace = !1, this.gl = null, this.stateId = 0, this.polygonOffset = 0, this.blendMode = "none", this._blendEq = !1, this.map = [], this.map[ht] = this.setBlend, this.map[lt] = this.setOffset, this.map[dt] = this.setCullFace, this.map[mt] = this.setDepthTest, this.map[Et] = this.setFrontFace, this.map[bt] = this.setDepthMask, this.checks = [], this.defaultState = U.for2d(), e.renderTarget.onRenderTargetChange.add(this);
1744
+ this._invertFrontFace = !1, this.gl = null, this.stateId = 0, this.polygonOffset = 0, this.blendMode = "none", this._blendEq = !1, this.map = [], this.map[ft] = this.setBlend, this.map[lt] = this.setOffset, this.map[dt] = this.setCullFace, this.map[mt] = this.setDepthTest, this.map[Et] = this.setFrontFace, this.map[bt] = this.setDepthMask, this.checks = [], this.defaultState = U.for2d(), e.renderTarget.onRenderTargetChange.add(this);
1743
1745
  }
1744
1746
  onRenderTargetChange(e) {
1745
1747
  this._invertFrontFace = !e.isRoot, this._cullFace ? this.setFrontFace(this._frontFace) : this._frontFaceDirty = !0;
1746
1748
  }
1747
1749
  contextChange(e) {
1748
- this.gl = e, this.blendModesMap = ft(e), this.resetState();
1750
+ this.gl = e, this.blendModesMap = ht(e), this.resetState();
1749
1751
  }
1750
1752
  /**
1751
1753
  * Sets the current state
@@ -1883,7 +1885,7 @@ Ee.extension = {
1883
1885
  let St = Ee;
1884
1886
  class pt {
1885
1887
  constructor(e) {
1886
- this.target = re.TEXTURE_2D, this.texture = e, this.width = -1, this.height = -1, this.type = f.UNSIGNED_BYTE, this.internalFormat = I.RGBA, this.format = I.RGBA, this.samplerType = 0;
1888
+ this.target = re.TEXTURE_2D, this.texture = e, this.width = -1, this.height = -1, this.type = h.UNSIGNED_BYTE, this.internalFormat = D.RGBA, this.format = D.RGBA, this.samplerType = 0;
1887
1889
  }
1888
1890
  }
1889
1891
  const gt = {
@@ -2056,7 +2058,7 @@ const gt = {
2056
2058
  t.resource
2057
2059
  ), e.width = a, e.height = o;
2058
2060
  }
2059
- }, vt = {
2061
+ }, Tt = {
2060
2062
  id: "video",
2061
2063
  upload(t, e, r, s) {
2062
2064
  if (!t.isValid) {
@@ -2078,7 +2080,7 @@ const gt = {
2078
2080
  }, W = {
2079
2081
  linear: 9729,
2080
2082
  nearest: 9728
2081
- }, Tt = {
2083
+ }, vt = {
2082
2084
  linear: {
2083
2085
  linear: 9987,
2084
2086
  nearest: 9985
@@ -2087,7 +2089,7 @@ const gt = {
2087
2089
  linear: 9986,
2088
2090
  nearest: 9984
2089
2091
  }
2090
- }, D = {
2092
+ }, I = {
2091
2093
  "clamp-to-edge": 33071,
2092
2094
  repeat: 10497,
2093
2095
  "mirror-repeat": 33648
@@ -2104,12 +2106,12 @@ const gt = {
2104
2106
  function j(t, e, r, s, n, i, a, o) {
2105
2107
  const c = i;
2106
2108
  if (!o || t.addressModeU !== "repeat" || t.addressModeV !== "repeat" || t.addressModeW !== "repeat") {
2107
- const u = D[a ? "clamp-to-edge" : t.addressModeU], _ = D[a ? "clamp-to-edge" : t.addressModeV], h = D[a ? "clamp-to-edge" : t.addressModeW];
2108
- e[n](c, e.TEXTURE_WRAP_S, u), e[n](c, e.TEXTURE_WRAP_T, _), e.TEXTURE_WRAP_R && e[n](c, e.TEXTURE_WRAP_R, h);
2109
+ const u = I[a ? "clamp-to-edge" : t.addressModeU], _ = I[a ? "clamp-to-edge" : t.addressModeV], f = I[a ? "clamp-to-edge" : t.addressModeW];
2110
+ e[n](c, e.TEXTURE_WRAP_S, u), e[n](c, e.TEXTURE_WRAP_T, _), e.TEXTURE_WRAP_R && e[n](c, e.TEXTURE_WRAP_R, f);
2109
2111
  }
2110
2112
  if ((!o || t.magFilter !== "linear") && e[n](c, e.TEXTURE_MAG_FILTER, W[t.magFilter]), r) {
2111
2113
  if (!o || t.mipmapFilter !== "linear") {
2112
- const u = Tt[t.minFilter][t.mipmapFilter];
2114
+ const u = vt[t.minFilter][t.mipmapFilter];
2113
2115
  e[n](c, e.TEXTURE_MIN_FILTER, u);
2114
2116
  }
2115
2117
  } else
@@ -2356,7 +2358,7 @@ class Se {
2356
2358
  this.managedTextures = [], this._glTextures = /* @__PURE__ */ Object.create(null), this._glSamplers = /* @__PURE__ */ Object.create(null), this._boundTextures = [], this._activeTextureLocation = -1, this._boundSamplers = /* @__PURE__ */ Object.create(null), this._uploads = {
2357
2359
  image: be,
2358
2360
  buffer: gt,
2359
- video: vt,
2361
+ video: Tt,
2360
2362
  compressed: xt
2361
2363
  }, this._premultiplyAlpha = !1, this._useSeparateSamplers = !1, this._renderer = e, this._renderer.renderableGC.addManagedHash(this, "_glTextures"), this._renderer.renderableGC.addManagedHash(this, "_glSamplers");
2362
2364
  }
@@ -2491,7 +2493,7 @@ class Se {
2491
2493
  ), { pixels: new Uint8ClampedArray(a.buffer), width: n, height: i };
2492
2494
  }
2493
2495
  destroy() {
2494
- this.managedTextures.slice().forEach((e) => this.onSourceDestroy(e)), this.managedTextures = null, this._renderer = null;
2496
+ this.managedTextures.slice().forEach((e) => this.onSourceDestroy(e)), this.managedTextures = null, this._glTextures = null, this._glSamplers = null, this._boundTextures = null, this._boundSamplers = null, this._mapFormatToInternalFormat = null, this._mapFormatToType = null, this._mapFormatToFormat = null, this._uploads = null, this._renderer = null;
2495
2497
  }
2496
2498
  resetState() {
2497
2499
  this._activeTextureLocation = -1, this._boundTextures.fill(b.EMPTY.source), this._boundSamplers = /* @__PURE__ */ Object.create(null);
@@ -2524,7 +2526,7 @@ class pe {
2524
2526
  glProgram: n,
2525
2527
  resources: {
2526
2528
  localUniforms: r,
2527
- batchSamplers: De(s)
2529
+ batchSamplers: Ie(s)
2528
2530
  }
2529
2531
  });
2530
2532
  }
@@ -2536,11 +2538,11 @@ class pe {
2536
2538
  n.groups[0] = i.globalUniforms.bindGroup, i.state.set(e.state), i.shader.bind(n), i.geometry.bind(o.geometry, n.glProgram);
2537
2539
  const u = c.instructions;
2538
2540
  for (let _ = 0; _ < c.instructionSize; _++) {
2539
- const h = u[_];
2540
- if (h.size) {
2541
- for (let l = 0; l < h.textures.count; l++)
2542
- i.texture.bind(h.textures.textures[l], l);
2543
- i.geometry.draw(h.topology, h.size, h.start);
2541
+ const f = u[_];
2542
+ if (f.size) {
2543
+ for (let l = 0; l < f.textures.count; l++)
2544
+ i.texture.bind(f.textures.textures[l], l);
2545
+ i.geometry.draw(f.topology, f.size, f.start);
2544
2546
  }
2545
2547
  }
2546
2548
  }
@@ -2603,7 +2605,7 @@ ge.extension = {
2603
2605
  ],
2604
2606
  name: "mesh"
2605
2607
  };
2606
- const Dt = [
2608
+ const It = [
2607
2609
  ...we,
2608
2610
  _e,
2609
2611
  $e,
@@ -2611,7 +2613,7 @@ const Dt = [
2611
2613
  oe,
2612
2614
  ee,
2613
2615
  Se,
2614
- fe,
2616
+ he,
2615
2617
  se,
2616
2618
  me,
2617
2619
  de,
@@ -2619,19 +2621,19 @@ const Dt = [
2619
2621
  St,
2620
2622
  ce,
2621
2623
  ie
2622
- ], It = [...Ve], Gt = [J, ge, pe], Re = [], xe = [], ve = [];
2623
- v.handleByNamedList(d.WebGLSystem, Re);
2624
- v.handleByNamedList(d.WebGLPipes, xe);
2625
- v.handleByNamedList(d.WebGLPipesAdaptor, ve);
2626
- v.add(...Dt, ...It, ...Gt);
2627
- class Pt extends Ie {
2624
+ ], Dt = [...Ve], Gt = [J, ge, pe], Re = [], xe = [], Te = [];
2625
+ T.handleByNamedList(d.WebGLSystem, Re);
2626
+ T.handleByNamedList(d.WebGLPipes, xe);
2627
+ T.handleByNamedList(d.WebGLPipesAdaptor, Te);
2628
+ T.add(...It, ...Dt, ...Gt);
2629
+ class Pt extends De {
2628
2630
  constructor() {
2629
2631
  const e = {
2630
2632
  name: "webgl",
2631
2633
  type: Ge.WEBGL,
2632
2634
  systems: Re,
2633
2635
  renderPipes: xe,
2634
- renderPipeAdaptors: ve
2636
+ renderPipeAdaptors: Te
2635
2637
  };
2636
2638
  super(e);
2637
2639
  }
@@ -2639,4 +2641,4 @@ class Pt extends Ie {
2639
2641
  export {
2640
2642
  Pt as WebGLRenderer
2641
2643
  };
2642
- //# sourceMappingURL=WebGLRenderer-BYTBSbn-.js.map
2644
+ //# sourceMappingURL=WebGLRenderer-olc8u2PI.js.map