@woosh/meep-engine 2.119.73 → 2.119.74
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
|
@@ -477,7 +477,7 @@ export class EngineHarness {
|
|
|
477
477
|
{
|
|
478
478
|
engine,
|
|
479
479
|
size = new Vector2(10, 10),
|
|
480
|
-
diffuse0 =
|
|
480
|
+
diffuse0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdj+P///38ACfsD/QVDRcoAAAAASUVORK5CYII=",
|
|
481
481
|
resolution = 10,
|
|
482
482
|
waterLevel = 0,
|
|
483
483
|
enableWater = true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainLayers.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/terrain/ecs/layers/TerrainLayers.js"],"names":[],"mappings":"AA6EA;IAGQ;;;OAGG;IACH,QAFU,KAAK,YAAY,CAAC,CAEJ;IAExB;;;OAGG;IACH,YAFU,OAAO,CAEoD;
|
|
1
|
+
{"version":3,"file":"TerrainLayers.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/terrain/ecs/layers/TerrainLayers.js"],"names":[],"mappings":"AA6EA;IAGQ;;;OAGG;IACH,QAFU,KAAK,YAAY,CAAC,CAEJ;IAExB;;;OAGG;IACH,YAFU,OAAO,CAEoD;IAMrE;;;OAGG;IACH,SAFU,kBAAkB,CAE8B;IAiB1D,2BAAsF;IAc1F;;;MAKC;IAED;;;aAGC;IAED;;;;OAIG;IACH,gCAHW,MAAM,iBACN,MAAM,QAuChB;IAED;;;;OAIG;IACH,0DAyBC;IAED,sCAIC;IAED;;;;OAIG;IACH,WAHW,MAAM,GACL,YAAY,CAIvB;IAED;;;;OAIG;IACH,8DAFa,MAAM,CAqBlB;IAED;;;;OAIG;IACH,kCAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;OAGG;IACH,SAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,gBAHW,YAAY,GACV,MAAM,CAWlB;IAED;;;;OAIG;IACH,mBAHW,YAAY,GACX,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,0CA8BC;IAED;;;OAGG;IACH,iCAFW,MAAM,QAgChB;IAED,gBAGC;IAED,cAEC;IAGD,qBAsCC;CACJ;iBA5ZgB,6CAA6C;6BAQjC,mBAAmB;oBAP5B,qCAAqC;mCALlD,OAAO;4BAAP,OAAO"}
|
|
@@ -36,7 +36,7 @@ class ScaledTextureKey {
|
|
|
36
36
|
* @returns {ScaledTextureKey}
|
|
37
37
|
*/
|
|
38
38
|
static from(uri, size) {
|
|
39
|
-
assert.isString(uri,
|
|
39
|
+
assert.isString(uri, 'uri');
|
|
40
40
|
|
|
41
41
|
const r = new ScaledTextureKey();
|
|
42
42
|
|
|
@@ -90,11 +90,15 @@ export class TerrainLayers {
|
|
|
90
90
|
*/
|
|
91
91
|
this.resolution = new Vector2(DEFAULT_RESOLUTION, DEFAULT_RESOLUTION);
|
|
92
92
|
|
|
93
|
+
|
|
94
|
+
const layer_data = new Uint8Array(3);
|
|
95
|
+
layer_data.fill(255); //pre-fill with white
|
|
96
|
+
|
|
93
97
|
/**
|
|
94
98
|
*
|
|
95
99
|
* @type {DataTexture2DArray}
|
|
96
100
|
*/
|
|
97
|
-
this.texture = new DataTexture2DArray(
|
|
101
|
+
this.texture = new DataTexture2DArray(layer_data, 1, 1, 1);
|
|
98
102
|
this.texture.format = GL_RGBFormat;
|
|
99
103
|
this.texture.type = UnsignedByteType;
|
|
100
104
|
|
|
@@ -109,6 +113,7 @@ export class TerrainLayers {
|
|
|
109
113
|
this.texture.generateMipmaps = true;
|
|
110
114
|
this.texture.encoding = LinearEncoding;
|
|
111
115
|
this.texture.internalFormat = 'RGB8';
|
|
116
|
+
this.texture.needsUpdate = true;
|
|
112
117
|
|
|
113
118
|
this.scalesTexture = new DataTexture(new Float32Array(64), 32, 1, RGFormat, FloatType);
|
|
114
119
|
|
|
@@ -121,6 +126,7 @@ export class TerrainLayers {
|
|
|
121
126
|
this.scalesTexture.internalFormat = 'RG32F';
|
|
122
127
|
|
|
123
128
|
this.scalesTexture.generateMipmaps = false;
|
|
129
|
+
this.scalesTexture.needsUpdate = true;
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
toJSON() {
|
|
@@ -406,6 +412,7 @@ export class TerrainLayers {
|
|
|
406
412
|
|
|
407
413
|
//build an array to hold texture array
|
|
408
414
|
const arrayData = new Uint8Array(size_x * size_y * 3 * layerCount);
|
|
415
|
+
arrayData.fill(255); // fill with white
|
|
409
416
|
|
|
410
417
|
if (image.width === size_x && image.height === size_y) {
|
|
411
418
|
// dimensions preserved, copy old data
|