@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.
Files changed (38) hide show
  1. package/Math/arc-cdf-points.js +252 -0
  2. package/Math/{arc-generate-points.js → arc-generate-points copy.js } +4 -0
  3. package/Math/arc-generate-points-exponantial.js +254 -0
  4. package/Math/arc.js +5 -5
  5. package/Math/circle-cdf-points.js +247 -0
  6. package/Math/circle.js +39 -0
  7. package/Math/methods.js +13 -3
  8. package/Math/vec3.js +3 -3
  9. package/package.json +1 -1
  10. package/programs/line-on-globe/circle-accurate.js +176 -175
  11. package/programs/line-on-globe/circle.js +166 -164
  12. package/programs/line-on-globe/linestrip/data.js +4 -0
  13. package/programs/line-on-globe/{linestrip.js → linestrip/linestrip.js} +38 -39
  14. package/programs/line-on-globe/to-the-surface.js +111 -109
  15. package/programs/rings/distancering/circleflatprogram.js +116 -120
  16. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +1 -1
  17. package/programs/rings/distancering/circlepaddysharedbuffer.js +368 -354
  18. package/programs/rings/distancering/index.js +6 -5
  19. package/programs/rings/distancering/paddyflatprogram.js +127 -136
  20. package/programs/rings/distancering/paddyflatprogram2d.js +129 -138
  21. package/programs/rings/distancering/paddyflatprogram3d.js +128 -136
  22. package/programs/totems/camerauniformblock.js +35 -8
  23. package/programs/totems/canvas-webglobe-info.js +55 -20
  24. package/programs/totems/{camerauniformblock copy.js → canvas-webglobe-info1.js} +11 -76
  25. package/programs/vectorfields/logics/pixelbased.js +4 -20
  26. package/shape-on-terrain/arc/naive/plugin.js +249 -288
  27. package/shape-on-terrain/circle/plugin.js +284 -0
  28. package/shape-on-terrain/type.js +1 -0
  29. package/util/account/index.js +2 -2
  30. package/util/account/single-attribute-buffer-management/buffer-manager.js +2 -3
  31. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +2 -2
  32. package/util/build-strategy/general-strategy.js +62 -0
  33. package/util/build-strategy/static-dynamic.js +31 -0
  34. package/util/gl-util/draw-options/types.js +1 -1
  35. package/globe-types.js +0 -1
  36. package/programs/interface.js +0 -1
  37. package/programs/rings/distancering/shader.js +0 -1
  38. package/programs/totems/camerauniformblock1.js +0 -171
