@pirireis/webglobeplugins 0.7.2 → 0.7.4
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/compass-rose/compass-text-writer.js +0 -1
- package/package.json +1 -1
- package/point-heat-map/plugin-webworker.js +2 -4
- package/point-heat-map/plugin.js +2 -4
- package/point-heat-map/point-to-heat-map-flow.js +6 -6
- package/point-tracks/key-methods.js +3 -0
- package/point-tracks/plugin.js +80 -0
- package/programs/point-on-globe/square-pixel-point.js +148 -0
- package/rangerings/rangeringangletext.js +1 -15
- package/timetracks/plugin-line-strip.js +0 -1
- package/timetracks/program-line-strip.js +45 -45
- package/util/interpolation/timetrack/timetrack-interpolator.js +0 -1
- package/util/interpolation/timetrack/web-worker-str.js +5 -1
- package/util/interpolation/timetrack/web-worker.js +5 -0
- package/util/webglobjectbuilders.js +1 -1
package/package.json
CHANGED
|
@@ -39,7 +39,8 @@ class PointHeatmapPlugin {
|
|
|
39
39
|
this.globe = globe;
|
|
40
40
|
this.gl = gl;
|
|
41
41
|
this.flow = new PointHeatmapFlow(globe);
|
|
42
|
-
|
|
42
|
+
this.setGeometry();
|
|
43
|
+
this.resize();
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
|
|
@@ -62,11 +63,8 @@ class PointHeatmapPlugin {
|
|
|
62
63
|
if (this.gl === null) {
|
|
63
64
|
throw new Error('Plugin not initialized');
|
|
64
65
|
};
|
|
65
|
-
console.log(values, thresholds, mode);
|
|
66
66
|
const rampData = getColorRampModed(values, thresholds, mode);
|
|
67
|
-
console.log(rampData);
|
|
68
67
|
const texture = createTexture(gl, gl.LINEAR, rampData, 256, 1);
|
|
69
|
-
console.log(texture);
|
|
70
68
|
if (this._legendTexture) {
|
|
71
69
|
this.gl.deleteTexture(this._legendTexture);
|
|
72
70
|
}
|
package/point-heat-map/plugin.js
CHANGED
|
@@ -24,7 +24,8 @@ class PointHeatmapPlugin {
|
|
|
24
24
|
this.globe = globe;
|
|
25
25
|
this.gl = gl;
|
|
26
26
|
this.flow = new PointHeatmapFlow(globe);
|
|
27
|
-
|
|
27
|
+
this.setGeometry();
|
|
28
|
+
this.resize();
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
|
|
@@ -47,11 +48,8 @@ class PointHeatmapPlugin {
|
|
|
47
48
|
if (this.gl === null) {
|
|
48
49
|
throw new Error('Plugin not initialized');
|
|
49
50
|
};
|
|
50
|
-
console.log(values, thresholds, mode);
|
|
51
51
|
const rampData = getColorRampModed(values, thresholds, mode);
|
|
52
|
-
console.log(rampData);
|
|
53
52
|
const texture = createTexture(gl, gl.LINEAR, rampData, 256, 1);
|
|
54
|
-
console.log(texture);
|
|
55
53
|
if (this._legendTexture) {
|
|
56
54
|
this.gl.deleteTexture(this._legendTexture);
|
|
57
55
|
}
|
|
@@ -13,7 +13,7 @@ class PointHeatmapFlow {
|
|
|
13
13
|
this.gl = globe.gl;
|
|
14
14
|
this.pointToDensityProgram = pointToDensityTextureCache.get(globe);
|
|
15
15
|
this.densityToLegendProgram = densityToLegendProgramCache.get(globe);
|
|
16
|
-
this.testTextureProgram = textureOnCanvasProgramCache.get(globe);
|
|
16
|
+
// this.testTextureProgram = textureOnCanvasProgramCache.get(globe);
|
|
17
17
|
this._lookInfo = globe.api_GetCurrentLookInfo();
|
|
18
18
|
const { gl } = this;
|
|
19
19
|
{
|
|
@@ -51,11 +51,11 @@ class PointHeatmapFlow {
|
|
|
51
51
|
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
52
52
|
}
|
|
53
53
|
defaultblendfunction(gl);
|
|
54
|
-
gl.viewport(0, 0, 400, 400);
|
|
55
|
-
this.testTextureProgram.draw(legendTexture, 1.0);
|
|
56
|
-
gl.viewport(0, 400, 400, 400);
|
|
57
|
-
this.testTextureProgram.draw(this.densityTexture, 1.0);
|
|
58
|
-
gl.viewport(0, 0, globe.api_ScrW(), globe.api_ScrH());
|
|
54
|
+
// gl.viewport(0, 0, 400, 400);
|
|
55
|
+
// this.testTextureProgram.draw(legendTexture, 1.0);
|
|
56
|
+
// gl.viewport(0, 400, 400, 400);
|
|
57
|
+
// this.testTextureProgram.draw(this.densityTexture, 1.0);
|
|
58
|
+
// gl.viewport(0, 0, globe.api_ScrW(), globe.api_ScrH());
|
|
59
59
|
this._drawLegend(legendTexture, opacity);
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BufferOrchestrator, BufferManager } from "../util/account";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @typedef { long ,lat, height, ID } Point
|
|
7
|
+
* @typedef {Array<Point>, rgba, TrackID} Track
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
class PointTracksPlugin {
|
|
11
|
+
|
|
12
|
+
constructor(id, { } = {}) {
|
|
13
|
+
this.id = id;
|
|
14
|
+
this._isFreed = false;
|
|
15
|
+
this._tracksInfoMap = new Map();
|
|
16
|
+
|
|
17
|
+
this.program = null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
init(globe, gl) {
|
|
22
|
+
|
|
23
|
+
this.globe = globe;
|
|
24
|
+
this.gl = gl;
|
|
25
|
+
|
|
26
|
+
this._initBufferManagers();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_initBufferManagers() {
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const { gl } = this;
|
|
33
|
+
const initialCapacity = 10;
|
|
34
|
+
|
|
35
|
+
this._bufferOrchestrator = new BufferOrchestrator({ initialCapacity });
|
|
36
|
+
this._bufferManagersMap = new Map(
|
|
37
|
+
[
|
|
38
|
+
["pos3D", new BufferManager(gl, 3, { bufferType: gl.ARRAY_BUFFER, initialCapacity })],
|
|
39
|
+
["pos2D", new BufferManager(gl, 2, { bufferType: gl.ARRAY_BUFFER, initialCapacity })],
|
|
40
|
+
["rgba", new BufferManager(gl, 4, { bufferType: gl.ARRAY_BUFFER, initialCapacity })],
|
|
41
|
+
]
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
this._vao = this.program.createVAO(
|
|
45
|
+
this._bufferManagersMap.get("pos3D"),
|
|
46
|
+
this._bufferManagersMap.get("pos2D"),
|
|
47
|
+
this._bufferManagersMap.get("rgba"),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @param {Array<Track>} tracks
|
|
58
|
+
*
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
insertBulk(tracks) {
|
|
62
|
+
const { _bufferManagersMap, _bufferOrchestrator, _tracksInfoMap } = this;
|
|
63
|
+
|
|
64
|
+
const { pos3DIndex, pos2DIndex, rgbaIndex } = _bufferOrchestrator.insertBulk(tracks);
|
|
65
|
+
const trackID = tracks[0].trackID;
|
|
66
|
+
_tracksInfoMap.set(trackID, { pos3DIndex, pos2DIndex, rgbaIndex });
|
|
67
|
+
return trackID;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
free() {
|
|
72
|
+
if (this._isFreed) return;
|
|
73
|
+
this._isFreed = true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { createProgram } from "../../util";
|
|
2
|
+
import { CameraUniformBlockTotemCache, CameraUniformBlockString } from "../totems";
|
|
3
|
+
import { mercatorXYToGLPosition, cartesian3DToGLPosition } from "../../util/shaderfunctions/geometrytransformations";
|
|
4
|
+
import { noRegisterGlobeProgramCache } from "../programcache";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const vs = `#version 300 es
|
|
8
|
+
${CameraUniformBlockString}
|
|
9
|
+
${mercatorXYToGLPosition}
|
|
10
|
+
${cartesian3DToGLPosition}
|
|
11
|
+
precision highp float;
|
|
12
|
+
precision highp int;
|
|
13
|
+
|
|
14
|
+
uniform int hovered_instanceID;
|
|
15
|
+
|
|
16
|
+
in vec3 pos3D;
|
|
17
|
+
in vec2 pos2D;
|
|
18
|
+
in vec4 rgba;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
flat out highp int vInstanceID;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
out vec4 v_rgba;
|
|
25
|
+
|
|
26
|
+
void main() {
|
|
27
|
+
|
|
28
|
+
if(is3D){
|
|
29
|
+
gl_Position = cartesian3DToGLPosition(pos3D);
|
|
30
|
+
}
|
|
31
|
+
else{
|
|
32
|
+
gl_Position = mercatorXYToGLPosition(pos2D);
|
|
33
|
+
}
|
|
34
|
+
if (hovered_instanceID == gl_InstanceID) {
|
|
35
|
+
gl_PointSize = 3.0;
|
|
36
|
+
} else {
|
|
37
|
+
gl_PointSize = 1.0;
|
|
38
|
+
v_rgba = rgba;
|
|
39
|
+
}`;
|
|
40
|
+
|
|
41
|
+
const fs = `#version 300 es
|
|
42
|
+
precision highp float;
|
|
43
|
+
|
|
44
|
+
uniform opacity;
|
|
45
|
+
|
|
46
|
+
flat in highp int vInstanceID;
|
|
47
|
+
|
|
48
|
+
in vec4 v_rgba;
|
|
49
|
+
|
|
50
|
+
layout(location = 0) out vec4 fragColor;
|
|
51
|
+
layout(location = 1) out int instanceID;
|
|
52
|
+
|
|
53
|
+
void main() {
|
|
54
|
+
fragColor = v_rgba;
|
|
55
|
+
fragColor.a *= opacity;
|
|
56
|
+
instanceID = vInstanceID;
|
|
57
|
+
}`;
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class PointOnGlobeProgram {
|
|
61
|
+
|
|
62
|
+
constructor(globe) {
|
|
63
|
+
|
|
64
|
+
this.globe = globe;
|
|
65
|
+
this.gl = globe.gl;
|
|
66
|
+
|
|
67
|
+
this.program = createProgram(this.gl, vs, fs);
|
|
68
|
+
|
|
69
|
+
const { gl, program } = this;
|
|
70
|
+
|
|
71
|
+
this.uniforms = {
|
|
72
|
+
opacity: gl.getUniformLocation(program, "opacity"),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
{ // assign attribute locations
|
|
76
|
+
gl.bindAttribLocation(program, 0, "pos3D");
|
|
77
|
+
gl.bindAttribLocation(program, 1, "pos2D");
|
|
78
|
+
gl.bindAttribLocation(program, 2, "rgba");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
{ // arrange camera uniform block
|
|
82
|
+
this.cameraBlockBingingPoint = 0;
|
|
83
|
+
this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
|
|
84
|
+
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
|
|
85
|
+
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBingingPoint);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
createVAO(pos3DBuffer, pos2DBuffer, rgbaBuffer) {
|
|
91
|
+
const { gl } = this;
|
|
92
|
+
const vao = gl.createVertexArray();
|
|
93
|
+
gl.bindVertexArray(vao);
|
|
94
|
+
|
|
95
|
+
{
|
|
96
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, pos3DBuffer);
|
|
97
|
+
gl.enableVertexAttribArray(0);
|
|
98
|
+
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
|
|
99
|
+
}
|
|
100
|
+
{
|
|
101
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, pos2DBuffer);
|
|
102
|
+
gl.enableVertexAttribArray(1);
|
|
103
|
+
gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
|
|
104
|
+
}
|
|
105
|
+
{
|
|
106
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, rgbaBuffer);
|
|
107
|
+
gl.enableVertexAttribArray(2);
|
|
108
|
+
gl.vertexAttribPointer(2, 4, gl.FLOAT, false, 0, 0);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
gl.bindVertexArray(null);
|
|
112
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
113
|
+
return vao;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
draw(vao, length, { opacity = 1.0, frameBuffer = null } = {}) {
|
|
117
|
+
if (length === 0 || opacity === 0) return;
|
|
118
|
+
const { gl, program, uniforms } = this;
|
|
119
|
+
gl.useProgram(program);
|
|
120
|
+
gl.uniform1f(uniforms.opacity, opacity);
|
|
121
|
+
gl.bindVertexArray(vao);
|
|
122
|
+
if (frameBuffer) {
|
|
123
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);
|
|
124
|
+
gl.
|
|
125
|
+
gl.drawArrays(gl.POINTS, 0, length);
|
|
126
|
+
}
|
|
127
|
+
this.cameraBlockTotem.bind(this.cameraBlockBingingPoint);
|
|
128
|
+
gl.drawArrays(gl.POINTS, 0, length);
|
|
129
|
+
this.cameraBlockTotem.unbind(this.cameraBlockBingingPoint);
|
|
130
|
+
gl.bindVertexArray(null);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
free() {
|
|
134
|
+
if (this._isFreed) return;
|
|
135
|
+
const { gl, globe } = this;
|
|
136
|
+
CameraUniformBlockTotemCache.release(globe);
|
|
137
|
+
gl.deleteProgram(this.program);
|
|
138
|
+
this._isFreed = true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
const pointOnGlobeProgramCache = Object.freeze({
|
|
144
|
+
get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, PointOnGlobeProgram),
|
|
145
|
+
release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, PointOnGlobeProgram)
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
export { pointOnGlobeProgramCache };
|
|
@@ -364,18 +364,4 @@ export default class RangeRingAngleText {
|
|
|
364
364
|
this._updateData(updateBucket, CSObjectArrayUpdateTypes.UPDATE);
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
const realCircle = (globe, longitude, latitude, radius, stepAngle) => {
|
|
372
|
-
const pointsLongLat = globe.Math.F(
|
|
373
|
-
longitude,
|
|
374
|
-
latitude,
|
|
375
|
-
radius,
|
|
376
|
-
radius,
|
|
377
|
-
0,
|
|
378
|
-
stepAngle);
|
|
379
|
-
console.log("pointsLongLat", stepAngle, pointsLongLat)
|
|
380
|
-
return pointsLongLat;
|
|
381
|
-
}
|
|
367
|
+
}
|
|
@@ -190,36 +190,36 @@ export default class TrackGlowLineProgram {
|
|
|
190
190
|
const gl = this.gl;
|
|
191
191
|
|
|
192
192
|
const vertexShader = `#version 300 es
|
|
193
|
-
|
|
193
|
+
precision highp float;
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
in vec2 a_position;
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
out vec2 v_texcoord;
|
|
198
198
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
void main() {
|
|
200
|
+
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
201
|
+
v_texcoord = a_position.xy * 0.5 + 0.5;
|
|
202
|
+
}
|
|
203
203
|
`;
|
|
204
204
|
|
|
205
205
|
const fragmentShader = `#version 300 es
|
|
206
|
-
|
|
206
|
+
precision highp float;
|
|
207
207
|
|
|
208
|
-
|
|
208
|
+
in vec2 v_texcoord;
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
uniform sampler2D u_main_texture;
|
|
212
211
|
|
|
213
|
-
uniform float u_final_alpha_ratio;
|
|
214
212
|
|
|
215
|
-
|
|
213
|
+
uniform float u_final_alpha_ratio;
|
|
216
214
|
|
|
217
|
-
|
|
215
|
+
out vec4 outColor;
|
|
218
216
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
217
|
+
void main() {
|
|
218
|
+
|
|
219
|
+
vec4 hdrColor = texture(u_main_texture, v_texcoord);
|
|
220
|
+
outColor = hdrColor;
|
|
221
|
+
outColor.a *= u_final_alpha_ratio;
|
|
222
|
+
}
|
|
223
223
|
`;
|
|
224
224
|
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
225
225
|
|
|
@@ -253,41 +253,41 @@ export default class TrackGlowLineProgram {
|
|
|
253
253
|
const gl = this.gl;
|
|
254
254
|
|
|
255
255
|
const vertexShader = `#version 300 es
|
|
256
|
-
|
|
256
|
+
precision highp float;
|
|
257
257
|
|
|
258
|
-
|
|
258
|
+
in vec2 a_position;
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
out vec2 v_texcoord;
|
|
261
261
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
void main() {
|
|
263
|
+
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
264
|
+
v_texcoord = a_position.xy * 0.5 + 0.5;
|
|
265
|
+
}
|
|
266
266
|
`;
|
|
267
267
|
|
|
268
268
|
const fragmentShader = `#version 300 es
|
|
269
|
-
|
|
269
|
+
precision highp float;
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
in vec2 v_texcoord;
|
|
272
272
|
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
uniform sampler2D u_main_texture;
|
|
274
|
+
uniform sampler2D u_bloom_texture;
|
|
275
275
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
uniform float u_exposure;
|
|
277
|
+
uniform float u_gamma;
|
|
278
|
+
uniform float u_final_alpha_ratio;
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
out vec4 outColor;
|
|
281
281
|
|
|
282
|
-
|
|
282
|
+
void main() {
|
|
283
283
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
284
|
+
vec4 hdrColor = texture(u_main_texture, v_texcoord);
|
|
285
|
+
vec4 bloomColor = texture(u_bloom_texture, v_texcoord);
|
|
286
|
+
vec4 result = hdrColor + bloomColor * u_exposure;
|
|
287
|
+
result = pow(result, vec4(1.0 / u_gamma));
|
|
288
|
+
result.a *= u_final_alpha_ratio;
|
|
289
|
+
outColor = result;
|
|
290
|
+
}
|
|
291
291
|
`;
|
|
292
292
|
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
293
293
|
|
|
@@ -577,7 +577,7 @@ void main() {
|
|
|
577
577
|
|
|
578
578
|
const texture = gl.createTexture();
|
|
579
579
|
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
580
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.
|
|
580
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, _width, _height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); // UNSIGNED_BYTE
|
|
581
581
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
|
|
582
582
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
|
|
583
583
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
@@ -589,11 +589,11 @@ void main() {
|
|
|
589
589
|
_resetTexture() {
|
|
590
590
|
const { gl, _width, _height } = this;
|
|
591
591
|
gl.bindTexture(gl.TEXTURE_2D, this._middleTexture); // UNSIGNED_BYTE
|
|
592
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.
|
|
592
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, _width, _height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
|
593
593
|
gl.bindTexture(gl.TEXTURE_2D, this._blurTextures[0]);
|
|
594
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.
|
|
594
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, _width, _height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
|
595
595
|
gl.bindTexture(gl.TEXTURE_2D, this._blurTextures[1]);
|
|
596
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.
|
|
596
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, _width, _height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
|
597
597
|
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
598
598
|
}
|
|
599
599
|
|
|
@@ -89,7 +89,6 @@ class TimeTrackInterpolator {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
setTimetracks(timeTracks) {
|
|
92
|
-
console.log("timetracks:", timeTracks);
|
|
93
92
|
this.timeTracks = timeTracks;
|
|
94
93
|
}
|
|
95
94
|
|
|
@@ -160,6 +159,11 @@ self.onmessage = function (e) {
|
|
|
160
159
|
if (time !== null) {
|
|
161
160
|
try {
|
|
162
161
|
const result = interpolator.interpolate(time);
|
|
162
|
+
if(result === null) {
|
|
163
|
+
/* eslint-disable-next-line no-restricted-globals */
|
|
164
|
+
self.postMessage({ error: 'No TimeTracks Data' });
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
163
167
|
/* eslint-disable-next-line no-restricted-globals */
|
|
164
168
|
self.postMessage(result, [result.buffer]);
|
|
165
169
|
return;
|
|
@@ -31,6 +31,11 @@ self.onmessage = function (e) {
|
|
|
31
31
|
if (time !== null) {
|
|
32
32
|
try {
|
|
33
33
|
const result = interpolator.interpolate(time);
|
|
34
|
+
if (result === null) {
|
|
35
|
+
/* eslint-disable-next-line no-restricted-globals */
|
|
36
|
+
self.postMessage({ error: 'No TimeTracks Data' });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
34
39
|
/* eslint-disable-next-line no-restricted-globals */
|
|
35
40
|
self.postMessage(result, [result.buffer]);
|
|
36
41
|
return;
|
|
@@ -51,7 +51,7 @@ export function createProgramWrapper(gl, vertexSource, fragmentSource) {
|
|
|
51
51
|
|
|
52
52
|
gl.linkProgram(program);
|
|
53
53
|
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
|
54
|
-
console.log(gl.getProgramInfoLog(program));
|
|
54
|
+
// console.log(gl.getProgramInfoLog(program));
|
|
55
55
|
throw new Error(gl.getProgramInfoLog(program));
|
|
56
56
|
}
|
|
57
57
|
|