@woosh/meep-engine 2.119.24 → 2.119.25

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.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.119.24",
8
+ "version": "2.119.25",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualTextureMemoryMapping.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTextureMemoryMapping.js"],"names":[],"mappings":"AAcA;;GAEG;AACH;IAQI,4BAEC;IAWD,2BAEC;IAeD;;;OAGG;IACH,4BAiCC;IAED,yBAEC;IAED;;;OAGG;IACH,uCAsEC;IAED;;;MAUC;IAGD,gBAEC;;CACJ;4BA9LkG,OAAO"}
1
+ {"version":3,"file":"VirtualTextureMemoryMapping.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTextureMemoryMapping.js"],"names":[],"mappings":"AAcA;;GAEG;AACH;IAQI,4BAEC;IAWD,2BAEC;IAgBD;;;OAGG;IACH,4BAiCC;IAED,yBAEC;IAED;;;OAGG;IACH,uCAsEC;IAED;;;MAUC;IAGD,gBAEC;;CACJ;4BA/LkG,OAAO"}
@@ -42,6 +42,7 @@ export class VirtualTextureMemoryMapping {
42
42
 
43
43
  constructor() {
44
44
  const texture = this.#texture;
45
+ texture.name = "Virtual Texture / Dereference Mapping"
45
46
 
46
47
  texture.internalFormat = "R32UI";
47
48
  texture.generateMipmaps = false;
@@ -25,18 +25,18 @@ export class VirtualTexturePage {
25
25
  set tile_resolution(arg: number);
26
26
  get tile_resolution(): number;
27
27
  get tile_margin(): number;
28
- /**
29
- *
30
- * @param {string} v
31
- */
32
- set path(arg: string);
33
- set asset_manager(arg: any);
34
28
  /**
35
29
  *
36
30
  * @param {number[]} v
37
31
  */
38
32
  set page_texture_size(arg: number[]);
39
33
  get page_texture_size(): number[];
34
+ /**
35
+ *
36
+ * @param {string} v
37
+ */
38
+ set path(arg: string);
39
+ set asset_manager(arg: any);
40
40
  /**
41
41
  *
42
42
  * @param {VirtualTextureUsage} usage
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualTexturePage.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTexturePage.js"],"names":[],"mappings":"AA8BA;IAcI,iDAEC;IAED;;;OAGG;IACH,cAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,SAFU,MAAM,CAEJ;IAeZ,uBAEC;IAGD,wCAEC;IAED,2BAEC;IAQD;;;OAGG;IACH,2CAEC;IAmBD;;;OAGG;IACH,iCAKC;IAbD,8BAEC;IAoBD,0BAEC;IAuED;;;OAGG;IACH,sBAEC;IAED,4BAIC;IAiKD;;;OAGG;IACH,qCA6BC;IAED,kCAEC;IAED;;;OAGG;IACH,+CAuDC;IAED,uBAMC;IAED,gBAOC;;CACJ;4BA1eM,OAAO"}
1
+ {"version":3,"file":"VirtualTexturePage.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTexturePage.js"],"names":[],"mappings":"AA8BA;IAkBI,iDAEC;IAED;;;OAGG;IACH,cAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,SAFU,MAAM,CAEJ;IAeZ,uBAEC;IAGD,wCAEC;IAED,2BAEC;IAQD;;;OAGG;IACH,2CAEC;IAmBD;;;OAGG;IACH,iCAKC;IAbD,8BAEC;IAoBD,0BAEC;IAuPD;;;OAGG;IACH,qCA8BC;IAED,kCAEC;IAnND;;;OAGG;IACH,sBAEC;IAED,4BAIC;IAyMD;;;OAGG;IACH,+CAuDC;IAED,uBAMC;IAED,gBAOC;;CACJ;4BAlfM,OAAO"}
@@ -29,12 +29,16 @@ import { VT_DEFAULT_PAGE_RESOLUTION } from "./VT_DEFAULT_PAGE_RESOLUTION.js";
29
29
  const DEFAULT_CACHE_SIZE = 256 * 1024 * 1024;
30
30
 
31
31
  export class VirtualTexturePage {
32
- #page_texture = new DataTexture(new Uint8Array(VT_DEFAULT_PAGE_RESOLUTION * VT_DEFAULT_PAGE_RESOLUTION * 4), VT_DEFAULT_PAGE_RESOLUTION, VT_DEFAULT_PAGE_RESOLUTION);
32
+ #page_texture = new DataTexture(
33
+ new Uint8Array(VT_DEFAULT_PAGE_RESOLUTION * VT_DEFAULT_PAGE_RESOLUTION * 4),
34
+ VT_DEFAULT_PAGE_RESOLUTION,
35
+ VT_DEFAULT_PAGE_RESOLUTION
36
+ );
33
37
 
34
38
  #tile_copy_sampler = Sampler2D.uint8(4, 1, 1);
35
39
  #tile_copy_texture = new DataTexture(this.#tile_copy_sampler.data, 1, 1);
36
40
 
37
- #page_texture_size = [1, 1];
41
+ #page_texture_size = [VT_DEFAULT_PAGE_RESOLUTION, VT_DEFAULT_PAGE_RESOLUTION];
38
42
 
39
43
  /**
40
44
  *
@@ -177,6 +181,7 @@ export class VirtualTexturePage {
177
181
  constructor() {
178
182
  this.#page_texture.name = "Virtual Texture / Page";
179
183
  this.#page_texture_set_parameters();
184
+ this.#page_texture.needsUpdate = true;
180
185
 
181
186
  this.#tile_copy_texture.name = "Virtual Texture / Copy Tile";
182
187
 
@@ -184,6 +189,8 @@ export class VirtualTexturePage {
184
189
  this.#tile_copy_texture.wrapS = ClampToEdgeWrapping;
185
190
 
186
191
  this.#loader.on.loaded.add(this.#handle_tile_loaded, this);
192
+
193
+ this.page_texture_size = [VT_DEFAULT_PAGE_RESOLUTION, VT_DEFAULT_PAGE_RESOLUTION];
187
194
  }
188
195
 
189
196
  /**
@@ -387,29 +394,30 @@ export class VirtualTexturePage {
387
394
  const page_texture = this.#page_texture;
388
395
  const page_image = page_texture.image;
389
396
 
390
- if (v[0] === page_image.width && v[1] === page_image.height) {
391
- // nothing to do
392
- return;
393
- }
397
+ const current_resolution = this.#page_texture_size;
394
398
 
395
- array_copy(
396
- v, 0,
397
- this.#page_texture_size, 0,
398
- 2
399
- );
399
+ if (v[0] !== current_resolution[0] || v[1] !== current_resolution[1]) {
400
400
 
401
- this.clear_resident();
401
+ array_copy(
402
+ v, 0,
403
+ current_resolution, 0,
404
+ 2
405
+ );
406
+
407
+ this.clear_resident();
402
408
 
403
- page_texture.dispose();
409
+ page_texture.dispose();
404
410
 
405
- const width = this.#page_texture_size[0];
406
- const height = this.#page_texture_size[1];
411
+ const width = current_resolution[0];
412
+ const height = current_resolution[1];
407
413
 
408
- page_image.data = new Uint8Array(width * height * 4);
409
- page_image.width = width;
410
- page_image.height = height;
414
+ page_image.data = new Uint8Array(width * height * 4);
415
+ page_image.width = width;
416
+ page_image.height = height;
411
417
 
412
- page_texture.needsUpdate = true;
418
+ page_texture.needsUpdate = true;
419
+
420
+ }
413
421
 
414
422
  this.#update_residency_capacity();
415
423
  }
@@ -8,10 +8,12 @@ export class VirtualTextureSystem {
8
8
  tile_resolution: any;
9
9
  tile_margin: any;
10
10
  }): void;
11
- initialize({ page_resolution, asset_manager }: {
12
- page_resolution?: number;
13
- asset_manager: any;
14
- }): void;
11
+ /**
12
+ *
13
+ * @param {number} [page_resolution]
14
+ * @param {AssetManager} asset_manager
15
+ */
16
+ initialize({ page_resolution, asset_manager }?: number): void;
15
17
  makeMaterial(): VirtualTextureMaterial;
16
18
  /**
17
19
  *
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualTextureSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTextureSystem.js"],"names":[],"mappings":"AAOA;IACI,oCAA0C;IAC1C,yBAA+B;IAC/B,qCAA2C;IAgB3C;;;;;aAeC;IAsBD;;;aASC;IAED,uCAIC;IAED;;;;;OAKG;IACH,oEAaC;;CACJ;2CAhG0C,iCAAiC;mCADzC,yBAAyB;4CADhB,kCAAkC;uCADvC,6BAA6B"}
1
+ {"version":3,"file":"VirtualTextureSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTextureSystem.js"],"names":[],"mappings":"AAOA;IACI,oCAA0C;IAC1C,yBAA+B;IAC/B,qCAA2C;IAgB3C;;;;;aAeC;IAsBD;;;;OAIG;IACH,gDAHW,MAAM,QAYhB;IAED,uCAIC;IAED;;;;;OAKG;IACH,oEAaC;;CACJ;2CArG0C,iCAAiC;mCADzC,yBAAyB;4CADhB,kCAAkC;uCADvC,6BAA6B"}
@@ -61,6 +61,11 @@ export class VirtualTextureSystem {
61
61
  uniforms.u_mapping_texture_width.value = mapping.texture.image.width;
62
62
  }
63
63
 
64
+ /**
65
+ *
66
+ * @param {number} [page_resolution]
67
+ * @param {AssetManager} asset_manager
68
+ */
64
69
  initialize({
65
70
  page_resolution = VT_DEFAULT_PAGE_RESOLUTION,
66
71
  asset_manager