@@ -1,164 +1,166 @@
1
- import { createProgram } from "../../util/webglobjectbuilders";
2
- import { CameraUniformBlockString, CameraUniformBlockTotemCache } from "../totems/camerauniformblock";
3
- import { noRegisterGlobeProgramCache } from "../programcache";
4
- import { vaoAttributeLoader } from "../../util/account/util";
5
- import { longLatRadToMercator, longLatRadToCartesian3D, cartesian3DToGLPosition, mercatorXYToGLPosition, realDistanceOnSphereR1, circleLimpFromLongLatRadCenterCartesian3D, circleLimpFromLongLatRadCenterMercatorCompass, circleLimpFromLongLatRadCenterMercatorRealDistance, POLE } from "../../util/shaderfunctions/geometrytransformations";
6
- /**
7
- * TODO:
8
- * 1. integrate geometry functions for radius angle and center
9
- * 2. integrate attributes
10
- *
11
- * TODO:
12
- * center_position is too small or doenst loaded as expected.
13
- */
14
- const EDGE_COUNT_ON_SPHERE = 360;
15
- const vertexShaderSource = `#version 300 es
16
- precision highp float;
17
- ${CameraUniformBlockString}
18
- ${longLatRadToMercator}
19
- ${longLatRadToCartesian3D}
20
- ${cartesian3DToGLPosition}
21
- ${mercatorXYToGLPosition}
22
- ${realDistanceOnSphereR1}
23
- ${circleLimpFromLongLatRadCenterCartesian3D}
24
- ${circleLimpFromLongLatRadCenterMercatorCompass}
25
- ${circleLimpFromLongLatRadCenterMercatorRealDistance}
26
-
27
- uniform float edge_count;
28
-
29
- in vec2 center_position;
30
- in float radius;
31
- in vec4 color;
32
- in float dash_ratio;
33
- in float dash_opacity;
34
-
35
- out float interpolation;
36
- out vec4 v_color;
37
- out float v_dash_ratio;
38
- out float v_dash_opacity;
39
- out vec2 v_limp;
40
- void main() {
41
- interpolation = float( gl_VertexID ) / ${EDGE_COUNT_ON_SPHERE}.0;
42
- float angle = PI * 2.0 * interpolation;
43
- if ( is3D ) {
44
- vec3 position = circleLimpFromLongLatRadCenterCartesian3D( center_position, radius, angle);
45
- gl_Position = cartesian3DToGLPosition(position);
46
- v_limp = vec2(0.0, 0.0);
47
- } else {
48
- vec2 position;
49
- if (radius < 1400.0) {
50
- position = circleLimpFromLongLatRadCenterMercatorCompass( center_position, radius/ cos(center_position.y), angle);
51
- } else {
52
- position = circleLimpFromLongLatRadCenterMercatorRealDistance( center_position, radius, angle);
53
- }
54
- v_limp = position;
55
- gl_Position = mercatorXYToGLPosition( position);
56
-
57
- }
58
- v_dash_ratio = dash_ratio;
59
- v_dash_opacity = dash_opacity;
60
- v_color = color;
61
-
62
- }`;
63
- const fragmentShaderSource = `#version 300 es
64
- ${POLE}
65
- precision highp float;
66
- uniform float opacity;
67
- in vec4 v_color;
68
- in float v_dash_ratio;
69
- in float v_dash_opacity;
70
- in float interpolation;
71
- in vec2 v_limp;
72
- out vec4 color;
73
- void main() {
74
- if ( v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE ){ color = vec4(0.0,0.0,0.0,0.0); return; }
75
- color = v_color;
76
- color.a *= opacity;
77
- if ( v_dash_ratio == 1.0 || v_dash_ratio == 0.0 ) return;
78
- if (fract(interpolation / (2.0 * v_dash_ratio)) < 0.5 ) {
79
- color.a *= v_dash_opacity;
80
- }
81
- }
82
- `;
83
- class Logic {
84
- constructor(globe) {
85
- this.globe = globe;
86
- this.gl = globe.gl;
87
- this._lastOpacity = 1.0;
88
- this.program = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);
89
- const { gl, program } = this;
90
- this.program.uniforms = {
91
- opacity: gl.getUniformLocation(program, "opacity")
92
- };
93
- { // initial uniform values
94
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
95
- gl.useProgram(program);
96
- gl.uniform1f(program.uniforms.opacity, 1.0);
97
- gl.useProgram(currentProgram);
98
- }
99
- { // assign attribute locations
100
- gl.bindAttribLocation(program, 0, "center_position");
101
- gl.bindAttribLocation(program, 1, "radius");
102
- gl.bindAttribLocation(program, 2, "color");
103
- gl.bindAttribLocation(program, 3, "dash_ratio");
104
- gl.bindAttribLocation(program, 4, "dash_opacity");
105
- }
106
- this.cameraBindingPoint = 0;
107
- this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
108
- const cameraBlockLocation = gl.getUniformBlockIndex(program, "CameraUniformBlock");
109
- gl.uniformBlockBinding(program, cameraBlockLocation, this.cameraBindingPoint);
110
- }
111
- createVAO(centerObj, radiusObj, colorObj, dashRatioObj, dashOpacityObj) {
112
- const { gl } = this;
113
- const vao = gl.createVertexArray();
114
- const divisor = 1;
115
- gl.bindVertexArray(vao);
116
- { // make this a function end import from account module.
117
- const { buffer, stride = 0, offset = 0 } = centerObj;
118
- vaoAttributeLoader(gl, buffer, 0, 2, stride, offset, divisor);
119
- }
120
- {
121
- const { buffer, stride = 0, offset = 0 } = radiusObj;
122
- vaoAttributeLoader(gl, buffer, 1, 1, stride, offset, divisor);
123
- }
124
- {
125
- const { buffer, stride = 0, offset = 0 } = colorObj;
126
- vaoAttributeLoader(gl, buffer, 2, 4, stride, offset, divisor);
127
- }
128
- {
129
- const { buffer, stride = 0, offset = 0 } = dashRatioObj;
130
- vaoAttributeLoader(gl, buffer, 3, 1, stride, offset, divisor);
131
- }
132
- {
133
- const { buffer, stride = 0, offset = 0 } = dashOpacityObj;
134
- vaoAttributeLoader(gl, buffer, 4, 1, stride, offset, divisor);
135
- }
136
- gl.bindVertexArray(null);
137
- gl.bindVertexArray(null);
138
- return vao;
139
- }
140
- draw(vao, length, opacity) {
141
- const { gl, program, cameraBlockTotem, cameraBindingPoint } = this;
142
- gl.useProgram(program);
143
- if (this._lastOpacity !== opacity) {
144
- gl.uniform1f(program.uniforms.opacity, opacity);
145
- this._lastOpacity = opacity;
146
- }
147
- gl.bindVertexArray(vao);
148
- cameraBlockTotem.bind(cameraBindingPoint);
149
- gl.drawArraysInstanced(gl.LINE_STRIP, 0, EDGE_COUNT_ON_SPHERE + 1, length);
150
- cameraBlockTotem.unbind(cameraBindingPoint);
151
- gl.bindVertexArray(null);
152
- }
153
- free() {
154
- if (this.isFreed)
155
- return;
156
- CameraUniformBlockTotemCache.release(this.globe);
157
- this.gl.deleteProgram(this.program);
158
- this.isFreed = true;
159
- }
160
- }
161
- export const CircleCache = Object.freeze({
162
- get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
163
- release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
164
- });
1
+ "use strict";
2
+ // TODO: Delete this file if it is not needed anymore.
3
+ // import { createProgram } from "../../util/webglobjectbuilders";
4
+ // import { CameraUniformBlockString, CameraUniformBlockTotemCache } from "../totems/camerauniformblock";
5
+ // import { noRegisterGlobeProgramCache } from "../programcache";
6
+ // import { vaoAttributeLoader } from "../../util/account/util";
7
+ // import {
8
+ // longLatRadToMercator, longLatRadToCartesian3D, cartesian3DToGLPosition, mercatorXYToGLPosition, realDistanceOnSphereR1,
9
+ // circleLimpFromLongLatRadCenterCartesian3D,
10
+ // circleLimpFromLongLatRadCenterMercatorCompass,
11
+ // circleLimpFromLongLatRadCenterMercatorRealDistance,
12
+ // POLE
13
+ // } from "../../util/shaderfunctions/geometrytransformations";
14
+ // /**
15
+ // * TODO:
16
+ // * 1. integrate geometry functions for radius angle and center
17
+ // * 2. integrate attributes
18
+ // *
19
+ // * TODO:
20
+ // * center_position is too small or doenst loaded as expected.
21
+ // */
22
+ // const EDGE_COUNT_ON_SPHERE = 360;
23
+ // const vertexShaderSource = `#version 300 es
24
+ // precision highp float;
25
+ // ${CameraUniformBlockString}
26
+ // ${longLatRadToMercator}
27
+ // ${longLatRadToCartesian3D}
28
+ // ${cartesian3DToGLPosition}
29
+ // ${mercatorXYToGLPosition}
30
+ // ${realDistanceOnSphereR1}
31
+ // ${circleLimpFromLongLatRadCenterCartesian3D}
32
+ // ${circleLimpFromLongLatRadCenterMercatorCompass}
33
+ // ${circleLimpFromLongLatRadCenterMercatorRealDistance}
34
+ // uniform float edge_count;
35
+ // in vec2 center_position;
36
+ // in float radius;
37
+ // in vec4 color;
38
+ // in float dash_ratio;
39
+ // in float dash_opacity;
40
+ // out float interpolation;
41
+ // out vec4 v_color;
42
+ // out float v_dash_ratio;
43
+ // out float v_dash_opacity;
44
+ // out vec2 v_limp;
45
+ // void main() {
46
+ // interpolation = float( gl_VertexID ) / ${EDGE_COUNT_ON_SPHERE}.0;
47
+ // float angle = PI * 2.0 * interpolation;
48
+ // if ( is3D ) {
49
+ // vec3 position = circleLimpFromLongLatRadCenterCartesian3D( center_position, radius, angle);
50
+ // gl_Position = cartesian3DToGLPosition(position);
51
+ // v_limp = vec2(0.0, 0.0);
52
+ // } else {
53
+ // vec2 position;
54
+ // if (radius < 1400.0) {
55
+ // position = circleLimpFromLongLatRadCenterMercatorCompass( center_position, radius/ cos(center_position.y), angle);
56
+ // } else {
57
+ // position = circleLimpFromLongLatRadCenterMercatorRealDistance( center_position, radius, angle);
58
+ // }
59
+ // v_limp = position;
60
+ // gl_Position = mercatorXYToGLPosition( position);
61
+ // }
62
+ // v_dash_ratio = dash_ratio;
63
+ // v_dash_opacity = dash_opacity;
64
+ // v_color = color;
65
+ // }`
66
+ // const fragmentShaderSource = `#version 300 es
67
+ // ${POLE}
68
+ // precision highp float;
69
+ // uniform float opacity;
70
+ // in vec4 v_color;
71
+ // in float v_dash_ratio;
72
+ // in float v_dash_opacity;
73
+ // in float interpolation;
74
+ // in vec2 v_limp;
75
+ // out vec4 color;
76
+ // void main() {
77
+ // if ( v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE ){ color = vec4(0.0,0.0,0.0,0.0); return; }
78
+ // color = v_color;
79
+ // color.a *= opacity;
80
+ // if ( v_dash_ratio == 1.0 || v_dash_ratio == 0.0 ) return;
81
+ // if (fract(interpolation / (2.0 * v_dash_ratio)) < 0.5 ) {
82
+ // color.a *= v_dash_opacity;
83
+ // }
84
+ // }
85
+ // `;
86
+ // class Logic {
87
+ // constructor(globe) {
88
+ // this.globe = globe;
89
+ // this.gl = globe.gl;
90
+ // this._lastOpacity = 1.0;
91
+ // this.program = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);
92
+ // const { gl, program } = this;
93
+ // this.program.uniforms = {
94
+ // opacity: gl.getUniformLocation(program, "opacity")
95
+ // };
96
+ // { // initial uniform values
97
+ // const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
98
+ // gl.useProgram(program);
99
+ // gl.uniform1f(program.uniforms.opacity, 1.0);
100
+ // gl.useProgram(currentProgram);
101
+ // }
102
+ // { // assign attribute locations
103
+ // gl.bindAttribLocation(program, 0, "center_position");
104
+ // gl.bindAttribLocation(program, 1, "radius");
105
+ // gl.bindAttribLocation(program, 2, "color");
106
+ // gl.bindAttribLocation(program, 3, "dash_ratio");
107
+ // gl.bindAttribLocation(program, 4, "dash_opacity");
108
+ // }
109
+ // this.cameraBindingPoint = 0;
110
+ // this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
111
+ // const cameraBlockLocation = gl.getUniformBlockIndex(program, "CameraUniformBlock");
112
+ // gl.uniformBlockBinding(program, cameraBlockLocation, this.cameraBindingPoint);
113
+ // }
114
+ // createVAO(centerObj, radiusObj, colorObj, dashRatioObj, dashOpacityObj) {
115
+ // const { gl } = this;
116
+ // const vao = gl.createVertexArray();
117
+ // const divisor = 1;
118
+ // gl.bindVertexArray(vao);
119
+ // { // make this a function end import from account module.
120
+ // const { buffer, stride = 0, offset = 0 } = centerObj;
121
+ // vaoAttributeLoader(gl, buffer, 0, 2, stride, offset, divisor);
122
+ // }
123
+ // {
124
+ // const { buffer, stride = 0, offset = 0 } = radiusObj;
125
+ // vaoAttributeLoader(gl, buffer, 1, 1, stride, offset, divisor);
126
+ // }
127
+ // {
128
+ // const { buffer, stride = 0, offset = 0 } = colorObj;
129
+ // vaoAttributeLoader(gl, buffer, 2, 4, stride, offset, divisor);
130
+ // }
131
+ // {
132
+ // const { buffer, stride = 0, offset = 0 } = dashRatioObj;
133
+ // vaoAttributeLoader(gl, buffer, 3, 1, stride, offset, divisor);
134
+ // }
135
+ // {
136
+ // const { buffer, stride = 0, offset = 0 } = dashOpacityObj;
137
+ // vaoAttributeLoader(gl, buffer, 4, 1, stride, offset, divisor);
138
+ // }
139
+ // gl.bindVertexArray(null);
140
+ // gl.bindVertexArray(null);
141
+ // return vao;
142
+ // }
143
+ // draw(vao, length, opacity) {
144
+ // const { gl, program, cameraBlockTotem, cameraBindingPoint } = this;
145
+ // gl.useProgram(program);
146
+ // if (this._lastOpacity !== opacity) {
147
+ // gl.uniform1f(program.uniforms.opacity, opacity);
148
+ // this._lastOpacity = opacity;
149
+ // }
150
+ // gl.bindVertexArray(vao);
151
+ // cameraBlockTotem.bind(cameraBindingPoint);
152
+ // gl.drawArraysInstanced(gl.LINE_STRIP, 0, EDGE_COUNT_ON_SPHERE + 1, length);
153
+ // cameraBlockTotem.unbind(cameraBindingPoint);
154
+ // gl.bindVertexArray(null);
155
+ // }
156
+ // free() {
157
+ // if (this.isFreed) return;
158
+ // CameraUniformBlockTotemCache.release(this.globe);
159
+ // this.gl.deleteProgram(this.program);
160
+ // this.isFreed = true;
161
+ // }
162
+ // }
163
+ // export const CircleCache = Object.freeze({
164
+ // get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
165
+ // release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
166
+ // });
@@ -0,0 +1,4 @@
1
+ export function createLineStripData(program, globe, gl, DrawStyleOptions) {
2
+ // @ts-ignore
3
+ return;
4
+ }
@@ -1,24 +1,23 @@
1
- import { createProgram } from "../../util/webglobjectbuilders";
2
- import "../interface";
3
- import { CameraUniformBlockString, CameraUniformBlockTotemCache } from "../totems/index";
4
- import { cartesian3DToGLPosition, mercatorXYToGLPosition, } from "../../util/shaderfunctions/geometrytransformations.js";
5
- import { noRegisterGlobeProgramCache } from "../programcache";
6
- import { attributeLoader } from "../../util/gl-util/buffer/attribute-loader";
7
- import "../../util/gl-util/buffer/attribute-loader";
8
- import { UniformBlockManager } from "../../util/gl-util/uniform-block/manager";
9
- import "../../util/gl-util/uniform-block/types";
10
- import { drawArrays } from "../../util/gl-util/draw-options/methods";
11
- import "../../util/gl-util/draw-options/types";
1
+ import { createProgram } from "../../../util/webglobjectbuilders";
2
+ import { CameraUniformBlockString, CameraUniformBlockTotemCache } from "../../totems/index";
3
+ import { cartesian3DToGLPosition, mercatorXYToGLPosition, } from "../../../util/shaderfunctions/geometrytransformations";
4
+ import { noRegisterGlobeProgramCache } from "../../programcache";
5
+ import { attributeLoader } from "../../../util/gl-util/buffer/attribute-loader";
6
+ import "../../../util/gl-util/buffer/attribute-loader";
7
+ import { UniformBlockManager } from "../../../util/gl-util/uniform-block/manager";
8
+ import "../../../util/gl-util/uniform-block/types";
9
+ import { drawArrays } from "../../../util/gl-util/draw-options/methods";
10
+ import "../../../util/gl-util/draw-options/types";
12
11
  const ESCAPE_VALUE = -1;
