@pirireis/webglobeplugins 0.9.11 → 0.9.12
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/Math/angle-calculation.js +8 -8
- package/Math/arc.js +18 -18
- package/Math/bounds/line-bbox.js +78 -80
- package/Math/constants.js +3 -3
- package/Math/juction/arc-plane.js +23 -23
- package/Math/juction/line-sphere.js +11 -11
- package/Math/juction/plane-plane.js +11 -11
- package/Math/line.js +14 -16
- package/Math/methods.js +65 -70
- package/Math/plane.js +16 -18
- package/Math/quaternion.js +45 -49
- package/Math/utils.js +2 -2
- package/Math/vec3.js +42 -45
- package/algorithms/search-binary.js +4 -4
- package/altitude-locator/draw-subset-obj.js +7 -8
- package/altitude-locator/plugin.js +98 -114
- package/arrowfield/adaptor.js +3 -4
- package/arrowfield/index.js +2 -2
- package/arrowfield/plugin.js +62 -65
- package/bearing-line/index.js +1 -1
- package/bearing-line/plugin.js +200 -226
- package/circle-line-chain/chain-list-map.js +82 -88
- package/circle-line-chain/plugin.js +134 -165
- package/circle-line-chain/util.js +1 -1
- package/compass-rose/compass-rose-padding-flat.js +108 -133
- package/compass-rose/compass-text-writer.js +62 -70
- package/compass-rose/index.js +2 -2
- package/compassrose/compassrose.js +46 -50
- package/compassrose/index.js +1 -1
- package/heatwave/index.js +2 -2
- package/heatwave/isobar/objectarraylabels.js +44 -48
- package/heatwave/isobar/plugin.js +104 -123
- package/heatwave/isobar/quadtreecontours.js +76 -92
- package/heatwave/plugins/heatwaveglobeshell.js +69 -87
- package/index.js +11 -11
- package/package.json +1 -1
- package/partialrings/buffer-manager.js +32 -64
- package/partialrings/index.js +1 -1
- package/partialrings/plugin.js +48 -84
- package/partialrings/program.js +136 -47
- package/pin/pin-object-array.js +83 -86
- package/pin/pin-point-totem.js +21 -22
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
- package/point-heat-map/plugin-webworker.js +40 -45
- package/point-heat-map/point-to-heat-map-flow.js +40 -42
- package/point-tracks/key-methods.js +1 -1
- package/point-tracks/plugin.js +137 -162
- package/programs/arrowfield/index.js +1 -1
- package/programs/arrowfield/logic.js +170 -62
- package/programs/arrowfield/object.js +33 -35
- package/programs/data2legend/density-to-legend.js +45 -21
- package/programs/data2legend/point-to-density-texture.js +52 -27
- package/programs/float2legendwithratio/index.js +1 -1
- package/programs/float2legendwithratio/logic.js +88 -42
- package/programs/float2legendwithratio/object.js +43 -46
- package/programs/globe-util/is-globe-moved.js +10 -11
- package/programs/globeshell/index.js +1 -1
- package/programs/globeshell/wiggle/index.js +1 -1
- package/programs/globeshell/wiggle/logic.js +191 -98
- package/programs/globeshell/wiggle/object.js +33 -35
- package/programs/helpers/blender/program.js +36 -19
- package/programs/helpers/fadeaway/index.js +1 -1
- package/programs/helpers/fadeaway/logic.js +35 -13
- package/programs/helpers/fadeaway/object.js +9 -10
- package/programs/helpers/index.js +1 -1
- package/programs/index.js +8 -8
- package/programs/line-on-globe/angled-line.js +91 -32
- package/programs/line-on-globe/circle-accurate-3d.js +82 -32
- package/programs/line-on-globe/circle-accurate-flat.js +108 -50
- package/programs/line-on-globe/circle-accurate.js +103 -33
- package/programs/line-on-globe/circle.js +97 -32
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +83 -33
- package/programs/line-on-globe/lines-color-instanced-flat.js +79 -34
- package/programs/line-on-globe/linestrip.js +111 -45
- package/programs/line-on-globe/naive-accurate-flexible.js +120 -50
- package/programs/line-on-globe/to-the-surface.js +58 -29
- package/programs/line-on-globe/util.js +1 -1
- package/programs/picking/pickable-renderer.js +117 -33
- package/programs/point-on-globe/element-globe-surface-glow.js +78 -38
- package/programs/point-on-globe/element-point-glow.js +103 -35
- package/programs/point-on-globe/square-pixel-point.js +76 -27
- package/programs/programcache.js +13 -13
- package/programs/rings/distancering/circleflatprogram.js +63 -21
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +156 -145
- package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -197
- package/programs/rings/distancering/index.js +4 -4
- package/programs/rings/distancering/paddyflatprogram.js +73 -20
- package/programs/rings/distancering/paddyflatprogram2d.js +75 -22
- package/programs/rings/distancering/paddyflatprogram3d.js +73 -20
- package/programs/rings/partial-ring/piece-of-pie.js +137 -35
- package/programs/totems/camerauniformblock.js +64 -51
- package/programs/totems/canvas-webglobe-info.js +48 -40
- package/programs/totems/gpu-selection-uniform-block.js +44 -40
- package/programs/totems/index.js +1 -1
- package/programs/two-d/pixel-padding-for-compass.js +90 -29
- package/programs/util.js +6 -7
- package/programs/vectorfields/index.js +1 -1
- package/programs/vectorfields/logics/drawrectangleparticles.js +70 -29
- package/programs/vectorfields/logics/index.js +3 -3
- package/programs/vectorfields/logics/pixelbased.js +91 -35
- package/programs/vectorfields/logics/ubo.js +31 -25
- package/programs/vectorfields/pingpongbuffermanager.js +30 -34
- package/rangerings/index.js +4 -4
- package/rangerings/plugin.js +202 -258
- package/rangerings/rangeringangletext.js +108 -120
- package/rangerings/ring-account.js +52 -69
- package/shaders/fragment-toy/firework.js +55 -1
- package/shaders/fragment-toy/singularity.js +55 -1
- package/timetracks/adaptors-line-strip.js +26 -37
- package/timetracks/adaptors.js +47 -61
- package/timetracks/index.js +4 -4
- package/timetracks/plugin-line-strip.js +63 -71
- package/timetracks/plugin.js +69 -77
- package/timetracks/program-line-strip.js +296 -103
- package/timetracks/program.js +419 -113
- package/timetracks/programpoint-line-strip.js +97 -44
- package/timetracks/programpoint.js +90 -44
- package/util/account/bufferoffsetmanager.js +72 -95
- package/util/account/index.js +1 -1
- package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -44
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -94
- package/util/account/single-attribute-buffer-management/index.js +3 -3
- package/util/account/single-attribute-buffer-management/object-store.js +29 -30
- package/util/account/util.js +2 -4
- package/util/algorithms/search-binary.js +4 -4
- package/util/check/get.js +5 -5
- package/util/check/typecheck.js +13 -15
- package/util/geometry/index.js +9 -11
- package/util/gl-util/buffer/attribute-loader.js +8 -20
- package/util/gl-util/buffer/index.js +1 -1
- package/util/gl-util/draw-options/methods.js +8 -9
- package/util/gl-util/uniform-block/manager.js +67 -67
- package/util/heatwavedatamanager/datamanager.js +56 -116
- package/util/heatwavedatamanager/index.js +2 -2
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +37 -40
- package/util/heatwavedatamanager/pointcoordsmeta.js +9 -10
- package/util/index.js +6 -6
- package/util/interpolation/timetrack/index.js +1 -1
- package/util/interpolation/timetrack/timetrack-interpolator.js +27 -29
- package/util/interpolation/timetrack/web-worker-str.js +179 -1
- package/util/interpolation/timetrack/web-worker.js +4 -4
- package/util/jshelpers/data-filler.js +7 -7
- package/util/jshelpers/timefilters.js +7 -7
- package/util/picking/fence.js +7 -7
- package/util/picking/picker-displayer.js +46 -52
- package/util/programs/draw-texture-on-canvas.js +39 -21
- package/util/programs/shapesonglobe.js +104 -64
- package/util/programs/supersampletotextures.js +45 -39
- package/util/programs/texturetoglobe.js +98 -48
- package/util/shaderfunctions/geometrytransformations.js +322 -27
- package/util/shaderfunctions/nodata.js +7 -1
- package/util/shaderfunctions/noisefunctions.js +39 -9
- package/util/surface-line-data/arcs-to-cuts.js +20 -23
- package/util/webglobe/rasteroverlay.js +35 -37
- package/util/webglobjectbuilders.js +55 -60
- package/util/webglobjectbuilders1.js +48 -49
- package/waveparticles/adaptor.js +6 -7
- package/waveparticles/index.js +2 -2
- package/waveparticles/plugin.js +79 -84
- package/wind/imagetovectorfieldandmagnitude.js +15 -15
- package/wind/index.js +4 -4
- package/wind/plugin.js +453 -251
- package/wind/vectorfieldimage.js +5 -5
- package/write-text/attached-text-writer.js +46 -48
- package/write-text/context-text.js +51 -58
- package/write-text/context-text3.js +69 -74
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const util_1 = require("../../util");
|
|
4
|
+
class default_1 {
|
|
5
|
+
constructor(gl) {
|
|
6
6
|
this.gl = gl;
|
|
7
7
|
// console.log("Float2LegendWithRatioProgram gl:", gl);
|
|
8
8
|
this._width = 1;
|
|
@@ -10,14 +10,63 @@ var default_1 = /** @class */ (function () {
|
|
|
10
10
|
this._blendRatio = 0.0;
|
|
11
11
|
this.programWrapper = this._createProgramWrapper();
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
_createProgramWrapper() {
|
|
14
|
+
const vertexShaderSource = `#version 300 es
|
|
15
|
+
precision highp float;
|
|
16
|
+
|
|
17
|
+
in vec2 a_position;
|
|
18
|
+
out vec2 v_texcoord;
|
|
19
|
+
|
|
20
|
+
void main() {
|
|
21
|
+
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
22
|
+
v_texcoord = a_position * 0.5 + 0.5;
|
|
23
|
+
v_texcoord.y = 1.0 - v_texcoord.y;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
const fragmentShaderSource = `#version 300 es
|
|
27
|
+
precision highp float;
|
|
28
|
+
|
|
29
|
+
in vec2 v_texcoord;
|
|
30
|
+
uniform sampler2D u_float_texture0;
|
|
31
|
+
uniform sampler2D u_float_texture1;
|
|
32
|
+
uniform sampler2D u_color_texture;
|
|
33
|
+
|
|
34
|
+
layout(std140) uniform HeatParametersBlock {
|
|
35
|
+
vec2 u_color_ramp_range; // x is min, y is range ( max - min)
|
|
36
|
+
vec2 u_min_max;
|
|
37
|
+
float u_escape_value;
|
|
38
|
+
float u_blend_ratio;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
out vec4 outColor;
|
|
42
|
+
|
|
43
|
+
void main() {
|
|
44
|
+
if ( u_blend_ratio < 0.0) {
|
|
45
|
+
outColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
float f0 = texture(u_float_texture0, v_texcoord).r;
|
|
49
|
+
float f1 = texture(u_float_texture1, v_texcoord).r;
|
|
50
|
+
// outColor = vec4(
|
|
51
|
+
|
|
52
|
+
if (f0 == u_escape_value || f1 == u_escape_value) {
|
|
53
|
+
outColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
float x = mix(f0, f1, u_blend_ratio);
|
|
57
|
+
if ( x < u_min_max.x || x > u_min_max.y) {
|
|
58
|
+
outColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
x = (x - u_color_ramp_range.x) / u_color_ramp_range.y;
|
|
62
|
+
outColor = texture(u_color_texture, vec2(x, 0.5));
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
const gl = this.gl;
|
|
66
|
+
const program = (0, util_1.createProgram)(gl, vertexShaderSource, fragmentShaderSource);
|
|
67
|
+
const vao = gl.createVertexArray();
|
|
19
68
|
gl.bindVertexArray(vao);
|
|
20
|
-
|
|
69
|
+
const buffer = gl.createBuffer();
|
|
21
70
|
this._buffer = buffer;
|
|
22
71
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
23
72
|
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
@@ -26,16 +75,16 @@ var default_1 = /** @class */ (function () {
|
|
|
26
75
|
1, 1,
|
|
27
76
|
-1, 1
|
|
28
77
|
]), gl.STATIC_DRAW);
|
|
29
|
-
|
|
78
|
+
const positionLocation = gl.getAttribLocation(program, "a_position");
|
|
30
79
|
gl.enableVertexAttribArray(positionLocation);
|
|
31
80
|
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
|
|
32
81
|
gl.bindVertexArray(null);
|
|
33
82
|
this.heatParametersBlockBindingPoint = 0;
|
|
34
|
-
|
|
83
|
+
const heatParametersBlockIndex = gl.getUniformBlockIndex(program, "HeatParametersBlock");
|
|
35
84
|
gl.uniformBlockBinding(program, heatParametersBlockIndex, this.heatParametersBlockBindingPoint);
|
|
36
85
|
return {
|
|
37
|
-
program
|
|
38
|
-
vao
|
|
86
|
+
program,
|
|
87
|
+
vao,
|
|
39
88
|
u_float_texture0: gl.getUniformLocation(program, "u_float_texture0"),
|
|
40
89
|
u_float_texture1: gl.getUniformLocation(program, "u_float_texture1"),
|
|
41
90
|
u_color_texture: gl.getUniformLocation(program, "u_color_texture"),
|
|
@@ -44,13 +93,13 @@ var default_1 = /** @class */ (function () {
|
|
|
44
93
|
u_min_max: gl.getUniformLocation(program, "u_min_max"),
|
|
45
94
|
u_escape_value: gl.getUniformLocation(program, "u_escape_value")
|
|
46
95
|
};
|
|
47
|
-
}
|
|
48
|
-
|
|
96
|
+
}
|
|
97
|
+
getUniformBlockManager() {
|
|
49
98
|
return new HeatParametersBlockManager(this.gl);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
99
|
+
}
|
|
100
|
+
draw(texture0, texture1, colorRampTexture, heatParametersBlockManager) {
|
|
101
|
+
const { gl, programWrapper } = this;
|
|
102
|
+
const { program, u_float_texture0, u_float_texture1, u_color_texture } = programWrapper;
|
|
54
103
|
gl.useProgram(program);
|
|
55
104
|
gl.bindVertexArray(programWrapper.vao);
|
|
56
105
|
gl.activeTexture(gl.TEXTURE1);
|
|
@@ -68,18 +117,17 @@ var default_1 = /** @class */ (function () {
|
|
|
68
117
|
gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);
|
|
69
118
|
gl.bindVertexArray(null);
|
|
70
119
|
heatParametersBlockManager.unbind();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
120
|
+
}
|
|
121
|
+
free() {
|
|
122
|
+
const gl = this.gl;
|
|
74
123
|
gl.deleteBuffer(this._buffer);
|
|
75
124
|
gl.deleteProgram(this.programWrapper.program);
|
|
76
125
|
gl.deleteVertexArray(this.programWrapper.vao);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
}());
|
|
126
|
+
}
|
|
127
|
+
}
|
|
80
128
|
exports.default = default_1;
|
|
81
|
-
|
|
82
|
-
|
|
129
|
+
class HeatParametersBlockManager {
|
|
130
|
+
constructor(gl) {
|
|
83
131
|
this.gl = gl;
|
|
84
132
|
this.buffer = gl.createBuffer();
|
|
85
133
|
gl.bindBuffer(gl.UNIFORM_BUFFER, this.buffer);
|
|
@@ -92,9 +140,8 @@ var HeatParametersBlockManager = /** @class */ (function () {
|
|
|
92
140
|
* @param {number} escape_value // value that will be ignored
|
|
93
141
|
* @param {number} blend_ratio // ratio of blending between two textures
|
|
94
142
|
* */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var _f = this, gl = _f.gl, buffer = _f.buffer;
|
|
143
|
+
update({ color_ramp_range = null, min_max = null, escape_value = null, blend_ratio = null }) {
|
|
144
|
+
const { gl, buffer } = this;
|
|
98
145
|
gl.bindBuffer(gl.UNIFORM_BUFFER, buffer);
|
|
99
146
|
if (color_ramp_range) {
|
|
100
147
|
gl.bufferSubData(gl.UNIFORM_BUFFER, 0, new Float32Array(color_ramp_range));
|
|
@@ -109,17 +156,16 @@ var HeatParametersBlockManager = /** @class */ (function () {
|
|
|
109
156
|
gl.bufferSubData(gl.UNIFORM_BUFFER, 20, new Float32Array([blend_ratio]));
|
|
110
157
|
}
|
|
111
158
|
gl.bindBuffer(gl.UNIFORM_BUFFER, null);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
159
|
+
}
|
|
160
|
+
bind() {
|
|
161
|
+
const { gl, buffer } = this;
|
|
115
162
|
gl.bindBufferBase(gl.UNIFORM_BUFFER, this.heatParametersBlockBindingPoint, buffer);
|
|
116
|
-
}
|
|
117
|
-
|
|
163
|
+
}
|
|
164
|
+
free() {
|
|
118
165
|
this.gl.deleteBuffer(this.buffer);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
166
|
+
}
|
|
167
|
+
unbind() {
|
|
168
|
+
const { gl } = this;
|
|
122
169
|
gl.bindBufferBase(gl.UNIFORM_BUFFER, this.heatParametersBlockBindingPoint, null);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
}());
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const logic_1 = __importDefault(require("./logic"));
|
|
7
|
+
const programcache_1 = require("../programcache");
|
|
8
8
|
// Uniform Buffer Objects use this
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.width, width = _c === void 0 ? 1 : _c, _d = _b.height, height = _d === void 0 ? 1 : _d, _e = _b.texture0, texture0 = _e === void 0 ? null : _e, _f = _b.texture1, texture1 = _f === void 0 ? null : _f, _g = _b.colorRampTexture, colorRampTexture = _g === void 0 ? null : _g, _h = _b.colorRampRange, colorRampRange = _h === void 0 ? null : _h, _j = _b.escapeValue, escapeValue = _j === void 0 ? 99999 : _j, _k = _b.blendRatio, blendRatio = _k === void 0 ? 0.0 : _k, _l = _b.minMaxEdges, minMaxEdges = _l === void 0 ? null : _l;
|
|
9
|
+
class DataObject {
|
|
10
|
+
constructor(gl, { width = 1, height = 1, texture0 = null, texture1 = null, colorRampTexture = null, colorRampRange = null, escapeValue = 99999, blendRatio = 0.0, minMaxEdges = null, } = {}) {
|
|
12
11
|
this.gl = gl;
|
|
13
12
|
this.programlogic = programcache_1.glProgramCache.getProgram(gl, logic_1.default);
|
|
14
13
|
this.heatParametersBlockManager = this.programlogic.getUniformBlockManager();
|
|
@@ -25,14 +24,14 @@ var DataObject = /** @class */ (function () {
|
|
|
25
24
|
color_ramp_range: colorRampRange
|
|
26
25
|
});
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
_bindBlock() {
|
|
28
|
+
const gl = this.gl;
|
|
29
|
+
const program = this.programlogic.programWrapper.program;
|
|
31
30
|
gl.uniformBlockBinding(program, gl.getUniformBlockIndex(program, 'Block'), 0);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
}
|
|
32
|
+
_createColorRampTexture() {
|
|
33
|
+
const { gl } = this;
|
|
34
|
+
const texture = gl.createTexture();
|
|
36
35
|
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
37
36
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
38
37
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
@@ -40,74 +39,72 @@ var DataObject = /** @class */ (function () {
|
|
|
40
39
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
41
40
|
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
42
41
|
return texture;
|
|
43
|
-
}
|
|
44
|
-
|
|
42
|
+
}
|
|
43
|
+
setBlendRatio(ratio) {
|
|
45
44
|
if (ratio < 0 || ratio > 1) {
|
|
46
45
|
console.warn('Invalid blend ratio');
|
|
47
46
|
return;
|
|
48
47
|
}
|
|
49
48
|
this.heatParametersBlockManager.update({ blend_ratio: ratio });
|
|
50
|
-
}
|
|
51
|
-
|
|
49
|
+
}
|
|
50
|
+
setEscapeValue(value) {
|
|
52
51
|
this.heatParametersBlockManager.update({ escape_value: value });
|
|
53
|
-
}
|
|
54
|
-
|
|
52
|
+
}
|
|
53
|
+
setTexture0(texture) {
|
|
55
54
|
this.texture0 = texture;
|
|
56
|
-
}
|
|
57
|
-
|
|
55
|
+
}
|
|
56
|
+
setTexture1(texture) {
|
|
58
57
|
this.texture1 = texture;
|
|
59
|
-
}
|
|
60
|
-
|
|
58
|
+
}
|
|
59
|
+
setColorRampTexture(texture) {
|
|
61
60
|
this.colorRampTexture = texture;
|
|
62
|
-
}
|
|
63
|
-
|
|
61
|
+
}
|
|
62
|
+
setDataWidthHeight(width, height) {
|
|
64
63
|
this.width = width;
|
|
65
64
|
this.height = height;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var _a = this, texture0 = _a.texture0, texture1 = _a.texture1, gl = _a.gl;
|
|
65
|
+
}
|
|
66
|
+
setFloatTextureData(data0, data1, width, height, yFlip = false) {
|
|
67
|
+
const { texture0, texture1, gl } = this;
|
|
70
68
|
gl.bindTexture(gl.TEXTURE_2D, texture0);
|
|
71
69
|
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, yFlip);
|
|
72
70
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.R16F, width, height, 0, gl.RED, gl.FLOAT, data0);
|
|
73
71
|
gl.bindTexture(gl.TEXTURE_2D, texture1);
|
|
74
72
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.R16F, width, height, 0, gl.RED, gl.FLOAT, data1);
|
|
75
73
|
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
|
76
|
-
}
|
|
77
|
-
|
|
74
|
+
}
|
|
75
|
+
discard() {
|
|
78
76
|
this.heatParametersBlockManager.update({ blend_ratio: -1 });
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
}
|
|
78
|
+
setColorRampTextureData(data, size) {
|
|
79
|
+
const { gl, colorRampTexture } = this;
|
|
82
80
|
gl.bindTexture(gl.TEXTURE_2D, colorRampTexture);
|
|
83
81
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data);
|
|
84
|
-
}
|
|
85
|
-
|
|
82
|
+
}
|
|
83
|
+
setColorRampRange(min, max) {
|
|
86
84
|
if (min > max) {
|
|
87
85
|
console.warn('Invalid min max values');
|
|
88
86
|
return;
|
|
89
87
|
}
|
|
90
|
-
|
|
88
|
+
const range = max - min;
|
|
91
89
|
this.heatParametersBlockManager.update({ color_ramp_range: new Float32Array([min, range]) });
|
|
92
|
-
}
|
|
93
|
-
|
|
90
|
+
}
|
|
91
|
+
setMinMaxEdges(min, max) {
|
|
94
92
|
if (min)
|
|
95
93
|
this.minMaxEdges[0] = min;
|
|
96
94
|
if (max)
|
|
97
95
|
this.minMaxEdges[1] = max;
|
|
98
96
|
this.heatParametersBlockManager.update({ min_max: this.minMaxEdges });
|
|
99
|
-
}
|
|
100
|
-
|
|
97
|
+
}
|
|
98
|
+
draw() {
|
|
101
99
|
this.programlogic.draw(this.texture0, this.texture1, this.colorRampTexture, this.heatParametersBlockManager);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
}
|
|
101
|
+
free() {
|
|
102
|
+
const { gl, texture0, texture1, colorRampTexture } = this;
|
|
105
103
|
gl.deleteTexture(texture0);
|
|
106
104
|
gl.deleteTexture(texture1);
|
|
107
105
|
gl.deleteTexture(colorRampTexture);
|
|
108
106
|
programcache_1.glProgramCache.releaseProgram(this.gl, logic_1.default);
|
|
109
107
|
this.heatParametersBlockManager.free();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
}());
|
|
108
|
+
}
|
|
109
|
+
}
|
|
113
110
|
exports.default = DataObject;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const programcache_1 = require("../programcache");
|
|
4
|
+
class IsGlobeMoved {
|
|
5
|
+
constructor(globe) {
|
|
6
6
|
this.globe = globe;
|
|
7
7
|
this._lastLOD = globe.api_GetCurrentLODWithDecimal();
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
isMoved() {
|
|
10
|
+
const globe = this.globe;
|
|
11
11
|
if (globe.api_IsScreenMoving() || this._lastLOD != globe.api_GetCurrentLODWithDecimal()) {
|
|
12
12
|
this._lastLOD = globe.api_GetCurrentLODWithDecimal();
|
|
13
13
|
return true;
|
|
14
14
|
}
|
|
15
15
|
return false;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
release: function (globe) { return programcache_1.noRegisterGlobeProgramCache.releaseProgram(globe, IsGlobeMoved); }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const IsGlobeMovedCache = Object.freeze({
|
|
19
|
+
get: (globe) => programcache_1.noRegisterGlobeProgramCache.getProgram(globe, IsGlobeMoved),
|
|
20
|
+
release: (globe) => programcache_1.noRegisterGlobeProgramCache.releaseProgram(globe, IsGlobeMoved)
|
|
22
21
|
});
|
|
@@ -4,5 +4,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.GlobeShellWiggle = void 0;
|
|
7
|
-
|
|
7
|
+
const wiggle_1 = __importDefault(require("./globeshell/wiggle"));
|
|
8
8
|
exports.GlobeShellWiggle = wiggle_1.default;
|
|
@@ -4,5 +4,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.GlobeShellWiggle = void 0;
|
|
7
|
-
|
|
7
|
+
const object_1 = __importDefault(require("./object"));
|
|
8
8
|
exports.GlobeShellWiggle = object_1.default;
|