@pirireis/webglobeplugins 0.9.11 → 0.9.13

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 (179) hide show
  1. package/Math/angle-calculation.js +9 -11
  2. package/Math/arc.js +38 -41
  3. package/Math/bounds/line-bbox.js +79 -83
  4. package/Math/constants.js +4 -9
  5. package/Math/frustum/types.js +1 -2
  6. package/Math/juction/arc-plane.js +33 -36
  7. package/Math/juction/line-sphere.js +15 -18
  8. package/Math/juction/plane-plane.js +20 -23
  9. package/Math/line.js +42 -47
  10. package/Math/methods.js +69 -92
  11. package/Math/plane.js +33 -38
  12. package/Math/quaternion.js +48 -55
  13. package/Math/types.js +1 -2
  14. package/Math/utils.js +2 -4
  15. package/Math/vec3.js +46 -52
  16. package/algorithms/search-binary.js +5 -8
  17. package/altitude-locator/draw-subset-obj.js +8 -11
  18. package/altitude-locator/plugin.js +114 -133
  19. package/altitude-locator/types.js +1 -3
  20. package/arrowfield/adaptor.js +3 -7
  21. package/arrowfield/index.js +3 -10
  22. package/arrowfield/plugin.js +63 -69
  23. package/bearing-line/index.js +2 -8
  24. package/bearing-line/plugin.js +218 -248
  25. package/circle-line-chain/chain-list-map.js +82 -92
  26. package/circle-line-chain/plugin.js +147 -182
  27. package/circle-line-chain/util.js +1 -5
  28. package/compass-rose/compass-rose-padding-flat.js +111 -140
  29. package/compass-rose/compass-text-writer.js +63 -75
  30. package/compass-rose/index.js +3 -7
  31. package/compassrose/compassrose.js +50 -57
  32. package/compassrose/index.js +2 -8
  33. package/heatwave/index.js +3 -10
  34. package/heatwave/isobar/objectarraylabels.js +50 -56
  35. package/heatwave/isobar/plugin.js +111 -170
  36. package/heatwave/isobar/quadtreecontours.js +78 -96
  37. package/heatwave/plugins/heatwaveglobeshell.js +73 -94
  38. package/index.js +12 -58
  39. package/package.json +1 -1
  40. package/partialrings/buffer-manager.js +32 -70
  41. package/partialrings/index.js +2 -41
  42. package/partialrings/plugin.js +55 -98
  43. package/partialrings/program.js +141 -59
  44. package/pin/pin-object-array.js +89 -97
  45. package/pin/pin-point-totem.js +21 -22
  46. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +11 -14
  47. package/point-heat-map/plugin-webworker.js +45 -53
  48. package/point-heat-map/point-to-heat-map-flow.js +46 -51
  49. package/point-tracks/key-methods.js +2 -5
  50. package/point-tracks/plugin.js +141 -170
  51. package/programs/arrowfield/index.js +2 -7
  52. package/programs/arrowfield/logic.js +172 -67
  53. package/programs/arrowfield/object.js +35 -43
  54. package/programs/data2legend/density-to-legend.js +47 -26
  55. package/programs/data2legend/point-to-density-texture.js +56 -34
  56. package/programs/float2legendwithratio/index.js +2 -8
  57. package/programs/float2legendwithratio/logic.js +88 -45
  58. package/programs/float2legendwithratio/object.js +45 -54
  59. package/programs/globe-util/is-globe-moved.js +10 -13
  60. package/programs/globeshell/index.js +2 -8
  61. package/programs/globeshell/wiggle/index.js +2 -8
  62. package/programs/globeshell/wiggle/logic.js +191 -101
  63. package/programs/globeshell/wiggle/object.js +35 -43
  64. package/programs/helpers/blender/program.js +36 -22
  65. package/programs/helpers/fadeaway/index.js +2 -7
  66. package/programs/helpers/fadeaway/logic.js +36 -17
  67. package/programs/helpers/fadeaway/object.js +11 -18
  68. package/programs/helpers/index.js +2 -8
  69. package/programs/index.js +9 -58
  70. package/programs/line-on-globe/angled-line.js +95 -39
  71. package/programs/line-on-globe/circle-accurate-3d.js +86 -39
  72. package/programs/line-on-globe/circle-accurate-flat.js +116 -64
  73. package/programs/line-on-globe/circle-accurate.js +113 -46
  74. package/programs/line-on-globe/circle.js +106 -44
  75. package/programs/line-on-globe/degree-padding-around-circle-3d.js +89 -42
  76. package/programs/line-on-globe/lines-color-instanced-flat.js +84 -43
  77. package/programs/line-on-globe/linestrip.js +126 -63
  78. package/programs/line-on-globe/naive-accurate-flexible.js +126 -59
  79. package/programs/line-on-globe/to-the-surface.js +62 -35
  80. package/programs/line-on-globe/util.js +2 -5
  81. package/programs/picking/pickable-renderer.js +127 -46
  82. package/programs/point-on-globe/element-globe-surface-glow.js +83 -46
  83. package/programs/point-on-globe/element-point-glow.js +112 -47
  84. package/programs/point-on-globe/square-pixel-point.js +80 -34
  85. package/programs/programcache.js +14 -19
  86. package/programs/rings/distancering/circleflatprogram.js +76 -70
  87. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +168 -194
  88. package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -200
  89. package/programs/rings/distancering/index.js +5 -14
  90. package/programs/rings/distancering/paddyflatprogram.js +87 -70
  91. package/programs/rings/distancering/paddyflatprogram2d.js +89 -72
  92. package/programs/rings/distancering/paddyflatprogram3d.js +87 -70
  93. package/programs/rings/index.js +1 -17
  94. package/programs/rings/partial-ring/piece-of-pie.js +144 -44
  95. package/programs/totems/camerauniformblock.js +65 -56
  96. package/programs/totems/canvas-webglobe-info.js +49 -45
  97. package/programs/totems/gpu-selection-uniform-block.js +45 -45
  98. package/programs/totems/index.js +2 -40
  99. package/programs/two-d/pixel-padding-for-compass.js +94 -36
  100. package/programs/util.js +7 -10
  101. package/programs/vectorfields/index.js +3 -23
  102. package/programs/vectorfields/logics/drawrectangleparticles.js +73 -35
  103. package/programs/vectorfields/logics/index.js +4 -12
  104. package/programs/vectorfields/logics/pixelbased.js +94 -41
  105. package/programs/vectorfields/logics/ubo.js +32 -32
  106. package/programs/vectorfields/pingpongbuffermanager.js +30 -37
  107. package/rangerings/enum.js +2 -5
  108. package/rangerings/index.js +5 -15
  109. package/rangerings/plugin.js +223 -286
  110. package/rangerings/rangeringangletext.js +122 -137
  111. package/rangerings/ring-account.js +53 -75
  112. package/shaders/fragment-toy/firework.js +55 -4
  113. package/shaders/fragment-toy/singularity.js +56 -5
  114. package/timetracks/adaptors-line-strip.js +27 -44
  115. package/timetracks/adaptors.js +48 -67
  116. package/timetracks/index.js +5 -19
  117. package/timetracks/plugin-line-strip.js +65 -79
  118. package/timetracks/plugin.js +71 -85
  119. package/timetracks/program-line-strip.js +297 -107
  120. package/timetracks/program.js +421 -118
  121. package/timetracks/programpoint-line-strip.js +98 -48
  122. package/timetracks/programpoint.js +91 -48
  123. package/util/account/bufferoffsetmanager.js +72 -98
  124. package/util/account/index.js +3 -23
  125. package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -48
  126. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -98
  127. package/util/account/single-attribute-buffer-management/index.js +4 -9
  128. package/util/account/single-attribute-buffer-management/object-store.js +29 -34
  129. package/util/account/single-attribute-buffer-management/types.js +1 -2
  130. package/util/account/util.js +2 -8
  131. package/util/algorithms/search-binary.js +5 -8
  132. package/util/check/get.js +5 -9
  133. package/util/check/typecheck.js +13 -24
  134. package/util/geometry/index.js +10 -18
  135. package/util/gl-util/buffer/attribute-loader.js +10 -26
  136. package/util/gl-util/buffer/index.js +2 -5
  137. package/util/gl-util/draw-options/methods.js +10 -15
  138. package/util/gl-util/uniform-block/manager.js +69 -72
  139. package/util/heatwavedatamanager/datamanager.js +56 -119
  140. package/util/heatwavedatamanager/index.js +3 -10
  141. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +38 -47
  142. package/util/heatwavedatamanager/pointcoordsmeta.js +9 -13
  143. package/util/index.js +13 -57
  144. package/util/interpolation/timetrack/index.js +2 -5
  145. package/util/interpolation/timetrack/timetrack-interpolator.js +30 -36
  146. package/util/interpolation/timetrack/web-worker-str.js +180 -5
  147. package/util/interpolation/timetrack/web-worker.js +4 -6
  148. package/util/jshelpers/data-filler.js +8 -11
  149. package/util/jshelpers/equality.js +1 -3
  150. package/util/jshelpers/index.js +2 -37
  151. package/util/jshelpers/timefilters.js +8 -10
  152. package/util/picking/fence.js +8 -11
  153. package/util/picking/picker-displayer.js +49 -58
  154. package/util/programs/draw-texture-on-canvas.js +41 -26
  155. package/util/programs/index.js +1 -17
  156. package/util/programs/shapesonglobe.js +104 -68
  157. package/util/programs/supersampletotextures.js +45 -43
  158. package/util/programs/texturetoglobe.js +99 -52
  159. package/util/shaderfunctions/geometrytransformations.js +323 -35
  160. package/util/shaderfunctions/index.js +2 -18
  161. package/util/shaderfunctions/nodata.js +8 -5
  162. package/util/shaderfunctions/noisefunctions.js +40 -12
  163. package/util/surface-line-data/arcs-to-cuts.js +20 -23
  164. package/util/webglobe/gldefaultstates.js +1 -4
  165. package/util/webglobe/index.js +2 -18
  166. package/util/webglobe/rasteroverlay.js +36 -41
  167. package/util/webglobjectbuilders.js +70 -93
  168. package/util/webglobjectbuilders1.js +63 -82
  169. package/waveparticles/adaptor.js +7 -10
  170. package/waveparticles/index.js +3 -10
  171. package/waveparticles/plugin.js +82 -90
  172. package/wind/imagetovectorfieldandmagnitude.js +16 -19
  173. package/wind/index.js +5 -14
  174. package/wind/plugin.js +454 -291
  175. package/wind/vectorfieldimage.js +6 -8
  176. package/write-text/attached-text-writer.js +48 -54
  177. package/write-text/context-text.js +52 -63
  178. package/write-text/context-text3.js +71 -80
  179. package/write-text/index.js +1 -5