13
12
  const uniformBindingPoints = {
14
13
  camera: 0,
15
14
  flexible: 1,
16
15
  };
17
- const one = new Float32Array([1]);
16
+ // const one = new Float32Array([1]);
18
17
  const flexibleBlockManager = new UniformBlockManager('FlexibleAttributes', [
19
18
  { name: "u_color", type: "vec4", value: new Float32Array([0.12, 1, 0.1, 1]) },
20
- { name: "u_dash_opacity", type: "float", value: one },
21
- { name: "u_dash_length", type: "float", value: one },
19
+ // { name: "u_dash_opacity", type: "float", value: one },
20
+ // { name: "u_dash_length", type: "float", value: one },
22
21
  ], uniformBindingPoints.flexible);
23
22
  const vertexShaderSource = `#version 300 es
24
23
  precision highp float;
@@ -32,11 +31,11 @@ ${flexibleBlockManager.glslCode()}
32
31
  in vec3 position3d;
33
32
  in vec2 position2d;
34
33
  in vec4 color;
35
- in float dash_length;
36
- in float dash_opacity;
34
+ // in float dash_length;
35
+ // in float dash_opacity;
37
36
 
38
- out float v_dash_length;
39
- out float v_dash_opacity;
37
+ // out float v_dash_length;
38
+ // out float v_dash_opacity;
40
39
  out vec4 v_color;
41
40
 
42
41
  flat out vec3 v_flat_position;
@@ -45,8 +44,8 @@ out vec3 v_position;
45
44
  void main() {
46
45
 
47
46
  v_color = ( color.r == -1.0 ) ? u_color : color;
48
- v_dash_length = ( dash_length == -1.0 ) ? u_dash_length : dash_length;
49
- v_dash_opacity = ( dash_opacity == -1.0 ) ? u_dash_opacity : dash_opacity;
47
+ // v_dash_length = ( dash_length == -1.0 ) ? u_dash_length : dash_length;
48
+ // v_dash_opacity = ( dash_opacity == -1.0 ) ? u_dash_opacity : dash_opacity;
50
49
 
51
50
  if ( is3D ) {
52
51
  gl_Position = cartesian3DToGLPosition( position3d );
@@ -57,7 +56,7 @@ void main() {
57
56
  v_position = vec3( position2d, 0.0 );
58
57
  v_flat_position = vec3( position2d, 0.0 );
59
58
  }
60
- gl_PointSize = 4.0;
59
+ gl_PointSize = 6.0;
61
60
  }`;
