@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/lib/point/models/text.js
CHANGED
|
@@ -22,15 +22,16 @@ var _l7Utils = require("@antv/l7-utils");
|
|
|
22
22
|
var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
|
|
23
23
|
var _collisionIndex = _interopRequireDefault(require("../../utils/collision-index"));
|
|
24
24
|
var _symbolLayout = require("../../utils/symbol-layout");
|
|
25
|
+
var _CommonStyleAttribute = require("../../core/CommonStyleAttribute");
|
|
25
26
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
26
27
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
28
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
28
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
29
30
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
|
-
/* babel-plugin-inline-import '../shaders/text_frag.glsl' */
|
|
31
|
-
var textFrag = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\nuniform sampler2D u_sdf_map;\
|
|
32
|
-
/* babel-plugin-inline-import '../shaders/text_vert.glsl' */
|
|
33
|
-
var textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\
|
|
31
|
+
/* babel-plugin-inline-import '../shaders/text/text_frag.glsl' */
|
|
32
|
+
var textFrag = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\n\nuniform sampler2D u_sdf_map;\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nin vec4 v_color;\nin vec4 v_stroke_color;\nin vec2 v_uv;\nin float v_gamma_scale;\nin float v_fontScale;\nout vec4 outputColor;\n\n#pragma include \"picking\"\nvoid main() {\n // get style data mapping\n\n // get sdf from atlas\n float dist = texture(SAMPLER_2D(u_sdf_map), v_uv).a;\n\n lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;\n highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\n\n highp float gamma_scaled = gamma * v_gamma_scale;\n\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));\n\n outputColor.a *= alpha;\n // \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20\n if (outputColor.a < 0.01) {\n discard;\n }\n outputColor = filterColor(outputColor);\n}\n";
|
|
33
|
+
/* babel-plugin-inline-import '../shaders/text/text_vert.glsl' */
|
|
34
|
+
var textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\n\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\nlayout(location = 14) in vec4 a_textUvAndOffsets;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nout vec2 v_uv;\nout float v_gamma_scale;\nout vec4 v_color;\nout vec4 v_stroke_color;\nout float v_fontScale;\n\n\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n \n v_uv = a_textUvAndOffsets.xy / u_sdf_map_size;\n\n\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);\n\n // \u6587\u672C\u7F29\u653E\u6BD4\u4F8B\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n vec2 offset = rotate_matrix(a_textUvAndOffsets.zw,rotation);\n \n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n";
|
|
34
35
|
var isEqual = _l7Utils.lodashUtil.isEqual;
|
|
35
36
|
function TextTrianglation(feature) {
|
|
36
37
|
// @ts-ignore
|
|
@@ -93,6 +94,16 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
|
|
|
93
94
|
(0, _createClass2.default)(TextModel, [{
|
|
94
95
|
key: "getUninforms",
|
|
95
96
|
value: function getUninforms() {
|
|
97
|
+
var commoninfo = this.getCommonUniformsInfo();
|
|
98
|
+
var attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
|
|
99
|
+
this.updateStyleUnifoms();
|
|
100
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, commoninfo.uniformsOption), attributeInfo.uniformsOption), {
|
|
101
|
+
u_sdf_map: this.textures[0]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "getCommonUniformsInfo",
|
|
106
|
+
value: function getCommonUniformsInfo() {
|
|
96
107
|
var _ref2 = this.layer.getLayerConfig(),
|
|
97
108
|
_ref2$stroke = _ref2.stroke,
|
|
98
109
|
stroke = _ref2$stroke === void 0 ? '#fff' : _ref2$stroke,
|
|
@@ -111,15 +122,16 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
|
|
|
111
122
|
this.textCount = Object.keys(mapping).length;
|
|
112
123
|
}
|
|
113
124
|
this.preTextStyle = this.getTextStyle();
|
|
114
|
-
|
|
125
|
+
var commonOptions = {
|
|
126
|
+
u_stroke_color: (0, _l7Utils.rgb2arr)(stroke),
|
|
127
|
+
u_sdf_map_size: [(canvas === null || canvas === void 0 ? void 0 : canvas.width) || 1, (canvas === null || canvas === void 0 ? void 0 : canvas.height) || 1],
|
|
115
128
|
u_raisingHeight: Number(raisingHeight),
|
|
116
129
|
u_stroke_width: strokeWidth,
|
|
117
|
-
u_stroke_color: (0, _l7Utils.rgb2arr)(stroke),
|
|
118
|
-
u_sdf_map: this.texture,
|
|
119
|
-
u_halo_blur: halo,
|
|
120
130
|
u_gamma_scale: gamma,
|
|
121
|
-
|
|
122
|
-
}
|
|
131
|
+
u_halo_blur: halo
|
|
132
|
+
};
|
|
133
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
134
|
+
return commonBufferInfo;
|
|
123
135
|
}
|
|
124
136
|
}, {
|
|
125
137
|
key: "initModels",
|
|
@@ -133,8 +145,9 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
|
|
|
133
145
|
this.extent = this.textExtent();
|
|
134
146
|
this.rawEncodeData = this.layer.getEncodedData();
|
|
135
147
|
this.preTextStyle = this.getTextStyle();
|
|
148
|
+
this.initUniformsBuffer();
|
|
136
149
|
return _context2.abrupt("return", this.buildModels());
|
|
137
|
-
case
|
|
150
|
+
case 6:
|
|
138
151
|
case "end":
|
|
139
152
|
return _context2.stop();
|
|
140
153
|
}
|
|
@@ -250,30 +263,31 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
|
|
|
250
263
|
key: "registerBuiltinAttributes",
|
|
251
264
|
value: function registerBuiltinAttributes() {
|
|
252
265
|
this.styleAttributeService.registerStyleAttribute({
|
|
253
|
-
name: '
|
|
266
|
+
name: 'textUvAndOffsets',
|
|
254
267
|
type: _l7Core.AttributeType.Attribute,
|
|
255
268
|
descriptor: {
|
|
256
|
-
name: '
|
|
269
|
+
name: 'a_textUvAndOffsets',
|
|
257
270
|
// 文字偏移量
|
|
271
|
+
shaderLocation: _CommonStyleAttribute.ShaderLocation.UV,
|
|
258
272
|
buffer: {
|
|
259
273
|
// give the WebGL driver a hint that this buffer may change
|
|
260
274
|
usage: _l7Core.gl.STATIC_DRAW,
|
|
261
275
|
data: [],
|
|
262
276
|
type: _l7Core.gl.FLOAT
|
|
263
277
|
},
|
|
264
|
-
size:
|
|
278
|
+
size: 4,
|
|
265
279
|
update: function update(feature, featureIdx, vertex) {
|
|
266
|
-
return [vertex[5], vertex[6]];
|
|
280
|
+
return [vertex[3], vertex[4], vertex[5], vertex[6]];
|
|
267
281
|
}
|
|
268
282
|
}
|
|
269
283
|
});
|
|
270
|
-
|
|
271
284
|
// point layer size;
|
|
272
285
|
this.styleAttributeService.registerStyleAttribute({
|
|
273
286
|
name: 'size',
|
|
274
287
|
type: _l7Core.AttributeType.Attribute,
|
|
275
288
|
descriptor: {
|
|
276
289
|
name: 'a_Size',
|
|
290
|
+
shaderLocation: _CommonStyleAttribute.ShaderLocation.SIZE,
|
|
277
291
|
buffer: {
|
|
278
292
|
// give the WebGL driver a hint that this buffer may change
|
|
279
293
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
@@ -288,22 +302,6 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
|
|
|
288
302
|
}
|
|
289
303
|
}
|
|
290
304
|
});
|
|
291
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
292
|
-
name: 'textUv',
|
|
293
|
-
type: _l7Core.AttributeType.Attribute,
|
|
294
|
-
descriptor: {
|
|
295
|
-
name: 'a_tex',
|
|
296
|
-
buffer: {
|
|
297
|
-
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
298
|
-
data: [],
|
|
299
|
-
type: _l7Core.gl.FLOAT
|
|
300
|
-
},
|
|
301
|
-
size: 2,
|
|
302
|
-
update: function update(feature, featureIdx, vertex) {
|
|
303
|
-
return [vertex[3], vertex[4]];
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
305
|
}
|
|
308
306
|
}, {
|
|
309
307
|
key: "bindEvent",
|
|
@@ -577,6 +575,7 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
|
|
|
577
575
|
width: canvas.width,
|
|
578
576
|
height: canvas.height
|
|
579
577
|
});
|
|
578
|
+
this.textures = [this.texture];
|
|
580
579
|
}
|
|
581
580
|
}, {
|
|
582
581
|
key: "reBuildModel",
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
uniform
|
|
3
|
-
|
|
2
|
+
layout(std140) uniform commonUniorm {
|
|
3
|
+
vec4 u_stroke_color;
|
|
4
|
+
float u_additive;
|
|
5
|
+
float u_stroke_opacity;
|
|
6
|
+
float u_stroke_width;
|
|
7
|
+
};
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
in vec4 v_color;
|
|
10
|
+
in float v_blur;
|
|
11
|
+
in float v_innerRadius;
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
varying float v_blur;
|
|
9
|
-
varying float v_innerRadius;
|
|
13
|
+
out vec4 outputColor;
|
|
10
14
|
|
|
11
15
|
#pragma include "picking"
|
|
12
16
|
void main() {
|
|
@@ -23,24 +27,24 @@ void main() {
|
|
|
23
27
|
float blurWidth = (1.0 - v_blur)/2.0;
|
|
24
28
|
vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);
|
|
25
29
|
if(fragmengTocenter > v_innerRadius + blurWidth) {
|
|
26
|
-
|
|
30
|
+
outputColor = stroke;
|
|
27
31
|
} else if(fragmengTocenter > v_innerRadius - blurWidth){
|
|
28
32
|
float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
|
|
29
|
-
|
|
33
|
+
outputColor = mix(v_color, stroke, mixR);
|
|
30
34
|
} else {
|
|
31
|
-
|
|
35
|
+
outputColor = v_color;
|
|
32
36
|
}
|
|
33
37
|
} else {
|
|
34
38
|
// 当不存在 stroke 或 stroke <= 0.01
|
|
35
|
-
|
|
39
|
+
outputColor = v_color;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
outputColor = filterColor(outputColor);
|
|
39
43
|
|
|
40
44
|
if(u_additive > 0.0) {
|
|
41
|
-
|
|
45
|
+
outputColor *= circleClipOpacity;
|
|
42
46
|
} else {
|
|
43
|
-
|
|
47
|
+
outputColor.a *= circleClipOpacity;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
attribute float a_Size;
|
|
6
|
-
attribute vec4 a_Color;
|
|
7
|
-
varying vec4 v_color;
|
|
8
|
-
|
|
9
|
-
uniform float u_opacity : 1;
|
|
10
|
-
uniform vec2 u_offsets;
|
|
11
|
-
uniform float u_stroke_width;
|
|
12
|
-
|
|
13
|
-
varying float v_blur;
|
|
14
|
-
varying float v_innerRadius;
|
|
2
|
+
layout(location = 0) in vec3 a_Position;
|
|
3
|
+
layout(location = 1) in vec4 a_Color;
|
|
4
|
+
layout(location = 9) in float a_Size;
|
|
15
5
|
|
|
6
|
+
layout(std140) uniform commonUniorm {
|
|
7
|
+
vec4 u_stroke_color;
|
|
8
|
+
float u_additive;
|
|
9
|
+
float u_stroke_opacity;
|
|
10
|
+
float u_stroke_width;
|
|
11
|
+
};
|
|
16
12
|
|
|
13
|
+
out vec4 v_color;
|
|
14
|
+
out float v_blur;
|
|
15
|
+
out float v_innerRadius;
|
|
17
16
|
|
|
18
17
|
#pragma include "projection"
|
|
19
18
|
#pragma include "picking"
|
|
20
19
|
#pragma include "project"
|
|
21
20
|
void main() {
|
|
22
|
-
v_color = vec4(a_Color.xyz, a_Color.w *
|
|
21
|
+
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
23
22
|
v_blur = 1.0 - max(2.0/a_Size, 0.05);
|
|
24
23
|
v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);
|
|
25
24
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
precision highp float;
|
|
2
|
+
in vec4 v_color;
|
|
3
|
+
|
|
4
|
+
#pragma include "picking"
|
|
5
|
+
|
|
6
|
+
layout(std140) uniform commonUniform {
|
|
7
|
+
vec4 u_sourceColor;
|
|
8
|
+
vec4 u_targetColor;
|
|
9
|
+
float u_linearColor: 0;
|
|
10
|
+
float u_heightfixed: 0.0; // 默认不固定
|
|
11
|
+
float u_globel;
|
|
12
|
+
float u_r;
|
|
13
|
+
float u_pickLight: 0.0;
|
|
14
|
+
float u_opacitylinear: 0.0;
|
|
15
|
+
float u_opacitylinear_dir: 1.0;
|
|
16
|
+
float u_lightEnable: 1.0;
|
|
17
|
+
};
|
|
18
|
+
in float v_lightWeight;
|
|
19
|
+
in float v_barLinearZ;
|
|
20
|
+
out vec4 outputColor;
|
|
21
|
+
void main() {
|
|
22
|
+
|
|
23
|
+
outputColor = v_color;
|
|
24
|
+
|
|
25
|
+
// 开启透明度渐变
|
|
26
|
+
if(u_opacitylinear > 0.0) {
|
|
27
|
+
outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// picking
|
|
31
|
+
if(u_pickLight > 0.0) {
|
|
32
|
+
outputColor = filterColorAlpha(outputColor, v_lightWeight);
|
|
33
|
+
} else {
|
|
34
|
+
outputColor = filterColor(outputColor);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -5,23 +5,30 @@ precision highp float;
|
|
|
5
5
|
#define diffuseRatio 0.3
|
|
6
6
|
#define specularRatio 0.2
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
uniform
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
|
|
9
|
+
layout(location = 0) in vec3 a_Position;
|
|
10
|
+
layout(location = 1) in vec4 a_Color;
|
|
11
|
+
layout(location = 9) in vec3 a_Size;
|
|
12
|
+
layout(location = 11) in vec3 a_Pos;
|
|
13
|
+
layout(location = 13) in vec3 a_Normal;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
layout(std140) uniform commonUniform {
|
|
17
|
+
vec4 u_sourceColor;
|
|
18
|
+
vec4 u_targetColor;
|
|
19
|
+
float u_linearColor: 0;
|
|
20
|
+
float u_heightfixed: 0.0; // 默认不固定
|
|
21
|
+
float u_globel;
|
|
22
|
+
float u_r;
|
|
23
|
+
float u_pickLight: 0.0;
|
|
24
|
+
float u_opacitylinear: 0.0;
|
|
25
|
+
float u_opacitylinear_dir: 1.0;
|
|
26
|
+
float u_lightEnable: 1.0;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
out vec4 v_color;
|
|
30
|
+
out float v_lightWeight;
|
|
31
|
+
out float v_barLinearZ;
|
|
25
32
|
// 用于将在顶点着色器中计算好的样式值传递给片元
|
|
26
33
|
|
|
27
34
|
|
|
@@ -47,10 +54,6 @@ float getXRadian(float y, float r) {
|
|
|
47
54
|
|
|
48
55
|
void main() {
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
float textureOffset = 0.0; // 在 cell 中取值的偏移量
|
|
52
|
-
|
|
53
|
-
textureOffset = opacityAndOffset.g;
|
|
54
57
|
// cal style mapping - 数据纹理映射部分的计算
|
|
55
58
|
vec3 size = a_Size * a_Position;
|
|
56
59
|
|
|
@@ -88,7 +91,7 @@ void main() {
|
|
|
88
91
|
v_lightWeight = lightWeight;
|
|
89
92
|
// 设置圆柱的底色
|
|
90
93
|
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
91
|
-
v_color = mix(u_sourceColor, u_targetColor,
|
|
94
|
+
v_color = mix(u_sourceColor, u_targetColor, v_barLinearZ);
|
|
92
95
|
v_color.rgb *= lightWeight;
|
|
93
96
|
} else { // 使用 color 方法传入的颜色
|
|
94
97
|
v_color = a_Color;
|
package/{es/point/shaders/earth/fill_frag.glsl → lib/point/shaders/earthFill/earthFill_frag.glsl}
RENAMED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
uniform float u_stroke_width : 2;
|
|
5
|
-
|
|
6
|
-
varying vec4 v_data;
|
|
7
|
-
varying vec4 v_color;
|
|
8
|
-
varying float v_radius;
|
|
1
|
+
in vec4 v_data;
|
|
2
|
+
in vec4 v_color;
|
|
3
|
+
in float v_radius;
|
|
9
4
|
|
|
5
|
+
layout(std140) uniform commonUniform {
|
|
6
|
+
float u_additive;
|
|
7
|
+
float u_stroke_opacity : 1;
|
|
8
|
+
float u_stroke_width : 2;
|
|
9
|
+
float u_blur : 0.0;
|
|
10
|
+
};
|
|
10
11
|
#pragma include "sdf_2d"
|
|
11
12
|
#pragma include "picking"
|
|
12
13
|
|
|
14
|
+
out vec4 outputColor;
|
|
13
15
|
|
|
14
16
|
void main() {
|
|
15
17
|
int shape = int(floor(v_data.w + 0.5));
|
|
16
18
|
|
|
17
|
-
vec4 strokeColor =
|
|
19
|
+
vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke;
|
|
18
20
|
|
|
19
21
|
lowp float antialiasblur = v_data.z;
|
|
20
|
-
float r = v_radius / (v_radius +
|
|
22
|
+
float r = v_radius / (v_radius + u_stroke_width);
|
|
21
23
|
|
|
22
24
|
float outer_df;
|
|
23
25
|
float inner_df;
|
|
@@ -55,23 +57,23 @@ void main() {
|
|
|
55
57
|
|
|
56
58
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
57
59
|
|
|
58
|
-
float color_t =
|
|
60
|
+
float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
|
|
59
61
|
antialiasblur,
|
|
60
62
|
0.0,
|
|
61
63
|
inner_df
|
|
62
64
|
);
|
|
63
65
|
|
|
64
|
-
if(
|
|
65
|
-
|
|
66
|
+
if(u_stroke_width < 0.01) {
|
|
67
|
+
outputColor = vec4(v_color.rgb, v_color.a * u_opacity);
|
|
66
68
|
} else {
|
|
67
|
-
|
|
69
|
+
outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
if(u_additive > 0.0) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
outputColor *= opacity_t;
|
|
74
|
+
outputColor = filterColorAlpha(outputColor, outputColor.a);
|
|
73
75
|
} else {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
outputColor.a *= opacity_t;
|
|
77
|
+
outputColor = filterColor(outputColor);
|
|
76
78
|
}
|
|
77
79
|
}
|
package/{es/point/shaders/earth/fill_vert.glsl → lib/point/shaders/earthFill/earthFill_vert.glsl}
RENAMED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
17
|
-
uniform vec2 u_offsets;
|
|
18
|
-
|
|
19
|
-
uniform float u_blur : 0.0;
|
|
1
|
+
layout(location = 0) in vec3 a_Position;
|
|
2
|
+
layout(location = 1) in vec4 a_Color;
|
|
3
|
+
layout(location = 9) in float a_Size;
|
|
4
|
+
layout(location = 10) in float a_Shape;
|
|
5
|
+
layout(location = 11) in vec3 a_Extrude;
|
|
6
|
+
|
|
7
|
+
layout(std140) uniform commonUniform {
|
|
8
|
+
float u_additive;
|
|
9
|
+
float u_stroke_opacity : 1;
|
|
10
|
+
float u_stroke_width : 2;
|
|
11
|
+
float u_blur : 0.0;
|
|
12
|
+
};
|
|
13
|
+
out vec4 v_data;
|
|
14
|
+
out vec4 v_color;
|
|
15
|
+
out float v_radius;
|
|
20
16
|
|
|
21
17
|
#pragma include "projection"
|
|
22
18
|
#pragma include "picking"
|
|
@@ -44,8 +40,7 @@ void main() {
|
|
|
44
40
|
// TODP: /abs(extrude.x) 是为了兼容地球模式
|
|
45
41
|
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + u_offsets, 1.0);
|
|
43
|
+
gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0);
|
|
49
44
|
|
|
50
45
|
setPickingColor(a_PickingColor);
|
|
51
|
-
}
|
|
46
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
1
|
layout(std140) uniform commonUniforms {
|
|
3
2
|
vec3 u_blur_height_fixed;
|
|
4
3
|
float u_stroke_width;
|
|
5
4
|
float u_additive;
|
|
6
5
|
float u_stroke_opacity;
|
|
7
6
|
float u_size_unit;
|
|
7
|
+
float u_time;
|
|
8
|
+
vec4 u_animate;
|
|
8
9
|
};
|
|
9
10
|
|
|
11
|
+
|
|
10
12
|
in vec4 v_color;
|
|
11
13
|
in vec4 v_stroke;
|
|
12
14
|
in vec4 v_data;
|
|
@@ -63,17 +65,32 @@ void main() {
|
|
|
63
65
|
inner_df
|
|
64
66
|
);
|
|
65
67
|
|
|
68
|
+
float PI = 3.14159;
|
|
69
|
+
float N_RINGS = 3.0;
|
|
70
|
+
float FREQ = 1.0;
|
|
71
|
+
|
|
66
72
|
if(u_stroke_width < 0.01) {
|
|
67
73
|
outputColor = v_color;
|
|
68
74
|
} else {
|
|
69
75
|
outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);
|
|
70
76
|
}
|
|
77
|
+
float intensity = 1.0;
|
|
78
|
+
if(u_time!=-1.0){
|
|
79
|
+
//wave相关逻辑
|
|
80
|
+
float d = length(v_data.xy);
|
|
81
|
+
if(d > 0.5) {
|
|
82
|
+
discard;
|
|
83
|
+
}
|
|
84
|
+
intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);
|
|
85
|
+
}
|
|
71
86
|
|
|
72
87
|
if(u_additive > 0.0) {
|
|
73
88
|
outputColor *= opacity_t;
|
|
89
|
+
outputColor *= intensity;//wave
|
|
74
90
|
outputColor = filterColorAlpha(outputColor, outputColor.a);
|
|
75
91
|
} else {
|
|
76
92
|
outputColor.a *= opacity_t;
|
|
93
|
+
outputColor.a *= intensity;//wave
|
|
77
94
|
outputColor = filterColor(outputColor);
|
|
78
95
|
}
|
|
79
96
|
// 作为 mask 模板时需要丢弃透明的像素
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
layout(location = 0) in vec3 a_Position;
|
|
2
2
|
layout(location = 1) in vec4 a_Color;
|
|
3
|
-
layout(location = 9) in
|
|
3
|
+
layout(location = 9) in vec2 a_SizeAndShape;
|
|
4
4
|
layout(location = 11) in vec3 a_Extrude;
|
|
5
|
-
layout(location = 10) in float a_Shape;
|
|
6
5
|
|
|
7
6
|
layout(std140) uniform commonUniforms {
|
|
8
7
|
vec3 u_blur_height_fixed;
|
|
@@ -10,6 +9,8 @@ layout(std140) uniform commonUniforms {
|
|
|
10
9
|
float u_additive;
|
|
11
10
|
float u_stroke_opacity;
|
|
12
11
|
float u_size_unit;
|
|
12
|
+
float u_time;
|
|
13
|
+
vec4 u_animate;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
out vec4 v_color;
|
|
@@ -25,12 +26,12 @@ void main() {
|
|
|
25
26
|
// 透明度计算
|
|
26
27
|
v_stroke = stroke;
|
|
27
28
|
vec3 extrude = a_Extrude;
|
|
28
|
-
float shape_type =
|
|
29
|
+
float shape_type = a_SizeAndShape.y;
|
|
29
30
|
/*
|
|
30
31
|
* setPickingSize 设置拾取大小
|
|
31
32
|
* u_meter2coord 在等面积大小的时候设置单位
|
|
32
33
|
*/
|
|
33
|
-
float newSize = setPickingSize(
|
|
34
|
+
float newSize = setPickingSize(a_SizeAndShape.x);
|
|
34
35
|
// float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
|
|
35
36
|
|
|
36
37
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
in vec4 v_color;
|
|
2
|
+
in vec2 v_uv;// 本身的 uv 坐标
|
|
3
|
+
in vec2 v_Iconuv;
|
|
4
|
+
in float v_opacity;
|
|
5
|
+
out vec4 outputColor;
|
|
6
|
+
|
|
7
|
+
uniform sampler2D u_texture;
|
|
8
|
+
layout(std140) uniform commonUniform {
|
|
9
|
+
vec2 u_textSize;
|
|
10
|
+
float u_heightfixed: 0.0;
|
|
11
|
+
float u_raisingHeight: 0.0;
|
|
12
|
+
float u_size_unit;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
#pragma include "sdf_2d"
|
|
16
|
+
#pragma include "picking"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
void main() {
|
|
20
|
+
vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;
|
|
21
|
+
outputColor = texture(SAMPLER_2D(u_texture), pos);
|
|
22
|
+
outputColor.a *= v_opacity;
|
|
23
|
+
outputColor = filterColor(outputColor);
|
|
24
|
+
}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
layout(location = 0) in vec3 a_Position;
|
|
2
|
+
layout(location = 1) in vec4 a_Color;
|
|
3
|
+
layout(location = 9) in float a_Size;
|
|
4
|
+
layout(location = 11) in vec3 a_Extrude;
|
|
5
|
+
layout(location = 14) in vec2 a_Uv;
|
|
6
6
|
|
|
7
|
-
uniform
|
|
7
|
+
layout(std140) uniform commonUniform {
|
|
8
|
+
vec2 u_textSize;
|
|
9
|
+
float u_heightfixed: 0.0;
|
|
10
|
+
float u_raisingHeight: 0.0;
|
|
11
|
+
float u_size_unit;
|
|
12
|
+
};
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
varying vec2 v_uv; // 本身的 uv 坐标
|
|
13
|
-
varying vec2 v_Iconuv; // icon 贴图的 uv 坐标
|
|
14
|
-
|
|
15
|
-
uniform float u_raisingHeight: 0.0;
|
|
16
|
-
uniform float u_heightfixed: 0.0;
|
|
17
|
-
varying float v_opacity;
|
|
18
|
-
// uniform vec2 u_offsets; // shader 注入
|
|
14
|
+
out vec2 v_uv;
|
|
15
|
+
out vec2 v_Iconuv;
|
|
16
|
+
out float v_opacity;
|
|
19
17
|
|
|
20
18
|
|
|
21
19
|
#pragma include "projection"
|
|
@@ -29,7 +27,7 @@ void main() {
|
|
|
29
27
|
v_Iconuv = a_Uv;
|
|
30
28
|
v_opacity = opacity;
|
|
31
29
|
float newSize = a_Size;
|
|
32
|
-
if(u_size_unit == 1) {
|
|
30
|
+
if(u_size_unit == 1.0) {
|
|
33
31
|
newSize = newSize * u_PixelsPerMeter.z;
|
|
34
32
|
}
|
|
35
33
|
|