@pirireis/webglobeplugins 0.6.47-a → 0.6.48-a
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.
|
@@ -10,7 +10,7 @@ import { GlobeShellWiggle, Float2LegendWithRatio } from "../../programs";
|
|
|
10
10
|
* @param dataWidthHeight : {width: number, height: number}
|
|
11
11
|
* @param options : {bbox: number[], minMaxEdges: {min: number, max: number}, escapeValue: number, resolution: number[], meshPartition: number[]}
|
|
12
12
|
*/
|
|
13
|
-
export default class
|
|
13
|
+
export default class HeatWaveGlobeShellPlugin {
|
|
14
14
|
constructor(id, dataManager, colorRampData, dataWidthHeight,
|
|
15
15
|
{
|
|
16
16
|
bbox = [-180, -90, 180, 90],
|
|
@@ -143,12 +143,15 @@ export default class Plugin {
|
|
|
143
143
|
|
|
144
144
|
_updateData(ratio, textureData0 = null, textureData1 = null) {
|
|
145
145
|
if (!textureData0 || !textureData1) {
|
|
146
|
-
this.
|
|
146
|
+
if (this._disCarded) return;
|
|
147
|
+
this.heatProgram.discard();
|
|
148
|
+
this.drawHeat();
|
|
149
|
+
this._disCarded = true;
|
|
147
150
|
return;
|
|
148
151
|
};
|
|
149
152
|
this.heatProgram.setBlendRatio(ratio);
|
|
150
153
|
if (this._lastTexture0data !== textureData0 || this._lastTexture1data !== textureData1) {
|
|
151
|
-
this.
|
|
154
|
+
this._disCarded = false;
|
|
152
155
|
this._lastTexture0data = textureData0;
|
|
153
156
|
this._lastTexture1data = textureData1;
|
|
154
157
|
this.heatProgram.setFloatTextureData(textureData0, textureData1, this._dataWidthHeight.width, this._dataWidthHeight.height);
|
|
@@ -166,7 +169,7 @@ export default class Plugin {
|
|
|
166
169
|
|
|
167
170
|
draw3D() {
|
|
168
171
|
if (!this._isOn) return;
|
|
169
|
-
if (!this.isAble) return;
|
|
172
|
+
// if (!this.isAble) return;
|
|
170
173
|
this.gl.disable(this.gl.DEPTH_TEST);
|
|
171
174
|
this.globeShell.draw();
|
|
172
175
|
this.gl.enable(this.gl.DEPTH_TEST);
|
package/package.json
CHANGED
|
@@ -46,7 +46,10 @@ export default class {
|
|
|
46
46
|
out vec4 outColor;
|
|
47
47
|
|
|
48
48
|
void main() {
|
|
49
|
-
|
|
49
|
+
if ( u_blend_ratio < 0.0) {
|
|
50
|
+
outColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
50
53
|
float f0 = texture(u_float_texture0, v_texcoord).r;
|
|
51
54
|
float f1 = texture(u_float_texture1, v_texcoord).r;
|
|
52
55
|
// outColor = vec4(
|
|
@@ -96,6 +96,11 @@ export default class {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
discard() {
|
|
100
|
+
this.heatParametersBlockManager.update({ blend_ratio: -1 });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
99
104
|
setColorRampTextureData(data, size) {
|
|
100
105
|
const { gl, colorRampTexture } = this;
|
|
101
106
|
gl.bindTexture(gl.TEXTURE_2D, colorRampTexture);
|