62
61
  const fragmentShaderSource = `#version 300 es
63
62
  precision highp float;
@@ -71,24 +70,23 @@ in float v_dash_opacity;
71
70
  flat in vec3 v_flat_position;
72
71
  in vec3 v_position;
73
72
 
74
-
75
73
  out vec4 outColor;
76
74
 
77
75
  void main() {
78
76
  outColor = v_color;
79
77
  return;
80
- float dash_length = v_dash_length;
81
- float dash_opacity = v_dash_opacity;
78
+ // float dash_length = v_dash_length;
79
+ // float dash_opacity = v_dash_opacity;
82
80
 
83
- if ( dash_length == 0.0 ) {
84
- outColor = vec4( v_color.rgb, v_color.a * v_dash_opacity );
85
- } else {
86
- float dist = distance( v_flat_position, v_position );
87
- // float alpha = mod( dist , v_dash_length * 2.0 ) / v_dash_length < 1.0 ? 1.0 : v_dash_opacity;
88
- outColor = vec4( v_color.rgb, v_color.a * opacity );
89
- }
81
+ // if ( dash_length == 0.0 ) {
82
+ outColor = vec4( v_color.rgb, v_color.a );
83
+ // } else {
84
+ // float dist = distance( v_flat_position, v_position );
85
+ // // float alpha = mod( dist , v_dash_length * 2.0 ) / v_dash_length < 1.0 ? 1.0 : v_dash_opacity;
86
+ // outColor = vec4( 1.0, 1.0, 1.0, v_color.a * opacity *alpha);
87
+ // }
90
88
  }`;
