@antv/l7-layers 2.20.5 → 2.20.8
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/es/canvas/index.d.ts +3 -3
- package/es/citybuliding/models/build.d.ts +7 -12
- package/es/citybuliding/models/build.js +22 -11
- package/es/citybuliding/shaders/build_frag.glsl +26 -23
- package/es/citybuliding/shaders/build_vert.glsl +24 -16
- package/es/core/BaseLayer.d.ts +14 -2
- package/es/core/BaseLayer.js +53 -9
- package/es/core/BaseModel.d.ts +1 -1
- package/es/core/BaseModel.js +41 -15
- package/es/core/CommonStyleAttribute.d.ts +4 -2
- package/es/core/CommonStyleAttribute.js +3 -0
- package/es/core/LayerPickService.d.ts +1 -1
- package/es/core/TextureService.d.ts +2 -2
- package/es/core/interface.d.ts +7 -3
- package/es/core/interface.js +0 -1
- package/es/core/line_trangluation.d.ts +1 -1
- package/es/core/shape/arrow.d.ts +1 -1
- package/es/core/shape/extrude.d.ts +1 -1
- package/es/core/triangulation.d.ts +1 -1
- package/es/core/triangulation.js +13 -7
- package/es/core/utils.js +1 -1
- package/es/earth/index.d.ts +1 -1
- package/es/earth/models/atmosphere.d.ts +8 -2
- package/es/earth/models/atmosphere.js +15 -8
- package/es/earth/models/base.d.ts +8 -2
- package/es/earth/models/base.js +21 -12
- package/es/earth/models/bloomsphere.d.ts +8 -2
- package/es/earth/models/bloomsphere.js +15 -8
- package/es/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -0
- package/es/earth/shaders/base/base_frag.glsl +11 -0
- package/es/earth/shaders/base/base_vert.glsl +52 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +16 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
- package/es/geometry/index.d.ts +2 -2
- package/es/geometry/models/billboard.d.ts +8 -1
- package/es/geometry/models/billboard.js +26 -11
- package/es/geometry/models/plane.d.ts +8 -1
- package/es/geometry/models/plane.js +23 -6
- package/es/geometry/models/sprite.d.ts +12 -2
- package/es/geometry/models/sprite.js +44 -18
- package/es/geometry/shaders/billboard_frag.glsl +11 -6
- package/es/geometry/shaders/billboard_vert.glsl +12 -15
- package/es/geometry/shaders/plane_frag.glsl +14 -10
- package/es/geometry/shaders/plane_vert.glsl +11 -10
- package/es/geometry/shaders/sprite_frag.glsl +11 -7
- package/es/geometry/shaders/sprite_vert.glsl +10 -9
- package/es/heatmap/index.d.ts +3 -3
- package/es/heatmap/models/grid.d.ts +8 -1
- package/es/heatmap/models/grid.js +25 -12
- package/es/heatmap/models/grid3d.d.ts +8 -1
- package/es/heatmap/models/grid3d.js +29 -13
- package/es/heatmap/models/heatmap.d.ts +6 -4
- package/es/heatmap/models/heatmap.js +123 -75
- package/es/heatmap/models/hexagon.d.ts +8 -1
- package/es/heatmap/models/hexagon.js +25 -12
- package/es/heatmap/shaders/grid/grid_frag.glsl +8 -0
- package/es/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
- package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
- package/{lib/heatmap/shaders/hexagon_3d_vert.glsl → es/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
- package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
- package/es/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
- package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
- package/{lib/heatmap/shaders → es/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
- package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/es/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
- package/es/image/index.d.ts +2 -2
- package/es/image/models/image.d.ts +9 -2
- package/es/image/models/image.js +83 -44
- package/es/image/shaders/image_frag.glsl +34 -7
- package/es/image/shaders/image_vert.glsl +11 -5
- package/es/line/index.d.ts +4 -4
- package/es/line/index.js +2 -1
- package/es/line/models/arc.d.ts +8 -3
- package/es/line/models/arc.js +57 -76
- package/es/line/models/arc_3d.d.ts +8 -3
- package/es/line/models/arc_3d.js +46 -57
- package/es/line/models/flow.d.ts +8 -2
- package/es/line/models/flow.js +14 -12
- package/es/line/models/great_circle.d.ts +8 -3
- package/es/line/models/great_circle.js +40 -29
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +3 -6
- package/es/line/models/line.d.ts +8 -3
- package/es/line/models/line.js +67 -140
- package/es/line/models/{simpleLine.d.ts → simple_line.d.ts} +8 -2
- package/es/line/models/simple_line.js +204 -0
- package/es/line/models/wall.d.ts +8 -3
- package/es/line/models/wall.js +35 -27
- package/es/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
- package/es/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
- package/es/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
- package/{lib/line/shaders → es/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
- package/es/line/shaders/flow/flow_line_frag.glsl +5 -4
- package/es/line/shaders/flow/flow_line_vert.glsl +17 -18
- package/es/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
- package/{lib/line/shaders → es/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
- package/es/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
- package/es/line/shaders/line/line_vert.glsl +114 -0
- package/es/line/shaders/simple/simpleline_frag.glsl +27 -3
- package/es/line/shaders/simple/simpleline_vert.glsl +20 -20
- package/es/line/shaders/wall/wall_frag.glsl +31 -26
- package/es/line/shaders/wall/wall_vert.glsl +29 -22
- package/es/mask/index.d.ts +2 -2
- package/es/mask/models/fill.d.ts +1 -1
- package/es/plugins/DataMappingPlugin.d.ts +1 -1
- package/es/plugins/DataMappingPlugin.js +1 -3
- package/es/plugins/DataSourcePlugin.d.ts +1 -1
- package/es/plugins/FeatureScalePlugin.d.ts +1 -1
- package/es/plugins/FeatureScalePlugin.js +14 -3
- package/es/plugins/LayerAnimateStylePlugin.d.ts +1 -1
- package/es/plugins/LayerMaskPlugin.d.ts +1 -1
- package/es/plugins/LayerModelPlugin.d.ts +1 -1
- package/es/plugins/LayerStylePlugin.d.ts +1 -1
- package/es/plugins/LightingPlugin.d.ts +1 -1
- package/es/plugins/MultiPassRendererPlugin.d.ts +1 -1
- package/es/plugins/PixelPickingPlugin.d.ts +6 -2
- package/es/plugins/PixelPickingPlugin.js +36 -49
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +1 -1
- package/es/plugins/ShaderUniformPlugin.d.ts +1 -1
- package/es/plugins/ShaderUniformPlugin.js +11 -6
- package/es/plugins/UpdateModelPlugin.d.ts +1 -1
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +1 -1
- package/es/point/index.d.ts +2 -2
- package/es/point/index.js +1 -0
- package/es/point/models/billboard_point.d.ts +9 -3
- package/es/point/models/billboard_point.js +18 -18
- package/es/point/models/earthExtrude.d.ts +7 -12
- package/es/point/models/earthExtrude.js +21 -13
- package/es/point/models/earthFill.d.ts +8 -3
- package/es/point/models/earthFill.js +18 -30
- package/es/point/models/extrude.d.ts +1 -4
- package/es/point/models/extrude.js +2 -11
- package/es/point/models/fill.d.ts +8 -2
- package/es/point/models/fill.js +33 -84
- package/es/point/models/{fillmage.d.ts → fillImage.d.ts} +8 -2
- package/es/point/models/{fillmage.js → fillImage.js} +23 -15
- package/es/point/models/image.d.ts +8 -1
- package/es/point/models/image.js +31 -17
- package/es/point/models/index.js +1 -1
- package/es/point/models/normal.d.ts +9 -3
- package/es/point/models/normal.js +13 -30
- package/es/point/models/radar.d.ts +8 -2
- package/es/point/models/radar.js +23 -45
- package/es/point/models/text.d.ts +9 -2
- package/es/point/models/text.js +31 -32
- package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
- package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
- package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/{lib/point/shaders/earth/extrude_vert.glsl → es/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
- package/{lib/point/shaders/earth/fill_frag.glsl → es/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
- package/{lib/point/shaders/earth/fill_vert.glsl → es/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
- package/es/point/shaders/extrude/extrude_vert.glsl +0 -3
- package/{lib/point/shaders → es/point/shaders/fill}/fill_frag.glsl +18 -1
- package/es/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
- package/es/point/shaders/fillImage/fillImage_frag.glsl +24 -0
- package/{lib/point/shaders/image → es/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
- package/es/point/shaders/image/image_frag.glsl +42 -0
- package/{lib/point/shaders → es/point/shaders/image}/image_vert.glsl +14 -13
- package/es/point/shaders/radar/radar_frag.glsl +19 -14
- package/es/point/shaders/radar/radar_vert.glsl +21 -24
- package/es/point/shaders/text/text_frag.glsl +44 -0
- package/es/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
- package/es/point/shape/extrude.d.ts +1 -1
- package/es/polygon/index.d.ts +2 -2
- package/es/polygon/models/extrude.d.ts +9 -9
- package/es/polygon/models/extrude.js +38 -15
- package/es/polygon/models/extrusion.d.ts +8 -1
- package/es/polygon/models/extrusion.js +24 -7
- package/es/polygon/models/fill.d.ts +9 -4
- package/es/polygon/models/fill.js +26 -13
- package/es/polygon/models/ocean.d.ts +9 -7
- package/es/polygon/models/ocean.js +30 -14
- package/es/polygon/models/water.d.ts +9 -4
- package/es/polygon/models/water.js +26 -10
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
- package/es/polygon/shaders/fill/fill_frag.glsl +7 -0
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
- package/{lib/polygon/shaders/polygon_linear_vert.glsl → es/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
- package/es/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
- package/es/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
- package/es/polygon/shaders/ocean/ocean_vert.glsl +22 -0
- package/es/polygon/shaders/water/polygon_water_frag.glsl +14 -12
- package/es/polygon/shaders/water/polygon_water_vert.glsl +10 -10
- package/es/raster/buffers/triangulation.d.ts +1 -1
- package/es/raster/index.d.ts +2 -2
- package/es/raster/models/raster.d.ts +9 -8
- package/es/raster/models/raster.js +54 -38
- package/es/raster/models/rasterRgb.d.ts +9 -7
- package/es/raster/models/rasterRgb.js +36 -19
- package/es/raster/models/rasterTerrainRgb.d.ts +1 -1
- package/es/raster/models/rasterTerrainRgb.js +2 -2
- package/es/raster/shaders/raster/raster_2d_frag.glsl +34 -0
- package/es/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/es/tile/core/BaseLayer.d.ts +2 -2
- package/es/tile/core/TileDebugLayer.d.ts +1 -1
- package/es/tile/interaction/getRasterData.d.ts +2 -2
- package/es/tile/interaction/utils.d.ts +1 -1
- package/es/tile/interface.d.ts +2 -2
- package/es/tile/service/TileLayerService.d.ts +2 -2
- package/es/tile/service/TilePickService.d.ts +2 -2
- package/es/tile/service/TileSourceService.d.ts +1 -1
- package/es/tile/tile/Tile.d.ts +2 -3
- package/es/tile/tile/VectorTile.d.ts +1 -1
- package/es/tile/tile/index.d.ts +1 -1
- package/es/tile/utils/constants.js +1 -1
- package/es/tile/utils/utils.d.ts +1 -1
- package/es/utils/blend.d.ts +1 -1
- package/es/utils/multiPassRender.d.ts +1 -1
- package/es/utils/stencil.d.ts +1 -1
- package/es/wind/index.d.ts +3 -3
- package/es/wind/models/wind.d.ts +1 -1
- package/lib/citybuliding/models/build.js +22 -11
- package/lib/citybuliding/shaders/build_frag.glsl +26 -23
- package/lib/citybuliding/shaders/build_vert.glsl +24 -16
- package/lib/core/BaseLayer.js +53 -9
- package/lib/core/BaseModel.js +41 -15
- package/lib/core/CommonStyleAttribute.js +3 -0
- package/lib/core/triangulation.js +12 -6
- package/lib/core/utils.js +1 -1
- package/lib/earth/models/atmosphere.js +15 -8
- package/lib/earth/models/base.js +21 -12
- package/lib/earth/models/bloomsphere.js +15 -8
- package/lib/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -0
- package/lib/earth/shaders/base/base_frag.glsl +11 -0
- package/lib/earth/shaders/base/base_vert.glsl +52 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +16 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
- package/lib/geometry/models/billboard.js +26 -11
- package/lib/geometry/models/plane.js +23 -6
- package/lib/geometry/models/sprite.js +44 -18
- package/lib/geometry/shaders/billboard_frag.glsl +11 -6
- package/lib/geometry/shaders/billboard_vert.glsl +12 -15
- package/lib/geometry/shaders/plane_frag.glsl +14 -10
- package/lib/geometry/shaders/plane_vert.glsl +11 -10
- package/lib/geometry/shaders/sprite_frag.glsl +11 -7
- package/lib/geometry/shaders/sprite_vert.glsl +10 -9
- package/lib/heatmap/models/grid.js +25 -12
- package/lib/heatmap/models/grid3d.js +29 -13
- package/lib/heatmap/models/heatmap.js +122 -74
- package/lib/heatmap/models/hexagon.js +25 -12
- package/lib/heatmap/shaders/grid/grid_frag.glsl +8 -0
- package/lib/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
- package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
- package/{es/heatmap/shaders/hexagon_3d_vert.glsl → lib/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
- package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
- package/lib/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
- package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
- package/{es/heatmap/shaders → lib/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
- package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/lib/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
- package/lib/image/models/image.js +83 -44
- package/lib/image/shaders/image_frag.glsl +34 -7
- package/lib/image/shaders/image_vert.glsl +11 -5
- package/lib/line/index.js +2 -1
- package/lib/line/models/arc.js +57 -76
- package/lib/line/models/arc_3d.js +47 -59
- package/lib/line/models/flow.js +14 -12
- package/lib/line/models/great_circle.js +40 -29
- package/lib/line/models/index.js +4 -7
- package/lib/line/models/line.js +67 -142
- package/lib/line/models/{simpleLine.js → simple_line.js} +84 -74
- package/lib/line/models/wall.js +35 -27
- package/lib/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
- package/lib/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
- package/lib/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
- package/{es/line/shaders → lib/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
- package/lib/line/shaders/flow/flow_line_frag.glsl +5 -4
- package/lib/line/shaders/flow/flow_line_vert.glsl +17 -18
- package/lib/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
- package/{es/line/shaders → lib/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
- package/lib/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
- package/lib/line/shaders/line/line_vert.glsl +114 -0
- package/lib/line/shaders/simple/simpleline_frag.glsl +27 -3
- package/lib/line/shaders/simple/simpleline_vert.glsl +20 -20
- package/lib/line/shaders/wall/wall_frag.glsl +31 -26
- package/lib/line/shaders/wall/wall_vert.glsl +29 -22
- package/lib/plugins/DataMappingPlugin.js +1 -3
- package/lib/plugins/FeatureScalePlugin.js +14 -3
- package/lib/plugins/PixelPickingPlugin.js +35 -48
- package/lib/plugins/ShaderUniformPlugin.js +11 -6
- package/lib/point/index.js +1 -0
- package/lib/point/models/billboard_point.js +18 -18
- package/lib/point/models/earthExtrude.js +21 -13
- package/lib/point/models/earthFill.js +18 -30
- package/lib/point/models/extrude.js +2 -11
- package/lib/point/models/fill.js +33 -84
- package/lib/point/models/{fillmage.js → fillImage.js} +24 -17
- package/lib/point/models/image.js +31 -17
- package/lib/point/models/index.js +2 -2
- package/lib/point/models/normal.js +13 -30
- package/lib/point/models/radar.js +23 -45
- package/lib/point/models/text.js +31 -32
- package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
- package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
- package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/{es/point/shaders/earth/extrude_vert.glsl → lib/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
- package/{es/point/shaders/earth/fill_frag.glsl → lib/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
- package/{es/point/shaders/earth/fill_vert.glsl → lib/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
- package/lib/point/shaders/extrude/extrude_vert.glsl +0 -3
- package/{es/point/shaders → lib/point/shaders/fill}/fill_frag.glsl +18 -1
- package/lib/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
- package/lib/point/shaders/fillImage/fillImage_frag.glsl +24 -0
- package/{es/point/shaders/image → lib/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
- package/lib/point/shaders/image/image_frag.glsl +42 -0
- package/{es/point/shaders → lib/point/shaders/image}/image_vert.glsl +14 -13
- package/lib/point/shaders/radar/radar_frag.glsl +19 -14
- package/lib/point/shaders/radar/radar_vert.glsl +21 -24
- package/lib/point/shaders/text/text_frag.glsl +44 -0
- package/lib/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
- package/lib/polygon/models/extrude.js +38 -15
- package/lib/polygon/models/extrusion.js +24 -7
- package/lib/polygon/models/fill.js +26 -13
- package/lib/polygon/models/ocean.js +30 -14
- package/lib/polygon/models/water.js +26 -10
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
- package/lib/polygon/shaders/fill/fill_frag.glsl +7 -0
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
- package/{es/polygon/shaders/polygon_linear_vert.glsl → lib/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
- package/lib/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
- package/lib/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +22 -0
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +14 -12
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +10 -10
- package/lib/raster/models/raster.js +54 -38
- package/lib/raster/models/rasterRgb.js +36 -19
- package/lib/raster/models/rasterTerrainRgb.js +2 -2
- package/lib/raster/shaders/raster/raster_2d_frag.glsl +34 -0
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/lib/tile/utils/constants.js +1 -1
- package/package.json +7 -7
- package/es/earth/shaders/atmosphere_vert.glsl +0 -26
- package/es/earth/shaders/base_frag.glsl +0 -13
- package/es/earth/shaders/base_vert.glsl +0 -52
- package/es/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/es/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/es/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/es/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/es/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/es/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/es/line/models/earthArc_3d.d.ts +0 -17
- package/es/line/models/earthArc_3d.js +0 -285
- package/es/line/models/linearline.d.ts +0 -11
- package/es/line/models/linearline.js +0 -241
- package/es/line/models/simpleLine.js +0 -194
- package/es/line/shaders/arc_chunks.vert.glsl +0 -21
- package/es/line/shaders/dash/arc_dash_frag.glsl +0 -21
- package/es/line/shaders/dash/arc_dash_vert.glsl +0 -102
- package/es/line/shaders/dash/line_dash_frag.glsl +0 -27
- package/es/line/shaders/dash/line_dash_vert.glsl +0 -82
- package/es/line/shaders/line_arc2d_vert.glsl +0 -114
- package/es/line/shaders/line_bezier_vert.glsl +0 -85
- package/es/line/shaders/line_vert.glsl +0 -165
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
- package/es/line/shaders/linear/arc_linear_frag.glsl +0 -10
- package/es/line/shaders/linear/arc_linear_vert.glsl +0 -98
- package/es/line/shaders/linear/line_linear_frag.glsl +0 -25
- package/es/line/shaders/linearLine/line_linear_frag.glsl +0 -8
- package/es/line/shaders/linearLine/line_linear_vert.glsl +0 -93
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
- package/es/point/shaders/animate/wave_frag.glsl +0 -55
- package/es/point/shaders/earth/extrude_frag.glsl +0 -32
- package/es/point/shaders/image/fillImage_frag.glsl +0 -18
- package/es/point/shaders/image_frag.glsl +0 -37
- package/es/point/shaders/text_frag.glsl +0 -39
- package/es/polygon/shaders/polygon_frag.glsl +0 -7
- package/es/polygon/shaders/polygon_linear_frag.glsl +0 -15
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
- package/es/raster/shaders/raster_2d_frag.glsl +0 -32
- package/es/raster/shaders/raster_2d_vert.glsl +0 -13
- package/es/raster/shaders/raster_frag.glsl +0 -11
- package/es/raster/shaders/raster_rgb_frag.glsl +0 -20
- package/es/raster/shaders/raster_vert.glsl +0 -34
- package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
- package/lib/earth/shaders/base_frag.glsl +0 -13
- package/lib/earth/shaders/base_vert.glsl +0 -52
- package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/lib/line/models/earthArc_3d.js +0 -291
- package/lib/line/models/linearline.js +0 -247
- package/lib/line/shaders/arc_chunks.vert.glsl +0 -21
- package/lib/line/shaders/dash/arc_dash_frag.glsl +0 -21
- package/lib/line/shaders/dash/arc_dash_vert.glsl +0 -102
- package/lib/line/shaders/dash/line_dash_frag.glsl +0 -27
- package/lib/line/shaders/dash/line_dash_vert.glsl +0 -82
- package/lib/line/shaders/line_arc2d_vert.glsl +0 -114
- package/lib/line/shaders/line_bezier_vert.glsl +0 -85
- package/lib/line/shaders/line_vert.glsl +0 -165
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
- package/lib/line/shaders/linear/arc_linear_frag.glsl +0 -10
- package/lib/line/shaders/linear/arc_linear_vert.glsl +0 -98
- package/lib/line/shaders/linear/line_linear_frag.glsl +0 -25
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +0 -8
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +0 -93
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
- package/lib/point/shaders/animate/wave_frag.glsl +0 -55
- package/lib/point/shaders/earth/extrude_frag.glsl +0 -32
- package/lib/point/shaders/image/fillImage_frag.glsl +0 -18
- package/lib/point/shaders/image_frag.glsl +0 -37
- package/lib/point/shaders/text_frag.glsl +0 -39
- package/lib/polygon/shaders/polygon_frag.glsl +0 -7
- package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -15
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
- package/lib/raster/shaders/raster_2d_frag.glsl +0 -32
- package/lib/raster/shaders/raster_2d_vert.glsl +0 -13
- package/lib/raster/shaders/raster_frag.glsl +0 -11
- package/lib/raster/shaders/raster_rgb_frag.glsl +0 -20
- package/lib/raster/shaders/raster_vert.glsl +0 -34
- /package/es/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
- /package/es/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
- /package/es/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
- /package/es/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
- /package/lib/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
- /package/lib/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
- /package/lib/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
- /package/lib/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
package/es/line/models/wall.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
4
|
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
@@ -13,11 +12,12 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
12
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
14
13
|
import { rgb2arr } from '@antv/l7-utils';
|
|
15
14
|
import BaseModel from "../../core/BaseModel";
|
|
15
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
16
16
|
import { LineTriangulation } from "../../core/triangulation";
|
|
17
17
|
/* babel-plugin-inline-import '../shaders/wall/wall_frag.glsl' */
|
|
18
|
-
var line_frag = "#define Animate 0.0\n#define LineTexture 1.0\n\n// line texture\nuniform
|
|
18
|
+
var line_frag = "#define Animate 0.0\n#define LineTexture 1.0\n\n// line texture\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed;\n float u_linearColor: 0;\n float u_line_texture;\n float u_textureBlend;\n float u_iconStepCount;\n float u_time;\n};\nin vec2 v_iconMapUV;\nin float v_blur;\nin float v_radio;\nin vec4 v_color;\nin vec4 v_dataset;\n\nout vec4 outputColor;\n#pragma include \"picking\"\n\nvoid main() {\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = v_dataset.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float v = v_dataset.a;\n\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n outputColor = mix(u_sourceColor, u_targetColor, v);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n outputColor = v_color;\n }\n\n outputColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_dataset.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n float d_texPixelLen = v_dataset.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_dataset.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 start\n float flag = 0.0;\n if(u > 1.0/u_iconStepCount) {\n flag = 1.0;\n }\n u = fract(u*u_iconStepCount);\n // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 end\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n // Tip: \u5224\u65AD\u7EB9\u7406\u95F4\u9694\n if(flag > 0.0) {\n pattern = vec4(0.0);\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor = filterColor(outputColor + pattern);\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = filterColor(pattern);\n }\n }\n \n\n // blur - AA\n if(v < v_blur) {\n outputColor.a = mix(0.0, outputColor.a, v/v_blur);\n } else if(v > 1.0 - v_blur) {\n outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);\n }\n\n outputColor = filterColor(outputColor);\n}\n";
|
|
19
19
|
/* babel-plugin-inline-import '../shaders/wall/wall_vert.glsl' */
|
|
20
|
-
var line_vert = "#define Animate 0.0\
|
|
20
|
+
var line_vert = "#define Animate 0.0\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in vec2 a_Size;\nlayout(location = 10) in float a_Miter;\nlayout(location = 11) in float a_Total_Distance;\nlayout(location = 12) in vec4 a_Instance;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_iconMapUV;\nlayout(location = 15) in float a_Distance;\n\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed;\n float u_linearColor: 0;\n float u_line_texture;\n float u_textureBlend;\n float u_iconStepCount;\n float u_time;\n};\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nout vec2 v_iconMapUV;\nout vec4 v_color;\nout float v_blur;\nout float v_radio;\nout vec4 v_dataset;\n\nvoid main() {\n\n\n float d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n\n v_iconMapUV = a_iconMapUV;\n if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n d_texPixelLen = project_pixel(u_icon_step);\n } else {\n d_texPixelLen = u_icon_step;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n if(u_animate.x == Animate || u_linearColor == 1.0) {\n d_distance_ratio = a_Distance / a_Total_Distance;\n }\n\n float miter = (a_Miter + 1.0)/2.0;\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n v_dataset[0] = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n v_dataset[1] = a_Distance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n v_dataset[2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_dataset[3] = miter; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C 0 - 1\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n float originSize = a_Size.x; // \u56FA\u5B9A\u9AD8\u5EA6\n if(u_heightfixed < 1.0) { \n originSize = project_float_meter(a_Size.x); // \u9AD8\u5EA6\u968F zoom \u8C03\u6574\n }\n\n\n float wallHeight = originSize * miter;\n float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));\n\n v_blur = min(project_float_pixel(2.0) / originSize, 0.05);\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
21
21
|
var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
22
22
|
_inherits(LineWallModel, _BaseModel);
|
|
23
23
|
var _super = _createSuper(LineWallModel);
|
|
@@ -45,12 +45,13 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
45
45
|
width: 1024,
|
|
46
46
|
height: _this.iconService.canvasHeight || 128
|
|
47
47
|
});
|
|
48
|
+
_this.textures = [_this.texture];
|
|
48
49
|
});
|
|
49
50
|
return _this;
|
|
50
51
|
}
|
|
51
52
|
_createClass(LineWallModel, [{
|
|
52
|
-
key: "
|
|
53
|
-
value: function
|
|
53
|
+
key: "getCommonUniformsInfo",
|
|
54
|
+
value: function getCommonUniformsInfo() {
|
|
54
55
|
var _ref = this.layer.getLayerConfig(),
|
|
55
56
|
sourceColor = _ref.sourceColor,
|
|
56
57
|
targetColor = _ref.targetColor,
|
|
@@ -64,6 +65,8 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
64
65
|
iconStep = _ref$iconStep === void 0 ? 100 : _ref$iconStep,
|
|
65
66
|
_ref$iconStepCount = _ref.iconStepCount,
|
|
66
67
|
iconStepCount = _ref$iconStepCount === void 0 ? 1 : _ref$iconStepCount;
|
|
68
|
+
var _ref2 = this.layer.getLayerConfig(),
|
|
69
|
+
animateOption = _ref2.animateOption;
|
|
67
70
|
if (this.rendererService.getDirty()) {
|
|
68
71
|
this.texture.bind();
|
|
69
72
|
}
|
|
@@ -77,33 +80,31 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
77
80
|
targetColorArr = rgb2arr(targetColor);
|
|
78
81
|
useLinearColor = 1;
|
|
79
82
|
}
|
|
80
|
-
|
|
83
|
+
var commonOptions = {
|
|
84
|
+
u_animate: this.animateOption2Array(animateOption),
|
|
85
|
+
u_sourceColor: sourceColorArr,
|
|
86
|
+
u_targetColor: targetColorArr,
|
|
87
|
+
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
88
|
+
u_icon_step: iconStep,
|
|
81
89
|
u_heightfixed: Number(heightfixed),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
u_texture: this.texture,
|
|
85
|
-
// 贴图
|
|
90
|
+
// 渐变色支持参数
|
|
91
|
+
u_linearColor: useLinearColor,
|
|
86
92
|
u_line_texture: lineTexture ? 1.0 : 0.0,
|
|
87
93
|
// 传入线的标识
|
|
94
|
+
u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,
|
|
88
95
|
u_iconStepCount: iconStepCount,
|
|
89
|
-
|
|
90
|
-
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
91
|
-
// 渐变色支持参数
|
|
92
|
-
u_linearColor: useLinearColor,
|
|
93
|
-
u_sourceColor: sourceColorArr,
|
|
94
|
-
u_targetColor: targetColorArr
|
|
95
|
-
}, this.getStyleAttribute());
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
key: "getAnimateUniforms",
|
|
99
|
-
value: function getAnimateUniforms() {
|
|
100
|
-
var _ref2 = this.layer.getLayerConfig(),
|
|
101
|
-
animateOption = _ref2.animateOption;
|
|
102
|
-
return {
|
|
103
|
-
u_animate: this.animateOption2Array(animateOption),
|
|
104
|
-
u_time: this.layer.getLayerAnimateTime()
|
|
96
|
+
u_time: this.layer.getLayerAnimateTime() || 0
|
|
105
97
|
};
|
|
98
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
99
|
+
return commonBufferInfo;
|
|
106
100
|
}
|
|
101
|
+
// public getAnimateUniforms(): IModelUniform {
|
|
102
|
+
// const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;
|
|
103
|
+
// return {
|
|
104
|
+
// u_animate: this.animateOption2Array(animateOption as IAnimateOption),
|
|
105
|
+
// u_time: this.layer.getLayerAnimateTime(),
|
|
106
|
+
// };
|
|
107
|
+
// }
|
|
107
108
|
}, {
|
|
108
109
|
key: "initModels",
|
|
109
110
|
value: function () {
|
|
@@ -111,10 +112,11 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
111
112
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
112
113
|
while (1) switch (_context.prev = _context.next) {
|
|
113
114
|
case 0:
|
|
115
|
+
this.initUniformsBuffer();
|
|
114
116
|
this.updateTexture();
|
|
115
117
|
this.iconService.on('imageUpdate', this.updateTexture);
|
|
116
118
|
return _context.abrupt("return", this.buildModels());
|
|
117
|
-
case
|
|
119
|
+
case 4:
|
|
118
120
|
case "end":
|
|
119
121
|
return _context.stop();
|
|
120
122
|
}
|
|
@@ -175,6 +177,7 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
175
177
|
type: AttributeType.Attribute,
|
|
176
178
|
descriptor: {
|
|
177
179
|
name: 'a_Distance',
|
|
180
|
+
shaderLocation: 15,
|
|
178
181
|
buffer: {
|
|
179
182
|
// give the WebGL driver a hint that this buffer may change
|
|
180
183
|
usage: gl.STATIC_DRAW,
|
|
@@ -192,6 +195,7 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
192
195
|
type: AttributeType.Attribute,
|
|
193
196
|
descriptor: {
|
|
194
197
|
name: 'a_Total_Distance',
|
|
198
|
+
shaderLocation: 11,
|
|
195
199
|
buffer: {
|
|
196
200
|
// give the WebGL driver a hint that this buffer may change
|
|
197
201
|
usage: gl.STATIC_DRAW,
|
|
@@ -209,6 +213,7 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
209
213
|
type: AttributeType.Attribute,
|
|
210
214
|
descriptor: {
|
|
211
215
|
name: 'a_Size',
|
|
216
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
212
217
|
buffer: {
|
|
213
218
|
// give the WebGL driver a hint that this buffer may change
|
|
214
219
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -230,6 +235,7 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
230
235
|
type: AttributeType.Attribute,
|
|
231
236
|
descriptor: {
|
|
232
237
|
name: 'a_Normal',
|
|
238
|
+
shaderLocation: ShaderLocation.NORMAL,
|
|
233
239
|
buffer: {
|
|
234
240
|
// give the WebGL driver a hint that this buffer may change
|
|
235
241
|
usage: gl.STATIC_DRAW,
|
|
@@ -248,6 +254,7 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
248
254
|
type: AttributeType.Attribute,
|
|
249
255
|
descriptor: {
|
|
250
256
|
name: 'a_Miter',
|
|
257
|
+
shaderLocation: 10,
|
|
251
258
|
buffer: {
|
|
252
259
|
// give the WebGL driver a hint that this buffer may change
|
|
253
260
|
usage: gl.STATIC_DRAW,
|
|
@@ -265,6 +272,7 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
265
272
|
type: AttributeType.Attribute,
|
|
266
273
|
descriptor: {
|
|
267
274
|
name: 'a_iconMapUV',
|
|
275
|
+
shaderLocation: 14,
|
|
268
276
|
buffer: {
|
|
269
277
|
// give the WebGL driver a hint that this buffer may change
|
|
270
278
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -1,39 +1,49 @@
|
|
|
1
1
|
|
|
2
2
|
#define Animate 0.0
|
|
3
3
|
#define LineTexture 1.0
|
|
4
|
-
uniform float u_textureBlend;
|
|
5
|
-
uniform float u_blur : 0.9;
|
|
6
|
-
uniform float u_line_type: 0.0;
|
|
7
|
-
// varying vec2 v_normal;
|
|
8
|
-
varying vec4 v_dash_array;
|
|
9
|
-
varying vec4 v_color;
|
|
10
|
-
|
|
11
|
-
uniform float u_time;
|
|
12
|
-
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
13
|
-
|
|
14
|
-
uniform float u_line_texture;
|
|
15
4
|
uniform sampler2D u_texture;
|
|
16
|
-
uniform
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
layout(std140) uniform commonUniorm {
|
|
6
|
+
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
7
|
+
vec4 u_dash_array;
|
|
8
|
+
vec4 u_sourceColor;
|
|
9
|
+
vec4 u_targetColor;
|
|
10
|
+
vec2 u_textSize;
|
|
11
|
+
float segmentNumber;
|
|
12
|
+
float u_lineDir: 1.0;
|
|
13
|
+
float u_icon_step: 100;
|
|
14
|
+
float u_line_texture: 0.0;
|
|
15
|
+
float u_textureBlend;
|
|
16
|
+
float u_blur : 0.9;
|
|
17
|
+
float u_line_type: 0.0;
|
|
18
|
+
float u_time;
|
|
19
|
+
float u_linearColor: 0.0;
|
|
20
|
+
};
|
|
21
|
+
in vec2 v_iconMapUV;
|
|
22
|
+
in vec4 v_lineData;
|
|
23
|
+
in vec4 v_color;
|
|
24
|
+
//dash
|
|
25
|
+
in vec4 v_dash_array;
|
|
26
|
+
in float v_distance_ratio;
|
|
22
27
|
|
|
28
|
+
out vec4 outputColor;
|
|
23
29
|
#pragma include "picking"
|
|
24
30
|
|
|
25
31
|
void main() {
|
|
32
|
+
if(u_dash_array!=vec4(0.0)){
|
|
33
|
+
float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
34
|
+
if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {
|
|
35
|
+
discard;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
26
38
|
float animateSpeed = 0.0; // 运动速度
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
outputColor = v_color;
|
|
30
40
|
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
31
41
|
animateSpeed = u_time / u_animate.y;
|
|
32
42
|
float alpha =1.0 - fract( mod(1.0- v_lineData.b, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
33
43
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
34
44
|
// alpha = smoothstep(0., 1., alpha);
|
|
35
45
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
36
|
-
|
|
46
|
+
outputColor.a *= alpha;
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
// 当存在贴图时在底色上贴上贴图
|
|
@@ -53,7 +63,7 @@ void main() {
|
|
|
53
63
|
float v = v_lineData.a; // 横向 v
|
|
54
64
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
55
65
|
|
|
56
|
-
vec4 pattern =
|
|
66
|
+
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
|
|
57
67
|
|
|
58
68
|
if(u_animate.x == Animate) {
|
|
59
69
|
float currentPlane = floor(redioCount - time);
|
|
@@ -66,16 +76,16 @@ void main() {
|
|
|
66
76
|
|
|
67
77
|
if(u_textureBlend == 0.0) { // normal
|
|
68
78
|
pattern.a = 0.0;
|
|
69
|
-
|
|
79
|
+
outputColor = filterColor(outputColor + pattern);
|
|
70
80
|
} else { // replace
|
|
71
81
|
pattern.a *= v_color.a;
|
|
72
|
-
if(
|
|
82
|
+
if(outputColor.a <= 0.0) {
|
|
73
83
|
pattern.a = 0.0;
|
|
74
84
|
}
|
|
75
|
-
|
|
85
|
+
outputColor = filterColor(pattern);
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
} else {
|
|
79
|
-
|
|
89
|
+
outputColor = filterColor(outputColor);
|
|
80
90
|
}
|
|
81
91
|
}
|
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
#define Animate 0.0
|
|
2
2
|
#define LineTexture 1.0
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
layout(location = 0) in vec3 a_Position;
|
|
4
|
+
layout(location = 1) in vec4 a_Color;
|
|
5
|
+
layout(location = 9) in float a_Size;
|
|
6
|
+
layout(location = 12) in vec4 a_Instance;
|
|
7
|
+
layout(location = 14) in vec2 a_iconMapUV;
|
|
8
|
+
|
|
9
|
+
layout(std140) uniform commonUniorm {
|
|
10
|
+
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
11
|
+
vec4 u_dash_array;
|
|
12
|
+
vec4 u_sourceColor;
|
|
13
|
+
vec4 u_targetColor;
|
|
14
|
+
vec2 u_textSize;
|
|
15
|
+
float segmentNumber;
|
|
16
|
+
float u_lineDir: 1.0;
|
|
17
|
+
float u_icon_step: 100;
|
|
18
|
+
float u_line_texture: 0.0;
|
|
19
|
+
float u_textureBlend;
|
|
20
|
+
float u_blur : 0.9;
|
|
21
|
+
float u_line_type: 0.0;
|
|
22
|
+
float u_time;
|
|
23
|
+
float u_linearColor: 0.0;
|
|
24
|
+
};
|
|
25
|
+
out vec4 v_color;
|
|
26
|
+
out vec2 v_iconMapUV;
|
|
27
|
+
out vec4 v_lineData;
|
|
28
|
+
//dash
|
|
29
|
+
out vec4 v_dash_array;
|
|
30
|
+
out float v_distance_ratio;
|
|
22
31
|
|
|
23
32
|
|
|
24
33
|
#pragma include "projection"
|
|
@@ -76,14 +85,35 @@ vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
|
76
85
|
}
|
|
77
86
|
|
|
78
87
|
void main() {
|
|
79
|
-
|
|
88
|
+
//vs中计算渐变色
|
|
89
|
+
if(u_linearColor==1.0){
|
|
90
|
+
float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置
|
|
91
|
+
v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
|
|
92
|
+
}
|
|
93
|
+
else{
|
|
94
|
+
v_color = a_Color;
|
|
95
|
+
}
|
|
80
96
|
v_color.a = v_color.a * opacity;
|
|
81
97
|
|
|
82
98
|
vec2 source = a_Instance.rg; // 起始点
|
|
83
99
|
vec2 target = a_Instance.ba; // 终点
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
84
103
|
float segmentIndex = a_Position.x;
|
|
85
104
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
86
105
|
|
|
106
|
+
//计算dashArray和distanceRatio 输出到片元
|
|
107
|
+
vec2 s = source;
|
|
108
|
+
vec2 t = target;
|
|
109
|
+
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
110
|
+
s = unProjCustomCoord(source);
|
|
111
|
+
t = unProjCustomCoord(target);
|
|
112
|
+
}
|
|
113
|
+
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
114
|
+
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
|
|
115
|
+
v_distance_ratio = segmentIndex / segmentNumber;
|
|
116
|
+
|
|
87
117
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
88
118
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
89
119
|
float d_distance_ratio;
|
|
@@ -95,7 +125,7 @@ void main() {
|
|
|
95
125
|
}
|
|
96
126
|
}
|
|
97
127
|
|
|
98
|
-
|
|
128
|
+
v_lineData.b = d_distance_ratio;
|
|
99
129
|
|
|
100
130
|
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, thetaOffset), 0.0, 1.0));
|
|
101
131
|
vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, thetaOffset), 0.0, 1.0));
|
|
@@ -105,7 +135,7 @@ void main() {
|
|
|
105
135
|
|
|
106
136
|
|
|
107
137
|
float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置
|
|
108
|
-
|
|
138
|
+
v_lineData.r = d_segmentIndex;
|
|
109
139
|
|
|
110
140
|
if(LineTexture == u_line_texture) { // 开启贴图模式
|
|
111
141
|
|
|
@@ -3,33 +3,41 @@
|
|
|
3
3
|
#define Animate 0.0
|
|
4
4
|
#define LineTexture 1.0
|
|
5
5
|
|
|
6
|
-
uniform float u_textureBlend;
|
|
7
|
-
uniform float u_blur : 0.9;
|
|
8
|
-
uniform float u_line_type: 0.0;
|
|
9
|
-
// varying vec2 v_normal;
|
|
10
|
-
varying vec4 v_dash_array;
|
|
11
|
-
varying vec4 v_color;
|
|
12
|
-
varying vec4 v_line_data;
|
|
13
|
-
|
|
14
|
-
uniform float u_line_texture: 0.0;
|
|
15
6
|
uniform sampler2D u_texture;
|
|
16
|
-
uniform vec2 u_textSize;
|
|
17
|
-
varying float v_segmentIndex;
|
|
18
|
-
uniform float segmentNumber;
|
|
19
7
|
|
|
8
|
+
layout(std140) uniform commonUniorm {
|
|
9
|
+
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
10
|
+
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
11
|
+
vec4 u_sourceColor;
|
|
12
|
+
vec4 u_targetColor;
|
|
13
|
+
vec2 u_textSize;
|
|
14
|
+
float u_globel;
|
|
15
|
+
float u_globel_radius;
|
|
16
|
+
float u_global_height: 10;
|
|
17
|
+
float segmentNumber;
|
|
18
|
+
float u_line_type: 0.0;
|
|
19
|
+
float u_icon_step: 100;
|
|
20
|
+
float u_line_texture: 0.0;
|
|
21
|
+
float u_textureBlend;
|
|
22
|
+
float u_time;
|
|
23
|
+
float u_linearColor: 0.0;
|
|
24
|
+
};
|
|
20
25
|
|
|
21
|
-
varying vec2
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
// varying vec2 v_normal;
|
|
27
|
+
in vec4 v_dash_array;
|
|
28
|
+
in vec4 v_color;
|
|
29
|
+
in vec4 v_line_data;
|
|
30
|
+
in float v_segmentIndex;
|
|
31
|
+
in vec2 v_iconMapUV;
|
|
25
32
|
|
|
33
|
+
out vec4 outputColor;
|
|
26
34
|
|
|
27
35
|
#pragma include "picking"
|
|
28
36
|
|
|
29
37
|
void main() {
|
|
30
38
|
float animateSpeed = 0.0; // 运动速度
|
|
31
39
|
float d_distance_ratio = v_line_data.g; // 当前点位距离占线总长的比例
|
|
32
|
-
|
|
40
|
+
outputColor = v_color;
|
|
33
41
|
|
|
34
42
|
if(u_line_type == LineTypeDash) {
|
|
35
43
|
float flag = 0.;
|
|
@@ -37,7 +45,7 @@ void main() {
|
|
|
37
45
|
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
|
|
38
46
|
flag = 1.;
|
|
39
47
|
}
|
|
40
|
-
|
|
48
|
+
outputColor.a *=flag;
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
@@ -47,7 +55,7 @@ void main() {
|
|
|
47
55
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
48
56
|
// alpha = smoothstep(0., 1., alpha);
|
|
49
57
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
50
|
-
|
|
58
|
+
outputColor.a *= alpha;
|
|
51
59
|
|
|
52
60
|
// u_animate
|
|
53
61
|
// x enable
|
|
@@ -71,7 +79,7 @@ void main() {
|
|
|
71
79
|
|
|
72
80
|
float v = v_line_data.a; // 线图层贴图部分的 v 坐标值
|
|
73
81
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
74
|
-
vec4 pattern =
|
|
82
|
+
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
|
|
75
83
|
|
|
76
84
|
if(u_animate.x == Animate) {
|
|
77
85
|
float currentPlane = floor(redioCount - time);
|
|
@@ -84,18 +92,18 @@ void main() {
|
|
|
84
92
|
|
|
85
93
|
if(u_textureBlend == 0.0) { // normal
|
|
86
94
|
pattern.a = 0.0;
|
|
87
|
-
|
|
95
|
+
outputColor = filterColor(outputColor + pattern);
|
|
88
96
|
} else { // replace
|
|
89
97
|
pattern.a *= v_color.a;
|
|
90
|
-
if(
|
|
98
|
+
if(outputColor.a <= 0.0) {
|
|
91
99
|
pattern.a = 0.0;
|
|
92
100
|
discard;
|
|
93
101
|
} else {
|
|
94
|
-
|
|
102
|
+
outputColor = filterColor(pattern);
|
|
95
103
|
}
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
} else {
|
|
99
|
-
|
|
107
|
+
outputColor = filterColor(outputColor);
|
|
100
108
|
}
|
|
101
109
|
}
|
|
@@ -2,31 +2,35 @@
|
|
|
2
2
|
#define LineTypeDash 1.0
|
|
3
3
|
#define Animate 0.0
|
|
4
4
|
#define LineTexture 1.0
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
uniform
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
5
|
+
layout(location = 0) in vec3 a_Position;
|
|
6
|
+
layout(location = 1) in vec4 a_Color;
|
|
7
|
+
layout(location = 9) in float a_Size;
|
|
8
|
+
layout(location = 12) in vec4 a_Instance;
|
|
9
|
+
layout(location = 14) in vec2 a_iconMapUV;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
layout(std140) uniform commonUniorm {
|
|
13
|
+
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
14
|
+
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
15
|
+
vec4 u_sourceColor;
|
|
16
|
+
vec4 u_targetColor;
|
|
17
|
+
vec2 u_textSize;
|
|
18
|
+
float u_globel;
|
|
19
|
+
float u_globel_radius;
|
|
20
|
+
float u_global_height: 10;
|
|
21
|
+
float segmentNumber;
|
|
22
|
+
float u_line_type: 0.0;
|
|
23
|
+
float u_icon_step: 100;
|
|
24
|
+
float u_line_texture: 0.0;
|
|
25
|
+
float u_textureBlend;
|
|
26
|
+
float u_time;
|
|
27
|
+
float u_linearColor: 0.0;
|
|
28
|
+
};
|
|
29
|
+
out vec4 v_color;
|
|
30
|
+
out vec4 v_dash_array;
|
|
31
|
+
out float v_segmentIndex;
|
|
32
|
+
out vec2 v_iconMapUV;
|
|
33
|
+
out vec4 v_line_data;
|
|
30
34
|
|
|
31
35
|
#pragma include "projection"
|
|
32
36
|
#pragma include "project"
|
|
@@ -94,8 +98,14 @@ vec3 lglt2xyz(vec2 lnglat) {
|
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
void main() {
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
//vs中计算渐变色
|
|
102
|
+
if(u_linearColor==1.0){
|
|
103
|
+
float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置
|
|
104
|
+
v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
|
|
105
|
+
}
|
|
106
|
+
else{
|
|
107
|
+
v_color = a_Color;
|
|
108
|
+
}
|
|
99
109
|
v_color.a = v_color.a * opacity;
|
|
100
110
|
vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;
|
|
101
111
|
vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
#extension GL_OES_standard_derivatives : enable
|
|
1
|
+
// #extension GL_OES_standard_derivatives : enable
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
in vec4 v_color;
|
|
4
|
+
out vec4 outputColor;
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
// line texture
|
|
@@ -8,6 +9,6 @@ varying vec4 v_color;
|
|
|
8
9
|
#pragma include "picking"
|
|
9
10
|
|
|
10
11
|
void main() {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
outputColor = v_color;
|
|
13
|
+
outputColor = filterColor(outputColor);
|
|
13
14
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
uniform
|
|
8
|
-
|
|
1
|
+
layout(location = 0) in vec3 a_Position;
|
|
2
|
+
layout(location = 1) in vec4 a_Color;
|
|
3
|
+
layout(location = 9) in vec2 a_Size;
|
|
4
|
+
layout(location = 12) in vec4 a_Instance;
|
|
5
|
+
layout(location = 13) in vec3 a_Normal;
|
|
6
|
+
|
|
7
|
+
layout(std140) uniform commonUniorm {
|
|
8
|
+
float u_gap_width: 1.0;
|
|
9
|
+
float u_stroke_width: 1.0;
|
|
10
|
+
float u_stroke_opacity: 1.0;
|
|
11
|
+
};
|
|
9
12
|
|
|
10
13
|
#pragma include "projection"
|
|
11
14
|
#pragma include "project"
|
|
12
15
|
#pragma include "picking"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
uniform float u_stroke_width: 1.0;
|
|
16
|
-
uniform float u_stroke_opacity: 1.0;
|
|
16
|
+
|
|
17
|
+
out vec4 v_color;
|
|
17
18
|
|
|
18
19
|
vec2 project_pixel_offset(vec2 offsets) {
|
|
19
20
|
|
|
@@ -51,9 +52,8 @@ void main() {
|
|
|
51
52
|
vec2 source = a_Instance.rg; // 起始点
|
|
52
53
|
vec2 target = a_Instance.ba; // 终点
|
|
53
54
|
vec2 flowlineDir = line_dir(target,source);
|
|
54
|
-
vec2 perpendicularDir = vec2(flowlineDir.y, flowlineDir.x); // mapbox || 高德
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
vec2 perpendicularDir = vec2(-flowlineDir.y, flowlineDir.x); // mapbox || 高德
|
|
56
|
+
|
|
57
57
|
vec2 position = mix(source, target, a_Position.x);
|
|
58
58
|
|
|
59
59
|
float lengthCommon = length(project_position(vec4(target,0,1)) - project_position(vec4(source,0,1))); //
|
|
@@ -77,17 +77,16 @@ void main() {
|
|
|
77
77
|
float gapCommon = flag_gap() * project_pixel(u_gap_width);
|
|
78
78
|
vec3 offsetCommon = vec3(
|
|
79
79
|
flowlineDir * (limitedOffsetDistances[1] + normalsCommon.y + endpointOffset * 1.05) -
|
|
80
|
-
perpendicularDir *
|
|
80
|
+
perpendicularDir * (limitedOffsetDistances[0] + gapCommon + normalsCommon.x),
|
|
81
81
|
0.0
|
|
82
82
|
);
|
|
83
83
|
|
|
84
|
-
|
|
85
84
|
vec4 project_pos = project_position(vec4(position.xy, 0, 1.0));
|
|
86
85
|
|
|
87
86
|
vec4 fillColor = vec4(a_Color.rgb, a_Color.a * opacity);
|
|
88
87
|
v_color = mix(fillColor, vec4(u_stroke.xyz, u_stroke.w * fillColor.w * u_stroke_opacity), a_Normal.z);
|
|
89
88
|
|
|
90
|
-
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy +
|
|
89
|
+
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offsetCommon.xy, 0., 1.0));
|
|
91
90
|
|
|
92
91
|
|
|
93
92
|
|