@woosh/meep-engine 2.119.21 → 2.119.23

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.21",
8
+ "version": "2.119.23",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualTexturePage.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTexturePage.js"],"names":[],"mappings":"AAsBA;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;IAgJD;;;OAGG;IACH,qCAqBC;IAED,kCAEC;IAED;;;OAGG;IACH,+CAuDC;IAED,uBAMC;IAED,gBAOC;;CACJ;4BAtcsF,OAAO"}
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;IAiKD;;;OAGG;IACH,qCAqBC;IAED,kCAEC;IAED;;;OAGG;IACH,+CAuDC;IAED,uBAMC;IAED,gBAOC;;CACJ;4BAvdM,OAAO"}
@@ -1,4 +1,11 @@
1
- import { ClampToEdgeWrapping, DataTexture, LinearFilter, NearestFilter, Vector2 } from "three";
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,40 @@ 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, this.#tile_copy_texture);
335
+ writeSample2DDataToDataTexture(copy_sampler, tile_texture);
328
336
  }
329
337
 
330
- this.#tile_copy_texture.image.data.set(tile.data.data);
331
- this.#tile_copy_texture.needsUpdate = true;
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.copyTextureToTexture(
339
- write_position, this.#tile_copy_texture, this.#page_texture
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
+ // dstPosition
362
+ write_position
363
+ );
364
+ }
341
365
 
342
366
  this.version++;
343
367
 
@@ -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,QAqBhB;IAED,0CAEC;IAED,4BAEC;IAiCD;;;;OAIG;IACH,yBAHW,MAAM,KACN,MAAM,QA+BhB;IA0BD;;;;;OAKG;IACH,yEAqDC;IAED,gBAEC;;CACJ;oCAnUmC,0BAA0B;0BADpC,yBAAyB"}
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;