91
- class Logic {
89
+ export class LineProgram {
92
90
  _vaosPublished = [];
93
91
  _ubosPublished = [];
94
92
  program;
@@ -112,8 +110,8 @@ class Logic {
112
110
  this.gl.bindAttribLocation(this.program, 0, "position3d");
113
111
  this.gl.bindAttribLocation(this.program, 1, "position2d");
114
112
  this.gl.bindAttribLocation(this.program, 2, "color");
115
- this.gl.bindAttribLocation(this.program, 3, "dash_length");
116
- this.gl.bindAttribLocation(this.program, 4, "dash_opacity");
113
+ // this.gl.bindAttribLocation(this.program, 3, "dash_length");
114
+ // this.gl.bindAttribLocation(this.program, 4, "dash_opacity");
117
115
  this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
118
116
  this.cameraBlockTotem.assignBindingPoint(this.program, uniformBindingPoints.camera);
119
117
  flexibleBlockManager.assignBindingPoint(this.gl, this.program);
@@ -125,15 +123,16 @@ class Logic {
125
123
  this._ubosPublished.push(ubo);
126
124
  return ubo;
127
125
  }
128
- createVAO(position3D, position2D, color, dashLength, dashOpacity) {
126
+ createVAO(position3D, position2D, color //, dashLength: BufferAndReadInfo, dashOpacity: BufferAndReadInfo,
127
+ ) {
129
128
  const { gl } = this;
130
129
  const vao = gl.createVertexArray();
131
130
  gl.bindVertexArray(vao);
132
131
  attributeLoader(gl, position3D, 0, 3);
133
132
  attributeLoader(gl, position2D, 1, 2);
134
133
  attributeLoader(gl, color, 2, 4, { escapeValues: [ESCAPE_VALUE, ESCAPE_VALUE, ESCAPE_VALUE, ESCAPE_VALUE] });
135
- attributeLoader(gl, dashLength, 3, 1, { escapeValues: [ESCAPE_VALUE] });
136
- attributeLoader(gl, dashOpacity, 4, 1, { escapeValues: [ESCAPE_VALUE] });
134
+ // attributeLoader(gl, dashLength, 3, 1, { escapeValues: [ESCAPE_VALUE] });
135
+ // attributeLoader(gl, dashOpacity, 4, 1, { escapeValues: [ESCAPE_VALUE] });
137
136
  gl.bindVertexArray(null);
138
137
  return vao;
139
138
  }
@@ -164,6 +163,6 @@ class Logic {
164
163
  }
165
164
  }
166
165
  export const LineStripProgramCache = Object.freeze({
167
- get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
168
- release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, Logic),
166
+ get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, LineProgram),
167
+ release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, LineProgram),
169
168
  });