@@ -1,46 +1,114 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LineStripProgramCache = void 0;
4
- var webglobjectbuilders_1 = require("../../util/webglobjectbuilders");
5
- require("../interface");
6
- var totems_1 = require("../totems");
7
- var geometrytransformations_js_1 = require("../../util/shaderfunctions/geometrytransformations.js");
8
- var programcache_1 = require("../programcache");
9
- var attribute_loader_1 = require("../../util/gl-util/buffer/attribute-loader");
10
- require("../../util/gl-util/buffer/attribute-loader");
11
- var manager_1 = require("../../util/gl-util/uniform-block/manager");
12
- require("../../util/gl-util/uniform-block/types");
13
- var methods_1 = require("../../util/gl-util/draw-options/methods");
14
- require("../../util/gl-util/draw-options/types");
15
- var ESCAPE_VALUE = -1;
16
- var uniformBindingPoints = {
1
+ import { createProgram } from "../../util/webglobjectbuilders";
2
+ import "../interface";
3
+ import { CameraUniformBlockString, CameraUniformBlockTotemCache } from "../totems";
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";
12
+ const ESCAPE_VALUE = -1;
13
+ const uniformBindingPoints = {
17
14
  camera: 0,
18
15
  flexible: 1,
19
16
  };
20
- var one = new Float32Array([1]);
21
- var flexibleBlockManager = new manager_1.UniformBlockManager('FlexibleAttributes', [
17
+ const one = new Float32Array([1]);
18
+ const flexibleBlockManager = new UniformBlockManager('FlexibleAttributes', [
22
19
  { name: "u_color", type: "vec4", value: new Float32Array([0.12, 1, 0.1, 1]) },
23
20
  { name: "u_dash_opacity", type: "float", value: one },
24
21
  { name: "u_dash_length", type: "float", value: one },
25
22
  ], uniformBindingPoints.flexible);
26
- var vertexShaderSource = "#version 300 es\nprecision highp float;\n\n".concat(totems_1.CameraUniformBlockString, "\n").concat(geometrytransformations_js_1.cartesian3DToGLPosition, "\n").concat(geometrytransformations_js_1.mercatorXYToGLPosition, "\n\n").concat(flexibleBlockManager.glslCode(), "\n\nin vec3 position3d;\nin vec2 position2d;\nin vec4 color; \nin float dash_length;\nin float dash_opacity;\n\nout float v_dash_length;\nout float v_dash_opacity;\nout vec4 v_color;\n\nflat out vec3 v_flat_position;\nout vec3 v_position;\n\nvoid main() {\n\n v_color = ( color.r == -1.0 ) ? u_color : color;\n v_dash_length = ( dash_length == -1.0 ) ? u_dash_length : dash_length;\n v_dash_opacity = ( dash_opacity == -1.0 ) ? u_dash_opacity : dash_opacity;\n\n if ( is3D ) {\n gl_Position = cartesian3DToGLPosition( position3d );\n v_position = position3d;\n v_flat_position = position3d;\n } else {\n gl_Position = mercatorXYToGLPosition( position2d );\n v_position = vec3( position2d, 0.0 );\n v_flat_position = vec3( position2d, 0.0 );\n }\n gl_PointSize = 4.0;\n}");
27
- var fragmentShaderSource = "#version 300 es\nprecision highp float;\n\nuniform float opacity;\n\nin vec4 v_color;\nin float v_dash_length;\nin float v_dash_opacity;\n\nflat in vec3 v_flat_position;\nin vec3 v_position;\n\n\nout vec4 outColor;\n\nvoid main() {\n outColor = v_color;\n return;\n float dash_length = v_dash_length;\n float dash_opacity = v_dash_opacity;\n\n if ( dash_length == 0.0 ) {\n outColor = vec4( v_color.rgb, v_color.a * v_dash_opacity );\n } else {\n float dist = distance( v_flat_position, v_position );\n // float alpha = mod( dist , v_dash_length * 2.0 ) / v_dash_length < 1.0 ? 1.0 : v_dash_opacity;\n outColor = vec4( v_color.rgb, v_color.a * opacity );\n }\n}";
23
+ const vertexShaderSource = `#version 300 es
24
+ precision highp float;
25
+
26
+ ${CameraUniformBlockString}
27
+ ${cartesian3DToGLPosition}
28
+ ${mercatorXYToGLPosition}
29
+
30
+ ${flexibleBlockManager.glslCode()}
31
+
32
+ in vec3 position3d;
33
+ in vec2 position2d;
34
+ in vec4 color;
35
+ in float dash_length;
36
+ in float dash_opacity;
37
+
38
+ out float v_dash_length;
39
+ out float v_dash_opacity;
40
+ out vec4 v_color;
41
+
42
+ flat out vec3 v_flat_position;
43
+ out vec3 v_position;
44
+
45
+ void main() {
46
+
47
+ 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;
50
+
51
+ if ( is3D ) {
52
+ gl_Position = cartesian3DToGLPosition( position3d );
53
+ v_position = position3d;
54
+ v_flat_position = position3d;
55
+ } else {
56
+ gl_Position = mercatorXYToGLPosition( position2d );
57
+ v_position = vec3( position2d, 0.0 );
58
+ v_flat_position = vec3( position2d, 0.0 );
59
+ }
60
+ gl_PointSize = 4.0;
61
+ }`;
62
+ const fragmentShaderSource = `#version 300 es
63
+ precision highp float;
64
+
65
+ uniform float opacity;
66
+
67
+ in vec4 v_color;
68
+ in float v_dash_length;
69
+ in float v_dash_opacity;
70
+
71
+ flat in vec3 v_flat_position;
72
+ in vec3 v_position;
73
+
74
+
75
+ out vec4 outColor;
76
+
77
+ void main() {
78
+ outColor = v_color;
79
+ return;
80
+ float dash_length = v_dash_length;
81
+ float dash_opacity = v_dash_opacity;
82
+
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
+ }
90
+ }`;
28
91
  console.log("LineStripProgram");
29
92
  console.log(vertexShaderSource);
30
93
  console.log(fragmentShaderSource);
31
- var Logic = /** @class */ (function () {
32
- function Logic(globe) {
33
- this._vaosPublished = [];
34
- this._ubosPublished = [];
35
- this._opacity = {
36
- value: 1,
37
- location: null
38
- };
94
+ class Logic {
95
+ _vaosPublished = [];
96
+ _ubosPublished = [];
97
+ program;
98
+ gl;
99
+ globe;
100
+ cameraBlockTotem;
101
+ _defaultFlexibleUBO;
102
+ _opacity = {
103
+ value: 1,
104
+ location: null
105
+ };
106
+ constructor(globe) {
39
107
  console.log("LineStripProgram globe", globe);
40
108
  this.gl = globe.gl;
41
109
  this.globe = globe;
42
- this.program = (0, webglobjectbuilders_1.createProgram)(this.gl, vertexShaderSource, fragmentShaderSource);
43
- var currentProgram = this.gl.getParameter(this.gl.CURRENT_PROGRAM);
110
+ this.program = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);
111
+ const currentProgram = this.gl.getParameter(this.gl.CURRENT_PROGRAM);
44
112
  this.gl.useProgram(this.program);
45
113
  this._opacity.location = this.gl.getUniformLocation(this.program, "opacity");
46
114
  this.gl.uniform1f(this._opacity.location, this._opacity.value);
@@ -50,61 +118,56 @@ var Logic = /** @class */ (function () {
50
118
  this.gl.bindAttribLocation(this.program, 2, "color");
51
119
  this.gl.bindAttribLocation(this.program, 3, "dash_length");
52
120
  this.gl.bindAttribLocation(this.program, 4, "dash_opacity");
53
- this.cameraBlockTotem = totems_1.CameraUniformBlockTotemCache.get(globe);
121
+ this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
54
122
  this.cameraBlockTotem.assignBindingPoint(this.program, uniformBindingPoints.camera);
55
123
  flexibleBlockManager.assignBindingPoint(this.gl, this.program);
56
124
  this._defaultFlexibleUBO = flexibleBlockManager.createUBO(this.gl);
57
125
  this.gl.useProgram(currentProgram);
58
126
  }
59
- Logic.prototype.createUBO = function (bufferReadType) {
60
- if (bufferReadType === void 0) { bufferReadType = "STATIC_DRAW"; }
61
- var ubo = flexibleBlockManager.createUBO(this.gl, bufferReadType);
127
+ createUBO(bufferReadType = "STATIC_DRAW") {
128
+ const ubo = flexibleBlockManager.createUBO(this.gl, bufferReadType);
62
129
  this._ubosPublished.push(ubo);
63
130
  return ubo;
64
- };
65
- Logic.prototype.createVAO = function (position3D, position2D, color, dashLength, dashOpacity) {
66
- var gl = this.gl;
67
- var vao = gl.createVertexArray();
131
+ }
132
+ createVAO(position3D, position2D, color, dashLength, dashOpacity) {
133
+ const { gl } = this;
134
+ const vao = gl.createVertexArray();
68
135
  gl.bindVertexArray(vao);
69
- (0, attribute_loader_1.attributeLoader)(gl, position3D, 0, 3);
70
- (0, attribute_loader_1.attributeLoader)(gl, position2D, 1, 2);
71
- (0, attribute_loader_1.attributeLoader)(gl, color, 2, 4, { escapeValues: [ESCAPE_VALUE, ESCAPE_VALUE, ESCAPE_VALUE, ESCAPE_VALUE] });
72
- (0, attribute_loader_1.attributeLoader)(gl, dashLength, 3, 1, { escapeValues: [ESCAPE_VALUE] });
73
- (0, attribute_loader_1.attributeLoader)(gl, dashOpacity, 4, 1, { escapeValues: [ESCAPE_VALUE] });
136
+ attributeLoader(gl, position3D, 0, 3);
137
+ attributeLoader(gl, position2D, 1, 2);
138
+ attributeLoader(gl, color, 2, 4, { escapeValues: [ESCAPE_VALUE, ESCAPE_VALUE, ESCAPE_VALUE, ESCAPE_VALUE] });
139
+ attributeLoader(gl, dashLength, 3, 1, { escapeValues: [ESCAPE_VALUE] });
140
+ attributeLoader(gl, dashOpacity, 4, 1, { escapeValues: [ESCAPE_VALUE] });
74
141
  gl.bindVertexArray(null);
75
142
  return vao;
76
- };
77
- Logic.prototype.draw = function (vao, drawOptions, opacity, flexibleUBO) {
78
- if (opacity === void 0) { opacity = 1; }
79
- if (flexibleUBO === void 0) { flexibleUBO = null; }
80
- var _a = this, gl = _a.gl, program = _a.program, cameraBlockTotem = _a.cameraBlockTotem;
143
+ }
144
+ draw(vao, drawOptions, opacity = 1, flexibleUBO = null) {
145
+ const { gl, program, cameraBlockTotem } = this;
81
146
  gl.useProgram(program);
82
147
  if (opacity !== this._opacity.value) {
83
148
  this._opacity.value = opacity;
84
149
  this.gl.uniform1f(this._opacity.location, this._opacity.value);
85
150
  }
86
- var ubo = flexibleUBO || this._defaultFlexibleUBO;
151
+ const ubo = flexibleUBO || this._defaultFlexibleUBO;
87
152
  cameraBlockTotem.bind(uniformBindingPoints.camera);
88
153
  ubo.bind();
89
154
  gl.bindVertexArray(vao);
90
- (0, methods_1.drawArrays)(gl, gl.POINTS, drawOptions);
91
- (0, methods_1.drawArrays)(gl, gl.LINE_STRIP, drawOptions);
155
+ drawArrays(gl, gl.POINTS, drawOptions);
156
+ drawArrays(gl, gl.LINE_STRIP, drawOptions);
92
157
  gl.bindVertexArray(null);
93
158
  ubo.unbind();
94
159
  cameraBlockTotem.unbind(uniformBindingPoints.camera);
95
- };
96
- Logic.prototype.free = function () {
97
- var _this = this;
98
- this._vaosPublished.forEach(function (vao) { return _this.gl.deleteVertexArray(vao); });
99
- this._ubosPublished.forEach(function (ubo) { return ubo.free(); });
160
+ }
161
+ free() {
162
+ this._vaosPublished.forEach((vao) => this.gl.deleteVertexArray(vao));
163
+ this._ubosPublished.forEach((ubo) => ubo.free());
100
164
  this.gl.deleteProgram(this.program);
101
165
  this._defaultFlexibleUBO.free();
102
- totems_1.CameraUniformBlockTotemCache.release(this.globe);
166
+ CameraUniformBlockTotemCache.release(this.globe);
103
167
  this.gl.deleteProgram(this.program);
104
- };
105
- return Logic;
106
- }());
107
- exports.LineStripProgramCache = Object.freeze({
108
- get: function (globe) { return programcache_1.noRegisterGlobeProgramCache.getProgram(globe, Logic); },
109
- release: function (globe) { return programcache_1.noRegisterGlobeProgramCache.releaseProgram(globe, Logic); },
168
+ }
169
+ }
170
+ export const LineStripProgramCache = Object.freeze({
171
+ get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
172
+ release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, Logic),
110
173
  });
@@ -1,37 +1,108 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LineOnGlobeCache = void 0;
4
- var totems_1 = require("../totems");
5
- var geometrytransformations_1 = require("../../util/shaderfunctions/geometrytransformations");
6
- var util_1 = require("../../util");
7
- var programcache_1 = require("../programcache");
8
- var attribute_loader_1 = require("../../util/gl-util/buffer/attribute-loader");
9
- var manager_1 = require("../../util/gl-util/uniform-block/manager");
10
- require("../../util/gl-util/draw-options/types");
11
- var methods_1 = require("../../util/gl-util/draw-options/methods");
12
- var GLOBE_MIDPOINT_COUNT = 30;
13
- var escapeValue = -1.0;
14
- var uniformBindingPoints = {
1
+ import { CameraUniformBlockString, CameraUniformBlockTotemCache } from "../totems";
2
+ import { slerp, POLE, R_3D, mercatorXYToGLPosition, cartesian3DToGLPosition } from "../../util/shaderfunctions/geometrytransformations";
3
+ import { createProgram } from "../../util";
4
+ import { noRegisterGlobeProgramCache } from "../programcache";
5
+ import { attributeLoader } from "../../util/gl-util/buffer/attribute-loader";
6
+ import { UniformBlockManager } from "../../util/gl-util/uniform-block/manager";
7
+ import "../../util/gl-util/draw-options/types";
8
+ import { drawInstanced } from "../../util/gl-util/draw-options/methods";
9
+ const GLOBE_MIDPOINT_COUNT = 30;
10
+ const escapeValue = -1.0;
11
+ const uniformBindingPoints = {
15
12
  camera: 0,
16
13
  flexible: 1
17
14
  };
18
- var uniformBlockManager = new manager_1.UniformBlockManager('FlexibleAttibutes', [
15
+ const uniformBlockManager = new UniformBlockManager('FlexibleAttibutes', [
19
16
  { name: 'u_color', type: 'vec4' },
20
17
  { name: 'u_dash_ratio', type: 'float' },
21
18
  { name: 'u_dash_opacity', type: 'float' }
22
19
  ], uniformBindingPoints.flexible);
23
- var vertexShader = "#version 300 es\nprecision highp float;\n\n".concat(geometrytransformations_1.R_3D, "\n").concat(totems_1.CameraUniformBlockString, "\n").concat(geometrytransformations_1.slerp, "\n").concat(geometrytransformations_1.mercatorXYToGLPosition, "\n").concat(geometrytransformations_1.cartesian3DToGLPosition, "\n\n").concat(uniformBlockManager.glslCode(), "\n\nin vec2 start_position;\nin vec3 start_position3d;\nin vec2 end_position;\nin vec3 end_position3d;\n\nin float dash_ratio;\nin float dash_opacity;\nin vec4 color;\n\nout float v_dash_ratio;\nout float v_dash_opacity;\nout vec4 v_color;\n\nout vec2 v_limp;\nout float interpolation;\n\nvoid main() {\n vec2 longLat;\n\n v_color = (color.r == -1.0) ? u_color: color;\n v_dash_ratio = (dash_ratio == -1.0) ? u_dash_ratio : dash_ratio;\n v_dash_opacity = (dash_opacity == -1.0) ? u_dash_opacity : dash_opacity;\n\n if (is3D) {\n interpolation = float(gl_VertexID) / ").concat(GLOBE_MIDPOINT_COUNT - 1, ".0;\n vec3 cartesian = slerp(start_position3d, end_position3d, interpolation);\n gl_Position = cartesian3DToGLPosition(cartesian);\n v_limp = vec2(0.0, 0.0);\n } else {\n if ( distance( start_position, end_position) > 30000000.0) { return; }\n interpolation = float(gl_VertexID);\n if (gl_VertexID % 2 == 0) {\n longLat = start_position;\n } else {\n longLat = end_position;\n }\n v_limp = longLat;\n gl_Position = mercatorXYToGLPosition(longLat);\n }\n}\n");
24
- var fragmentShader = "#version 300 es\n".concat(geometrytransformations_1.POLE, "\nprecision highp float;\n\nuniform float opacity;\n\nin float interpolation;\nin vec2 v_limp;\nin vec4 v_color;\nin float v_dash_ratio;\nin float v_dash_opacity;\n\nout vec4 color;\n\nvoid main() {\n if (v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE) { discard; }\n color = v_color;\n color.a *= opacity;\n if ( v_dash_ratio >= 1.0 ) { return; }\n if (interpolation > 0.95) { return; }\n if (fract(interpolation / (2.0 * v_dash_ratio)) < 0.5) { color.a *= v_dash_opacity; }\n\n}\n");
25
- var Logic = /** @class */ (function () {
26
- function Logic(globe) {
27
- this.vaosPublished = [];
28
- this.isFreed = false;
20
+ const vertexShader = `#version 300 es
21
+ precision highp float;
22
+
23
+ ${R_3D}
24
+ ${CameraUniformBlockString}
25
+ ${slerp}
26
+ ${mercatorXYToGLPosition}
27
+ ${cartesian3DToGLPosition}
28
+
29
+ ${uniformBlockManager.glslCode()}
30
+
31
+ in vec2 start_position;
32
+ in vec3 start_position3d;
33
+ in vec2 end_position;
34
+ in vec3 end_position3d;
35
+
36
+ in float dash_ratio;
37
+ in float dash_opacity;
38
+ in vec4 color;
39
+
40
+ out float v_dash_ratio;
41
+ out float v_dash_opacity;
42
+ out vec4 v_color;
43
+
44
+ out vec2 v_limp;
45
+ out float interpolation;
46
+
47
+ void main() {
48
+ vec2 longLat;
49
+
50
+ v_color = (color.r == -1.0) ? u_color: color;
51
+ v_dash_ratio = (dash_ratio == -1.0) ? u_dash_ratio : dash_ratio;
52
+ v_dash_opacity = (dash_opacity == -1.0) ? u_dash_opacity : dash_opacity;
53
+
54
+ if (is3D) {
55
+ interpolation = float(gl_VertexID) / ${GLOBE_MIDPOINT_COUNT - 1}.0;
56
+ vec3 cartesian = slerp(start_position3d, end_position3d, interpolation);
57
+ gl_Position = cartesian3DToGLPosition(cartesian);
58
+ v_limp = vec2(0.0, 0.0);
59
+ } else {
60
+ if ( distance( start_position, end_position) > 30000000.0) { return; }
61
+ interpolation = float(gl_VertexID);
62
+ if (gl_VertexID % 2 == 0) {
63
+ longLat = start_position;
64
+ } else {
65
+ longLat = end_position;
66
+ }
67
+ v_limp = longLat;
68
+ gl_Position = mercatorXYToGLPosition(longLat);
69
+ }
70
+ }
71
+ `;
72
+ const fragmentShader = `#version 300 es
73
+ ${POLE}
74
+ precision highp float;
75
+
76
+ uniform float opacity;
77
+
78
+ in float interpolation;
79
+ in vec2 v_limp;
80
+ in vec4 v_color;
81
+ in float v_dash_ratio;
82
+ in float v_dash_opacity;
83
+
84
+ out vec4 color;
85
+
86
+ void main() {
87
+ if (v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE) { discard; }
88
+ color = v_color;
89
+ color.a *= opacity;
90
+ if ( v_dash_ratio >= 1.0 ) { return; }
91
+ if (interpolation > 0.95) { return; }
92
+ if (fract(interpolation / (2.0 * v_dash_ratio)) < 0.5) { color.a *= v_dash_opacity; }
93
+
94
+ }
95
+ `;
96
+ class Logic {
97
+ vaosPublished = [];
98
+ isFreed = false;
99
+ constructor(globe) {
29
100
  this.globe = globe;
30
101
  this.gl = globe.gl;
31
- this.program = (0, util_1.createProgram)(this.gl, vertexShader, fragmentShader);
102
+ this.program = createProgram(this.gl, vertexShader, fragmentShader);
32
103
  this._lastOpacity = 1.0;
33
- var _a = this, gl = _a.gl, program = _a.program;
34
- var currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
104
+ const { gl, program } = this;
105
+ const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
35
106
  gl.useProgram(program);
36
107
  // assign attribute locations
37
108
  gl.bindAttribLocation(program, 0, "start_position");
@@ -44,7 +115,7 @@ var Logic = /** @class */ (function () {
44
115
  this._opacityLocation = gl.getUniformLocation(program, "opacity");
45
116
  gl.uniform1f(this._opacityLocation, this._lastOpacity);
46
117
  gl.useProgram(currentProgram);
47
- this.cameraBlockTotem = totems_1.CameraUniformBlockTotemCache.get(globe);
118
+ this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
48
119
  this.cameraBlockTotem.assignBindingPoint(program, uniformBindingPoints.camera);
49
120
  this._ubosPublished = [];
50
121
  uniformBlockManager.assignBindingPoint(this.gl, this.program);
@@ -60,9 +131,8 @@ var Logic = /** @class */ (function () {
60
131
  * @param {number} flexibleOptions.dash_opacity
61
132
  * @param {number} flexibleOptions.dash_ratio
62
133
  */
63
- Logic.prototype.draw = function (vao, drawOptions, opacity, flexibleUBO) {
64
- if (flexibleUBO === void 0) { flexibleUBO = null; }
65
- var _a = this, gl = _a.gl, program = _a.program, globe = _a.globe, cameraBlockTotem = _a.cameraBlockTotem, _defaultFlexibleUBO = _a._defaultFlexibleUBO;
134
+ draw(vao, drawOptions, opacity, flexibleUBO = null) {
135
+ const { gl, program, globe, cameraBlockTotem, _defaultFlexibleUBO } = this;
66
136
  gl.useProgram(program);
67
137
  cameraBlockTotem.bind(uniformBindingPoints.camera);
68
138
  gl.bindVertexArray(vao);
@@ -71,17 +141,16 @@ var Logic = /** @class */ (function () {
71
141
  this._lastOpacity = opacity;
72
142
  }
73
143
  // this._setFlexibleUniforms(flexibleOptions);
74
- var vertexCount = globe.api_GetCurrentGeometry() === 0 ? GLOBE_MIDPOINT_COUNT : 2;
75
- var ubo = flexibleUBO || _defaultFlexibleUBO;
144
+ const vertexCount = globe.api_GetCurrentGeometry() === 0 ? GLOBE_MIDPOINT_COUNT : 2;
145
+ const ubo = flexibleUBO || _defaultFlexibleUBO;
76
146
  ubo.bind();
77
- (0, methods_1.drawInstanced)(gl, gl.LINE_STRIP, drawOptions, vertexCount);
147
+ drawInstanced(gl, gl.LINE_STRIP, drawOptions, vertexCount);
78
148
  ubo.unbind();
79
149
  gl.bindVertexArray(null);
80
150
  cameraBlockTotem.unbind(uniformBindingPoints.camera);
81
- };
82
- Logic.prototype.createUBO = function (bufferReadType) {
83
- if (bufferReadType === void 0) { bufferReadType = "STATIC_DRAW"; }
84
- var ubo = uniformBlockManager.createUBO(this.gl, bufferReadType);
151
+ }
152
+ createUBO(bufferReadType = "STATIC_DRAW") {
153
+ const ubo = uniformBlockManager.createUBO(this.gl, bufferReadType);
85
154
  this._ubosPublished.push(ubo);
86
155
  ubo.update(new Map([
87
156
  ["u_color", [1, 1, 1, 1]],
@@ -89,37 +158,35 @@ var Logic = /** @class */ (function () {
89
158
  ["u_dash_opacity", [1]]
90
159
  ]));
91
160
  return ubo;
92
- };
93
- Logic.prototype.createVAO = function (startPotision2DBufferObj, startPotision3DBufferObj, endPosition2DBufferObj, endPosition3DBufferObj, dashRatioBufferObj, dashOpacityBufferObj, colorBufferObj) {
94
- var gl = this.gl;
95
- var vao = gl.createVertexArray();
161
+ }
162
+ createVAO(startPotision2DBufferObj, startPotision3DBufferObj, endPosition2DBufferObj, endPosition3DBufferObj, dashRatioBufferObj, dashOpacityBufferObj, colorBufferObj) {
163
+ const { gl } = this;
164
+ const vao = gl.createVertexArray();
96
165
  gl.bindVertexArray(vao);
97
- var divisor = 1;
98
- (0, attribute_loader_1.attributeLoader)(gl, startPotision2DBufferObj, 0, 2, { divisor: divisor });
99
- (0, attribute_loader_1.attributeLoader)(gl, startPotision3DBufferObj, 1, 3, { divisor: divisor });
100
- (0, attribute_loader_1.attributeLoader)(gl, endPosition2DBufferObj, 2, 2, { divisor: divisor });
101
- (0, attribute_loader_1.attributeLoader)(gl, endPosition3DBufferObj, 3, 3, { divisor: divisor });
102
- (0, attribute_loader_1.attributeLoader)(gl, dashRatioBufferObj, 4, 1, { divisor: divisor, escapeValues: [escapeValue] });
103
- (0, attribute_loader_1.attributeLoader)(gl, dashOpacityBufferObj, 5, 1, { divisor: divisor, escapeValues: [escapeValue] });
104
- (0, attribute_loader_1.attributeLoader)(gl, colorBufferObj, 6, 4, { divisor: divisor, escapeValues: [escapeValue, escapeValue, escapeValue, escapeValue] });
166
+ const divisor = 1;
167
+ attributeLoader(gl, startPotision2DBufferObj, 0, 2, { divisor });
168
+ attributeLoader(gl, startPotision3DBufferObj, 1, 3, { divisor });
169
+ attributeLoader(gl, endPosition2DBufferObj, 2, 2, { divisor });
170
+ attributeLoader(gl, endPosition3DBufferObj, 3, 3, { divisor });
171
+ attributeLoader(gl, dashRatioBufferObj, 4, 1, { divisor, escapeValues: [escapeValue] });
172
+ attributeLoader(gl, dashOpacityBufferObj, 5, 1, { divisor, escapeValues: [escapeValue] });
173
+ attributeLoader(gl, colorBufferObj, 6, 4, { divisor, escapeValues: [escapeValue, escapeValue, escapeValue, escapeValue] });
105
174
  gl.bindVertexArray(null);
106
175
  gl.bindBuffer(gl.ARRAY_BUFFER, null);
107
176
  this.vaosPublished.push(vao);
108
177
  return vao;
109
- };
110
- Logic.prototype.free = function () {
111
- var _this = this;
178
+ }
179
+ free() {
112
180
  if (this.isFreed)
113
181
  return;
114
- totems_1.CameraUniformBlockTotemCache.release(this.globe);
182
+ CameraUniformBlockTotemCache.release(this.globe);
115
183
  this.gl.deleteProgram(this.program);
116
- this.vaosPublished.forEach(function (vao) { return _this.gl.deleteVertexArray(vao); });
117
- this._ubosPublished.forEach(function (ubo) { return ubo.free(); });
184
+ this.vaosPublished.forEach(vao => this.gl.deleteVertexArray(vao));
185
+ this._ubosPublished.forEach(ubo => ubo.free());
118
186
  this.isFreed = true;
119
- };
120
- return Logic;
121
- }());
122
- exports.LineOnGlobeCache = Object.freeze({
123
- get: function (globe) { return programcache_1.noRegisterGlobeProgramCache.getProgram(globe, Logic); },
124
- release: function (globe) { return programcache_1.noRegisterGlobeProgramCache.releaseProgram(globe, Logic); }
187
+ }
188
+ }
189
+ export const LineOnGlobeCache = Object.freeze({
190
+ get: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic); },
191
+ release: (globe) => { return noRegisterGlobeProgramCache.releaseProgram(globe, Logic); }
125
192
  });
@@ -1,20 +1,49 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var util_1 = require("./util");
4
- var totems_1 = require("../totems");
5
- var geometrytransformations_1 = require("../../util/shaderfunctions/geometrytransformations");
6
- var programcache_1 = require("../programcache");
7
- var attribute_loader_1 = require("../../util/gl-util/buffer/attribute-loader");
8
- require("../draw-options/types");
9
- var methods_1 = require("../draw-options/methods");
10
- var vs = "#version 300 es\n".concat(geometrytransformations_1.R_3D, "\n").concat(totems_1.CameraUniformBlockString, "\n").concat(geometrytransformations_1.cartesian3DToGLPosition, "\nin vec3 pos3D\nin vec4 color;\nout float ratio;\nout flat vec4 vColor;\nvoid main(){\n if ( gl_VertexID == 0) {\n gl_Position = cartesian3DToGLPosition(pos3D);\n ratio =0.0;\n } else {\n vec3 sea_level_pos3D = norm(pos3D) * R_3D;\n gl_Position = cartesian3DToGLPosition(pos3D);\n ratio = 1.0;\n }\n vColor = color; \n}");
11
- var fs = "#version 300 es\nuniform float opacity;\nuniform float phase;\nuniform float fadeOpacity;\nin flat vec4 vColor;\nin float ratio;\nout vec4 fragColor;\nvoid main(){\n fragColor = vec4( vColor.rgb, vColor.a * opacity);\n if (fadeOpacity < 1.0) {\n float alpha= mix( fadeOpacity, vColor.a, fract( ratio + phase ));\n fragColor.a *= alpha;\n } \n}";
12
- var Logic = /** @class */ (function () {
13
- function Logic(globe) {
1
+ import { createProgram } from './util';
2
+ import { CameraUniformBlockTotemCache, CameraUniformBlockString } from '../totems';
3
+ import { cartesian3DToGLPosition, R_3D } from '../../util/shaderfunctions/geometrytransformations';
4
+ import { noRegisterGlobeProgramCache } from '../programcache';
5
+ import { attributeLoader } from '../../util/gl-util/buffer/attribute-loader';
6
+ import '../draw-options/types';
7
+ import { drawInstanced } from '../draw-options/methods';
8
+ const vs = `#version 300 es
9
+ ${R_3D}
10
+ ${CameraUniformBlockString}
11
+ ${cartesian3DToGLPosition}
12
+ in vec3 pos3D
13
+ in vec4 color;
14
+ out float ratio;
15
+ out flat vec4 vColor;
16
+ void main(){
17
+ if ( gl_VertexID == 0) {
18
+ gl_Position = cartesian3DToGLPosition(pos3D);
19
+ ratio =0.0;
20
+ } else {
21
+ vec3 sea_level_pos3D = norm(pos3D) * R_3D;
22
+ gl_Position = cartesian3DToGLPosition(pos3D);
23
+ ratio = 1.0;
24
+ }
25
+ vColor = color;
26
+ }`;
27
+ const fs = `#version 300 es
28
+ uniform float opacity;
29
+ uniform float phase;
30
+ uniform float fadeOpacity;
31
+ in flat vec4 vColor;
32
+ in float ratio;
33
+ out vec4 fragColor;
34
+ void main(){
35
+ fragColor = vec4( vColor.rgb, vColor.a * opacity);
36
+ if (fadeOpacity < 1.0) {
37
+ float alpha= mix( fadeOpacity, vColor.a, fract( ratio + phase ));
38
+ fragColor.a *= alpha;
39
+ }
40
+ }`;
41
+ class Logic {
42
+ constructor(globe) {
14
43
  this.globe = globe;
15
44
  this.gl = globe.gl;
16
- this.program = (0, util_1.createProgram)(this.gl, vs, fs);
17
- var _a = this, gl = _a.gl, program = _a.program;
45
+ this.program = createProgram(this.gl, vs, fs);
46
+ const { gl, program } = this;
18
47
  this._opacity = {
19
48
  lastValue: 1.0,
20
49
  location: gl.getUniformLocation(program, 'opacity')
@@ -27,37 +56,36 @@ var Logic = /** @class */ (function () {
27
56
  lastValue: 1.0,
28
57
  location: gl.getUniformBlockLocation(program, 'fadeOpacity')
29
58
  };
30
- var currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
59
+ const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
31
60
  gl.useProgram(program);
32
- [this._opacity, this._phase, this._fadeOpacity].forEach(function (wrapper) { return gl.uniform1f(wrapper.location, wrapper.lastValue); });
61
+ [this._opacity, this._phase, this._fadeOpacity].forEach((wrapper) => gl.uniform1f(wrapper.location, wrapper.lastValue));
33
62
  gl.useProgram(currentProgram);
34
63
  gl.useProgram(program);
35
64
  gl.bindAttribLocation(program, 0, 'pos3D');
36
65
  gl.bindAttribLocation(program, 1, 'color');
37
- this.cameraUniformBlockTotem = new totems_1.CameraUniformBlockTotemCache.get(globe);
66
+ this.cameraUniformBlockTotem = new CameraUniformBlockTotemCache.get(globe);
38
67
  this.cameraBlockBindingPoint = 0;
39
- var cameraBlockIndex = gl.getUniformBlockLocation(program, 'CameraUniformBlock');
68
+ const cameraBlockIndex = gl.getUniformBlockLocation(program, 'CameraUniformBlock');
40
69
  gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
41
70
  }
42
- Logic.prototype.createVao = function (pos3DObj, colorObj) {
43
- var gl = this.gl;
44
- var vao = gl.createVertexArray();
45
- var divisor = 1;
71
+ createVao(pos3DObj, colorObj) {
72
+ const { gl } = this;
73
+ const vao = gl.createVertexArray();
74
+ const divisor = 1;
46
75
  gl.bindVertexArray(vao);
47
- (0, attribute_loader_1.attributeLoader)(gl, pos3DObj, 0, 3, { divisor: divisor });
48
- (0, attribute_loader_1.attributeLoader)(gl, colorObj, 1, 4, { divisor: divisor, escapeValue: [-1, -1, -1, -1] });
76
+ attributeLoader(gl, pos3DObj, 0, 3, { divisor });
77
+ attributeLoader(gl, colorObj, 1, 4, { divisor, escapeValue: [-1, -1, -1, -1] });
49
78
  gl.bindVertexArray(null);
50
79
  this._vaoCache.push(vao);
51
80
  return vao;
52
- };
81
+ }
53
82
  /**
54
83
  *
55
84
  * @param {WebGL2RenderingContext.vertexArrayObject} vao
56
85
  * @param {Render} drawOptions
57
86
  */
58
- Logic.prototype.draw = function (vao, drawOptions, _a) {
59
- var _b = _a.opacity, opacity = _b === void 0 ? 1.0 : _b, _c = _a.fadeOpacity, fadeOpacity = _c === void 0 ? 1.0 : _c;
60
- var _d = this, globe = _d.globe, gl = _d.gl, program = _d.program, _opacity = _d._opacity, _fadeOpacity = _d._fadeOpacity;
87
+ draw(vao, drawOptions, { opacity = 1.0, fadeOpacity = 1.0, }) {
88
+ const { globe, gl, program, _opacity, _fadeOpacity } = this;
61
89
  gl.useProgram(program);
62
90
  gl.bindVertexArray(vao);
63
91
  if (fadeOpacity < 1.0) {
@@ -72,11 +100,10 @@ var Logic = /** @class */ (function () {
72
100
  _opacity.lastValue = opacity;
73
101
  gl.uniform1f(_opacity.location, opacity);
74
102
  }
75
- (0, methods_1.drawInstanced)(gl, gl.TRIANGLE_FAN, drawOptions);
76
- };
77
- Logic.prototype._updatePhase = function () {
103
+ drawInstanced(gl, gl.TRIANGLE_FAN, drawOptions);
104
+ }
105
+ _updatePhase() {
78
106
  this._phase.lastValue = (Date.now() / 3.0) % 1000;
79
107
  gl.uniform1f(_phase.location, _phase.lastValue);
80
- };
81
- return Logic;
82
- }());
108
+ }
109
+ }
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Z_ALPHA_MODE = void 0;
4
- var Z_ALPHA_MODE = Object.freeze({
1
+ const Z_ALPHA_MODE = Object.freeze({
5
2
  ON: 1,
6
3
  OFF: 0
7
4
  });
8
- exports.Z_ALPHA_MODE = Z_ALPHA_MODE;
5
+ export { Z_ALPHA_MODE };