@pirireis/webglobeplugins 0.11.1-alpha → 0.13.0-alpha
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/arc-cdf-points.js +252 -0
- package/Math/{arc-generate-points.js → arc-generate-points copy.js } +4 -0
- package/Math/arc-generate-points-exponantial.js +254 -0
- package/Math/arc.js +5 -5
- package/Math/circle-cdf-points.js +247 -0
- package/Math/circle.js +39 -0
- package/Math/methods.js +13 -3
- package/Math/vec3.js +3 -3
- package/package.json +1 -1
- package/programs/line-on-globe/circle-accurate.js +176 -175
- package/programs/line-on-globe/circle.js +166 -164
- package/programs/line-on-globe/linestrip/data.js +4 -0
- package/programs/line-on-globe/{linestrip.js → linestrip/linestrip.js} +38 -39
- package/programs/line-on-globe/to-the-surface.js +111 -109
- package/programs/rings/distancering/circleflatprogram.js +116 -120
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +1 -1
- package/programs/rings/distancering/circlepaddysharedbuffer.js +368 -354
- package/programs/rings/distancering/index.js +6 -5
- package/programs/rings/distancering/paddyflatprogram.js +127 -136
- package/programs/rings/distancering/paddyflatprogram2d.js +129 -138
- package/programs/rings/distancering/paddyflatprogram3d.js +128 -136
- package/programs/totems/camerauniformblock.js +35 -8
- package/programs/totems/canvas-webglobe-info.js +55 -20
- package/programs/totems/{camerauniformblock copy.js → canvas-webglobe-info1.js} +11 -76
- package/programs/vectorfields/logics/pixelbased.js +4 -20
- package/shape-on-terrain/arc/naive/plugin.js +249 -288
- package/shape-on-terrain/circle/plugin.js +284 -0
- package/shape-on-terrain/type.js +1 -0
- package/util/account/index.js +2 -2
- package/util/account/single-attribute-buffer-management/buffer-manager.js +2 -3
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +2 -2
- package/util/build-strategy/general-strategy.js +62 -0
- package/util/build-strategy/static-dynamic.js +31 -0
- package/util/gl-util/draw-options/types.js +1 -1
- package/globe-types.js +0 -1
- package/programs/interface.js +0 -1
- package/programs/rings/distancering/shader.js +0 -1
- package/programs/totems/camerauniformblock1.js +0 -171
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { programCache as circleProgramCache } from './circleflatprogram';
|
|
3
|
+
// import { PaddingProgramCache } from './paddyflatprogram';
|
|
4
|
+
// import CirclePaddySharedBuffer from './circlepaddysharedbuffer';
|
|
5
|
+
// // import { PaddingFreeAngleCache } from './circlepaddingfreeangleprogram';
|
|
6
|
+
// // export { circleProgramCache, PaddingProgramCache, CirclePaddySharedBuffer, PaddingFreeAngleCache };
|
|
@@ -1,136 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
in
|
|
19
|
-
in float
|
|
20
|
-
in
|
|
21
|
-
in
|
|
22
|
-
|
|
23
|
-
uniform int compass;
|
|
24
|
-
uniform float pad_count;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
free() {
|
|
129
|
-
this.gl.deleteProgram(this.program);
|
|
130
|
-
globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
export const PaddingProgramCache = Object.freeze({
|
|
134
|
-
getProgram: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic); },
|
|
135
|
-
releaseProgram: (globe) => { noRegisterGlobeProgramCache.releaseProgram(globe, Logic); }
|
|
136
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// TODO: Delete this file if it is not needed anymore.
|
|
3
|
+
// import { createProgram, shaderfunctions } from "../../../util";
|
|
4
|
+
// import CameraUniformBlockTotem, { CameraUniformBlockString } from "../../totems/camerauniformblock";
|
|
5
|
+
// import { globeProgramCache, noRegisterGlobeProgramCache } from "../../programcache";
|
|
6
|
+
// const vertexShader = `#version 300 es ` +
|
|
7
|
+
// shaderfunctions.PI +
|
|
8
|
+
// shaderfunctions.R +
|
|
9
|
+
// shaderfunctions.POLE +
|
|
10
|
+
// CameraUniformBlockString +
|
|
11
|
+
// shaderfunctions.mercatorXYToGLPosition +
|
|
12
|
+
// shaderfunctions.longLatRadToMercator +
|
|
13
|
+
// shaderfunctions.longLatRadToCartesian3D +
|
|
14
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterCartesian3D +
|
|
15
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterMercatorCompass +
|
|
16
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistancePadding +
|
|
17
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistance + `
|
|
18
|
+
// in vec2 center;
|
|
19
|
+
// in float radius;
|
|
20
|
+
// in float pad_range;
|
|
21
|
+
// in vec4 color;
|
|
22
|
+
// in float flag;
|
|
23
|
+
// uniform int compass;
|
|
24
|
+
// uniform float pad_count;
|
|
25
|
+
// uniform float opacity;
|
|
26
|
+
// out vec2 v_limp;
|
|
27
|
+
// out vec4 v_color;
|
|
28
|
+
// void main() {
|
|
29
|
+
// float alpha_padding = z_level * z_level / (pad_range/ 100.0 );
|
|
30
|
+
// if( flag == 2.0 || flag == 1.0 || radius == 0.0 || alpha_padding < 0.1 || z_level < 3.0 ) return; // 1.0 is hide
|
|
31
|
+
// v_color = vec4(color.rgb, color.a * alpha_padding * opacity);
|
|
32
|
+
// gl_PointSize = 2.0;
|
|
33
|
+
// float odd = mod(float(gl_VertexID), 2.0);
|
|
34
|
+
// float index = (float(gl_VertexID)- odd ) / 2.0;
|
|
35
|
+
// float angle = 3.1415926535897932384626433832795 * 2.0 * (index / pad_count );
|
|
36
|
+
// float radius_ = radius - (pad_range * odd);
|
|
37
|
+
// if ( is3D){
|
|
38
|
+
// gl_Position = projection * view * vec4(
|
|
39
|
+
// circleLimpFromLongLatRadCenterCartesian3D( center, radius_, angle) - translate, 1.0);
|
|
40
|
+
// v_limp = vec2(0.0, 0.0);
|
|
41
|
+
// return;
|
|
42
|
+
// }
|
|
43
|
+
// vec2 limp;
|
|
44
|
+
// if ( compass == 1 ){
|
|
45
|
+
// limp = circleLimpFromLongLatRadCenterMercatorCompass(center , radius_, angle);
|
|
46
|
+
// } else {
|
|
47
|
+
// // limp = circleLimpFromLongLatRadCenterMercatorRealDistancePadding(center, radius_, angle);
|
|
48
|
+
// limp = circleLimpFromLongLatRadCenterMercatorRealDistance(center, radius_, angle);
|
|
49
|
+
// }
|
|
50
|
+
// v_limp = limp;
|
|
51
|
+
// gl_Position = mercatorXYToGLPosition(limp);
|
|
52
|
+
// }`;
|
|
53
|
+
// const fragmentShader = `#version 300 es
|
|
54
|
+
// precision highp float; `+
|
|
55
|
+
// shaderfunctions.POLE + `
|
|
56
|
+
// in vec4 v_color;
|
|
57
|
+
// in vec2 v_limp;
|
|
58
|
+
// out vec4 outColor;
|
|
59
|
+
// void main() {
|
|
60
|
+
// if ( v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE ){ discard; }
|
|
61
|
+
// outColor = v_color;
|
|
62
|
+
// }`;
|
|
63
|
+
// class Logic {
|
|
64
|
+
// constructor(globe) {
|
|
65
|
+
// this.globe = globe;
|
|
66
|
+
// this.gl = globe.gl;
|
|
67
|
+
// this.program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
68
|
+
// { // bind positions so bufferManager can use them
|
|
69
|
+
// this.gl.bindAttribLocation(this.program, 0, "center");
|
|
70
|
+
// this.gl.bindAttribLocation(this.program, 1, "radius");
|
|
71
|
+
// this.gl.bindAttribLocation(this.program, 2, "pad_range");
|
|
72
|
+
// this.gl.bindAttribLocation(this.program, 3, "color");
|
|
73
|
+
// this.gl.bindAttribLocation(this.program, 4, "flag");
|
|
74
|
+
// }
|
|
75
|
+
// this.cameraBlockBindingPoint = 0;
|
|
76
|
+
// const cameraBlockIndex = this.gl.getUniformBlockIndex(this.program, "CameraUniformBlock");
|
|
77
|
+
// this.gl.uniformBlockBinding(this.program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
78
|
+
// this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
79
|
+
// this._padCountLocation = this.gl.getUniformLocation(this.program, "pad_count");
|
|
80
|
+
// this._opacityLocation = this.gl.getUniformLocation(this.program, "opacity");
|
|
81
|
+
// this._compassLocation = this.gl.getUniformLocation(this.program, "compass");
|
|
82
|
+
// this._compassMode = 1;
|
|
83
|
+
// this._opacity = 1.0;
|
|
84
|
+
// this._padCount = 360;
|
|
85
|
+
// {
|
|
86
|
+
// const currentProgram = this.gl.getParameter(this.gl.CURRENT_PROGRAM);
|
|
87
|
+
// this.gl.useProgram(this.program);
|
|
88
|
+
// this.gl.uniform1i(this._compassLocation, 1);
|
|
89
|
+
// this.gl.uniform1f(this._opacityLocation, 1.0);
|
|
90
|
+
// this.gl.uniform1f(this._padCountLocation, 360)
|
|
91
|
+
// this.gl.useProgram(currentProgram);
|
|
92
|
+
// }
|
|
93
|
+
// }
|
|
94
|
+
// draw(attrBufferManager, padCount, compass, opacity) {
|
|
95
|
+
// const { gl, program, _padCountLocation, cameraBlockBindingPoint, cameraBlockTotem, _compassLocation } = this;
|
|
96
|
+
// gl.useProgram(program);
|
|
97
|
+
// attrBufferManager.bindPaddingVAO();
|
|
98
|
+
// cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
99
|
+
// // draw instanced
|
|
100
|
+
// if (padCount !== this._padCount) {
|
|
101
|
+
// this._padCount = padCount;
|
|
102
|
+
// // console.log("padCount", padCount);
|
|
103
|
+
// gl.uniform1f(_padCountLocation, padCount);
|
|
104
|
+
// }
|
|
105
|
+
// if (compass !== this._compassMode) {
|
|
106
|
+
// // console.log("compass", compass);
|
|
107
|
+
// gl.uniform1i(_compassLocation, compass);
|
|
108
|
+
// this._compassMode = compass;
|
|
109
|
+
// }
|
|
110
|
+
// if (opacity !== this._opacity) {
|
|
111
|
+
// // console.log("opacity", opacity);
|
|
112
|
+
// this._opacity = opacity;
|
|
113
|
+
// gl.uniform1f(this._opacityLocation, opacity);
|
|
114
|
+
// }
|
|
115
|
+
// gl.drawArraysInstanced(gl.LINES, 0, padCount * 2, attrBufferManager.length);
|
|
116
|
+
// gl.bindVertexArray(null);
|
|
117
|
+
// cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
118
|
+
// }
|
|
119
|
+
// free() {
|
|
120
|
+
// this.gl.deleteProgram(this.program);
|
|
121
|
+
// globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
122
|
+
// }
|
|
123
|
+
// }
|
|
124
|
+
// export const PaddingProgramCache = Object.freeze({
|
|
125
|
+
// getProgram: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic) },
|
|
126
|
+
// releaseProgram: (globe) => { noRegisterGlobeProgramCache.releaseProgram(globe, Logic) }
|
|
127
|
+
// })
|
|
@@ -1,138 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
in
|
|
19
|
-
in float
|
|
20
|
-
in
|
|
21
|
-
in
|
|
22
|
-
|
|
23
|
-
uniform int compass;
|
|
24
|
-
uniform float pad_count;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
free() {
|
|
131
|
-
this.gl.deleteProgram(this.program);
|
|
132
|
-
globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
export const PaddingProgramCache = Object.freeze({
|
|
136
|
-
getProgram: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic); },
|
|
137
|
-
releaseProgram: (globe) => { noRegisterGlobeProgramCache.releaseProgram(globe, Logic); }
|
|
138
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// TODO: Delete this file if it is not needed anymore.
|
|
3
|
+
// import { createProgram, shaderfunctions } from "../../../util";
|
|
4
|
+
// import CameraUniformBlockTotem, { CameraUniformBlockString } from "../../totems/camerauniformblock";
|
|
5
|
+
// import { globeProgramCache, noRegisterGlobeProgramCache } from "../../programcache";
|
|
6
|
+
// const vertexShader = `#version 300 es ` +
|
|
7
|
+
// shaderfunctions.PI +
|
|
8
|
+
// shaderfunctions.R +
|
|
9
|
+
// shaderfunctions.POLE +
|
|
10
|
+
// CameraUniformBlockString +
|
|
11
|
+
// shaderfunctions.mercatorXYToGLPosition +
|
|
12
|
+
// shaderfunctions.longLatRadToMercator +
|
|
13
|
+
// shaderfunctions.longLatRadToCartesian3D +
|
|
14
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterCartesian3D +
|
|
15
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterMercatorCompass +
|
|
16
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistancePadding +
|
|
17
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistance + `
|
|
18
|
+
// in vec2 center;
|
|
19
|
+
// in float radius;
|
|
20
|
+
// in float pad_range;
|
|
21
|
+
// in vec4 color;
|
|
22
|
+
// in float flag;
|
|
23
|
+
// uniform int compass;
|
|
24
|
+
// uniform float pad_count;
|
|
25
|
+
// uniform float opacity;
|
|
26
|
+
// out vec2 v_limp;
|
|
27
|
+
// out vec4 v_color;
|
|
28
|
+
// void main() {
|
|
29
|
+
// float alpha_padding = z_level * z_level / (pad_range/ 100.0 );
|
|
30
|
+
// if( flag == 2.0 || flag == 1.0 || radius == 0.0 || alpha_padding < 0.1 || z_level < 3.0 ) return; // 1.0 is hide
|
|
31
|
+
// v_color = vec4(color.rgb, color.a * alpha_padding * opacity);
|
|
32
|
+
// gl_PointSize = 2.0;
|
|
33
|
+
// float odd = mod(float(gl_VertexID), 2.0);
|
|
34
|
+
// float index = (float(gl_VertexID)- odd ) / 2.0;
|
|
35
|
+
// float angle = 3.1415926535897932384626433832795 * 2.0 * (index / pad_count );
|
|
36
|
+
// float radius_ = radius - (pad_range * odd);
|
|
37
|
+
// if ( is3D){
|
|
38
|
+
// gl_Position = projection * view * vec4(
|
|
39
|
+
// circleLimpFromLongLatRadCenterCartesian3D( center, radius_, angle) - translate, 1.0);
|
|
40
|
+
// v_limp = vec2(0.0, 0.0);
|
|
41
|
+
// return;
|
|
42
|
+
// }
|
|
43
|
+
// vec2 limp;
|
|
44
|
+
// if ( compass == 1 ){
|
|
45
|
+
// limp = circleLimpFromLongLatRadCenterMercatorCompass(center , radius_, angle);
|
|
46
|
+
// } else {
|
|
47
|
+
// // limp = circleLimpFromLongLatRadCenterMercatorRealDistancePadding(center, radius_, angle);
|
|
48
|
+
// limp = circleLimpFromLongLatRadCenterMercatorRealDistance(center, radius_, angle);
|
|
49
|
+
// }
|
|
50
|
+
// v_limp = limp;
|
|
51
|
+
// gl_Position = mercatorXYToGLPosition(limp);
|
|
52
|
+
// }`;
|
|
53
|
+
// const fragmentShader = `#version 300 es
|
|
54
|
+
// precision highp float; `+
|
|
55
|
+
// shaderfunctions.POLE + `
|
|
56
|
+
// in vec4 v_color;
|
|
57
|
+
// in vec2 v_limp;
|
|
58
|
+
// out vec4 outColor;
|
|
59
|
+
// void main() {
|
|
60
|
+
// if ( v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE ){ discard; }
|
|
61
|
+
// outColor = v_color;
|
|
62
|
+
// }`;
|
|
63
|
+
// class Logic {
|
|
64
|
+
// constructor(globe) {
|
|
65
|
+
// this.globe = globe;
|
|
66
|
+
// this.gl = globe.gl;
|
|
67
|
+
// this.program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
68
|
+
// { // bind positions so bufferManager can use them
|
|
69
|
+
// this.gl.bindAttribLocation(this.program, 0, "center");
|
|
70
|
+
// this.gl.bindAttribLocation(this.program, 1, "radius");
|
|
71
|
+
// this.gl.bindAttribLocation(this.program, 2, "pad_range");
|
|
72
|
+
// this.gl.bindAttribLocation(this.program, 3, "color");
|
|
73
|
+
// this.gl.bindAttribLocation(this.program, 4, "flag");
|
|
74
|
+
// }
|
|
75
|
+
// this.cameraBlockBindingPoint = 0;
|
|
76
|
+
// const cameraBlockIndex = this.gl.getUniformBlockIndex(this.program, "CameraUniformBlock");
|
|
77
|
+
// this.gl.uniformBlockBinding(this.program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
78
|
+
// this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
79
|
+
// this._padCountLocation = this.gl.getUniformLocation(this.program, "pad_count");
|
|
80
|
+
// this._opacityLocation = this.gl.getUniformLocation(this.program, "opacity");
|
|
81
|
+
// this._compassLocation = this.gl.getUniformLocation(this.program, "compass");
|
|
82
|
+
// this._compassMode = 1;
|
|
83
|
+
// this._opacity = 1.0;
|
|
84
|
+
// this._padCount = 360;
|
|
85
|
+
// {
|
|
86
|
+
// const currentProgram = this.gl.getParameter(this.gl.CURRENT_PROGRAM);
|
|
87
|
+
// this.gl.useProgram(this.program);
|
|
88
|
+
// this.gl.uniform1i(this._compassLocation, 1);
|
|
89
|
+
// this.gl.uniform1f(this._opacityLocation, 1.0);
|
|
90
|
+
// this.gl.uniform1f(this._padCountLocation, 360)
|
|
91
|
+
// this.gl.useProgram(currentProgram);
|
|
92
|
+
// }
|
|
93
|
+
// }
|
|
94
|
+
// draw(vao, length, opaity) {
|
|
95
|
+
// }
|
|
96
|
+
// draw(attrBufferManager, padCount, compass, opacity) {
|
|
97
|
+
// const { gl, program, _padCountLocation, cameraBlockBindingPoint, cameraBlockTotem, _compassLocation } = this;
|
|
98
|
+
// gl.useProgram(program);
|
|
99
|
+
// attrBufferManager.bindPaddingVAO();
|
|
100
|
+
// cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
101
|
+
// // draw instanced
|
|
102
|
+
// if (padCount !== this._padCount) {
|
|
103
|
+
// this._padCount = padCount;
|
|
104
|
+
// // console.log("padCount", padCount);
|
|
105
|
+
// gl.uniform1f(_padCountLocation, padCount);
|
|
106
|
+
// }
|
|
107
|
+
// if (compass !== this._compassMode) {
|
|
108
|
+
// // console.log("compass", compass);
|
|
109
|
+
// gl.uniform1i(_compassLocation, compass);
|
|
110
|
+
// this._compassMode = compass;
|
|
111
|
+
// }
|
|
112
|
+
// if (opacity !== this._opacity) {
|
|
113
|
+
// // console.log("opacity", opacity);
|
|
114
|
+
// this._opacity = opacity;
|
|
115
|
+
// gl.uniform1f(this._opacityLocation, opacity);
|
|
116
|
+
// }
|
|
117
|
+
// gl.drawArraysInstanced(gl.LINES, 0, padCount * 2, attrBufferManager.length);
|
|
118
|
+
// gl.bindVertexArray(null);
|
|
119
|
+
// cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
120
|
+
// }
|
|
121
|
+
// free() {
|
|
122
|
+
// this.gl.deleteProgram(this.program);
|
|
123
|
+
// globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
124
|
+
// }
|
|
125
|
+
// }
|
|
126
|
+
// export const PaddingProgramCache = Object.freeze({
|
|
127
|
+
// getProgram: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic) },
|
|
128
|
+
// releaseProgram: (globe) => { noRegisterGlobeProgramCache.releaseProgram(globe, Logic) }
|
|
129
|
+
// })
|