@woosh/meep-engine 2.33.18 → 2.33.22

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 (74) hide show
  1. package/core/assert.js +3 -1
  2. package/core/bvh2/traversal/__detailed_box_volume_intersection.js +1 -1
  3. package/core/collection/HashMap.js +66 -22
  4. package/core/geom/3d/CircleMath.js +4 -4
  5. package/core/geom/3d/cone/computeConeBoundingBox.js +4 -4
  6. package/core/geom/3d/{compute_bounding_cone_of_2_cones.js → cone/compute_bounding_cone_of_2_cones.js} +3 -3
  7. package/core/geom/3d/{compute_bounding_cone_of_2_cones.spec.js → cone/compute_bounding_cone_of_2_cones.spec.js} +1 -1
  8. package/core/geom/3d/frustum/array_setFromProjectionMatrix.js +1 -1
  9. package/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +1 -1
  10. package/core/geom/3d/{encode_unit3_hemioct.js → normal/hemioct/encode_unit3_hemioct.js} +0 -0
  11. package/core/geom/3d/{unit_hemioct.spec.js → normal/hemioct/unit_hemioct.spec.js} +1 -1
  12. package/core/geom/3d/normal/lamber_azimuth/transform.js +61 -0
  13. package/core/geom/3d/normal/spherical/sphere_map_transform.js +77 -0
  14. package/core/geom/3d/{lerp_planes_to_array.js → plane/lerp_planes_to_array.js} +1 -3
  15. package/core/geom/3d/plane/plane3_lerp.js +3 -1
  16. package/core/geom/3d/plane/plane3_slerp.js +4 -1
  17. package/core/geom/3d/{plane_computeConvex3PlaneIntersection.js → plane/plane_computeConvex3PlaneIntersection.js} +1 -2
  18. package/core/geom/3d/topology/TopoTriangle.js +1 -1
  19. package/core/geom/3d/topology/TopoVertex.js +1 -1
  20. package/core/geom/3d/topology/bounds/computeTraingleClusterNormalBoundingCone.js +2 -2
  21. package/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +1 -1
  22. package/core/geom/3d/topology/simplify/quadratic/Quadratic3.js +1 -1
  23. package/core/geom/3d/triangle/computeTrianglePlaneSide.js +1 -1
  24. package/core/geom/3d/triangle/computeTriangleRayIntersection.js +1 -1
  25. package/core/geom/LineSegment.js +3 -1
  26. package/core/geom/Matrix4.js +2 -1
  27. package/core/geom/Plane.js +1 -1
  28. package/core/geom/Quaternion.js +2 -1
  29. package/core/geom/Vector3.d.ts +2 -0
  30. package/core/geom/Vector3.js +33 -158
  31. package/core/geom/Vector3.spec.js +2 -1
  32. package/core/geom/v3_angle_between.js +31 -0
  33. package/core/geom/v3_distance.js +16 -0
  34. package/core/geom/v3_distance_sqr.js +17 -0
  35. package/core/geom/v3_dot.js +13 -0
  36. package/core/geom/v3_length.js +5 -0
  37. package/core/geom/v3_length_sqr.js +10 -0
  38. package/core/geom/v3_lerp.js +21 -0
  39. package/core/geom/v3_slerp.js +48 -0
  40. package/core/primitives/array/computeIntegerArrayHash.js +5 -0
  41. package/engine/asset/loaders/material/computeMaterialHash.js +1 -2
  42. package/engine/asset/loaders/material/computeTextureEquality.js +13 -5
  43. package/engine/ecs/animation/OneBoneSurfaceAlignmentSolver.js +3 -1
  44. package/engine/ecs/animation/TwoBoneInverseKinematicsSolver.js +3 -1
  45. package/engine/ecs/fow/FogOfWar.js +2 -3
  46. package/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +1 -1
  47. package/engine/ecs/systems/SteeringSystem.js +2 -1
  48. package/engine/ecs/terrain/ecs/Terrain.js +6 -0
  49. package/engine/ecs/terrain/ecs/layers/TerrainLayers.js +5 -0
  50. package/engine/ecs/terrain/ecs/splat/SplatMapping.js +5 -0
  51. package/engine/graphics/GraphicsEngine.js +18 -0
  52. package/engine/graphics/ecs/camera/CameraClippingPlaneComputer.js +1 -1
  53. package/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +0 -53
  54. package/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +2 -1
  55. package/engine/graphics/micron/build/clustering/computeFaceCurvatureScore.js +1 -1
  56. package/engine/graphics/micron/build/clustering/compute_face_connection_weight.js +1 -1
  57. package/engine/graphics/micron/build/hierarchy/computePatchMergeScore.js +1 -1
  58. package/engine/graphics/micron/build/hierarchy/patch_combine.js +1 -1
  59. package/engine/graphics/micron/render/refinement/is_patch_facing_back.js +2 -2
  60. package/engine/graphics/particles/particular/engine/shader/ShaderManager.js +7 -25
  61. package/engine/graphics/render/forward_plus/computeFrustumCorners.js +1 -1
  62. package/engine/graphics/render/forward_plus/plugin/MaterialTransformer.js +12 -2
  63. package/engine/graphics/render/forward_plus/queryBVH_Frustum.js +1 -1
  64. package/engine/graphics/render/layers/RenderLayerUtils.js +1 -1
  65. package/engine/graphics/texture/atlas/TextureAtlas.js +16 -12
  66. package/engine/graphics/util/projectSphere.js +1 -1
  67. package/engine/navigation/ecs/components/Path.js +2 -1
  68. package/engine/network/convertPathToURL.js +3 -3
  69. package/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +3 -2
  70. package/generation/markers/GridCellActionPlaceMarker.js +13 -1
  71. package/generation/markers/MarkerNode.js +6 -0
  72. package/generation/theme/ThemeEngine.js +3 -0
  73. package/package.json +1 -1
  74. package/view/minimap/gl/MinimapMarkersGL.js +13 -1
