@woosh/meep-engine 2.119.21 → 2.119.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.
- package/package.json +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTexturePage.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTexturePage.js +39 -8
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.js +1 -0
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualTexturePage.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTexturePage.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VirtualTexturePage.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTexturePage.js"],"names":[],"mappings":"AA6BA;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;IA6DD;;;OAGG;IACH,sBAEC;IAED,4BAIC;IAwKD;;;OAGG;IACH,qCAqBC;IAED,kCAEC;IAED;;;OAGG;IACH,+CAuDC;IAED,uBAMC;IAED,gBAOC;;CACJ;4BA9dM,OAAO"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ClampToEdgeWrapping,
|
|
3
|
+
DataTexture,
|
|
4
|
+
LinearFilter,
|
|
5
|
+
NearestFilter,
|
|
6
|
+
REVISION as THREE_VERSION,
|
|
7
|
+
Vector2
|
|
8
|
+
} from "three";
|
|
2
9
|
import { assert } from "../../../../core/assert.js";
|
|
3
10
|
import { BitSet } from "../../../../core/binary/BitSet.js";
|
|
4
11
|
import { Cache } from "../../../../core/cache/Cache.js";
|
|
@@ -160,7 +167,7 @@ export class VirtualTexturePage {
|
|
|
160
167
|
texture.minFilter = NearestFilter;
|
|
161
168
|
texture.magFilter = LinearFilter;
|
|
162
169
|
// texture.magFilter = NearestFilter;
|
|
163
|
-
texture.anisotropy = this.#tile_margin*2;
|
|
170
|
+
texture.anisotropy = this.#tile_margin * 2;
|
|
164
171
|
|
|
165
172
|
this.#tile_copy_texture.wrapT = ClampToEdgeWrapping;
|
|
166
173
|
this.#tile_copy_texture.wrapS = ClampToEdgeWrapping;
|
|
@@ -321,23 +328,47 @@ export class VirtualTexturePage {
|
|
|
321
328
|
const slot_resolution = this.#tile_slot_resolution;
|
|
322
329
|
|
|
323
330
|
const copy_sampler = this.#tile_copy_sampler;
|
|
331
|
+
const tile_texture = this.#tile_copy_texture;
|
|
324
332
|
if (copy_sampler.width !== slot_resolution || copy_sampler.height !== slot_resolution) {
|
|
325
333
|
copy_sampler.resize(slot_resolution, slot_resolution);
|
|
326
334
|
|
|
327
|
-
writeSample2DDataToDataTexture(copy_sampler,
|
|
335
|
+
writeSample2DDataToDataTexture(copy_sampler, tile_texture);
|
|
328
336
|
}
|
|
329
337
|
|
|
330
|
-
|
|
331
|
-
|
|
338
|
+
tile_texture.image.data.set(tile.data.data);
|
|
339
|
+
tile_texture.needsUpdate = true;
|
|
332
340
|
|
|
333
341
|
const write_position = new Vector2(
|
|
334
342
|
position_tile_x * slot_resolution,
|
|
335
343
|
position_tile_y * slot_resolution,
|
|
336
344
|
);
|
|
337
345
|
|
|
338
|
-
this.#renderer
|
|
339
|
-
|
|
340
|
-
|
|
346
|
+
const renderer = this.#renderer;
|
|
347
|
+
if (THREE_VERSION < 165) {
|
|
348
|
+
renderer.copyTextureToTexture(
|
|
349
|
+
write_position, tile_texture, this.#page_texture
|
|
350
|
+
);
|
|
351
|
+
} else {
|
|
352
|
+
// API changed since version 165
|
|
353
|
+
renderer.copyTextureToTexture(
|
|
354
|
+
tile_texture,
|
|
355
|
+
this.#page_texture,
|
|
356
|
+
// srcRegion
|
|
357
|
+
{
|
|
358
|
+
min: { x: 0, y: 0 },
|
|
359
|
+
max: { x: slot_resolution, y: slot_resolution },
|
|
360
|
+
},
|
|
361
|
+
// dstRegion
|
|
362
|
+
{
|
|
363
|
+
min: {
|
|
364
|
+
x: write_position.x, y: write_position.y,
|
|
365
|
+
},
|
|
366
|
+
max: {
|
|
367
|
+
x: write_position.x + slot_resolution, y: write_position.y + slot_resolution
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
}
|
|
341
372
|
|
|
342
373
|
this.version++;
|
|
343
374
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualTextureUsageUpdater.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.js"],"names":[],"mappings":"AA2EA;IAgBI;;;OAGG;IACH,uCAEC;IAVD,oCAEC;IA8CD,iCAEC;IAED,8BAEC;IAED,4BAEC;IASD;;;;;OAKG;IACH,iCAJW,MAAM,aACN,MAAM,cACN,MAAM,
|
|
1
|
+
{"version":3,"file":"VirtualTextureUsageUpdater.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.js"],"names":[],"mappings":"AA2EA;IAgBI;;;OAGG;IACH,uCAEC;IAVD,oCAEC;IA8CD,iCAEC;IAED,8BAEC;IAED,4BAEC;IASD;;;;;OAKG;IACH,iCAJW,MAAM,aACN,MAAM,cACN,MAAM,QAsBhB;IAED,0CAEC;IAED,4BAEC;IAiCD;;;;OAIG;IACH,yBAHW,MAAM,KACN,MAAM,QA+BhB;IA0BD;;;;;OAKG;IACH,yEAqDC;IAED,gBAEC;;CACJ;oCApUmC,0BAA0B;0BADpC,yBAAyB"}
|
|
@@ -163,6 +163,7 @@ export class VirtualTextureUsageUpdater {
|
|
|
163
163
|
tile_size,
|
|
164
164
|
texture_id
|
|
165
165
|
) {
|
|
166
|
+
assert.isNonNegativeInteger(resolution,'resolution');
|
|
166
167
|
assert.lessThanOrEqual(tile_size, resolution, `tile_size(=${tile_size}) must be <= than the overall texture resolution(=${resolution})`);
|
|
167
168
|
|
|
168
169
|
this.#texture_id = texture_id;
|