@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 +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureMemoryMapping.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureMemoryMapping.js +1 -0
- package/src/engine/graphics/texture/virtual/VirtualTexturePage.d.ts +6 -6
- package/src/engine/graphics/texture/virtual/VirtualTexturePage.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTexturePage.js +27 -19
- package/src/engine/graphics/texture/virtual/VirtualTextureSystem.d.ts +6 -4
- package/src/engine/graphics/texture/virtual/VirtualTextureSystem.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureSystem.js +5 -0
package/package.json
CHANGED
|
@@ -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;
|
|
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"}
|
|
@@ -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;
|
|
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(
|
|
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 = [
|
|
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
|
-
|
|
391
|
-
// nothing to do
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
397
|
+
const current_resolution = this.#page_texture_size;
|
|
394
398
|
|
|
395
|
-
|
|
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
|
-
|
|
401
|
+
array_copy(
|
|
402
|
+
v, 0,
|
|
403
|
+
current_resolution, 0,
|
|
404
|
+
2
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
this.clear_resident();
|
|
402
408
|
|
|
403
|
-
|
|
409
|
+
page_texture.dispose();
|
|
404
410
|
|
|
405
|
-
|
|
406
|
-
|
|
411
|
+
const width = current_resolution[0];
|
|
412
|
+
const height = current_resolution[1];
|
|
407
413
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
414
|
+
page_image.data = new Uint8Array(width * height * 4);
|
|
415
|
+
page_image.width = width;
|
|
416
|
+
page_image.height = height;
|
|
411
417
|
|
|
412
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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
|