@pirireis/webglobeplugins 0.9.6 → 0.9.7
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/package.json +5 -2
- package/Math/angle-calculation.js +0 -14
- package/Math/arc.ts +0 -76
- package/Math/bounds/line-bbox.js +0 -225
- package/Math/constants.ts +0 -11
- package/Math/frustum/camera.ts +0 -32
- package/Math/frustum/from-globeinfo.ts +0 -63
- package/Math/frustum/types.ts +0 -11
- package/Math/globe-util/horizon-plane.ts +0 -137
- package/Math/index.js +0 -0
- package/Math/juction/arc-plane.ts +0 -114
- package/Math/juction/line-sphere.ts +0 -30
- package/Math/juction/plane-plane.ts +0 -66
- package/Math/line.ts +0 -70
- package/Math/matrix4.ts +0 -0
- package/Math/methods.js +0 -237
- package/Math/plane.ts +0 -86
- package/Math/quaternion.ts +0 -120
- package/Math/roadmap.md +0 -10
- package/Math/types.ts +0 -45
- package/Math/utils.js +0 -3
- package/Math/vec3.ts +0 -155
- package/algorithms/search-binary.js +0 -14
- package/altitude-locator/adaptors.js +0 -0
- package/altitude-locator/draw-subset-obj.js +0 -27
- package/altitude-locator/keymethod.js +0 -0
- package/altitude-locator/plugin.js +0 -439
- package/altitude-locator/types.js +0 -26
- package/arrowfield/adaptor.js +0 -11
- package/arrowfield/index.js +0 -3
- package/arrowfield/plugin.js +0 -128
- package/bearing-line/index.js +0 -2
- package/bearing-line/plugin.js +0 -512
- package/circle-line-chain/chain-list-map.js +0 -221
- package/circle-line-chain/init.js +0 -0
- package/circle-line-chain/plugin.js +0 -469
- package/circle-line-chain/readme.md +0 -57
- package/circle-line-chain/util.js +0 -1
- package/compass-rose/compass-rose-padding-flat.js +0 -266
- package/compass-rose/compass-text-writer.js +0 -173
- package/compass-rose/index.js +0 -3
- package/compassrose/compassrose.js +0 -341
- package/compassrose/index.js +0 -2
- package/depth-locator/readme.md +0 -26
- package/globe-types.ts +0 -13
- package/heatwave/index.js +0 -4
- package/heatwave/isobar/objectarraylabels.js +0 -247
- package/heatwave/isobar/plugin.js +0 -340
- package/heatwave/isobar/quadtreecontours.js +0 -336
- package/heatwave/plugins/heatwaveglobeshell.js +0 -258
- package/jest.config.js +0 -6
- package/partialrings/buffer-manager.js +0 -89
- package/partialrings/goals.md +0 -17
- package/partialrings/index.js +0 -3
- package/partialrings/plugin.js +0 -160
- package/partialrings/program.js +0 -324
- package/pin/pin-object-array.js +0 -381
- package/pin/pin-point-totem.js +0 -77
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +0 -78
- package/point-heat-map/index.js +0 -0
- package/point-heat-map/plugin-webworker.js +0 -151
- package/point-heat-map/point-to-heat-map-flow.js +0 -150
- package/point-heat-map/readme.md +0 -15
- package/point-tracks/key-methods.js +0 -3
- package/point-tracks/plugin.js +0 -394
- package/programs/arrowfield/index.js +0 -2
- package/programs/arrowfield/logic.js +0 -286
- package/programs/arrowfield/object.js +0 -89
- package/programs/data2legend/density-to-legend.js +0 -115
- package/programs/data2legend/point-to-density-texture.js +0 -114
- package/programs/float2legendwithratio/index.js +0 -3
- package/programs/float2legendwithratio/logic.js +0 -194
- package/programs/float2legendwithratio/object.js +0 -141
- package/programs/globe-util/is-globe-moved.js +0 -27
- package/programs/globeshell/index.js +0 -2
- package/programs/globeshell/noise/noises.js +0 -0
- package/programs/globeshell/wiggle/index.js +0 -6
- package/programs/globeshell/wiggle/logic.js +0 -371
- package/programs/globeshell/wiggle/object.js +0 -93
- package/programs/helpers/blender/index.js +0 -0
- package/programs/helpers/blender/program.js +0 -91
- package/programs/helpers/fadeaway/index.js +0 -3
- package/programs/helpers/fadeaway/logic.js +0 -76
- package/programs/helpers/fadeaway/object.js +0 -20
- package/programs/helpers/index.js +0 -2
- package/programs/index.js +0 -21
- package/programs/interface.ts +0 -7
- package/programs/line-on-globe/angled-line.js +0 -206
- package/programs/line-on-globe/circle-accurate-3d.js +0 -167
- package/programs/line-on-globe/circle-accurate-flat.js +0 -262
- package/programs/line-on-globe/circle-accurate.js +0 -202
- package/programs/line-on-globe/circle.js +0 -191
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +0 -188
- package/programs/line-on-globe/index.js +0 -0
- package/programs/line-on-globe/lines-color-instanced-flat.js +0 -151
- package/programs/line-on-globe/linestrip.ts +0 -228
- package/programs/line-on-globe/naive-accurate-flexible.js +0 -239
- package/programs/line-on-globe/to-the-surface.js +0 -129
- package/programs/line-on-globe/util.js +0 -8
- package/programs/picking/pickable-renderer.js +0 -216
- package/programs/point-on-globe/element-globe-surface-glow.js +0 -168
- package/programs/point-on-globe/element-point-glow.js +0 -184
- package/programs/point-on-globe/square-pixel-point.js +0 -189
- package/programs/programcache.ts +0 -131
- package/programs/rings/distancering/circleflatprogram.js +0 -136
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -378
- package/programs/rings/distancering/circlepaddysharedbuffer.js +0 -420
- package/programs/rings/distancering/index.js +0 -5
- package/programs/rings/distancering/paddyflatprogram.js +0 -146
- package/programs/rings/distancering/paddyflatprogram2d.js +0 -150
- package/programs/rings/distancering/paddyflatprogram3d.js +0 -146
- package/programs/rings/distancering/shader.js +0 -0
- package/programs/rings/index.js +0 -1
- package/programs/rings/partial-ring/piece-of-pie.js +0 -315
- package/programs/totems/camerauniformblock.d.ts +0 -48
- package/programs/totems/camerauniformblock.js +0 -197
- package/programs/totems/canvas-webglobe-info.js +0 -136
- package/programs/totems/gpu-selection-uniform-block.js +0 -132
- package/programs/totems/index.ts +0 -2
- package/programs/two-d/pixel-circle.js +0 -0
- package/programs/two-d/pixel-padding-for-compass.js +0 -174
- package/programs/util.js +0 -20
- package/programs/vectorfields/index.js +0 -3
- package/programs/vectorfields/logics/drawrectangleparticles.js +0 -125
- package/programs/vectorfields/logics/index.js +0 -5
- package/programs/vectorfields/logics/pixelbased.js +0 -161
- package/programs/vectorfields/logics/ubo.js +0 -64
- package/programs/vectorfields/pingpongbuffermanager.js +0 -80
- package/publish.bat +0 -60
- package/rangerings/enum.js +0 -3
- package/rangerings/index.js +0 -5
- package/rangerings/plugin.js +0 -649
- package/rangerings/rangeringangletext.js +0 -368
- package/rangerings/ring-account.js +0 -129
- package/shaders/fragment-toy/firework.js +0 -55
- package/shaders/fragment-toy/singularity.js +0 -59
- package/shape-on-terrain/arc/naive/plugin.ts +0 -304
- package/shape-on-terrain/goal.md +0 -12
- package/tests/Math/junction/arc-plane.test.ts +0 -133
- package/tests/Math/junction/plane-plane.test.ts +0 -82
- package/tests/Math/plane.test.ts +0 -43
- package/tests/Math/vec3.test.ts +0 -14
- package/timetracks/adaptors-line-strip.js +0 -80
- package/timetracks/adaptors.js +0 -133
- package/timetracks/index.js +0 -6
- package/timetracks/plugin-line-strip.js +0 -295
- package/timetracks/plugin.js +0 -304
- package/timetracks/program-line-strip.js +0 -688
- package/timetracks/program.js +0 -850
- package/timetracks/programpoint-line-strip.js +0 -175
- package/timetracks/programpoint.js +0 -168
- package/timetracks/readme.md +0 -1
- package/tsconfig.json +0 -22
- package/types.ts +0 -17
- package/util/account/bufferoffsetmanager.js +0 -209
- package/util/account/index.js +0 -6
- package/util/account/single-attribute-buffer-management/buffer-manager.ts +0 -119
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.ts +0 -173
- package/util/account/single-attribute-buffer-management/index.ts +0 -13
- package/util/account/single-attribute-buffer-management/object-store.ts +0 -65
- package/util/account/single-attribute-buffer-management/types.ts +0 -39
- package/util/account/util.js +0 -22
- package/util/algorithms/index.js +0 -0
- package/util/algorithms/search-binary.js +0 -26
- package/util/check/get.js +0 -13
- package/util/check/index.js +0 -0
- package/util/check/typecheck.js +0 -39
- package/util/geometry/index.js +0 -53
- package/util/gl-util/buffer/attribute-loader.ts +0 -85
- package/util/gl-util/buffer/index.ts +0 -6
- package/util/gl-util/buffer/types.ts +0 -13
- package/util/gl-util/draw-options/methods.ts +0 -66
- package/util/gl-util/draw-options/types.ts +0 -28
- package/util/gl-util/uniform-block/manager.ts +0 -187
- package/util/gl-util/uniform-block/roadmap.md +0 -70
- package/util/gl-util/uniform-block/shader.js +0 -0
- package/util/gl-util/uniform-block/types.ts +0 -27
- package/util/heatwavedatamanager/datamanager.js +0 -168
- package/util/heatwavedatamanager/index.js +0 -3
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +0 -133
- package/util/heatwavedatamanager/pointcoordsmeta.js +0 -22
- package/util/index.js +0 -13
- package/util/interpolation/index.js +0 -0
- package/util/interpolation/timetrack/index.js +0 -9
- package/util/interpolation/timetrack/timetrack-interpolator.js +0 -88
- package/util/interpolation/timetrack/web-worker-str.js +0 -180
- package/util/interpolation/timetrack/web-worker.js +0 -51
- package/util/jshelpers/data-filler.js +0 -19
- package/util/jshelpers/equality.js +0 -17
- package/util/jshelpers/index.js +0 -1
- package/util/jshelpers/timefilters.js +0 -32
- package/util/picking/fence.js +0 -46
- package/util/picking/picker-displayer.js +0 -177
- package/util/programs/draw-texture-on-canvas.js +0 -102
- package/util/programs/index.js +0 -1
- package/util/programs/shapesonglobe.js +0 -246
- package/util/programs/supersampletotextures.js +0 -142
- package/util/programs/texturetoglobe.js +0 -203
- package/util/shaderfunctions/geometrytransformations.ts +0 -388
- package/util/shaderfunctions/index.js +0 -2
- package/util/shaderfunctions/nodata.js +0 -10
- package/util/shaderfunctions/noisefunctions.js +0 -44
- package/util/surface-line-data/arc-bboxes.ts +0 -42
- package/util/surface-line-data/arcs-to-cuts.js +0 -74
- package/util/surface-line-data/cut-arc.js +0 -0
- package/util/surface-line-data/flow.ts +0 -52
- package/util/surface-line-data/rbush-manager.js +0 -0
- package/util/surface-line-data/types.ts +0 -27
- package/util/surface-line-data/web-worker.js +0 -0
- package/util/webglobe/gldefaultstates.js +0 -5
- package/util/webglobe/index.js +0 -2
- package/util/webglobe/rasteroverlay.js +0 -96
- package/util/webglobjectbuilders.ts +0 -456
- package/util/webglobjectbuilders1.js +0 -271
- package/waveparticles/adaptor.js +0 -16
- package/waveparticles/index.js +0 -3
- package/waveparticles/plugin.js +0 -313
- package/wind/imagetovectorfieldandmagnitude.js +0 -39
- package/wind/index.js +0 -5
- package/wind/plugin.js +0 -1057
- package/wind/vectorfieldimage.js +0 -27
- package/write-text/attached-text-writer.js +0 -105
- package/write-text/context-text.js +0 -125
- package/write-text/context-text3.js +0 -178
- package/write-text/index.js +0 -1
- package/write-text/writer-plugin.js +0 -7
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { createProgram, shaderfunctions } from "../../../util";
|
|
2
|
-
import CameraUniformBlockTotem, { CameraUniformBlockString } from "../../totems/camerauniformblock";
|
|
3
|
-
import { globeProgramCache, noRegisterGlobeProgramCache } from "../../programcache";
|
|
4
|
-
|
|
5
|
-
const vertexShader = `#version 300 es ` +
|
|
6
|
-
shaderfunctions.PI +
|
|
7
|
-
shaderfunctions.R +
|
|
8
|
-
shaderfunctions.POLE +
|
|
9
|
-
CameraUniformBlockString +
|
|
10
|
-
shaderfunctions.mercatorXYToGLPosition +
|
|
11
|
-
shaderfunctions.longLatRadToMercator +
|
|
12
|
-
shaderfunctions.longLatRadToCartesian3D +
|
|
13
|
-
shaderfunctions.circleLimpFromLongLatRadCenterCartesian3D +
|
|
14
|
-
shaderfunctions.circleLimpFromLongLatRadCenterMercatorCompass +
|
|
15
|
-
shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistancePadding +
|
|
16
|
-
shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistance + `
|
|
17
|
-
|
|
18
|
-
in vec2 center;
|
|
19
|
-
in float radius;
|
|
20
|
-
in float pad_range;
|
|
21
|
-
in vec4 color;
|
|
22
|
-
in float flag;
|
|
23
|
-
|
|
24
|
-
uniform int compass;
|
|
25
|
-
uniform float pad_count;
|
|
26
|
-
|
|
27
|
-
uniform float opacity;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
out vec2 v_limp;
|
|
31
|
-
out vec4 v_color;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
void main() {
|
|
35
|
-
|
|
36
|
-
float alpha_padding = z_level * z_level / (pad_range/ 100.0 );
|
|
37
|
-
if( flag == 2.0 || flag == 1.0 || radius == 0.0 || alpha_padding < 0.1 || z_level < 3.0 ) return; // 1.0 is hide
|
|
38
|
-
v_color = vec4(color.rgb, color.a * alpha_padding * opacity);
|
|
39
|
-
|
|
40
|
-
gl_PointSize = 2.0;
|
|
41
|
-
|
|
42
|
-
float odd = mod(float(gl_VertexID), 2.0);
|
|
43
|
-
float index = (float(gl_VertexID)- odd ) / 2.0;
|
|
44
|
-
float angle = 3.1415926535897932384626433832795 * 2.0 * (index / pad_count );
|
|
45
|
-
float radius_ = radius - (pad_range * odd);
|
|
46
|
-
|
|
47
|
-
if ( is3D){
|
|
48
|
-
gl_Position = projection * view * vec4(
|
|
49
|
-
circleLimpFromLongLatRadCenterCartesian3D( center, radius_, angle) - translate, 1.0);
|
|
50
|
-
v_limp = vec2(0.0, 0.0);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
vec2 limp;
|
|
54
|
-
if ( compass == 1 ){
|
|
55
|
-
limp = circleLimpFromLongLatRadCenterMercatorCompass(center , radius_, angle);
|
|
56
|
-
} else {
|
|
57
|
-
// limp = circleLimpFromLongLatRadCenterMercatorRealDistancePadding(center, radius_, angle);
|
|
58
|
-
limp = circleLimpFromLongLatRadCenterMercatorRealDistance(center, radius_, angle);
|
|
59
|
-
}
|
|
60
|
-
v_limp = limp;
|
|
61
|
-
gl_Position = mercatorXYToGLPosition(limp);
|
|
62
|
-
}`;
|
|
63
|
-
|
|
64
|
-
const fragmentShader = `#version 300 es
|
|
65
|
-
precision highp float; `+
|
|
66
|
-
shaderfunctions.POLE + `
|
|
67
|
-
in vec4 v_color;
|
|
68
|
-
in vec2 v_limp;
|
|
69
|
-
out vec4 outColor;
|
|
70
|
-
void main() {
|
|
71
|
-
if ( v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE ){ discard; }
|
|
72
|
-
outColor = v_color;
|
|
73
|
-
}`;
|
|
74
|
-
|
|
75
|
-
class Logic {
|
|
76
|
-
constructor(globe) {
|
|
77
|
-
this.globe = globe;
|
|
78
|
-
this.gl = globe.gl;
|
|
79
|
-
this.program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
80
|
-
{ // bind positions so bufferManager can use them
|
|
81
|
-
this.gl.bindAttribLocation(this.program, 0, "center");
|
|
82
|
-
this.gl.bindAttribLocation(this.program, 1, "radius");
|
|
83
|
-
this.gl.bindAttribLocation(this.program, 2, "pad_range");
|
|
84
|
-
this.gl.bindAttribLocation(this.program, 3, "color");
|
|
85
|
-
this.gl.bindAttribLocation(this.program, 4, "flag");
|
|
86
|
-
}
|
|
87
|
-
this.cameraBlockBindingPoint = 0;
|
|
88
|
-
const cameraBlockIndex = this.gl.getUniformBlockIndex(this.program, "CameraUniformBlock");
|
|
89
|
-
this.gl.uniformBlockBinding(this.program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
90
|
-
this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
91
|
-
this._padCountLocation = this.gl.getUniformLocation(this.program, "pad_count");
|
|
92
|
-
this._opacityLocation = this.gl.getUniformLocation(this.program, "opacity");
|
|
93
|
-
this._compassLocation = this.gl.getUniformLocation(this.program, "compass");
|
|
94
|
-
this._compassMode = 1;
|
|
95
|
-
this._opacity = 1.0;
|
|
96
|
-
this._padCount = 360;
|
|
97
|
-
{
|
|
98
|
-
const currentProgram = this.gl.getParameter(this.gl.CURRENT_PROGRAM);
|
|
99
|
-
this.gl.useProgram(this.program);
|
|
100
|
-
this.gl.uniform1i(this._compassLocation, 1);
|
|
101
|
-
this.gl.uniform1f(this._opacityLocation, 1.0);
|
|
102
|
-
this.gl.uniform1f(this._padCountLocation, 360)
|
|
103
|
-
this.gl.useProgram(currentProgram);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
draw(vao, length, opaity) {
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
draw(attrBufferManager, padCount, compass, opacity) {
|
|
114
|
-
const { gl, program, _padCountLocation, cameraBlockBindingPoint, cameraBlockTotem, _compassLocation } = this;
|
|
115
|
-
gl.useProgram(program);
|
|
116
|
-
attrBufferManager.bindPaddingVAO();
|
|
117
|
-
cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
118
|
-
// draw instanced
|
|
119
|
-
if (padCount !== this._padCount) {
|
|
120
|
-
this._padCount = padCount;
|
|
121
|
-
// console.log("padCount", padCount);
|
|
122
|
-
gl.uniform1f(_padCountLocation, padCount);
|
|
123
|
-
}
|
|
124
|
-
if (compass !== this._compassMode) {
|
|
125
|
-
// console.log("compass", compass);
|
|
126
|
-
gl.uniform1i(_compassLocation, compass);
|
|
127
|
-
this._compassMode = compass;
|
|
128
|
-
}
|
|
129
|
-
if (opacity !== this._opacity) {
|
|
130
|
-
// console.log("opacity", opacity);
|
|
131
|
-
this._opacity = opacity;
|
|
132
|
-
gl.uniform1f(this._opacityLocation, opacity);
|
|
133
|
-
}
|
|
134
|
-
gl.drawArraysInstanced(gl.LINES, 0, padCount * 2, attrBufferManager.length);
|
|
135
|
-
gl.bindVertexArray(null);
|
|
136
|
-
cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
free() {
|
|
140
|
-
this.gl.deleteProgram(this.program);
|
|
141
|
-
globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
export const PaddingProgramCache = Object.freeze({
|
|
148
|
-
getProgram: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic) },
|
|
149
|
-
releaseProgram: (globe) => { noRegisterGlobeProgramCache.releaseProgram(globe, Logic) }
|
|
150
|
-
})
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { createProgram, shaderfunctions } from "../../../util";
|
|
2
|
-
import CameraUniformBlockTotem, { CameraUniformBlockString } from "../../totems/camerauniformblock";
|
|
3
|
-
import { globeProgramCache, noRegisterGlobeProgramCache } from "../../programcache";
|
|
4
|
-
|
|
5
|
-
const vertexShader = `#version 300 es ` +
|
|
6
|
-
shaderfunctions.PI +
|
|
7
|
-
shaderfunctions.R +
|
|
8
|
-
shaderfunctions.POLE +
|
|
9
|
-
CameraUniformBlockString +
|
|
10
|
-
shaderfunctions.mercatorXYToGLPosition +
|
|
11
|
-
shaderfunctions.longLatRadToMercator +
|
|
12
|
-
shaderfunctions.longLatRadToCartesian3D +
|
|
13
|
-
shaderfunctions.circleLimpFromLongLatRadCenterCartesian3D +
|
|
14
|
-
shaderfunctions.circleLimpFromLongLatRadCenterMercatorCompass +
|
|
15
|
-
shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistancePadding +
|
|
16
|
-
shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistance + `
|
|
17
|
-
|
|
18
|
-
in vec2 center;
|
|
19
|
-
in float radius;
|
|
20
|
-
in float pad_range;
|
|
21
|
-
in vec4 color;
|
|
22
|
-
in float flag;
|
|
23
|
-
|
|
24
|
-
uniform int compass;
|
|
25
|
-
uniform float pad_count;
|
|
26
|
-
|
|
27
|
-
uniform float opacity;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
out vec2 v_limp;
|
|
31
|
-
out vec4 v_color;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
void main() {
|
|
35
|
-
|
|
36
|
-
float alpha_padding = z_level * z_level / (pad_range/ 100.0 );
|
|
37
|
-
if( flag == 2.0 || flag == 1.0 || radius == 0.0 || alpha_padding < 0.1 || z_level < 3.0 ) return; // 1.0 is hide
|
|
38
|
-
v_color = vec4(color.rgb, color.a * alpha_padding * opacity);
|
|
39
|
-
|
|
40
|
-
gl_PointSize = 2.0;
|
|
41
|
-
|
|
42
|
-
float odd = mod(float(gl_VertexID), 2.0);
|
|
43
|
-
float index = (float(gl_VertexID)- odd ) / 2.0;
|
|
44
|
-
float angle = 3.1415926535897932384626433832795 * 2.0 * (index / pad_count );
|
|
45
|
-
float radius_ = radius - (pad_range * odd);
|
|
46
|
-
|
|
47
|
-
if ( is3D){
|
|
48
|
-
gl_Position = projection * view * vec4(
|
|
49
|
-
circleLimpFromLongLatRadCenterCartesian3D( center, radius_, angle) - translate, 1.0);
|
|
50
|
-
v_limp = vec2(0.0, 0.0);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
vec2 limp;
|
|
54
|
-
if ( compass == 1 ){
|
|
55
|
-
limp = circleLimpFromLongLatRadCenterMercatorCompass(center , radius_, angle);
|
|
56
|
-
} else {
|
|
57
|
-
// limp = circleLimpFromLongLatRadCenterMercatorRealDistancePadding(center, radius_, angle);
|
|
58
|
-
limp = circleLimpFromLongLatRadCenterMercatorRealDistance(center, radius_, angle);
|
|
59
|
-
}
|
|
60
|
-
v_limp = limp;
|
|
61
|
-
gl_Position = mercatorXYToGLPosition(limp);
|
|
62
|
-
}`;
|
|
63
|
-
|
|
64
|
-
const fragmentShader = `#version 300 es
|
|
65
|
-
precision highp float; `+
|
|
66
|
-
shaderfunctions.POLE + `
|
|
67
|
-
in vec4 v_color;
|
|
68
|
-
in vec2 v_limp;
|
|
69
|
-
out vec4 outColor;
|
|
70
|
-
void main() {
|
|
71
|
-
if ( v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE ){ discard; }
|
|
72
|
-
outColor = v_color;
|
|
73
|
-
}`;
|
|
74
|
-
|
|
75
|
-
class Logic {
|
|
76
|
-
constructor(globe) {
|
|
77
|
-
this.globe = globe;
|
|
78
|
-
this.gl = globe.gl;
|
|
79
|
-
this.program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
80
|
-
{ // bind positions so bufferManager can use them
|
|
81
|
-
this.gl.bindAttribLocation(this.program, 0, "center");
|
|
82
|
-
this.gl.bindAttribLocation(this.program, 1, "radius");
|
|
83
|
-
this.gl.bindAttribLocation(this.program, 2, "pad_range");
|
|
84
|
-
this.gl.bindAttribLocation(this.program, 3, "color");
|
|
85
|
-
this.gl.bindAttribLocation(this.program, 4, "flag");
|
|
86
|
-
}
|
|
87
|
-
this.cameraBlockBindingPoint = 0;
|
|
88
|
-
const cameraBlockIndex = this.gl.getUniformBlockIndex(this.program, "CameraUniformBlock");
|
|
89
|
-
this.gl.uniformBlockBinding(this.program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
90
|
-
this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
91
|
-
this._padCountLocation = this.gl.getUniformLocation(this.program, "pad_count");
|
|
92
|
-
this._opacityLocation = this.gl.getUniformLocation(this.program, "opacity");
|
|
93
|
-
this._compassLocation = this.gl.getUniformLocation(this.program, "compass");
|
|
94
|
-
this._compassMode = 1;
|
|
95
|
-
this._opacity = 1.0;
|
|
96
|
-
this._padCount = 360;
|
|
97
|
-
{
|
|
98
|
-
const currentProgram = this.gl.getParameter(this.gl.CURRENT_PROGRAM);
|
|
99
|
-
this.gl.useProgram(this.program);
|
|
100
|
-
this.gl.uniform1i(this._compassLocation, 1);
|
|
101
|
-
this.gl.uniform1f(this._opacityLocation, 1.0);
|
|
102
|
-
this.gl.uniform1f(this._padCountLocation, 360)
|
|
103
|
-
this.gl.useProgram(currentProgram);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
draw(attrBufferManager, padCount, compass, opacity) {
|
|
110
|
-
const { gl, program, _padCountLocation, cameraBlockBindingPoint, cameraBlockTotem, _compassLocation } = this;
|
|
111
|
-
gl.useProgram(program);
|
|
112
|
-
attrBufferManager.bindPaddingVAO();
|
|
113
|
-
cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
114
|
-
// draw instanced
|
|
115
|
-
if (padCount !== this._padCount) {
|
|
116
|
-
this._padCount = padCount;
|
|
117
|
-
// console.log("padCount", padCount);
|
|
118
|
-
gl.uniform1f(_padCountLocation, padCount);
|
|
119
|
-
}
|
|
120
|
-
if (compass !== this._compassMode) {
|
|
121
|
-
// console.log("compass", compass);
|
|
122
|
-
gl.uniform1i(_compassLocation, compass);
|
|
123
|
-
this._compassMode = compass;
|
|
124
|
-
}
|
|
125
|
-
if (opacity !== this._opacity) {
|
|
126
|
-
// console.log("opacity", opacity);
|
|
127
|
-
this._opacity = opacity;
|
|
128
|
-
gl.uniform1f(this._opacityLocation, opacity);
|
|
129
|
-
}
|
|
130
|
-
gl.drawArraysInstanced(gl.LINES, 0, padCount * 2, attrBufferManager.length);
|
|
131
|
-
gl.bindVertexArray(null);
|
|
132
|
-
cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
free() {
|
|
136
|
-
this.gl.deleteProgram(this.program);
|
|
137
|
-
globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
export const PaddingProgramCache = Object.freeze({
|
|
144
|
-
getProgram: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic) },
|
|
145
|
-
releaseProgram: (globe) => { noRegisterGlobeProgramCache.releaseProgram(globe, Logic) }
|
|
146
|
-
})
|
|
File without changes
|
package/programs/rings/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./distancering";
|
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
import { createProgram, shaderfunctions } from "../../../util";
|
|
2
|
-
import { CameraUniformBlockTotem, CameraUniformBlockString } from "../../totems";
|
|
3
|
-
import { noRegisterGlobeProgramCache, globeProgramCache } from "../../programcache";
|
|
4
|
-
import {
|
|
5
|
-
POLE,
|
|
6
|
-
PI,
|
|
7
|
-
longLatRadToMercator,
|
|
8
|
-
mercatorXYToGLPosition,
|
|
9
|
-
longLatRadToCartesian3D,
|
|
10
|
-
circleLimpFromLongLatRadCenterCartesian3D_accurate,
|
|
11
|
-
circleLimpFromLongLatRadCenterMercatorCompass_accurate,
|
|
12
|
-
//circleLimpFromLongLatRadCenterMercatorRealDistanceNew_accurate,
|
|
13
|
-
cartesian3DToGLPosition
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "../../../util/shaderfunctions/geometrytransformations";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* TODO:
|
|
21
|
-
* 1. Triangle face looks at screen. if rotation angle is positive the last vertex must be the faintest.
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
const drawModeMap = Object.freeze({
|
|
26
|
-
LINE_STRIP: 0,
|
|
27
|
-
TRIANGLE_FAN: 1,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
//${ circleLimpFromLongLatRadCenterMercatorRealDistanceNew_accurate }
|
|
32
|
-
|
|
33
|
-
const vertexShaderSource = `#version 300 es
|
|
34
|
-
|
|
35
|
-
${CameraUniformBlockString}
|
|
36
|
-
${PI}
|
|
37
|
-
${longLatRadToMercator}
|
|
38
|
-
${mercatorXYToGLPosition}
|
|
39
|
-
${longLatRadToCartesian3D}
|
|
40
|
-
${circleLimpFromLongLatRadCenterCartesian3D_accurate}
|
|
41
|
-
${circleLimpFromLongLatRadCenterMercatorCompass_accurate}
|
|
42
|
-
${cartesian3DToGLPosition}
|
|
43
|
-
|
|
44
|
-
uniform float edge_count;
|
|
45
|
-
uniform int draw_mode; // %2 => 0: LINE_STRIP, 1: TRIANGLE_FAN
|
|
46
|
-
uniform float plugin_alpha_multiplier;
|
|
47
|
-
//, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode
|
|
48
|
-
// in vec2 center; // long, lat in radian
|
|
49
|
-
in vec2 center2d;
|
|
50
|
-
in vec3 center3d;
|
|
51
|
-
in float start_angle2d;
|
|
52
|
-
in float tail_angle2d;
|
|
53
|
-
|
|
54
|
-
in float start_angle3d;
|
|
55
|
-
in float tail_angle3d;
|
|
56
|
-
|
|
57
|
-
in vec4 color;
|
|
58
|
-
in float radius; // in meter
|
|
59
|
-
in float color_mode; // 0.0: constant, 1.0: fading, 2.0: hide
|
|
60
|
-
// flat out int vid;
|
|
61
|
-
// flat out float v_phase;
|
|
62
|
-
out vec2 v_pos;
|
|
63
|
-
out vec4 v_color;
|
|
64
|
-
// flat out float v_angle;
|
|
65
|
-
|
|
66
|
-
void main() {
|
|
67
|
-
// vid = gl_VertexID;
|
|
68
|
-
if (color_mode == 2.0 || radius == 0.0) { return; }
|
|
69
|
-
float start_angle, tail_angle;
|
|
70
|
-
if (is3D) {
|
|
71
|
-
start_angle = start_angle3d;
|
|
72
|
-
tail_angle = tail_angle3d;
|
|
73
|
-
} else {
|
|
74
|
-
start_angle = start_angle2d;
|
|
75
|
-
tail_angle = tail_angle2d;
|
|
76
|
-
}
|
|
77
|
-
float color_mode_ = color_mode;
|
|
78
|
-
if ( draw_mode == 0 && color_mode == 1.0) {color_mode_ = 0.0;}
|
|
79
|
-
float vertexID = float(gl_VertexID);
|
|
80
|
-
float radius_ = radius;
|
|
81
|
-
float alpha = plugin_alpha_multiplier;
|
|
82
|
-
if (draw_mode == 1) { // TRIANGLE_FAN
|
|
83
|
-
if (gl_VertexID == 0) {
|
|
84
|
-
radius_ = 0.0;
|
|
85
|
-
if ( color_mode == 1.0 ) { alpha = 0.0; }
|
|
86
|
-
}
|
|
87
|
-
vertexID -= 1.0;
|
|
88
|
-
}
|
|
89
|
-
float phase = ( vertexID / (edge_count - 1.0) );
|
|
90
|
-
// v_angle = tail_angle;
|
|
91
|
-
|
|
92
|
-
if ( color_mode_ == 1.0 ) {
|
|
93
|
-
if ( tail_angle < 0.0 ) {
|
|
94
|
-
v_color = vec4( color.rgb , color.a * ( 1.0 - phase ) * alpha );
|
|
95
|
-
} else {
|
|
96
|
-
v_color = vec4( color.rgb , color.a * phase * alpha );
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
v_color = vec4( color.rgb , color.a * alpha );
|
|
100
|
-
}
|
|
101
|
-
if ( color_mode == 0.0 && draw_mode == 1 ) {
|
|
102
|
-
v_color.a /= 2.0;
|
|
103
|
-
}
|
|
104
|
-
float angle;
|
|
105
|
-
if ( tail_angle > 0.0 ) {
|
|
106
|
-
angle = tail_angle * (-phase + 1.0) + start_angle;
|
|
107
|
-
} else {
|
|
108
|
-
angle = tail_angle * phase + start_angle;
|
|
109
|
-
}
|
|
110
|
-
if (is3D) {
|
|
111
|
-
vec3 pos = circleLimpFromLongLatRadCenterCartesian3D_accurate(center3d, radius_, angle);
|
|
112
|
-
v_pos = vec2(0.0, 0.0);
|
|
113
|
-
gl_Position = cartesian3DToGLPosition(pos);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
vec2 pos2 = circleLimpFromLongLatRadCenterMercatorCompass_accurate(center2d, radius_, angle);
|
|
117
|
-
v_pos = pos2;
|
|
118
|
-
gl_Position = mercatorXYToGLPosition(pos2);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
gl_PointSize = 10.0;
|
|
122
|
-
}`;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const fragmentShaderSource = `#version 300 es` + POLE + PI + `
|
|
126
|
-
precision highp float;
|
|
127
|
-
// flat in int vid;
|
|
128
|
-
in vec4 v_color;
|
|
129
|
-
in vec2 v_pos;
|
|
130
|
-
// flat in float v_phase;
|
|
131
|
-
// in float v_angle;
|
|
132
|
-
out vec4 outColor;
|
|
133
|
-
void main() {
|
|
134
|
-
// if( vid % 2 == 0 ) { discard; }
|
|
135
|
-
// if ( mod(v_angle, PI / 36.0 ) < (PI / 72.0)) { discard; }
|
|
136
|
-
// if ( mod(v_angle * v_phase, PI / 90.0 ) < (PI / 180.0)) { discard; }
|
|
137
|
-
if ( v_pos.x < -POLE || v_pos.x > POLE || v_pos.y < -POLE || v_pos.y > POLE ) { discard; }
|
|
138
|
-
outColor = v_color;
|
|
139
|
-
}`;
|
|
140
|
-
|
|
141
|
-
export const ITEM_SIZE = 10;
|
|
142
|
-
|
|
143
|
-
export class Logic {
|
|
144
|
-
|
|
145
|
-
constructor(globe) {
|
|
146
|
-
this.globe = globe;
|
|
147
|
-
this.gl = globe.gl;
|
|
148
|
-
this._lastMode = 0;
|
|
149
|
-
this._lastEdgeCount = 64;
|
|
150
|
-
this._lastAlphaMultiplier = 1.0;
|
|
151
|
-
|
|
152
|
-
this.program = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);
|
|
153
|
-
const { gl, program } = this;
|
|
154
|
-
{ // set attributes locations
|
|
155
|
-
gl.bindAttribLocation(program, 0, 'center2d');
|
|
156
|
-
gl.bindAttribLocation(program, 1, 'center3d')
|
|
157
|
-
gl.bindAttribLocation(program, 2, 'start_angle2d');
|
|
158
|
-
gl.bindAttribLocation(program, 3, 'tail_angle2d');
|
|
159
|
-
gl.bindAttribLocation(program, 4, 'start_angle3d');
|
|
160
|
-
gl.bindAttribLocation(program, 5, 'tail_angle3d');
|
|
161
|
-
gl.bindAttribLocation(program, 6, 'color');
|
|
162
|
-
gl.bindAttribLocation(program, 7, 'radius');
|
|
163
|
-
gl.bindAttribLocation(program, 8, 'color_mode');
|
|
164
|
-
// vao
|
|
165
|
-
// instanced draw read 1
|
|
166
|
-
}
|
|
167
|
-
{ // Uniforms
|
|
168
|
-
this._edgeCountLocation = gl.getUniformLocation(program, 'edge_count');
|
|
169
|
-
this._draw_modeLocation = gl.getUniformLocation(program, 'draw_mode');
|
|
170
|
-
this._plugin_alpha_multiplierLocation = gl.getUniformLocation(program, 'plugin_alpha_multiplier');
|
|
171
|
-
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
172
|
-
gl.useProgram(program);
|
|
173
|
-
gl.uniform1i(this._draw_modeLocation, this._lastMode);
|
|
174
|
-
gl.uniform1f(this._edgeCountLocation, this._lastEdgeCount);
|
|
175
|
-
gl.uniform1f(this._plugin_alpha_multiplierLocation, 1.0);
|
|
176
|
-
|
|
177
|
-
this.cameraBlockBindingPoint = 0;
|
|
178
|
-
this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
179
|
-
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
|
|
180
|
-
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
181
|
-
|
|
182
|
-
gl.useProgram(currentProgram);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
draw(length, vao, edgeCount, alphaMultiplier, drawMode) {
|
|
190
|
-
const { gl, program, cameraBlockTotem, cameraBlockBindingPoint } = this
|
|
191
|
-
|
|
192
|
-
// gl.disable(gl.DEPTH_TEST);
|
|
193
|
-
gl.useProgram(program);
|
|
194
|
-
if (drawMode !== this._lastMode) {
|
|
195
|
-
gl.uniform1i(this._draw_modeLocation, drawModeMap[drawMode]);
|
|
196
|
-
this._lastMode = drawMode;
|
|
197
|
-
}
|
|
198
|
-
if (edgeCount !== this._lastEdgeCount) {
|
|
199
|
-
gl.uniform1f(this._edgeCountLocation, edgeCount);
|
|
200
|
-
this._lastEdgeCount = edgeCount;
|
|
201
|
-
}
|
|
202
|
-
if (alphaMultiplier !== this._lastAlphaMultiplier) {
|
|
203
|
-
gl.uniform1f(this._plugin_alpha_multiplierLocation, alphaMultiplier);
|
|
204
|
-
this._lastAlphaMultiplier = alphaMultiplier;
|
|
205
|
-
}
|
|
206
|
-
const overdraw = drawModeMap[drawMode];
|
|
207
|
-
cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
208
|
-
gl.bindVertexArray(vao);
|
|
209
|
-
gl.drawArraysInstanced(gl[drawMode], 0, edgeCount + overdraw, length);
|
|
210
|
-
cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
211
|
-
gl.bindVertexArray(null);
|
|
212
|
-
// gl.enable(gl.DEPTH_TEST);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
free() {
|
|
217
|
-
noRegisterGlobeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
218
|
-
this.gl.deleteProgram(this.program);
|
|
219
|
-
this.program = null;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* in vec2 center; // long, lat in radian
|
|
225
|
-
in float start_angle; // the start of partial circle from bearing point
|
|
226
|
-
in float tail_angle; // the rotation of the partial circle
|
|
227
|
-
in vec4 color;
|
|
228
|
-
in float radius; // in meter
|
|
229
|
-
in float color_mode; // 0.0: constant, 1.0: fading, 2.0: hide
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
createVAO(center2dObj, center3dObj, startAngle2DObj, tailAngle2DObj, startAngle3DObj, tailAngle3DObj, colorObj, radiusObj, colorModeObj) {
|
|
233
|
-
|
|
234
|
-
const { gl } = this;
|
|
235
|
-
const vao = gl.createVertexArray();
|
|
236
|
-
gl.bindVertexArray(vao);
|
|
237
|
-
|
|
238
|
-
{
|
|
239
|
-
const { buffer, stride, offset } = center2dObj;
|
|
240
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
241
|
-
gl.enableVertexAttribArray(0);
|
|
242
|
-
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, stride, offset);
|
|
243
|
-
gl.vertexAttribDivisor(0, 1);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
{
|
|
247
|
-
const { buffer, stride, offset } = center3dObj;
|
|
248
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
249
|
-
gl.enableVertexAttribArray(1);
|
|
250
|
-
gl.vertexAttribPointer(1, 3, gl.FLOAT, false, stride, offset);
|
|
251
|
-
gl.vertexAttribDivisor(1, 1);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
{
|
|
255
|
-
const { buffer, stride, offset } = startAngle2DObj;
|
|
256
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
257
|
-
gl.enableVertexAttribArray(2);
|
|
258
|
-
gl.vertexAttribPointer(2, 1, gl.FLOAT, false, stride, offset);
|
|
259
|
-
gl.vertexAttribDivisor(2, 1);
|
|
260
|
-
}
|
|
261
|
-
{
|
|
262
|
-
const { buffer, stride, offset } = tailAngle2DObj;
|
|
263
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
264
|
-
gl.enableVertexAttribArray(3);
|
|
265
|
-
gl.vertexAttribPointer(3, 1, gl.FLOAT, false, stride, offset);
|
|
266
|
-
gl.vertexAttribDivisor(3, 1);
|
|
267
|
-
}
|
|
268
|
-
{
|
|
269
|
-
const { buffer, stride, offset } = startAngle3DObj;
|
|
270
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
271
|
-
gl.enableVertexAttribArray(4);
|
|
272
|
-
gl.vertexAttribPointer(4, 1, gl.FLOAT, false, stride, offset);
|
|
273
|
-
gl.vertexAttribDivisor(4, 1);
|
|
274
|
-
}
|
|
275
|
-
{
|
|
276
|
-
const { buffer, stride, offset } = tailAngle3DObj;
|
|
277
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
278
|
-
gl.enableVertexAttribArray(5);
|
|
279
|
-
gl.vertexAttribPointer(5, 1, gl.FLOAT, false, stride, offset);
|
|
280
|
-
gl.vertexAttribDivisor(5, 1);
|
|
281
|
-
}
|
|
282
|
-
{
|
|
283
|
-
const { buffer, stride, offset } = colorObj;
|
|
284
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
285
|
-
gl.enableVertexAttribArray(6);
|
|
286
|
-
gl.vertexAttribPointer(6, 4, gl.FLOAT, false, stride, offset);
|
|
287
|
-
gl.vertexAttribDivisor(6, 1);
|
|
288
|
-
}
|
|
289
|
-
{
|
|
290
|
-
const { buffer, stride, offset } = radiusObj;
|
|
291
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
292
|
-
gl.enableVertexAttribArray(7);
|
|
293
|
-
gl.vertexAttribPointer(7, 1, gl.FLOAT, false, stride, offset);
|
|
294
|
-
gl.vertexAttribDivisor(7, 1);
|
|
295
|
-
}
|
|
296
|
-
{
|
|
297
|
-
const { buffer, stride, offset } = colorModeObj;
|
|
298
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
299
|
-
gl.enableVertexAttribArray(8);
|
|
300
|
-
gl.vertexAttribPointer(8, 1, gl.FLOAT, false, stride, offset);
|
|
301
|
-
gl.vertexAttribDivisor(8, 1);
|
|
302
|
-
}
|
|
303
|
-
gl.bindVertexArray(null);
|
|
304
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
305
|
-
return vao;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
export const PieceOfPieProgramCache = Object.freeze({
|
|
313
|
-
get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
|
|
314
|
-
release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
|
|
315
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export declare const CameraUniformBlockString: string;
|
|
2
|
-
|
|
3
|
-
export default class CameraUniformBlockTotem {
|
|
4
|
-
id: string;
|
|
5
|
-
description: string;
|
|
6
|
-
gl: WebGL2RenderingContext | null;
|
|
7
|
-
globe: any;
|
|
8
|
-
ubo: WebGLBuffer | null;
|
|
9
|
-
// _frustumPlanes: any; // Uncomment and type if used
|
|
10
|
-
_isMovedParams: {
|
|
11
|
-
lastLod: number | null;
|
|
12
|
-
isMoved: boolean;
|
|
13
|
-
};
|
|
14
|
-
traslateFloat32: Float32Array;
|
|
15
|
-
mapWHFloat32: Float32Array;
|
|
16
|
-
|
|
17
|
-
constructor();
|
|
18
|
-
|
|
19
|
-
init(globe: any, gl: WebGL2RenderingContext): void;
|
|
20
|
-
resize(): void;
|
|
21
|
-
setGeometry(): void;
|
|
22
|
-
draw3D(
|
|
23
|
-
projection: Float32Array,
|
|
24
|
-
modelView: Float32Array,
|
|
25
|
-
translate: { x: number; y: number; z: number }
|
|
26
|
-
): void;
|
|
27
|
-
assignBindingPoint(program: WebGLProgram, bindingPoint: number): void;
|
|
28
|
-
getUBO(): WebGLBuffer | null;
|
|
29
|
-
getFrustumPlanes(): any; // Update type if needed
|
|
30
|
-
bind(bindingPoint: number): void;
|
|
31
|
-
unbind(bindingPoint: number): void;
|
|
32
|
-
isMoved(): boolean;
|
|
33
|
-
free(): void;
|
|
34
|
-
readBuffer(): {
|
|
35
|
-
view: Float32Array;
|
|
36
|
-
projection: Float32Array;
|
|
37
|
-
translate: Float32Array;
|
|
38
|
-
is3D: number;
|
|
39
|
-
mapWH: Float32Array;
|
|
40
|
-
screenWH: Float32Array;
|
|
41
|
-
z_level: number;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export declare const CameraUniformBlockTotemCache: Readonly<{
|
|
46
|
-
get: (globe: any) => any;
|
|
47
|
-
release: (globe: any) => void;
|
|
48
|
-
}>;
|