@pirireis/webglobeplugins 0.16.0 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Math/angle-calculation.js +13 -14
- package/Math/bounds/line-bbox.js +186 -225
- package/Math/index.js +1 -0
- package/Math/mesh/mapbox-delaunay.js +544 -607
- package/Math/utils.js +2 -3
- package/algorithms/search-binary.js +16 -14
- package/altitude-locator/adaptors.js +1 -0
- package/altitude-locator/keymethod.js +1 -0
- package/altitude-locator/plugin.js +345 -446
- package/altitude-locator/types.js +21 -26
- package/arrowfield/adaptor.js +11 -11
- package/arrowfield/index.js +3 -3
- package/arrowfield/plugin.js +83 -128
- package/bearing-line/index.js +2 -2
- package/bearing-line/plugin.js +444 -520
- package/circle-line-chain/chain-list-map.js +201 -221
- package/circle-line-chain/init.js +1 -0
- package/circle-line-chain/plugin.js +411 -464
- package/circle-line-chain/util.js +1 -1
- package/compass-rose/compass-rose-padding-flat.js +230 -274
- package/compass-rose/compass-text-writer.js +149 -173
- package/compass-rose/index.js +3 -3
- package/compassrose/compassrose.js +293 -341
- package/compassrose/index.js +2 -2
- package/constants.js +3 -0
- package/heatwave/index.js +3 -4
- package/heatwave/isobar/objectarraylabels.js +200 -247
- package/heatwave/isobar/plugin.js +302 -339
- package/heatwave/isobar/quadtreecontours.js +298 -336
- package/heatwave/plugins/heatwaveglobeshell.js +204 -259
- package/index.js +12 -15
- package/jest.config.js +7 -6
- package/package.json +1 -4
- package/partialrings/buffer-manager.js +75 -89
- package/partialrings/index.js +2 -3
- package/partialrings/plugin.js +128 -160
- package/partialrings/program.js +188 -233
- package/pin/pin-object-array.js +300 -381
- package/pin/pin-point-totem.js +60 -77
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +63 -78
- package/point-heat-map/index.js +1 -0
- package/point-heat-map/plugin-webworker.js +121 -148
- package/point-heat-map/point-to-heat-map-flow.js +124 -150
- package/point-tracks/key-methods.js +2 -3
- package/point-tracks/plugin.js +393 -480
- package/programs/arrowfield/index.js +2 -2
- package/programs/arrowfield/logic.js +141 -173
- package/programs/arrowfield/object.js +60 -89
- package/programs/data2legend/density-to-legend.js +73 -90
- package/programs/data2legend/point-to-density-texture.js +70 -87
- package/programs/float2legendwithratio/index.js +2 -3
- package/programs/float2legendwithratio/logic.js +118 -144
- package/programs/float2legendwithratio/object.js +104 -141
- package/programs/globe-util/is-globe-moved.js +19 -27
- package/programs/globeshell/index.js +2 -2
- package/programs/globeshell/wiggle/index.js +2 -3
- package/programs/globeshell/wiggle/logic.js +243 -272
- package/programs/globeshell/wiggle/object.js +66 -93
- package/programs/helpers/blender/index.js +1 -0
- package/programs/helpers/blender/program.js +58 -73
- package/programs/helpers/fadeaway/index.js +2 -3
- package/programs/helpers/fadeaway/logic.js +46 -53
- package/programs/helpers/fadeaway/object.js +14 -20
- package/programs/helpers/index.js +2 -2
- package/programs/index.js +9 -21
- package/programs/line-on-globe/circle-accurate-3d.js +87 -115
- package/programs/line-on-globe/circle-accurate-flat.js +149 -201
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +104 -136
- package/programs/line-on-globe/index.js +1 -0
- package/programs/line-on-globe/lines-color-instanced-flat.js +83 -102
- package/programs/line-on-globe/util.js +5 -8
- package/programs/picking/pickable-polygon-renderer.js +98 -129
- package/programs/picking/pickable-renderer.js +98 -129
- package/programs/point-on-globe/element-globe-surface-glow.js +93 -122
- package/programs/point-on-globe/element-point-glow.js +80 -114
- package/programs/point-on-globe/square-pixel-point.js +120 -138
- package/programs/rings/distancering/circleflatprogram.js +116 -138
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +275 -323
- package/programs/rings/distancering/circlepaddysharedbuffer.js +368 -423
- package/programs/rings/distancering/index.js +6 -5
- package/programs/rings/distancering/paddyflatprogram.js +127 -148
- package/programs/rings/distancering/paddyflatprogram2d.js +129 -153
- package/programs/rings/distancering/paddyflatprogram3d.js +128 -149
- package/programs/rings/index.js +1 -1
- package/{dist/programs → programs}/totems/camerauniformblock.js +10 -3
- package/programs/totems/gpu-selection-uniform-block.js +99 -127
- package/programs/two-d/pixel-circle.js +1 -0
- package/programs/two-d/pixel-padding-for-compass.js +97 -112
- package/programs/util.js +14 -19
- package/programs/vectorfields/index.js +3 -3
- package/programs/vectorfields/logics/drawrectangleparticles.js +58 -78
- package/programs/vectorfields/logics/index.js +2 -4
- package/programs/vectorfields/logics/pixelbased.js +73 -92
- package/programs/vectorfields/logics/ubo.js +51 -57
- package/programs/vectorfields/pingpongbuffermanager.js +73 -80
- package/rangerings/index.js +5 -5
- package/rangerings/plugin.js +543 -644
- package/rangerings/rangeringangletext.js +326 -369
- package/rangerings/ring-account.js +112 -129
- package/shaders/fragment-toy/firework.js +1 -1
- package/shaders/fragment-toy/singularity.js +2 -5
- package/timetracks/adaptors-line-strip.js +65 -80
- package/timetracks/index.js +1 -0
- package/timetracks/plugin-line-strip.js +240 -295
- package/timetracks/program-line-strip.js +411 -491
- package/timetracks/programpoint-line-strip.js +98 -122
- package/util/account/bufferoffsetmanager.js +176 -209
- package/util/account/index.js +3 -6
- package/util/account/util.js +18 -22
- package/util/algorithms/index.js +1 -0
- package/util/algorithms/search-binary.js +25 -26
- package/util/check/index.js +1 -0
- package/util/geometry/index.js +121 -0
- package/util/gl-util/uniform-block/shader.js +1 -0
- package/util/heatwavedatamanager/datamanager.js +149 -168
- package/util/heatwavedatamanager/index.js +2 -2
- package/util/index.js +13 -13
- package/util/interpolation/index.js +1 -0
- package/util/interpolation/timetrack/index.js +2 -9
- package/util/interpolation/timetrack/timetrack-interpolator.js +79 -94
- package/util/interpolation/timetrack/web-worker.js +46 -51
- package/util/jshelpers/data-filler.js +17 -19
- package/util/jshelpers/equality.js +18 -17
- package/util/jshelpers/index.js +2 -1
- package/util/jshelpers/timefilters.js +30 -32
- package/util/picking/fence.js +43 -46
- package/util/picking/picker-displayer.js +136 -177
- package/util/programs/draw-texture-on-canvas.js +66 -82
- package/util/programs/index.js +1 -1
- package/util/programs/shapesonglobe.js +167 -203
- package/util/programs/supersampletotextures.js +99 -132
- package/util/programs/texturetoglobe.js +128 -152
- package/util/shaderfunctions/index.js +2 -2
- package/util/shaderfunctions/nodata.js +2 -4
- package/util/shaderfunctions/noisefunctions.js +7 -10
- package/util/surface-line-data/arcs-to-cuts.js +50 -74
- package/util/surface-line-data/cut-arc.js +1 -0
- package/util/surface-line-data/rbush-manager.js +1 -0
- package/util/surface-line-data/web-worker.js +1 -0
- package/util/webglobe/gldefaultstates.js +4 -5
- package/util/webglobe/index.js +2 -2
- package/util/webglobe/rasteroverlay.js +75 -96
- package/waveparticles/adaptor.js +15 -16
- package/waveparticles/index.js +3 -3
- package/waveparticles/plugin.js +290 -342
- package/wind/imagetovectorfieldandmagnitude.js +56 -71
- package/wind/index.js +5 -5
- package/wind/plugin.js +670 -845
- package/wind/vectorfieldimage.js +23 -27
- package/write-text/attached-text-writer.js +87 -105
- package/{dist/write-text → write-text}/context-text-bulk.js +35 -20
- package/write-text/context-text.js +94 -125
- package/write-text/context-text3old.js +152 -179
- package/{dist/write-text → write-text}/context-text4.js +5 -3
- package/write-text/index.js +1 -1
- package/write-text/writer-plugin.js +8 -7
- package/Math/arc-cdf-points.ts +0 -329
- package/Math/arc-generate-points-exponantial.ts +0 -299
- package/Math/arc.ts +0 -299
- package/Math/circle-cdf-points.ts +0 -143
- package/Math/circle.ts +0 -49
- package/Math/constants.ts +0 -12
- package/Math/juction/arc-plane.ts +0 -129
- package/Math/juction/line-sphere.ts +0 -30
- package/Math/juction/plane-plane.ts +0 -64
- package/Math/line.ts +0 -84
- package/Math/matrix4.ts +0 -0
- package/Math/methods.ts +0 -157
- package/Math/plane.ts +0 -92
- package/Math/quaternion.ts +0 -128
- package/Math/roadmap.md +0 -10
- package/Math/templete-shapes/grid-visually-equal.ts +0 -119
- package/Math/types.ts +0 -66
- package/Math/vec3.ts +0 -180
- package/circle-line-chain/readme.md +0 -57
- package/depth-locator/readme.md +0 -26
- package/dist/Math/angle-calculation.js +0 -13
- package/dist/Math/bounds/line-bbox.js +0 -186
- package/dist/Math/index.js +0 -1
- package/dist/Math/mesh/mapbox-delaunay.js +0 -544
- package/dist/Math/utils.js +0 -2
- package/dist/algorithms/search-binary.js +0 -16
- package/dist/altitude-locator/adaptors.js +0 -1
- package/dist/altitude-locator/keymethod.js +0 -1
- package/dist/altitude-locator/plugin.js +0 -345
- package/dist/altitude-locator/types.js +0 -21
- package/dist/arrowfield/adaptor.js +0 -11
- package/dist/arrowfield/index.js +0 -3
- package/dist/arrowfield/plugin.js +0 -83
- package/dist/bearing-line/index.js +0 -2
- package/dist/bearing-line/plugin.js +0 -444
- package/dist/circle-line-chain/chain-list-map.js +0 -201
- package/dist/circle-line-chain/init.js +0 -1
- package/dist/circle-line-chain/plugin.js +0 -411
- package/dist/circle-line-chain/util.js +0 -1
- package/dist/compass-rose/compass-rose-padding-flat.js +0 -230
- package/dist/compass-rose/compass-text-writer.js +0 -149
- package/dist/compass-rose/index.js +0 -3
- package/dist/compassrose/compassrose.js +0 -293
- package/dist/compassrose/index.js +0 -2
- package/dist/heatwave/index.js +0 -3
- package/dist/heatwave/isobar/objectarraylabels.js +0 -200
- package/dist/heatwave/isobar/plugin.js +0 -302
- package/dist/heatwave/isobar/quadtreecontours.js +0 -298
- package/dist/heatwave/plugins/heatwaveglobeshell.js +0 -204
- package/dist/index.js +0 -12
- package/dist/jest.config.js +0 -7
- package/dist/partialrings/buffer-manager.js +0 -75
- package/dist/partialrings/index.js +0 -2
- package/dist/partialrings/plugin.js +0 -128
- package/dist/partialrings/program.js +0 -279
- package/dist/pin/pin-object-array.js +0 -300
- package/dist/pin/pin-point-totem.js +0 -60
- package/dist/point-heat-map/adaptors/timetracksplugin-format-to-this.js +0 -63
- package/dist/point-heat-map/index.js +0 -1
- package/dist/point-heat-map/plugin-webworker.js +0 -121
- package/dist/point-heat-map/point-to-heat-map-flow.js +0 -124
- package/dist/point-tracks/key-methods.js +0 -2
- package/dist/point-tracks/plugin.js +0 -393
- package/dist/programs/arrowfield/index.js +0 -2
- package/dist/programs/arrowfield/logic.js +0 -254
- package/dist/programs/arrowfield/object.js +0 -60
- package/dist/programs/data2legend/density-to-legend.js +0 -98
- package/dist/programs/data2legend/point-to-density-texture.js +0 -97
- package/dist/programs/float2legendwithratio/index.js +0 -2
- package/dist/programs/float2legendwithratio/logic.js +0 -167
- package/dist/programs/float2legendwithratio/object.js +0 -104
- package/dist/programs/globe-util/is-globe-moved.js +0 -19
- package/dist/programs/globeshell/index.js +0 -2
- package/dist/programs/globeshell/wiggle/index.js +0 -2
- package/dist/programs/globeshell/wiggle/logic.js +0 -342
- package/dist/programs/globeshell/wiggle/object.js +0 -66
- package/dist/programs/helpers/blender/index.js +0 -1
- package/dist/programs/helpers/blender/program.js +0 -76
- package/dist/programs/helpers/fadeaway/index.js +0 -2
- package/dist/programs/helpers/fadeaway/logic.js +0 -69
- package/dist/programs/helpers/fadeaway/object.js +0 -14
- package/dist/programs/helpers/index.js +0 -2
- package/dist/programs/index.js +0 -9
- package/dist/programs/line-on-globe/circle-accurate-3d.js +0 -138
- package/dist/programs/line-on-globe/circle-accurate-flat.js +0 -210
- package/dist/programs/line-on-globe/degree-padding-around-circle-3d.js +0 -156
- package/dist/programs/line-on-globe/index.js +0 -1
- package/dist/programs/line-on-globe/lines-color-instanced-flat.js +0 -131
- package/dist/programs/line-on-globe/util.js +0 -5
- package/dist/programs/picking/pickable-polygon-renderer.js +0 -184
- package/dist/programs/picking/pickable-renderer.js +0 -184
- package/dist/programs/point-on-globe/element-globe-surface-glow.js +0 -138
- package/dist/programs/point-on-globe/element-point-glow.js +0 -150
- package/dist/programs/point-on-globe/square-pixel-point.js +0 -171
- package/dist/programs/rings/distancering/circleflatprogram.js +0 -116
- package/dist/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -326
- package/dist/programs/rings/distancering/circlepaddysharedbuffer.js +0 -368
- package/dist/programs/rings/distancering/index.js +0 -6
- package/dist/programs/rings/distancering/paddyflatprogram.js +0 -127
- package/dist/programs/rings/distancering/paddyflatprogram2d.js +0 -129
- package/dist/programs/rings/distancering/paddyflatprogram3d.js +0 -128
- package/dist/programs/rings/index.js +0 -1
- package/dist/programs/totems/gpu-selection-uniform-block.js +0 -104
- package/dist/programs/two-d/pixel-circle.js +0 -1
- package/dist/programs/two-d/pixel-padding-for-compass.js +0 -159
- package/dist/programs/util.js +0 -14
- package/dist/programs/vectorfields/index.js +0 -3
- package/dist/programs/vectorfields/logics/drawrectangleparticles.js +0 -113
- package/dist/programs/vectorfields/logics/index.js +0 -2
- package/dist/programs/vectorfields/logics/pixelbased.js +0 -140
- package/dist/programs/vectorfields/logics/ubo.js +0 -60
- package/dist/programs/vectorfields/pingpongbuffermanager.js +0 -73
- package/dist/rangerings/index.js +0 -5
- package/dist/rangerings/plugin.js +0 -543
- package/dist/rangerings/rangeringangletext.js +0 -326
- package/dist/rangerings/ring-account.js +0 -112
- package/dist/shaders/fragment-toy/firework.js +0 -55
- package/dist/shaders/fragment-toy/singularity.js +0 -56
- package/dist/timetracks/adaptors-line-strip.js +0 -65
- package/dist/timetracks/index.js +0 -1
- package/dist/timetracks/plugin-line-strip.js +0 -240
- package/dist/timetracks/program-line-strip.js +0 -608
- package/dist/timetracks/programpoint-line-strip.js +0 -151
- package/dist/util/account/bufferoffsetmanager.js +0 -176
- package/dist/util/account/index.js +0 -3
- package/dist/util/account/util.js +0 -18
- package/dist/util/algorithms/index.js +0 -1
- package/dist/util/algorithms/search-binary.js +0 -25
- package/dist/util/check/index.js +0 -1
- package/dist/util/geometry/index.js +0 -47
- package/dist/util/gl-util/uniform-block/shader.js +0 -1
- package/dist/util/heatwavedatamanager/datamanager.js +0 -149
- package/dist/util/heatwavedatamanager/index.js +0 -2
- package/dist/util/index.js +0 -13
- package/dist/util/interpolation/index.js +0 -1
- package/dist/util/interpolation/timetrack/index.js +0 -2
- package/dist/util/interpolation/timetrack/timetrack-interpolator.js +0 -79
- package/dist/util/interpolation/timetrack/web-worker.js +0 -46
- package/dist/util/jshelpers/data-filler.js +0 -17
- package/dist/util/jshelpers/equality.js +0 -18
- package/dist/util/jshelpers/index.js +0 -2
- package/dist/util/jshelpers/timefilters.js +0 -30
- package/dist/util/picking/fence.js +0 -43
- package/dist/util/picking/picker-displayer.js +0 -136
- package/dist/util/programs/draw-texture-on-canvas.js +0 -86
- package/dist/util/programs/index.js +0 -1
- package/dist/util/programs/shapesonglobe.js +0 -210
- package/dist/util/programs/supersampletotextures.js +0 -109
- package/dist/util/programs/texturetoglobe.js +0 -179
- package/dist/util/shaderfunctions/index.js +0 -2
- package/dist/util/shaderfunctions/nodata.js +0 -8
- package/dist/util/shaderfunctions/noisefunctions.js +0 -41
- package/dist/util/surface-line-data/arcs-to-cuts.js +0 -50
- package/dist/util/surface-line-data/cut-arc.js +0 -1
- package/dist/util/surface-line-data/rbush-manager.js +0 -1
- package/dist/util/surface-line-data/web-worker.js +0 -1
- package/dist/util/webglobe/gldefaultstates.js +0 -4
- package/dist/util/webglobe/index.js +0 -2
- package/dist/util/webglobe/rasteroverlay.js +0 -75
- package/dist/waveparticles/adaptor.js +0 -15
- package/dist/waveparticles/index.js +0 -3
- package/dist/waveparticles/plugin.js +0 -290
- package/dist/wind/imagetovectorfieldandmagnitude.js +0 -56
- package/dist/wind/index.js +0 -5
- package/dist/wind/plugin.js +0 -921
- package/dist/wind/vectorfieldimage.js +0 -23
- package/dist/write-text/attached-text-writer.js +0 -87
- package/dist/write-text/context-text.js +0 -94
- package/dist/write-text/context-text3old.js +0 -152
- package/dist/write-text/index.js +0 -1
- package/dist/write-text/writer-plugin.js +0 -8
- package/partialrings/goals.md +0 -17
- package/point-heat-map/readme.md +0 -15
- package/programs/line-on-globe/linestrip/data.ts +0 -29
- package/programs/line-on-globe/linestrip/linestrip.ts +0 -201
- package/programs/line-on-globe/naive-accurate-flexible.ts +0 -258
- package/programs/polygon-on-globe/texture-dem-triangle-test-plugin.ts +0 -120
- package/programs/polygon-on-globe/texture-dem-triangles.ts +0 -207
- package/programs/programcache.ts +0 -131
- package/programs/rings/partial-ring/piece-of-pie.ts +0 -323
- package/programs/totems/camerauniformblock.ts +0 -310
- package/programs/totems/canvas-webglobe-info.ts +0 -156
- package/programs/totems/globe-changes.ts +0 -79
- package/programs/totems/index.ts +0 -2
- package/programs/vectorfields/logics/constants.ts +0 -5
- package/programs/vectorfields/logics/ubo-new.ts +0 -37
- package/publish.bat +0 -62
- package/range-tools-on-terrain/bearing-line/adapters.ts +0 -154
- package/range-tools-on-terrain/bearing-line/plugin.ts +0 -569
- package/range-tools-on-terrain/bearing-line/types.ts +0 -65
- package/range-tools-on-terrain/circle-line-chain/adapters.ts +0 -109
- package/range-tools-on-terrain/circle-line-chain/chain-list-map.ts +0 -446
- package/range-tools-on-terrain/circle-line-chain/plugin.ts +0 -607
- package/range-tools-on-terrain/circle-line-chain/types.ts +0 -43
- package/range-tools-on-terrain/range-ring/adapters.ts +0 -114
- package/range-tools-on-terrain/range-ring/enum.ts +0 -2
- package/range-tools-on-terrain/range-ring/plugin.ts +0 -447
- package/range-tools-on-terrain/range-ring/rangeringangletext.ts +0 -396
- package/range-tools-on-terrain/range-ring/types.ts +0 -30
- package/rangerings/enum.ts +0 -2
- package/semiplugins/interface.ts +0 -14
- package/semiplugins/lightweight/line-plugin.ts +0 -343
- package/semiplugins/lightweight/piece-of-pie-plugin.ts +0 -275
- package/semiplugins/shape-on-terrain/arc-plugin.ts +0 -602
- package/semiplugins/shape-on-terrain/circle-plugin.ts +0 -588
- package/semiplugins/shape-on-terrain/goal.md +0 -12
- package/semiplugins/shape-on-terrain/padding-1-degree.ts +0 -714
- package/semiplugins/shape-on-terrain/terrain-cover/notes.md +0 -90
- package/semiplugins/shape-on-terrain/terrain-cover/texture-dem-cover.ts +0 -0
- package/semiplugins/type.ts +0 -8
- package/tests/Math/arc-sampling-test.js +0 -367
- package/tests/Math/arc-sampling-test.ts +0 -429
- package/tests/Math/arc.test.ts +0 -102
- package/tests/Math/junction/arc-plane.test.ts +0 -163
- package/tests/Math/junction/plane-plane.test.ts +0 -91
- package/tests/Math/plane-test.ts +0 -17
- package/tests/Math/plane.test.ts +0 -43
- package/tests/Math/vec3.test.ts +0 -14
- package/timetracks/readme.md +0 -1
- package/tsconfig.json +0 -22
- package/types.ts +0 -265
- package/util/account/create-buffermap-orchastration.ts +0 -85
- package/util/account/single-attribute-buffer-management/buffer-manager.ts +0 -149
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.ts +0 -332
- package/util/account/single-attribute-buffer-management/buffer-orchestrator1.ts +0 -184
- package/util/account/single-attribute-buffer-management/index.ts +0 -11
- package/util/account/single-attribute-buffer-management/object-store.ts +0 -76
- package/util/account/single-attribute-buffer-management/types.ts +0 -43
- package/util/build-strategy/general-strategy.ts +0 -99
- package/util/build-strategy/static-dynamic.ts +0 -50
- package/util/check/typecheck.ts +0 -74
- package/util/frame-counter-trigger.ts +0 -99
- package/util/geometry/index.ts +0 -64
- package/util/gl-util/buffer/attribute-loader.ts +0 -84
- package/util/gl-util/buffer/index.ts +0 -6
- package/util/gl-util/draw-options/methods.ts +0 -47
- package/util/gl-util/uniform-block/manager.ts +0 -210
- package/util/gl-util/uniform-block/roadmap.md +0 -70
- package/util/gl-util/uniform-block/types.ts +0 -20
- package/util/heatwavedatamanager/pointcoordsmeta.ts +0 -28
- package/util/heatwavedatamanager/texture-point-sampler.ts +0 -198
- package/util/shaderfunctions/geometrytransformations.ts +0 -388
- package/util/surface-line-data/arc-bboxes.ts +0 -42
- package/util/surface-line-data/flow.ts +0 -52
- package/util/surface-line-data/types.ts +0 -27
- package/util/webglobjectbuilders.ts +0 -446
- package/write-text/context-text-bulk.ts +0 -268
- package/write-text/context-text3.ts +0 -253
- package/write-text/context-text4.ts +0 -243
- /package/{dist/Math → Math}/arc-cdf-points.js +0 -0
- /package/{dist/Math → Math}/arc-generate-points-exponantial.js +0 -0
- /package/{dist/Math → Math}/arc.js +0 -0
- /package/{dist/Math → Math}/circle-cdf-points.js +0 -0
- /package/{dist/Math → Math}/circle.js +0 -0
- /package/{dist/Math → Math}/constants.js +0 -0
- /package/{dist/Math → Math}/juction/arc-plane.js +0 -0
- /package/{dist/Math → Math}/juction/line-sphere.js +0 -0
- /package/{dist/Math → Math}/juction/plane-plane.js +0 -0
- /package/{dist/Math → Math}/line.js +0 -0
- /package/{dist/Math → Math}/matrix4.js +0 -0
- /package/{dist/Math → Math}/methods.js +0 -0
- /package/{dist/Math → Math}/plane.js +0 -0
- /package/{dist/Math → Math}/quaternion.js +0 -0
- /package/{dist/Math → Math}/templete-shapes/grid-visually-equal.js +0 -0
- /package/{dist/Math → Math}/types.js +0 -0
- /package/{dist/Math → Math}/vec3.js +0 -0
- /package/{dist/programs → programs}/line-on-globe/linestrip/data.js +0 -0
- /package/{dist/programs → programs}/line-on-globe/linestrip/linestrip.js +0 -0
- /package/{dist/programs → programs}/line-on-globe/naive-accurate-flexible.js +0 -0
- /package/{dist/programs → programs}/polygon-on-globe/texture-dem-triangle-test-plugin.js +0 -0
- /package/{dist/programs → programs}/polygon-on-globe/texture-dem-triangles.js +0 -0
- /package/{dist/programs → programs}/programcache.js +0 -0
- /package/{dist/programs → programs}/rings/partial-ring/piece-of-pie.js +0 -0
- /package/{dist/programs → programs}/totems/canvas-webglobe-info.js +0 -0
- /package/{dist/programs → programs}/totems/globe-changes.js +0 -0
- /package/{dist/programs → programs}/totems/index.js +0 -0
- /package/{dist/programs → programs}/vectorfields/logics/constants.js +0 -0
- /package/{dist/programs → programs}/vectorfields/logics/ubo-new.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/bearing-line/adapters.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/bearing-line/plugin.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/bearing-line/types.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/circle-line-chain/adapters.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/circle-line-chain/chain-list-map.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/circle-line-chain/plugin.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/circle-line-chain/types.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/range-ring/adapters.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/range-ring/enum.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/range-ring/plugin.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/range-ring/rangeringangletext.js +0 -0
- /package/{dist/range-tools-on-terrain → range-tools-on-terrain}/range-ring/types.js +0 -0
- /package/{dist/rangerings → rangerings}/enum.js +0 -0
- /package/{dist/semiplugins → semiplugins}/interface.js +0 -0
- /package/{dist/semiplugins → semiplugins}/lightweight/line-plugin.js +0 -0
- /package/{dist/semiplugins → semiplugins}/lightweight/piece-of-pie-plugin.js +0 -0
- /package/{dist/semiplugins → semiplugins}/shape-on-terrain/arc-plugin.js +0 -0
- /package/{dist/semiplugins → semiplugins}/shape-on-terrain/circle-plugin.js +0 -0
- /package/{dist/semiplugins → semiplugins}/shape-on-terrain/padding-1-degree.js +0 -0
- /package/{dist/semiplugins → semiplugins}/shape-on-terrain/terrain-cover/texture-dem-cover.js +0 -0
- /package/{dist/semiplugins → semiplugins}/type.js +0 -0
- /package/{dist/types.js → types.js} +0 -0
- /package/{dist/util → util}/account/create-buffermap-orchastration.js +0 -0
- /package/{dist/util → util}/account/single-attribute-buffer-management/buffer-manager.js +0 -0
- /package/{dist/util → util}/account/single-attribute-buffer-management/buffer-orchestrator.js +0 -0
- /package/{dist/util → util}/account/single-attribute-buffer-management/buffer-orchestrator1.js +0 -0
- /package/{dist/util → util}/account/single-attribute-buffer-management/index.js +0 -0
- /package/{dist/util → util}/account/single-attribute-buffer-management/object-store.js +0 -0
- /package/{dist/util → util}/account/single-attribute-buffer-management/types.js +0 -0
- /package/{dist/util → util}/build-strategy/general-strategy.js +0 -0
- /package/{dist/util → util}/build-strategy/static-dynamic.js +0 -0
- /package/{dist/util → util}/check/typecheck.js +0 -0
- /package/{dist/util → util}/frame-counter-trigger.js +0 -0
- /package/{dist/util → util}/gl-util/buffer/attribute-loader.js +0 -0
- /package/{dist/util → util}/gl-util/buffer/index.js +0 -0
- /package/{dist/util → util}/gl-util/draw-options/methods.js +0 -0
- /package/{dist/util → util}/gl-util/uniform-block/manager.js +0 -0
- /package/{dist/util → util}/gl-util/uniform-block/types.js +0 -0
- /package/{dist/util → util}/heatwavedatamanager/pointcoordsmeta.js +0 -0
- /package/{dist/util → util}/heatwavedatamanager/texture-point-sampler.js +0 -0
- /package/{dist/util → util}/shaderfunctions/geometrytransformations.js +0 -0
- /package/{dist/util → util}/surface-line-data/arc-bboxes.js +0 -0
- /package/{dist/util → util}/surface-line-data/flow.js +0 -0
- /package/{dist/util → util}/surface-line-data/types.js +0 -0
- /package/{dist/util → util}/webglobjectbuilders.js +0 -0
- /package/{dist/write-text → write-text}/context-text3.js +0 -0
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { createProgram } from "../../util";
|
|
2
|
-
import { globeProgramCache } from "../programcache";
|
|
3
|
-
import { CameraUniformBlockTotem } from "../totems";
|
|
4
|
-
const arrowVertexShader = `#version 300 es
|
|
5
|
-
#define R 6378.137
|
|
6
|
-
#define PI 3.1415926535897932384626433832795
|
|
7
|
-
#define POLE 20037508.34
|
|
8
|
-
#define POLE_BY_PI 6366198.2
|
|
9
|
-
#define HALF_PI 1.5707963267948966192313216916398
|
|
10
|
-
|
|
11
|
-
uniform sampler2D rotation; // rotation of arrow
|
|
12
|
-
|
|
13
|
-
out vec4 v_color;
|
|
14
|
-
|
|
15
|
-
layout(std140) uniform CameraBlock {
|
|
16
|
-
mat4 u_view;
|
|
17
|
-
mat4 u_projection;
|
|
18
|
-
vec3 u_translate;
|
|
19
|
-
bool u_is3D;
|
|
20
|
-
vec2 u_mapWH;
|
|
21
|
-
vec2 u_scrWH;
|
|
22
|
-
float u_zlevel;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
layout(std140) uniform ArrowBlock {
|
|
26
|
-
vec4 u_color;
|
|
27
|
-
vec2 u_bbox_offset_rad;
|
|
28
|
-
vec2 u_bbox_size_rad;
|
|
29
|
-
vec2 u_resolution;
|
|
30
|
-
float u_length_ratio;
|
|
31
|
-
float u_width_ratio;
|
|
32
|
-
float u_height;
|
|
33
|
-
float u_no_data_value;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
vec2 f_texCoord(){
|
|
37
|
-
float fID = float(gl_InstanceID);
|
|
38
|
-
float x = mod( fID, u_resolution.x ) / ( u_resolution.x - 1.0);
|
|
39
|
-
float y = 1.0 - floor( fID / u_resolution.x ) / ( u_resolution.y - 1.0);
|
|
40
|
-
return vec2(x, y);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
vec2 f_radCoord(vec2 texCoord){
|
|
44
|
-
float x = (texCoord.x * u_bbox_size_rad.x ) + u_bbox_offset_rad.x;
|
|
45
|
-
float y = (texCoord.y * u_bbox_size_rad.y ) + u_bbox_offset_rad.y;
|
|
46
|
-
return vec2(x, y);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
vec3 f_onSphere(vec2 radCoord){
|
|
50
|
-
float x = sin(radCoord.y) * cos(radCoord.x);
|
|
51
|
-
float y = sin(radCoord.y) * sin(radCoord.x);
|
|
52
|
-
float z = cos(radCoord.y);
|
|
53
|
-
return vec3(x, y, z) * (R + u_height);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
vec2 f_onFlat(vec2 radCoord){
|
|
58
|
-
float mercX = radCoord.x * POLE_BY_PI;
|
|
59
|
-
float mercY = log(tan(HALF_PI - radCoord.y * 0.5)) * POLE_BY_PI;
|
|
60
|
-
float normX = ( mercX - u_translate.x ) / u_mapWH.x;
|
|
61
|
-
float normY = ( mercY - u_translate.y ) / u_mapWH.y;
|
|
62
|
-
return vec2(normX, normY);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
void main() {
|
|
66
|
-
// escape if no data
|
|
67
|
-
vec2 texCoord = f_texCoord();
|
|
68
|
-
vec2 geoCoord = vec2( texCoord.x , 1.0 - texCoord.y );
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
float angle = texture(rotation, texCoord).r;
|
|
72
|
-
|
|
73
|
-
if ( angle == u_no_data_value ) {
|
|
74
|
-
gl_Position = vec4(-2.0, -2.0, 0.0, 1.0);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
vec2 arrowLimb;
|
|
78
|
-
if (0.0 == mod(float(gl_VertexID), 2.0)) {
|
|
79
|
-
arrowLimb = vec2(0.0, 0.0);
|
|
80
|
-
} else if (gl_VertexID == 1) {
|
|
81
|
-
// tail
|
|
82
|
-
arrowLimb = vec2( cos(angle), sin(angle)) * u_length_ratio / (170.0 );
|
|
83
|
-
} else if (gl_VertexID == 3) {
|
|
84
|
-
// right wing
|
|
85
|
-
arrowLimb = vec2( cos(angle + 0.45), sin(angle + 0.45)) * u_width_ratio / (170.0 );
|
|
86
|
-
} else if (gl_VertexID == 5) {
|
|
87
|
-
// left wing
|
|
88
|
-
arrowLimb = vec2( cos(angle - 0.45), sin(angle - 0.45)) * u_width_ratio / (170.0 );
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
vec2 radCoord = f_radCoord(geoCoord + arrowLimb);
|
|
93
|
-
if ( u_is3D ) {
|
|
94
|
-
vec3 spherePos = f_onSphere(radCoord);
|
|
95
|
-
gl_Position = u_projection * u_view * vec4(spherePos - u_translate, 1.0);
|
|
96
|
-
} else {
|
|
97
|
-
vec2 flatPos = f_onFlat(radCoord);
|
|
98
|
-
gl_Position = u_projection * vec4(
|
|
99
|
-
flatPos.x * u_scrWH.x,
|
|
100
|
-
(1.0 - flatPos.y) * u_scrWH.y,
|
|
101
|
-
0.0, 1.0
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
v_color = u_color;
|
|
107
|
-
gl_PointSize = 4.0;
|
|
108
|
-
}
|
|
109
|
-
`;
|
|
110
|
-
const arrowFragmentShader = `#version 300 es
|
|
111
|
-
precision highp float;
|
|
112
|
-
in vec4 v_color;
|
|
113
|
-
out vec4 outColor;
|
|
114
|
-
|
|
115
|
-
void main() {
|
|
116
|
-
outColor = v_color;
|
|
117
|
-
}
|
|
118
|
-
`;
|
|
119
|
-
export default class ArrowFieldLogic {
|
|
120
|
-
constructor() {
|
|
121
|
-
this.gl = null;
|
|
122
|
-
this.globe = null;
|
|
123
|
-
this.cameraUniformBlockTotem = null;
|
|
124
|
-
this.program = null;
|
|
125
|
-
this.cameraBlockBindingPoint = 0;
|
|
126
|
-
this.arrayBlockBindingPoint = 1;
|
|
127
|
-
}
|
|
128
|
-
init(globe, gl) {
|
|
129
|
-
this.gl = gl;
|
|
130
|
-
this.globe = globe;
|
|
131
|
-
this.cameraUniformBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
132
|
-
this.program = this._createProgram();
|
|
133
|
-
}
|
|
134
|
-
_createProgram() {
|
|
135
|
-
const gl = this.gl;
|
|
136
|
-
const program = createProgram(gl, arrowVertexShader, arrowFragmentShader);
|
|
137
|
-
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraBlock");
|
|
138
|
-
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
139
|
-
const arrowBlockIndex = gl.getUniformBlockIndex(program, "ArrowBlock");
|
|
140
|
-
gl.uniformBlockBinding(program, arrowBlockIndex, this.arrayBlockBindingPoint);
|
|
141
|
-
this.textureLocations = {
|
|
142
|
-
rotationLocation: gl.getUniformLocation(program, "rotation"),
|
|
143
|
-
};
|
|
144
|
-
return program;
|
|
145
|
-
}
|
|
146
|
-
getArrowBlockBufferManager() {
|
|
147
|
-
return new ArrowBlockBufferManager(this.gl, this.arrayBlockBindingPoint);
|
|
148
|
-
}
|
|
149
|
-
// initial load type is static.
|
|
150
|
-
// after that, it is dynamic.
|
|
151
|
-
getTextureManager(width, height) {
|
|
152
|
-
return new TextureManager(this.gl, width, height, this.textureLocations);
|
|
153
|
-
}
|
|
154
|
-
draw(arrowBlockManager, textureManager, instanceCount) {
|
|
155
|
-
const { gl, cameraBlockBindingPoint, cameraUniformBlockTotem } = this;
|
|
156
|
-
gl.useProgram(this.program);
|
|
157
|
-
arrowBlockManager.bind();
|
|
158
|
-
textureManager.activate();
|
|
159
|
-
cameraUniformBlockTotem.bind(cameraBlockBindingPoint);
|
|
160
|
-
gl.drawArraysInstanced(gl.LINES, 0, 6, instanceCount);
|
|
161
|
-
// gl.drawArraysInstanced(gl.POINTS, 0, 4, instanceCount);
|
|
162
|
-
cameraUniformBlockTotem.unbind(cameraBlockBindingPoint);
|
|
163
|
-
arrowBlockManager.unbind();
|
|
164
|
-
}
|
|
165
|
-
free() {
|
|
166
|
-
const { gl, program } = this;
|
|
167
|
-
gl.deleteProgram(program);
|
|
168
|
-
globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
class ArrowBlockBufferManager {
|
|
172
|
-
constructor(gl, bindingPoint) {
|
|
173
|
-
this.gl = gl;
|
|
174
|
-
this.bindingPoint = bindingPoint;
|
|
175
|
-
this.ubo = gl.createBuffer();
|
|
176
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER, this.ubo);
|
|
177
|
-
// 4 + 2+ 2 + 2 + 1 +1 +1 +1+1= 15 ~= 16
|
|
178
|
-
gl.bufferData(gl.UNIFORM_BUFFER, 56, gl.DYNAMIC_DRAW);
|
|
179
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER, null);
|
|
180
|
-
}
|
|
181
|
-
update({ color = null, bboxOffsetRad = null, bboxSizeRad = null, resolution = null, tailLengthRatio = null, wingLengthRatio = null, height = null, opacity = null, noDataValue = null, } = {}) {
|
|
182
|
-
const { gl, ubo } = this;
|
|
183
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER, ubo);
|
|
184
|
-
if (color !== null)
|
|
185
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 0, new Float32Array(color));
|
|
186
|
-
if (opacity !== null)
|
|
187
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 12, new Float32Array([opacity]));
|
|
188
|
-
if (bboxOffsetRad !== null)
|
|
189
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 16, new Float32Array(bboxOffsetRad));
|
|
190
|
-
if (bboxSizeRad !== null)
|
|
191
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 24, new Float32Array(bboxSizeRad));
|
|
192
|
-
if (resolution !== null)
|
|
193
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 32, new Float32Array(resolution));
|
|
194
|
-
if (tailLengthRatio !== null)
|
|
195
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 40, new Float32Array([tailLengthRatio]));
|
|
196
|
-
if (wingLengthRatio !== null)
|
|
197
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 44, new Float32Array([wingLengthRatio]));
|
|
198
|
-
if (height !== null)
|
|
199
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 48, new Float32Array([height]));
|
|
200
|
-
if (noDataValue !== null)
|
|
201
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 52, new Float32Array([noDataValue]));
|
|
202
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER, null);
|
|
203
|
-
}
|
|
204
|
-
bind() {
|
|
205
|
-
const { gl, ubo, bindingPoint } = this;
|
|
206
|
-
gl.bindBufferBase(gl.UNIFORM_BUFFER, bindingPoint, ubo);
|
|
207
|
-
}
|
|
208
|
-
unbind() {
|
|
209
|
-
const { gl, bindingPoint } = this;
|
|
210
|
-
gl.bindBufferBase(gl.UNIFORM_BUFFER, bindingPoint, null);
|
|
211
|
-
}
|
|
212
|
-
free() {
|
|
213
|
-
const { gl, ubo } = this;
|
|
214
|
-
gl.deleteBuffer(ubo);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
class TextureManager {
|
|
218
|
-
constructor(gl, width, height, { rotationLocation }) {
|
|
219
|
-
this.gl = gl;
|
|
220
|
-
this.width = width;
|
|
221
|
-
this.height = height;
|
|
222
|
-
this.rotationLocation = rotationLocation;
|
|
223
|
-
this.rotationTexture = this._createFloatTexture();
|
|
224
|
-
}
|
|
225
|
-
_createFloatTexture() {
|
|
226
|
-
const { gl, width, height } = this;
|
|
227
|
-
const texture = gl.createTexture();
|
|
228
|
-
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
229
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
|
|
230
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
|
|
231
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.R32F, width, height, 0, gl.RED, gl.FLOAT, null);
|
|
232
|
-
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
233
|
-
return texture;
|
|
234
|
-
}
|
|
235
|
-
setData(rotation) {
|
|
236
|
-
const { gl, rotationTexture, width, height } = this;
|
|
237
|
-
// gl flip y axis
|
|
238
|
-
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
|
|
239
|
-
gl.bindTexture(gl.TEXTURE_2D, rotationTexture);
|
|
240
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.R32F, width, height, 0, gl.RED, gl.FLOAT, rotation);
|
|
241
|
-
gl.bindTexture(gl.TEXTURE_2D, null);
|
|
242
|
-
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
|
243
|
-
}
|
|
244
|
-
activate() {
|
|
245
|
-
const { gl, rotationTexture } = this;
|
|
246
|
-
gl.activeTexture(gl.TEXTURE0);
|
|
247
|
-
gl.bindTexture(gl.TEXTURE_2D, rotationTexture);
|
|
248
|
-
gl.uniform1i(this.rotationLocation, 0);
|
|
249
|
-
}
|
|
250
|
-
free() {
|
|
251
|
-
const { gl, rotationTexture } = this;
|
|
252
|
-
gl.deleteTexture(rotationTexture);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// this contains vao, drawCount, ArrowBufferBlock, vao,
|
|
2
|
-
// how to, where to set instanced parameters
|
|
3
|
-
// the vectorfield buffer should be managed outside, since it can be static or dynamic.
|
|
4
|
-
import Logic from './logic';
|
|
5
|
-
import { globeProgramCache } from '../programcache';
|
|
6
|
-
import { longlatbbox2normalbbox } from "../util";
|
|
7
|
-
export default class ArrowField {
|
|
8
|
-
constructor(gl, globe, { minLon = -180, maxLon = 180, minLat = -90, maxLat = 90, height = 0, opacity = 1, color = [0.04, 0.2, 0.8], targetWidth = 100, targetHeight = 100, dataWidth = null, dataHeight = null, tailLengthRatio = 1, wingLengthRatio = 0.5, noDataValue = null,
|
|
9
|
-
// maxMagnitude = null
|
|
10
|
-
} = {}) {
|
|
11
|
-
this.gl = gl;
|
|
12
|
-
this.globe = globe;
|
|
13
|
-
this.program = globeProgramCache.getProgram(globe, Logic);
|
|
14
|
-
this.arrowBlockManager = this.program.getArrowBlockBufferManager();
|
|
15
|
-
this.instanceCount = targetWidth * targetHeight;
|
|
16
|
-
this.arrowBlockManager.update({ resolution: [targetWidth, targetHeight] });
|
|
17
|
-
this.textureManager = this.program.getTextureManager(dataWidth, dataHeight);
|
|
18
|
-
this.setBBox({ minLon, maxLon, minLat, maxLat });
|
|
19
|
-
this.update({ height, opacity, color, tailLengthRatio, wingLengthRatio, noDataValue });
|
|
20
|
-
}
|
|
21
|
-
setBBox({ minLon = -180, maxLon = 180, minLat = -90, maxLat = 90 } = {}) {
|
|
22
|
-
this.bbox = { minLon, maxLon, minLat, maxLat };
|
|
23
|
-
const { bboxSizeRad, bboxOffsetRad } = longlatbbox2normalbbox(this.bbox);
|
|
24
|
-
this.arrowBlockManager.update({ bboxSizeRad, bboxOffsetRad });
|
|
25
|
-
this.globe.DrawRender();
|
|
26
|
-
}
|
|
27
|
-
update({ height, opacity, color, resolution, tailLengthRatio, wingLengthRatio, noDataValue } = {}) {
|
|
28
|
-
if (resolution) {
|
|
29
|
-
this.instanceCount = resolution[0] * resolution[1];
|
|
30
|
-
}
|
|
31
|
-
this.arrowBlockManager.update({
|
|
32
|
-
color,
|
|
33
|
-
resolution,
|
|
34
|
-
height,
|
|
35
|
-
opacity,
|
|
36
|
-
tailLengthRatio,
|
|
37
|
-
wingLengthRatio,
|
|
38
|
-
noDataValue,
|
|
39
|
-
});
|
|
40
|
-
this.globe.DrawRender();
|
|
41
|
-
}
|
|
42
|
-
setTargetResolution(width, height) {
|
|
43
|
-
this.instanceCount = width * height;
|
|
44
|
-
this.arrowBlockManager.update({ resolution: [width, height] });
|
|
45
|
-
this.globe.DrawRender();
|
|
46
|
-
}
|
|
47
|
-
draw() {
|
|
48
|
-
const { program, arrowBlockManager, textureManager, instanceCount } = this;
|
|
49
|
-
program.draw(arrowBlockManager, textureManager, instanceCount);
|
|
50
|
-
}
|
|
51
|
-
setData(rotation) {
|
|
52
|
-
this.textureManager.setData(rotation);
|
|
53
|
-
this.globe.DrawRender();
|
|
54
|
-
}
|
|
55
|
-
free() {
|
|
56
|
-
this.arrowBlockManager.free();
|
|
57
|
-
this.textureManager.free();
|
|
58
|
-
globeProgramCache.releaseProgram(this.gl, Logic);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { createProgram } from "../../util/";
|
|
2
|
-
import { noRegisterGlobeProgramCache } from "../programcache";
|
|
3
|
-
const vs = `#version 300 es
|
|
4
|
-
precision highp float;
|
|
5
|
-
|
|
6
|
-
uniform sampler2D u_density_texture;
|
|
7
|
-
in vec2 a_position;
|
|
8
|
-
|
|
9
|
-
out vec2 v_texcoord;
|
|
10
|
-
|
|
11
|
-
void main() {
|
|
12
|
-
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
13
|
-
v_texcoord = a_position * 0.5 + 0.5;
|
|
14
|
-
}`;
|
|
15
|
-
const fs = `#version 300 es
|
|
16
|
-
precision highp float;
|
|
17
|
-
|
|
18
|
-
uniform sampler2D u_legend_texture;
|
|
19
|
-
uniform sampler2D u_density_texture;
|
|
20
|
-
|
|
21
|
-
uniform float u_opacity;
|
|
22
|
-
in vec2 v_texcoord;
|
|
23
|
-
out vec4 fragColor;
|
|
24
|
-
|
|
25
|
-
void main() {
|
|
26
|
-
float density = texture(u_density_texture, v_texcoord).r;
|
|
27
|
-
fragColor = texture(u_legend_texture, vec2(density, 0.5));
|
|
28
|
-
fragColor.a *= u_opacity * sqrt(density);
|
|
29
|
-
}`;
|
|
30
|
-
class DensityToLegendProgram {
|
|
31
|
-
constructor(globe) {
|
|
32
|
-
this.globe = globe;
|
|
33
|
-
this.gl = globe.gl;
|
|
34
|
-
this.program = createProgram(globe.gl, vs, fs);
|
|
35
|
-
const { gl, program } = this;
|
|
36
|
-
this.uniforms = {
|
|
37
|
-
densityTexture: gl.getUniformLocation(program, "u_density_texture"),
|
|
38
|
-
legendTexture: gl.getUniformLocation(program, "u_legend_texture"),
|
|
39
|
-
opacity: gl.getUniformLocation(program, "u_opacity"),
|
|
40
|
-
};
|
|
41
|
-
{ // assign attribute locations
|
|
42
|
-
gl.bindAttribLocation(program, 0, "a_position");
|
|
43
|
-
}
|
|
44
|
-
{
|
|
45
|
-
this.vao = gl.createVertexArray();
|
|
46
|
-
const a_positionLocation = gl.getAttribLocation(program, "a_position");
|
|
47
|
-
gl.bindVertexArray(this.vao);
|
|
48
|
-
const buffer = gl.createBuffer();
|
|
49
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
50
|
-
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
51
|
-
-1, -1,
|
|
52
|
-
1, -1,
|
|
53
|
-
1, 1,
|
|
54
|
-
-1, 1,
|
|
55
|
-
]), gl.STATIC_DRAW);
|
|
56
|
-
gl.enableVertexAttribArray(a_positionLocation);
|
|
57
|
-
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
|
|
58
|
-
gl.bindVertexArray(null);
|
|
59
|
-
// gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
60
|
-
this._buffer = buffer;
|
|
61
|
-
}
|
|
62
|
-
{
|
|
63
|
-
this._lastOpacity = 1;
|
|
64
|
-
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
65
|
-
gl.useProgram(program);
|
|
66
|
-
gl.uniform1f(this.uniforms.opacity, this._lastOpacity);
|
|
67
|
-
gl.useProgram(currentProgram);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
draw(densityTexture, legendTexture, opacity) {
|
|
71
|
-
const { gl, program, uniforms } = this;
|
|
72
|
-
gl.useProgram(program);
|
|
73
|
-
gl.bindVertexArray(this.vao);
|
|
74
|
-
gl.activeTexture(gl.TEXTURE1);
|
|
75
|
-
gl.bindTexture(gl.TEXTURE_2D, legendTexture);
|
|
76
|
-
gl.uniform1i(uniforms.legendTexture, 1);
|
|
77
|
-
gl.activeTexture(gl.TEXTURE0);
|
|
78
|
-
gl.bindTexture(gl.TEXTURE_2D, densityTexture);
|
|
79
|
-
gl.uniform1i(uniforms.densityTexture, 0);
|
|
80
|
-
if (this._lastOpacity !== opacity) {
|
|
81
|
-
gl.uniform1f(uniforms.opacity, opacity);
|
|
82
|
-
this._lastOpacity = opacity;
|
|
83
|
-
}
|
|
84
|
-
gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);
|
|
85
|
-
gl.bindVertexArray(null);
|
|
86
|
-
}
|
|
87
|
-
free() {
|
|
88
|
-
const gl = this.gl;
|
|
89
|
-
gl.deleteVertexArray(this.vao);
|
|
90
|
-
gl.deleteBuffer(this._buffer);
|
|
91
|
-
gl.deleteProgram(this.program);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const densityToLegendProgramCache = {
|
|
95
|
-
get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, DensityToLegendProgram),
|
|
96
|
-
release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, DensityToLegendProgram)
|
|
97
|
-
};
|
|
98
|
-
export { densityToLegendProgramCache };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { createProgram } from "../../util/";
|
|
2
|
-
import { noRegisterGlobeProgramCache } from "../programcache";
|
|
3
|
-
import { CameraUniformBlockTotemCache, CameraUniformBlockString } from "../totems/camerauniformblock";
|
|
4
|
-
import { mercatorXYToGLPosition, cartesian3DToGLPosition } from "../../util/shaderfunctions/geometrytransformations";
|
|
5
|
-
const vs = `#version 300 es
|
|
6
|
-
precision highp float;
|
|
7
|
-
|
|
8
|
-
${CameraUniformBlockString}
|
|
9
|
-
${mercatorXYToGLPosition}
|
|
10
|
-
${cartesian3DToGLPosition}
|
|
11
|
-
|
|
12
|
-
in vec3 position;
|
|
13
|
-
uniform float pointSize;
|
|
14
|
-
|
|
15
|
-
void main() {
|
|
16
|
-
if (is3D) {
|
|
17
|
-
gl_Position = cartesian3DToGLPosition(position);
|
|
18
|
-
} else {
|
|
19
|
-
gl_Position = mercatorXYToGLPosition(position.xy);
|
|
20
|
-
}
|
|
21
|
-
gl_PointSize = pointSize;
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
const fs = `#version 300 es
|
|
25
|
-
precision highp float;
|
|
26
|
-
out vec4 fragColor;
|
|
27
|
-
|
|
28
|
-
void main() {
|
|
29
|
-
float r = length(gl_PointCoord - 0.5) * 2.0;
|
|
30
|
-
if (r > 1.0) discard;
|
|
31
|
-
// float density = smoothstep(0.1, 1.0, 1.0 - r);
|
|
32
|
-
fragColor = vec4((15.0/16.0)*sqrt(1.0-sqrt(r)));
|
|
33
|
-
}`;
|
|
34
|
-
class PointHeatmapProgram {
|
|
35
|
-
constructor(globe) {
|
|
36
|
-
this.globe = globe;
|
|
37
|
-
this.gl = globe.gl;
|
|
38
|
-
this._isFreed = false;
|
|
39
|
-
this.program = createProgram(globe.gl, vs, fs);
|
|
40
|
-
const { gl, program } = this;
|
|
41
|
-
this.uniforms = {
|
|
42
|
-
pointSize: gl.getUniformLocation(this.program, "pointSize"),
|
|
43
|
-
};
|
|
44
|
-
{ // assign attribute locations
|
|
45
|
-
gl.bindAttribLocation(program, 0, "position");
|
|
46
|
-
}
|
|
47
|
-
{ // arrange camera uniform block
|
|
48
|
-
this.cameraBlockBingingPoint = 0;
|
|
49
|
-
this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
|
|
50
|
-
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
|
|
51
|
-
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBingingPoint);
|
|
52
|
-
}
|
|
53
|
-
{ // last values
|
|
54
|
-
this._lastPointSize = 0;
|
|
55
|
-
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
56
|
-
gl.useProgram(program);
|
|
57
|
-
gl.uniform1f(this.uniforms.pointSize, this._lastPointSize);
|
|
58
|
-
gl.useProgram(currentProgram);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
createVAO(positionBuffer, vectorSize) {
|
|
62
|
-
const gl = this.gl;
|
|
63
|
-
const vao = gl.createVertexArray();
|
|
64
|
-
gl.bindVertexArray(vao);
|
|
65
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
|
|
66
|
-
gl.enableVertexAttribArray(0);
|
|
67
|
-
gl.vertexAttribPointer(0, vectorSize, gl.FLOAT, false, 0, 0);
|
|
68
|
-
gl.bindVertexArray(null);
|
|
69
|
-
return vao;
|
|
70
|
-
}
|
|
71
|
-
draw(vao, length, pointSize = 5.0) {
|
|
72
|
-
const gl = this.gl;
|
|
73
|
-
gl.useProgram(this.program);
|
|
74
|
-
if (pointSize !== this._lastPointSize) {
|
|
75
|
-
gl.uniform1f(this.uniforms.pointSize, pointSize);
|
|
76
|
-
this._lastPointSize = pointSize;
|
|
77
|
-
}
|
|
78
|
-
gl.bindVertexArray(vao);
|
|
79
|
-
this.cameraBlockTotem.bind(this.cameraBlockBingingPoint);
|
|
80
|
-
gl.drawArrays(gl.POINTS, 0, length);
|
|
81
|
-
this.cameraBlockTotem.unbind(this.cameraBlockBingingPoint);
|
|
82
|
-
gl.bindVertexArray(null);
|
|
83
|
-
}
|
|
84
|
-
free() {
|
|
85
|
-
if (this._isFreed)
|
|
86
|
-
return;
|
|
87
|
-
const { gl, globe } = this;
|
|
88
|
-
CameraUniformBlockTotemCache.release(globe);
|
|
89
|
-
gl.deleteProgram(this.program);
|
|
90
|
-
this._isFreed = true;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const pointToDensityTextureCache = {
|
|
94
|
-
get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, PointHeatmapProgram),
|
|
95
|
-
release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, PointHeatmapProgram)
|
|
96
|
-
};
|
|
97
|
-
export { pointToDensityTextureCache };
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { createProgram } from "../../util";
|
|
2
|
-
export default class {
|
|
3
|
-
constructor(gl) {
|
|
4
|
-
this.gl = gl;
|
|
5
|
-
this._width = 1;
|
|
6
|
-
this._height = 1;
|
|
7
|
-
this._blendRatio = 0.0;
|
|
8
|
-
this.programWrapper = this._createProgramWrapper();
|
|
9
|
-
}
|
|
10
|
-
_createProgramWrapper() {
|
|
11
|
-
const vertexShaderSource = `#version 300 es
|
|
12
|
-
precision highp float;
|
|
13
|
-
|
|
14
|
-
in vec2 a_position;
|
|
15
|
-
out vec2 v_texcoord;
|
|
16
|
-
|
|
17
|
-
void main() {
|
|
18
|
-
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
19
|
-
v_texcoord = a_position * 0.5 + 0.5;
|
|
20
|
-
v_texcoord.y = 1.0 - v_texcoord.y;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
const fragmentShaderSource = `#version 300 es
|
|
24
|
-
precision highp float;
|
|
25
|
-
|
|
26
|
-
in vec2 v_texcoord;
|
|
27
|
-
uniform sampler2D u_float_texture0;
|
|
28
|
-
uniform sampler2D u_float_texture1;
|
|
29
|
-
uniform sampler2D u_color_texture;
|
|
30
|
-
|
|
31
|
-
layout(std140) uniform HeatParametersBlock {
|
|
32
|
-
vec2 u_color_ramp_range; // x is min, y is range ( max - min)
|
|
33
|
-
vec2 u_min_max;
|
|
34
|
-
float u_escape_value;
|
|
35
|
-
float u_blend_ratio;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
out vec4 outColor;
|
|
39
|
-
|
|
40
|
-
void main() {
|
|
41
|
-
if ( u_blend_ratio < 0.0) {
|
|
42
|
-
outColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
float f0 = texture(u_float_texture0, v_texcoord).r;
|
|
46
|
-
float f1 = texture(u_float_texture1, v_texcoord).r;
|
|
47
|
-
// outColor = vec4(
|
|
48
|
-
|
|
49
|
-
if (f0 == u_escape_value || f1 == u_escape_value) {
|
|
50
|
-
outColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
float x = mix(f0, f1, u_blend_ratio);
|
|
54
|
-
if ( x < u_min_max.x || x > u_min_max.y) {
|
|
55
|
-
outColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
x = (x - u_color_ramp_range.x) / u_color_ramp_range.y;
|
|
59
|
-
outColor = texture(u_color_texture, vec2(x, 0.5));
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
const gl = this.gl;
|
|
63
|
-
const program = createProgram(gl, vertexShaderSource, fragmentShaderSource);
|
|
64
|
-
const vao = gl.createVertexArray();
|
|
65
|
-
gl.bindVertexArray(vao);
|
|
66
|
-
const buffer = gl.createBuffer();
|
|
67
|
-
this._buffer = buffer;
|
|
68
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
69
|
-
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
70
|
-
-1, -1,
|
|
71
|
-
1, -1,
|
|
72
|
-
1, 1,
|
|
73
|
-
-1, 1
|
|
74
|
-
]), gl.STATIC_DRAW);
|
|
75
|
-
const positionLocation = gl.getAttribLocation(program, "a_position");
|
|
76
|
-
gl.enableVertexAttribArray(positionLocation);
|
|
77
|
-
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
|
|
78
|
-
gl.bindVertexArray(null);
|
|
79
|
-
this.heatParametersBlockBindingPoint = 0;
|
|
80
|
-
const heatParametersBlockIndex = gl.getUniformBlockIndex(program, "HeatParametersBlock");
|
|
81
|
-
gl.uniformBlockBinding(program, heatParametersBlockIndex, this.heatParametersBlockBindingPoint);
|
|
82
|
-
return {
|
|
83
|
-
program,
|
|
84
|
-
vao,
|
|
85
|
-
u_float_texture0: gl.getUniformLocation(program, "u_float_texture0"),
|
|
86
|
-
u_float_texture1: gl.getUniformLocation(program, "u_float_texture1"),
|
|
87
|
-
u_color_texture: gl.getUniformLocation(program, "u_color_texture"),
|
|
88
|
-
u_blend_ratio: gl.getUniformLocation(program, "u_blend_ratio"),
|
|
89
|
-
u_color_ramp_range: gl.getUniformLocation(program, "u_color_ramp_range"),
|
|
90
|
-
u_min_max: gl.getUniformLocation(program, "u_min_max"),
|
|
91
|
-
u_escape_value: gl.getUniformLocation(program, "u_escape_value")
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
getUniformBlockManager() {
|
|
95
|
-
return new HeatParametersBlockManager(this.gl);
|
|
96
|
-
}
|
|
97
|
-
draw(texture0, texture1, colorRampTexture, heatParametersBlockManager) {
|
|
98
|
-
const { gl, programWrapper } = this;
|
|
99
|
-
const { program, u_float_texture0, u_float_texture1, u_color_texture } = programWrapper;
|
|
100
|
-
gl.useProgram(program);
|
|
101
|
-
gl.bindVertexArray(programWrapper.vao);
|
|
102
|
-
gl.activeTexture(gl.TEXTURE1);
|
|
103
|
-
gl.bindTexture(gl.TEXTURE_2D, texture1);
|
|
104
|
-
gl.uniform1i(u_float_texture1, 1);
|
|
105
|
-
gl.activeTexture(gl.TEXTURE2);
|
|
106
|
-
gl.bindTexture(gl.TEXTURE_2D, colorRampTexture);
|
|
107
|
-
gl.uniform1i(u_color_texture, 2);
|
|
108
|
-
gl.activeTexture(gl.TEXTURE0);
|
|
109
|
-
gl.bindTexture(gl.TEXTURE_2D, texture0);
|
|
110
|
-
gl.uniform1i(u_float_texture0, 0);
|
|
111
|
-
heatParametersBlockManager.bind();
|
|
112
|
-
// clear output texture
|
|
113
|
-
gl.clearColor(0, 0, 0, 0);
|
|
114
|
-
gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);
|
|
115
|
-
gl.bindVertexArray(null);
|
|
116
|
-
heatParametersBlockManager.unbind();
|
|
117
|
-
}
|
|
118
|
-
free() {
|
|
119
|
-
const gl = this.gl;
|
|
120
|
-
gl.deleteBuffer(this._buffer);
|
|
121
|
-
gl.deleteProgram(this.programWrapper.program);
|
|
122
|
-
gl.deleteVertexArray(this.programWrapper.vao);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
class HeatParametersBlockManager {
|
|
126
|
-
constructor(gl) {
|
|
127
|
-
this.gl = gl;
|
|
128
|
-
this.buffer = gl.createBuffer();
|
|
129
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER, this.buffer);
|
|
130
|
-
gl.bufferData(gl.UNIFORM_BUFFER, 24, gl.DYNAMIC_DRAW);
|
|
131
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER, null);
|
|
132
|
-
}
|
|
133
|
-
/*
|
|
134
|
-
* @param {Array<number>} color_ramp_range [minValue,( maxValue - minValue)]
|
|
135
|
-
* @param {Array<number>} min_max [minEdge, maxEdge]
|
|
136
|
-
* @param {number} escape_value // value that will be ignored
|
|
137
|
-
* @param {number} blend_ratio // ratio of blending between two textures
|
|
138
|
-
* */
|
|
139
|
-
update({ color_ramp_range = null, min_max = null, escape_value = null, blend_ratio = null }) {
|
|
140
|
-
const { gl, buffer } = this;
|
|
141
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER, buffer);
|
|
142
|
-
if (color_ramp_range) {
|
|
143
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 0, new Float32Array(color_ramp_range));
|
|
144
|
-
}
|
|
145
|
-
if (min_max) {
|
|
146
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 8, new Float32Array(min_max));
|
|
147
|
-
}
|
|
148
|
-
if (escape_value) {
|
|
149
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 16, new Float32Array([escape_value]));
|
|
150
|
-
}
|
|
151
|
-
if (blend_ratio) {
|
|
152
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 20, new Float32Array([blend_ratio]));
|
|
153
|
-
}
|
|
154
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER, null);
|
|
155
|
-
}
|
|
156
|
-
bind() {
|
|
157
|
-
const { gl, buffer } = this;
|
|
158
|
-
gl.bindBufferBase(gl.UNIFORM_BUFFER, this.heatParametersBlockBindingPoint, buffer);
|
|
159
|
-
}
|
|
160
|
-
free() {
|
|
161
|
-
this.gl.deleteBuffer(this.buffer);
|
|
162
|
-
}
|
|
163
|
-
unbind() {
|
|
164
|
-
const { gl } = this;
|
|
165
|
-
gl.bindBufferBase(gl.UNIFORM_BUFFER, this.heatParametersBlockBindingPoint, null);
|
|
166
|
-
}
|
|
167
|
-
}
|