@@ -18,8 +18,6 @@ import {
18
18
  Vector2,
19
19
  WebGLRenderTarget
20
20
  } from "three";
21
- import { Sampler2D } from "../../../texture/sampler/Sampler2D.js";
22
- import convertSampler2D2Canvas from "../../../texture/sampler/Sampler2D2Canvas.js";
23
21
  import { makeHighlightDecodeShader } from "./HighlightDecodeShader.js";
24
22
  import { makeDilationShader } from "./makeDilationShader.js";
25
23
  import { ScreenSpaceQuadShader } from "../../../shaders/ScreenSpaceQuadShader.js";
@@ -500,57 +498,6 @@ export class OutlineRenderer {
500
498
  renderer.setRenderTarget(null);
501
499
  }
502
500
 
503
- debugObjectIDs() {
504
-
505
- const s = Sampler2D.uint8(4, this.__renderTargetObjectId_t0.width, this.__renderTargetObjectId_t0.height);
506
-
507
- this.renderer.readRenderTargetPixels(this.__renderTargetObjectId_t0, 0, 0, this.__renderTargetObjectId_t0.width, this.__renderTargetObjectId_t0.height, s);
508
-
509
-
510
- const htmlCanvasElement = convertSampler2D2Canvas(s, 1, 0);
511
-
512
- htmlCanvasElement.style.zIndex = 10000;
513
- htmlCanvasElement.style.position = "absolute";
514
-
515
- document.body.appendChild(htmlCanvasElement);
516
- }
517
-
518
- /**
519
- *
520
- * @param {Object3D} object
521
- */
522
- renderObjectId(object) {
523
- if (object.isMesh || object.isSkinnedMesh) {
524
-
525
- const geometry = object.geometry;
526
-
527
- if (geometry === undefined) {
528
- return;
529
- }
530
-
531
- const renderer = this.renderer;
532
-
533
- if (object.isSkinnedMesh) {
534
-
535
- renderer.renderBufferDirect(this.camera, null, geometry, material_id_skinned, object, null);
536
-
537
- } else {
538
- renderer.renderBufferDirect(this.camera, null, geometry, material_id_unskinned, object, null);
539
- }
540
-
541
- }
542
-
543
- const children = object.children;
544
-
545
- const child_count = children.length;
546
-
547
- for (let i = 0; i < child_count; i++) {
548
- const child = children[i];
549
-
550
- this.renderObjectId(child);
551
- }
552
- }
553
-
554
501
  /**
555
502
  *
556
503
  * @param {Material} material
@@ -1,9 +1,10 @@
1
- import Vector3, { v3_length } from "../../../../../core/geom/Vector3.js";
1
+ import Vector3 from "../../../../../core/geom/Vector3.js";
2
2
 
3
3
  import { Vector3 as ThreeVector3 } from 'three';
4
4
  import { rayTriangleIntersection } from "../../../../../core/geom/GeometryMath.js";
5
5
  import { SurfacePoint3 } from "../../../../../core/geom/3d/SurfacePoint3.js";
6
6
  import { assert } from "../../../../../core/assert.js";
7
+ import { v3_length } from "../../../../../core/geom/v3_length.js";
7
8
 
8
9
  const hit = new ThreeVector3();
9
10
 
@@ -1,4 +1,4 @@
1
- import { v3_dot } from "../../../../../core/geom/Vector3.js";
1
+ import { v3_dot } from "../../../../../core/geom/v3_dot.js";
2
2
 
3
3
  /**
4
4
  * If a given face is added to the patch, how beneficial would that be?
@@ -1,5 +1,5 @@
1
- import { v3_distance_sqr } from "../../../../../core/geom/Vector3.js";
2
1
  import { vec3 } from "gl-matrix";
2
+ import { v3_distance_sqr } from "../../../../../core/geom/v3_distance_sqr.js";
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { ConicRay } from "../../../../../core/geom/ConicRay.js";
2
- import { compute_bounding_cone_of_2_cones } from "../../../../../core/geom/3d/compute_bounding_cone_of_2_cones.js";
2
+ import { compute_bounding_cone_of_2_cones } from "../../../../../core/geom/3d/cone/compute_bounding_cone_of_2_cones.js";
3
3
  import { compute_patches_shared_vertex_count } from "./compute_patches_shared_vertex_count.js";
4
4
  import { compute_bounding_sphere_of_2_spheres } from "../../../../../core/geom/3d/compute_bounding_sphere_of_2_spheres.js";
5
5
  import { max2 } from "../../../../../core/math/max2.js";
@@ -5,7 +5,7 @@ import { array_remove_first } from "../../../../../core/collection/array/array_r
5
5
  import { max2 } from "../../../../../core/math/max2.js";
6
6
  import { array_push_if_unique } from "../../../../../core/collection/array/array_push_if_unique.js";
7
7
  import { compute_bounding_sphere_of_2_spheres } from "../../../../../core/geom/3d/compute_bounding_sphere_of_2_spheres.js";
8
- import { compute_bounding_cone_of_2_cones } from "../../../../../core/geom/3d/compute_bounding_cone_of_2_cones.js";
8
+ import { compute_bounding_cone_of_2_cones } from "../../../../../core/geom/3d/cone/compute_bounding_cone_of_2_cones.js";
9
9
  import { ConicRay } from "../../../../../core/geom/ConicRay.js";
10
10
  import { passThrough } from "../../../../../core/function/Functions.js";
11
11
 
@@ -1,5 +1,5 @@
1
1
  import { PI_HALF } from "../../../../../core/math/MathUtils.js";
2
- import { v3_angleBetween } from "../../../../../core/geom/Vector3.js";
2
+ import { v3_angle_between } from "../../../../../core/geom/v3_angle_between.js";
3
3
 
4
4
  /**
5
5
  *
@@ -28,7 +28,7 @@ function is_patch_facing_back(refinement_spec, patch) {
28
28
  // compute view angle of the bounding sphere
29
29
  const normal_cone_direction = normal_cone.direction;
30
30
 
31
- const angle = v3_angleBetween(
31
+ const angle = v3_angle_between(
32
32
  view_direction_x, view_direction_y, view_direction_z,
33
33
  normal_cone_direction.x, normal_cone_direction.y, normal_cone_direction.z
34
34
  );
@@ -115,6 +115,8 @@ export class ShaderManager {
115
115
  anisotropy: 0
116
116
  });
117
117
 
118
+ this.spriteTexture.name = 'Sprite sheet';
119
+
118
120
  /**
119
121
  *
120
122
  * @type {Texture|null}
@@ -284,37 +286,14 @@ export class ShaderManager {
284
286
 
285
287
  console.warn('Recomputing hashes ... ');
286
288
 
287
- this.recordGraveyard.updateHashes();
288
- this.materialMap.updateHashes();
289
+ this.recordGraveyard.rebuild();
290
+ this.materialMap.rebuild();
289
291
  }
290
292
 
291
293
  this.materialMap.delete(bestKey);
292
294
  }
293
295
  }
294
296
 
295
- /**
296
- *
297
- * @param {MaterialRecord} entry
298
- */
299
- destroyMaterialRecord(entry) {
300
-
301
- const parameters = entry.parameters.asArray();
302
-
303
- //remove parameters from parameter sheet
304
- for (let i = 0; i < parameters.length; i++) {
305
- const particleParameter = parameters[i];
306
- this.parameterSheet.remove(particleParameter);
307
- }
308
-
309
- //unlink signal bindings
310
- entry.signalBindings.forEach(function (binding) {
311
- binding.unlink();
312
- });
313
-
314
- //decommission material
315
- entry.material.dispose();
316
- }
317
-
318
297
  /**
319
298
  *
320
299
  * @param {ParticleEmitter} emitter
@@ -369,6 +348,7 @@ export class ShaderManager {
369
348
  const cameraNear = camera.near;
370
349
  const cameraFar = camera.far;
371
350
 
351
+ // TODO use a shader uniform structure to avoid iteration
372
352
  this.materialMap.forEach(function (entry) {
373
353
  const uniforms = entry.material.uniforms;
374
354
 
@@ -386,6 +366,7 @@ export class ShaderManager {
386
366
  setDepthTexture(texture) {
387
367
  this.depthTexture = texture;
388
368
 
369
+ // TODO use a shader uniform structure to avoid iteration
389
370
  this.materialMap.forEach(function (entry) {
390
371
  const material = entry.material;
391
372
  material.uniforms.tDepth.value = texture;
@@ -400,6 +381,7 @@ export class ShaderManager {
400
381
  setViewportSize(x, y) {
401
382
  this.viewportSize.set(x, y);
402
383
 
384
+ // TODO use a shader uniform structure to avoid iteration
403
385
  this.materialMap.forEach(function (entry) {
404
386
  entry.material.uniforms.resolution.value.set(x, y);
405
387
  });
@@ -1,5 +1,5 @@
1
1
  import Vector3 from "../../../../core/geom/Vector3.js";
2
- import { plane_three_computeConvex3PlaneIntersection } from "../../../../core/geom/3d/plane_computeConvex3PlaneIntersection.js";
2
+ import { plane_three_computeConvex3PlaneIntersection } from "../../../../core/geom/3d/plane/plane_computeConvex3PlaneIntersection.js";
3
3
 
4
4
  const v_000 = new Vector3();
5
5
  const v_001 = new Vector3();
@@ -61,12 +61,22 @@ export class MaterialTransformer extends AbstractMaterialTransformer {
61
61
  }
62
62
 
63
63
  transform(source) {
64
+ let result = source;
65
+
64
66
  if (isLitMaterial(source)) {
65
67
 
66
- source.onBeforeCompile = composeCompile(source.onBeforeCompile, this.__on_before_compile);
68
+ result = source.clone();
69
+ // inherit uniforms directly
70
+
71
+ if (source.isShaderMaterial) {
72
+ result.uniforms = source.uniforms;
73
+ result.defines = source.defines;
74
+ }
75
+
76
+ result.onBeforeCompile = composeCompile(source.onBeforeCompile, this.__on_before_compile);
67
77
 
68
78
  }
69
79
 
70
- return source;
80
+ return result;
71
81
  }
72
82
  }
@@ -1,7 +1,7 @@
1
- import { v3_distance_sqr } from "../../../../core/geom/Vector3.js";
2
1
  import { line3_computeSegmentPointDistance_sqr } from "../../../../core/geom/LineSegment.js";
3
2
  import { computeConePlaneSide } from "../../../../core/geom/3d/cone/computeConePlaneSide.js";
4
3
  import { aabb3_computeDistanceAbovePlane } from "../../../../core/geom/3d/aabb/aabb3_computeDistanceAbovePlane.js";
4
+ import { v3_distance_sqr } from "../../../../core/geom/v3_distance_sqr.js";
5
5
 
6
6
  /**
7
7
  *
@@ -1,6 +1,6 @@
1
1
  import Vector3 from "../../../../core/geom/Vector3.js";
2
2
  import { computePointDistanceToPlane } from "../../../../core/geom/Plane.js";
3
- import { plane_three_computeConvex3PlaneIntersection } from "../../../../core/geom/3d/plane_computeConvex3PlaneIntersection.js";
3
+ import { plane_three_computeConvex3PlaneIntersection } from "../../../../core/geom/3d/plane/plane_computeConvex3PlaneIntersection.js";
4
4
 
5
5
  /**
6
6
  *
@@ -116,28 +116,32 @@ export class TextureAtlas {
116
116
  *
117
117
  * @param {number} x
118
118
  * @param {number} y
119
- * @returns {boolean}
119
+ * @returns {boolean} true if resizing successful, false otherwise
120
120
  */
