@pirireis/webglobeplugins 0.8.24 → 0.8.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.
@@ -18,6 +18,7 @@ export default class HeatWaveGlobeShellPlugin {
18
18
  minMaxEdges = { min: -99999, max: 99999 },
19
19
  escapeValue = 99999,
20
20
  resolution = [2056, 2056],
21
+ yFlip = true,
21
22
  } = {}) {
22
23
  this.id = id;
23
24
  this.dataManager = dataManager;
@@ -30,7 +31,7 @@ export default class HeatWaveGlobeShellPlugin {
30
31
  this._resolution = resolution;
31
32
 
32
33
  this._colorRampData = colorRampData; // holds until init
33
-
34
+ this._yFlip = yFlip;
34
35
  this._lastTexture0data = null;
35
36
  this._lastTexture1data = null;
36
37
 
@@ -155,7 +156,7 @@ export default class HeatWaveGlobeShellPlugin {
155
156
  this._disCarded = false;
156
157
  this._lastTexture0data = textureData0;
157
158
  this._lastTexture1data = textureData1;
158
- this.heatProgram.setFloatTextureData(textureData0, textureData1, this._dataWidthHeight.width, this._dataWidthHeight.height);
159
+ this.heatProgram.setFloatTextureData(textureData0, textureData1, this._dataWidthHeight.width, this._dataWidthHeight.height, this._yFlip);
159
160
  }
160
161
  this.drawHeat();
161
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.8.24",
3
+ "version": "0.8.25",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -87,12 +87,15 @@ export default class DataObject {
87
87
  }
88
88
 
89
89
 
90
- setFloatTextureData(data0, data1, width, height) {
90
+ setFloatTextureData(data0, data1, width, height, yFlip = false) {
91
91
  const { texture0, texture1, gl } = this;
92
+
92
93
  gl.bindTexture(gl.TEXTURE_2D, texture0);
94
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, yFlip);
93
95
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.R16F, width, height, 0, gl.RED, gl.FLOAT, data0);
94
96
  gl.bindTexture(gl.TEXTURE_2D, texture1);
95
97
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.R16F, width, height, 0, gl.RED, gl.FLOAT, data1);
98
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
96
99
  }
97
100
 
98
101