121
121
  resize(x, y) {
122
122
  //check if any patches would be cut
123
123
  const patches = this.patches;
124
124
  const numPatches = patches.length;
125
- const patchBoundsViolated = patches.some(patch => {
126
125
 
127
- if (!patch.getFlag(AtlasPatchFlag.Packed)) {
126
+ //update patch UVs
127
+ for (let i = 0; i < numPatches; i++) {
128
+ const patch = patches[i];
129
+
130
+ if (patch.getFlag(AtlasPatchFlag.Packed)) {
128
131
  //only care about packed patches
129
- return false;
130
- }
131
132
 
132
- const x1 = patch.position.x + patch.size.x + patch.padding;
133
- const y1 = patch.position.y + patch.size.y + patch.padding;
133
+ const pp = patch.position;
134
+ const ps = patch.size;
134
135
 
135
- return x1 >= x || y1 >= y;
136
- });
136
+ const x1 = pp.x + ps.x + patch.padding;
137
+ const y1 = pp.y + ps.y + patch.padding;
137
138
 
138
- if (patchBoundsViolated) {
139
- //Resizing atlas would result in some patches not fitting
140
- return false;
139
+ if (x1 >= x || y1 >= y) {
140
+ // patch bounds would violate the desired atlas extends
141
+ //Resizing atlas would result in some patches not fitting
142
+ return false;
143
+ }
144
+ }
141
145
  }
142
146
 
143
147
  //update patch UVs
@@ -1,6 +1,6 @@
1
1
  import { assert } from "../../../core/assert.js";
2
2
  import { v4_applyMatrix4 } from "../../../core/geom/Vector4.js";
3
- import { v3_dot } from "../../../core/geom/Vector3.js";
3
+ import { v3_dot } from "../../../core/geom/v3_dot.js";
4
4
 
5
5
  const v4 = [];
6
6
 
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  import { line3_computeSegmentPointDistance_sqr } from "../../../../core/geom/LineSegment.js";
7
- import Vector3, { v3_distance } from "../../../../core/geom/Vector3.js";
7
+ import Vector3 from "../../../../core/geom/Vector3.js";
8
8
 
9
9
  import { CatmullRomCurve3 } from "three";
10
10
  import { clamp } from "../../../../core/math/clamp.js";
@@ -17,6 +17,7 @@ import { max2 } from "../../../../core/math/max2.js";
17
17
  import { min2 } from "../../../../core/math/min2.js";
18
18
  import { computeNonuniformCatmullRomSplineSample } from "./computeNonuniformCatmullRomSplineSample.js";
19
19
  import { InterpolationType } from "./InterpolationType.js";
20
+ import { v3_distance } from "../../../../core/geom/v3_distance.js";
20
21
 
21
22
  const v3_a = new Vector3();
22
23
  const v3_b = new Vector3();
@@ -36,7 +36,7 @@ export function convertPathToURL(path) {
36
36
  scope = self;
37
37
  } else if (ENVIRONMENT_IS_NODE) {
38
38
 
39
- let normalized_path = process.cwd().replace(/\\/g, '/');
39
+ let normalized_path = `${process.cwd()}/`.replace(/\\/g, '/');
40
40
 
41
41
  // remove multiple sequential slashes
42
42
  normalized_path = normalized_path.replace(/\/+/g, '/');
@@ -68,8 +68,8 @@ export function convertPathToURL(path) {
68
68
  */
69
69
 
70
70
  if (pathname.endsWith('/')) {
71
- //path is to a directory
72
- directoryPath = pathname;
71
+ //path is to a directory, strip last slash
72
+ directoryPath = pathname.substring(0, pathname.length - 1);
73
73
  } else {
74
74
  //path is to a file
75
75
  const i = pathname.lastIndexOf('/');
@@ -1,6 +1,7 @@
1
1
  import { CellFilter } from "../../CellFilter.js";
2
- import Vector3, { v3_angleBetween } from "../../../../core/geom/Vector3.js";
2
+ import Vector3 from "../../../../core/geom/Vector3.js";
3
3
  import { assert } from "../../../../core/assert.js";
4
+ import { v3_angle_between } from "../../../../core/geom/v3_angle_between.js";
4
5
 
5
6
  /**
6
7
  * Builds surface normal of another filter, and then computes the angle to a fixed 3d vector
@@ -70,7 +71,7 @@ export class CellFilterAngleToNormal extends CellFilter {
70
71
 
71
72
  const reference = this.reference;
72
73
 
73
- const angle = v3_angleBetween(reference.x, reference.y, reference.z, _x, _y, _z);
74
+ const angle = v3_angle_between(reference.x, reference.y, reference.z, _x, _y, _z);
74
75
 
75
76
  return angle;
76
77
  }
@@ -36,6 +36,12 @@ export class GridCellActionPlaceMarker extends GridCellAction {
36
36
  */
37
37
  this.transformers = [];
38
38
 
39
+ /**
40
+ *
41
+ * @type {number}
42
+ */
43
+ this.priority = 0;
44
+
39
45
  /**
40
46
  *
41
47
  * @type {Vector2}
@@ -91,6 +97,7 @@ export class GridCellActionPlaceMarker extends GridCellAction {
91
97
  * @param {string[]} [tags]
92
98
  * @param {Transform} [transform]
93
99
  * @param {*} [properties]
100
+ * @param priority
94
101
  * @return {GridCellActionPlaceMarker}
95
102
  */
96
103
  static from({
@@ -99,7 +106,8 @@ export class GridCellActionPlaceMarker extends GridCellAction {
99
106
  transformers = [],
100
107
  tags = [],
101
108
  transform,
102
- properties
109
+ properties,
110
+ priority = 0
103
111
  }) {
104
112
 
105
113
  assert.typeOf(type, 'string', 'type');
@@ -125,6 +133,8 @@ export class GridCellActionPlaceMarker extends GridCellAction {
125
133
  r.properties = properties;
126
134
  }
127
135
 
136
+ r.priority = priority;
137
+
128
138
  return r;
129
139
  }
130
140
 
@@ -183,6 +193,8 @@ export class GridCellActionPlaceMarker extends GridCellAction {
183
193
  //write properties
184
194
  Object.assign(node.properties, this.properties);
185
195
 
196
+ node.priority = this.priority;
197
+
186
198
  //apply transformations
187
199
  const transformers = this.transformers;
188
200
  const transformerCount = transformers.length;
@@ -5,6 +5,12 @@ import { circleIntersectsCircle } from "../../core/geom/2d/circle/circleIntersec
5
5
 
6
6
  export class MarkerNode {
7
7
  constructor() {
8
+ /**
9
+ * Processing order, higher priority nodes are processed first
10
+ * @type {number}
11
+ */
12
+ this.priority = 0;
13
+
8
14
  /**
9
15
  *
10
16
  * @type {String}
@@ -451,6 +451,9 @@ export class ThemeEngine {
451
451
  return new Task({
452
452
  initializer() {
453
453
  grid.markers.getRawData(nodes);
454
+
455
+ // sort nodes by priority
456
+ nodes.sort((a, b) => b.priority - a.priority);
454
457
  },
455
458
  cycleFunction
456
459
  });
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "productName": "Meep",
5
5
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
6
6
  "author": "Alexander Goldring",
7
- "version": "2.33.18",
7
+ "version": "2.33.22",
8
8
  "dependencies": {
9
9
  "fast-levenshtein": "2.0.6",
10
10
  "opentype.js": "1.3.3",
@@ -297,8 +297,17 @@ export class MinimapMarkersGL extends MinimapWorldLayer {
297
297
  }
298
298
 
299
299
 
300
+ /**
301
+ *
302
+ * @return {DataTexture}
303
+ * @private
304
+ */
305
+ __getAtlasTexture() {
306
+ return this.material.uniforms.atlas.value;
307
+ }
308
+
300
309
  handleAtlasUpdate() {
301
- writeSample2DDataToDataTexture(this.atlasManager.atlas.sampler, this.material.uniforms.atlas.value);
310
+ writeSample2DDataToDataTexture(this.atlasManager.atlas.sampler, this.__getAtlasTexture());
302
311
 
303
312
  this.updateSprites();
304
313
 
@@ -391,6 +400,9 @@ export class MinimapMarkersGL extends MinimapWorldLayer {
391
400
  //clear out data arrays
392
401
  this.particles.reset();
393
402
 
403
+ // release atlas GPU memory
404
+ this.__getAtlasTexture().dispose();
405
+
394
406
  //execute shutdown hooks
395
407
  this.shutdownHooks.forEach(function (hook) {
396
408
  hook();