@antv/l7-layers 2.20.5 → 2.20.6
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/point/models/fill.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -13,14 +11,11 @@ import { AttributeType, gl } from '@antv/l7-core';
|
|
|
13
11
|
import { PointFillTriangulation } from '@antv/l7-utils';
|
|
14
12
|
import BaseModel from "../../core/BaseModel";
|
|
15
13
|
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
14
|
+
/* babel-plugin-inline-import '../shaders/fill/fill_frag.glsl' */
|
|
15
|
+
var pointFillFrag = "layout(std140) uniform commonUniforms {\n vec3 u_blur_height_fixed;\n float u_stroke_width;\n float u_additive;\n float u_stroke_opacity;\n float u_size_unit;\n float u_time;\n vec4 u_animate;\n};\n\n\nin vec4 v_color;\nin vec4 v_stroke;\nin vec4 v_data;\nin float v_radius;\n\n#pragma include \"scene_uniforms\"\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n if(u_stroke_width < 0.01) {\n outputColor = v_color;\n } else {\n outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);\n }\n float intensity = 1.0;\n if(u_time!=-1.0){\n //wave\u76F8\u5173\u903B\u8F91\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n 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);\n }\n\n if(u_additive > 0.0) {\n outputColor *= opacity_t;\n outputColor *= intensity;//wave\n outputColor = filterColorAlpha(outputColor, outputColor.a);\n } else {\n outputColor.a *= opacity_t;\n outputColor.a *= intensity;//wave \n outputColor = filterColor(outputColor);\n }\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}\n";
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/fill/fill_vert.glsl' */
|
|
17
|
+
var pointFillVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in vec2 a_SizeAndShape;\nlayout(location = 11) in vec3 a_Extrude;\n\nlayout(std140) uniform commonUniforms {\n vec3 u_blur_height_fixed;\n float u_stroke_width;\n float u_additive;\n float u_stroke_opacity;\n float u_size_unit;\n float u_time;\n vec4 u_animate; \n};\n\nout vec4 v_color;\nout vec4 v_stroke;\nout vec4 v_data;\nout float v_radius;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n // \u900F\u660E\u5EA6\u8BA1\u7B97\n v_stroke = stroke; \n vec3 extrude = a_Extrude;\n float shape_type = a_SizeAndShape.y;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n * u_meter2coord \u5728\u7B49\u9762\u79EF\u5927\u5C0F\u7684\u65F6\u5019\u8BBE\u7F6E\u5355\u4F4D\n */\n float newSize = setPickingSize(a_SizeAndShape.x);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n\n\n // unpack color(vec2)\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n if(u_size_unit == 1.0) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);\n vec3 aPosition = a_Position;\n\n offset = project_pixel(offset);\n offset = rotate_matrix(offset,rotation);\n \n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n // vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n float raisingHeight = u_blur_height_fixed.y;\n\n if(u_blur_height_fixed.z < 1.0) { // false\n raisingHeight = project_pixel(u_blur_height_fixed.y);\n } else {\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 raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;\n }\n }\n \n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
16
18
|
import { SizeUnitType } from "../../core/interface";
|
|
17
|
-
// animate pointLayer shader - support animate
|
|
18
|
-
/* babel-plugin-inline-import '../shaders/animate/wave_frag.glsl' */
|
|
19
|
-
var waveFillFrag = "\nuniform float u_additive;\n\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n \n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n gl_FragColor = v_color;\n\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n float 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);\n \n // \u6839\u636E\u53E0\u52A0\u6A21\u5F0F\u9009\u62E9\u6548\u679C\n if(u_additive > 0.0) {\n gl_FragColor *= intensity;\n // \u4F18\u5316\u6C34\u6CE2\u70B9 blend additive \u6A21\u5F0F\u4E0B\u6709\u7684\u62FE\u53D6\u6548\u679C \n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n"; // static pointLayer shader - not support animate
|
|
20
|
-
/* babel-plugin-inline-import '../shaders/fill_frag.glsl' */
|
|
21
|
-
var pointFillFrag = "\nlayout(std140) uniform commonUniforms {\n vec3 u_blur_height_fixed;\n float u_stroke_width;\n float u_additive;\n float u_stroke_opacity;\n float u_size_unit;\n};\n\nin vec4 v_color;\nin vec4 v_stroke;\nin vec4 v_data;\nin float v_radius;\n\n#pragma include \"scene_uniforms\"\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(u_stroke_width < 0.01) {\n outputColor = v_color;\n } else {\n outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n outputColor *= opacity_t;\n outputColor = filterColorAlpha(outputColor, outputColor.a);\n } else {\n outputColor.a *= opacity_t;\n outputColor = filterColor(outputColor);\n }\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}\n";
|
|
22
|
-
/* babel-plugin-inline-import '../shaders/fill_vert.glsl' */
|
|
23
|
-
var pointFillVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\nlayout(location = 11) in vec3 a_Extrude;\nlayout(location = 10) in float a_Shape;\n\nlayout(std140) uniform commonUniforms {\n vec3 u_blur_height_fixed;\n float u_stroke_width;\n float u_additive;\n float u_stroke_opacity;\n float u_size_unit;\n};\n\nout vec4 v_color;\nout vec4 v_stroke;\nout vec4 v_data;\nout float v_radius;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n // \u900F\u660E\u5EA6\u8BA1\u7B97\n v_stroke = stroke; \n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n * u_meter2coord \u5728\u7B49\u9762\u79EF\u5927\u5C0F\u7684\u65F6\u5019\u8BBE\u7F6E\u5355\u4F4D\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n\n\n // unpack color(vec2)\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n if(u_size_unit == 1.0) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);\n vec3 aPosition = a_Position;\n\n offset = project_pixel(offset);\n offset = rotate_matrix(offset,rotation);\n \n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n // vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n float raisingHeight = u_blur_height_fixed.y;\n\n if(u_blur_height_fixed.z < 1.0) { // false\n raisingHeight = project_pixel(u_blur_height_fixed.y);\n } else {\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 raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;\n }\n }\n \n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
24
19
|
var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
25
20
|
_inherits(FillModel, _BaseModel);
|
|
26
21
|
var _super = _createSuper(FillModel);
|
|
@@ -29,8 +24,8 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
29
24
|
return _super.apply(this, arguments);
|
|
30
25
|
}
|
|
31
26
|
_createClass(FillModel, [{
|
|
32
|
-
key: "
|
|
33
|
-
value: function
|
|
27
|
+
key: "getCommonUniformsInfo",
|
|
28
|
+
value: function getCommonUniformsInfo() {
|
|
34
29
|
var _ref = this.layer.getLayerConfig(),
|
|
35
30
|
_ref$strokeOpacity = _ref.strokeOpacity,
|
|
36
31
|
strokeOpacity = _ref$strokeOpacity === void 0 ? 1 : _ref$strokeOpacity,
|
|
@@ -45,23 +40,21 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
45
40
|
heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed,
|
|
46
41
|
_ref$unit = _ref.unit,
|
|
47
42
|
unit = _ref$unit === void 0 ? 'pixel' : _ref$unit;
|
|
48
|
-
var
|
|
43
|
+
var u_time = this.getAnimateUniforms().u_time;
|
|
44
|
+
if (isNaN(u_time)) {
|
|
45
|
+
u_time = -1.0;
|
|
46
|
+
}
|
|
47
|
+
var commonOptions = {
|
|
49
48
|
u_blur_height_fixed: [blur, Number(raisingHeight), Number(heightfixed)],
|
|
49
|
+
u_stroke_width: strokeWidth,
|
|
50
50
|
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
51
51
|
u_stroke_opacity: strokeOpacity,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
data: new Uint8Array(new Float32Array([].concat(_toConsumableArray(attributes.u_stroke), _toConsumableArray(attributes.u_offsets), [attributes.u_opacity, attributes.u_rotation])).buffer)
|
|
59
|
-
});
|
|
60
|
-
this.uniformBuffers[1].subData({
|
|
61
|
-
offset: 0,
|
|
62
|
-
data: new Uint8Array(new Float32Array([].concat(_toConsumableArray(commonIniform.u_blur_height_fixed), [commonIniform.u_stroke_width, commonIniform.u_stroke_opacity, commonIniform.u_additive, commonIniform.u_size_unit])).buffer)
|
|
63
|
-
});
|
|
64
|
-
return commonIniform;
|
|
52
|
+
u_size_unit: SizeUnitType[unit],
|
|
53
|
+
u_time: u_time,
|
|
54
|
+
u_animate: this.getAnimateUniforms().u_animate
|
|
55
|
+
};
|
|
56
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
57
|
+
return commonBufferInfo;
|
|
65
58
|
}
|
|
66
59
|
}, {
|
|
67
60
|
key: "getAnimateUniforms",
|
|
@@ -104,7 +97,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
104
97
|
key: "buildModels",
|
|
105
98
|
value: function () {
|
|
106
99
|
var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
107
|
-
var _ref3, _ref3$animateOption, animateOption, _this$getShaders, frag, vert, type,
|
|
100
|
+
var _ref3, _ref3$animateOption, animateOption, _this$getShaders, frag, vert, type, model;
|
|
108
101
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
109
102
|
while (1) switch (_context2.prev = _context2.next) {
|
|
110
103
|
case 0:
|
|
@@ -113,16 +106,8 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
113
106
|
} : _ref3$animateOption;
|
|
114
107
|
_this$getShaders = this.getShaders(animateOption), frag = _this$getShaders.frag, vert = _this$getShaders.vert, type = _this$getShaders.type;
|
|
115
108
|
this.layer.triangulation = PointFillTriangulation;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
isUBO: true
|
|
119
|
-
});
|
|
120
|
-
commonUniforms = this.rendererService.createBuffer({
|
|
121
|
-
data: new Float32Array(8),
|
|
122
|
-
isUBO: true
|
|
123
|
-
});
|
|
124
|
-
this.uniformBuffers.push(attributeUniformBuffer, commonUniforms);
|
|
125
|
-
_context2.next = 8;
|
|
109
|
+
this.initUniformsBuffer();
|
|
110
|
+
_context2.next = 6;
|
|
126
111
|
return this.layer.buildLayerModel({
|
|
127
112
|
moduleName: type,
|
|
128
113
|
vertexShader: vert,
|
|
@@ -133,10 +118,10 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
133
118
|
enable: false
|
|
134
119
|
}
|
|
135
120
|
});
|
|
136
|
-
case
|
|
121
|
+
case 6:
|
|
137
122
|
model = _context2.sent;
|
|
138
123
|
return _context2.abrupt("return", [model]);
|
|
139
|
-
case
|
|
124
|
+
case 8:
|
|
140
125
|
case "end":
|
|
141
126
|
return _context2.stop();
|
|
142
127
|
}
|
|
@@ -154,28 +139,11 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
154
139
|
}, {
|
|
155
140
|
key: "getShaders",
|
|
156
141
|
value: function getShaders(animateOption) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
vert: pointFillVert,
|
|
163
|
-
type: 'pointWave'
|
|
164
|
-
};
|
|
165
|
-
default:
|
|
166
|
-
return {
|
|
167
|
-
frag: waveFillFrag,
|
|
168
|
-
vert: pointFillVert,
|
|
169
|
-
type: 'pointWave'
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
} else {
|
|
173
|
-
return {
|
|
174
|
-
frag: pointFillFrag,
|
|
175
|
-
vert: pointFillVert,
|
|
176
|
-
type: 'pointFill'
|
|
177
|
-
};
|
|
178
|
-
}
|
|
142
|
+
return {
|
|
143
|
+
frag: pointFillFrag,
|
|
144
|
+
vert: pointFillVert,
|
|
145
|
+
type: 'pointFill'
|
|
146
|
+
};
|
|
179
147
|
}
|
|
180
148
|
|
|
181
149
|
// overwrite baseModel func
|
|
@@ -212,10 +180,10 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
212
180
|
|
|
213
181
|
// point layer size;
|
|
214
182
|
this.styleAttributeService.registerStyleAttribute({
|
|
215
|
-
name: '
|
|
183
|
+
name: 'sizeAndShape',
|
|
216
184
|
type: AttributeType.Attribute,
|
|
217
185
|
descriptor: {
|
|
218
|
-
name: '
|
|
186
|
+
name: 'a_SizeAndShape',
|
|
219
187
|
shaderLocation: ShaderLocation.SIZE,
|
|
220
188
|
buffer: {
|
|
221
189
|
// give the WebGL driver a hint that this buffer may change
|
|
@@ -223,34 +191,15 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
223
191
|
data: [],
|
|
224
192
|
type: gl.FLOAT
|
|
225
193
|
},
|
|
226
|
-
size:
|
|
194
|
+
size: 2,
|
|
227
195
|
update: function update(feature) {
|
|
228
196
|
var _feature$size = feature.size,
|
|
229
197
|
size = _feature$size === void 0 ? 5 : _feature$size;
|
|
230
|
-
return Array.isArray(size) ? [size[0]] : [size];
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
// point layer shape;
|
|
236
|
-
this.styleAttributeService.registerStyleAttribute({
|
|
237
|
-
name: 'shape',
|
|
238
|
-
type: AttributeType.Attribute,
|
|
239
|
-
descriptor: {
|
|
240
|
-
name: 'a_Shape',
|
|
241
|
-
shaderLocation: ShaderLocation.SHAPE,
|
|
242
|
-
buffer: {
|
|
243
|
-
// give the WebGL driver a hint that this buffer may change
|
|
244
|
-
usage: gl.DYNAMIC_DRAW,
|
|
245
|
-
data: [],
|
|
246
|
-
type: gl.FLOAT
|
|
247
|
-
},
|
|
248
|
-
size: 1,
|
|
249
|
-
update: function update(feature) {
|
|
250
198
|
var _feature$shape = feature.shape,
|
|
251
199
|
shape = _feature$shape === void 0 ? 2 : _feature$shape;
|
|
252
200
|
var shapeIndex = shape2d.indexOf(shape);
|
|
253
|
-
|
|
201
|
+
var a_Size = Array.isArray(size) ? size[0] : size;
|
|
202
|
+
return [a_Size, shapeIndex];
|
|
254
203
|
}
|
|
255
204
|
}
|
|
256
205
|
});
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { IAttribute, IElements, IModel
|
|
1
|
+
import type { IAttribute, IElements, IModel } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class FillImageModel extends BaseModel {
|
|
4
4
|
private meter2coord;
|
|
5
5
|
private texture;
|
|
6
6
|
private isMeter;
|
|
7
7
|
private radian;
|
|
8
|
-
|
|
8
|
+
protected getCommonUniformsInfo(): {
|
|
9
|
+
uniformsArray: number[];
|
|
10
|
+
uniformsLength: number;
|
|
11
|
+
uniformsOption: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
9
15
|
getAttribute(): {
|
|
10
16
|
attributes: {
|
|
11
17
|
[attributeName: string]: IAttribute;
|
|
@@ -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";
|
|
@@ -16,10 +15,11 @@ import BaseModel from "../../core/BaseModel";
|
|
|
16
15
|
import { SizeUnitType } from "../../core/interface";
|
|
17
16
|
import { PointFillTriangulation } from "../../core/triangulation";
|
|
18
17
|
// static pointLayer shader - not support animate
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
19
|
+
/* babel-plugin-inline-import '../shaders/fillImage/fillImage_frag.glsl' */
|
|
20
|
+
var pointFillFrag = "in vec4 v_color;\nin vec2 v_uv;// \u672C\u8EAB\u7684 uv \u5750\u6807\nin vec2 v_Iconuv;\nin float v_opacity;\nout vec4 outputColor;\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniform {\n vec2 u_textSize;\n float u_heightfixed: 0.0;\n float u_raisingHeight: 0.0;\n float u_size_unit;\n};\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;\n outputColor = texture(SAMPLER_2D(u_texture), pos);\n outputColor.a *= v_opacity;\n outputColor = filterColor(outputColor);\n}\n";
|
|
21
|
+
/* babel-plugin-inline-import '../shaders/fillImage/fillImage_vert.glsl' */
|
|
22
|
+
var pointFillVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\nlayout(location = 11) in vec3 a_Extrude;\nlayout(location = 14) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniform {\n vec2 u_textSize;\n float u_heightfixed: 0.0;\n float u_raisingHeight: 0.0;\n float u_size_unit;\n};\n\nout vec2 v_uv;\nout vec2 v_Iconuv;\nout float v_opacity;\n\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n v_uv = (a_Extrude.xy + 1.0)/2.0;\n v_uv.y = 1.0 - v_uv.y;\n v_Iconuv = a_Uv;\n v_opacity = opacity;\n float newSize = a_Size;\n if(u_size_unit == 1.0) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n \n // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);\n vec2 offset = (extrude.xy * (newSize) + offsets);\n\n offset = rotate_matrix(offset,rotation);\n\n vec3 aPosition = a_Position;\n\n offset = project_pixel(offset);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n float raisingHeight = u_raisingHeight;\n if(u_heightfixed < 1.0) { // height fixed\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\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 raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
23
23
|
var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
24
24
|
_inherits(FillImageModel, _BaseModel);
|
|
25
25
|
var _super = _createSuper(FillImageModel);
|
|
@@ -55,14 +55,15 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
55
55
|
height: _this.iconService.canvasHeight || 128,
|
|
56
56
|
mipmap: true
|
|
57
57
|
});
|
|
58
|
+
_this.textures = [_this.texture];
|
|
58
59
|
});
|
|
59
60
|
return _this;
|
|
60
61
|
}
|
|
61
62
|
_createClass(FillImageModel, [{
|
|
62
|
-
key: "
|
|
63
|
+
key: "getCommonUniformsInfo",
|
|
63
64
|
value:
|
|
64
65
|
// 旋转的弧度
|
|
65
|
-
function
|
|
66
|
+
function getCommonUniformsInfo() {
|
|
66
67
|
var _ref = this.layer.getLayerConfig(),
|
|
67
68
|
_ref$raisingHeight = _ref.raisingHeight,
|
|
68
69
|
raisingHeight = _ref$raisingHeight === void 0 ? 0.0 : _ref$raisingHeight,
|
|
@@ -81,13 +82,16 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
81
82
|
* GAODE1.x -1
|
|
82
83
|
*/
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
var commonOptions = {
|
|
86
|
+
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
86
87
|
u_heightfixed: Number(heightfixed),
|
|
88
|
+
u_raisingHeight: Number(raisingHeight),
|
|
87
89
|
u_size_unit: SizeUnitType[unit],
|
|
88
|
-
u_texture: this.texture
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
u_texture: this.texture
|
|
91
|
+
};
|
|
92
|
+
this.textures = [this.texture];
|
|
93
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
94
|
+
return commonBufferInfo;
|
|
91
95
|
}
|
|
92
96
|
}, {
|
|
93
97
|
key: "getAttribute",
|
|
@@ -123,7 +127,8 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
123
127
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
124
128
|
while (1) switch (_context2.prev = _context2.next) {
|
|
125
129
|
case 0:
|
|
126
|
-
|
|
130
|
+
this.initUniformsBuffer();
|
|
131
|
+
_context2.next = 3;
|
|
127
132
|
return this.layer.buildLayerModel({
|
|
128
133
|
moduleName: 'pointFillImage',
|
|
129
134
|
vertexShader: pointFillVert,
|
|
@@ -138,10 +143,10 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
138
143
|
face: getCullFace(this.mapService.version)
|
|
139
144
|
}
|
|
140
145
|
});
|
|
141
|
-
case
|
|
146
|
+
case 3:
|
|
142
147
|
model = _context2.sent;
|
|
143
148
|
return _context2.abrupt("return", [model]);
|
|
144
|
-
case
|
|
149
|
+
case 5:
|
|
145
150
|
case "end":
|
|
146
151
|
return _context2.stop();
|
|
147
152
|
}
|
|
@@ -170,6 +175,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
170
175
|
type: AttributeType.Attribute,
|
|
171
176
|
descriptor: {
|
|
172
177
|
name: 'a_Uv',
|
|
178
|
+
shaderLocation: ShaderLocation.UV,
|
|
173
179
|
buffer: {
|
|
174
180
|
// give the WebGL driver a hint that this buffer may change
|
|
175
181
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -195,6 +201,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
195
201
|
type: AttributeType.Attribute,
|
|
196
202
|
descriptor: {
|
|
197
203
|
name: 'a_Extrude',
|
|
204
|
+
shaderLocation: ShaderLocation.EXTRUDE,
|
|
198
205
|
buffer: {
|
|
199
206
|
// give the WebGL driver a hint that this buffer may change
|
|
200
207
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -216,6 +223,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
216
223
|
type: AttributeType.Attribute,
|
|
217
224
|
descriptor: {
|
|
218
225
|
name: 'a_Size',
|
|
226
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
219
227
|
buffer: {
|
|
220
228
|
// give the WebGL driver a hint that this buffer may change
|
|
221
229
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { IModel, IModelUniform } from '@antv/l7-core';
|
|
1
|
+
import type { IModel, IModelUniform } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class ImageModel extends BaseModel {
|
|
4
4
|
private texture;
|
|
5
5
|
getUninforms(): IModelUniform;
|
|
6
|
+
protected getCommonUniformsInfo(): {
|
|
7
|
+
uniformsArray: number[];
|
|
8
|
+
uniformsLength: number;
|
|
9
|
+
uniformsOption: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
6
13
|
initModels(): Promise<IModel[]>;
|
|
7
14
|
clearModels(): void;
|
|
8
15
|
buildModels(): Promise<IModel[]>;
|
package/es/point/models/image.js
CHANGED
|
@@ -12,11 +12,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
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; } }
|
|
13
13
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
14
14
|
import BaseModel from "../../core/BaseModel";
|
|
15
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
15
16
|
import { PointImageTriangulation } from "../../core/triangulation";
|
|
16
|
-
/* babel-plugin-inline-import '../shaders/image_frag.glsl' */
|
|
17
|
-
var pointImageFrag = "\nuniform sampler2D u_texture;\
|
|
18
|
-
/* babel-plugin-inline-import '../shaders/image_vert.glsl' */
|
|
19
|
-
var pointImageVert = "
|
|
17
|
+
/* babel-plugin-inline-import '../shaders/image/image_frag.glsl' */
|
|
18
|
+
var pointImageFrag = "layout(std140) uniform commonUniforms {\n vec2 u_textSize;\n float u_raisingHeight;\n float u_heightfixed;\n};\n\nuniform sampler2D u_texture;\n\nin vec4 v_color;\nin vec2 v_uv;\nin float v_opacity;\n\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main(){\n vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;\n vec4 textureColor;\n\n // Y = 0.299R + 0.587G + 0.114B // \u4EAE\u5EA6\u63D0\u53D6\n \n textureColor = texture(SAMPLER_2D(u_texture), pos);\n\n // Tip: \u53BB\u9664\u8FB9\u7F18\u90E8\u5206 mipmap \u5BFC\u81F4\u7684\u6DF7\u5408\u53D8\u6697\n float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);\n if(fragmengTocenter >= 0.5) {\n float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;\n textureColor.a *= luma;\n }\n \n if(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){\n outputColor= textureColor;\n }else {\n outputColor= step(0.01, textureColor.z) * v_color;\n }\n outputColor.a *= v_opacity;\n if (outputColor.a < 0.01) {\n discard;\n }\n outputColor = filterColor(outputColor);\n}\n";
|
|
19
|
+
/* babel-plugin-inline-import '../shaders/image/image_vert.glsl' */
|
|
20
|
+
var pointImageVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\nlayout(location = 14) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_textSize;\n float u_raisingHeight;\n float u_heightfixed;\n};\n\nout vec4 v_color;\nout vec2 v_uv;\nout float v_opacity;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n v_color = a_Color;\n v_opacity = opacity;\n v_uv = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n \n vec2 offset = project_pixel(offsets);\n\n float raisingHeight = u_raisingHeight;\n if(u_heightfixed < 1.0) { // false\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\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 raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n";
|
|
20
21
|
var ImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
21
22
|
_inherits(ImageModel, _BaseModel);
|
|
22
23
|
var _super = _createSuper(ImageModel);
|
|
@@ -59,22 +60,32 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
59
60
|
_createClass(ImageModel, [{
|
|
60
61
|
key: "getUninforms",
|
|
61
62
|
value: function getUninforms() {
|
|
63
|
+
// ThreeJS 图层兼容
|
|
64
|
+
if (this.rendererService.getDirty()) {
|
|
65
|
+
this.texture.bind();
|
|
66
|
+
}
|
|
67
|
+
var commonInfo = this.getCommonUniformsInfo();
|
|
68
|
+
var attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
|
|
69
|
+
this.updateStyleUnifoms();
|
|
70
|
+
return _objectSpread(_objectSpread({}, commonInfo.uniformsOption), attributeInfo.uniformsOption);
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "getCommonUniformsInfo",
|
|
74
|
+
value: function getCommonUniformsInfo() {
|
|
62
75
|
var _ref = this.layer.getLayerConfig(),
|
|
63
76
|
_ref$raisingHeight = _ref.raisingHeight,
|
|
64
77
|
raisingHeight = _ref$raisingHeight === void 0 ? 0 : _ref$raisingHeight,
|
|
65
78
|
_ref$heightfixed = _ref.heightfixed,
|
|
66
79
|
heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (this.rendererService.getDirty()) {
|
|
70
|
-
this.texture.bind();
|
|
71
|
-
}
|
|
72
|
-
return _objectSpread({
|
|
80
|
+
var commonOptions = {
|
|
81
|
+
u_textSize: [1024, this.iconService.canvasHeight || 128],
|
|
73
82
|
u_raisingHeight: Number(raisingHeight),
|
|
74
83
|
u_heightfixed: Number(heightfixed),
|
|
75
|
-
u_texture: this.texture
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
u_texture: this.texture
|
|
85
|
+
};
|
|
86
|
+
this.textures = [this.texture];
|
|
87
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
88
|
+
return commonBufferInfo;
|
|
78
89
|
}
|
|
79
90
|
}, {
|
|
80
91
|
key: "initModels",
|
|
@@ -112,7 +123,8 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
112
123
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
113
124
|
while (1) switch (_context2.prev = _context2.next) {
|
|
114
125
|
case 0:
|
|
115
|
-
|
|
126
|
+
this.initUniformsBuffer();
|
|
127
|
+
_context2.next = 3;
|
|
116
128
|
return this.layer.buildLayerModel({
|
|
117
129
|
moduleName: 'pointImage',
|
|
118
130
|
vertexShader: pointImageVert,
|
|
@@ -124,10 +136,10 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
124
136
|
},
|
|
125
137
|
primitive: gl.POINTS
|
|
126
138
|
});
|
|
127
|
-
case
|
|
139
|
+
case 3:
|
|
128
140
|
model = _context2.sent;
|
|
129
141
|
return _context2.abrupt("return", [model]);
|
|
130
|
-
case
|
|
142
|
+
case 5:
|
|
131
143
|
case "end":
|
|
132
144
|
return _context2.stop();
|
|
133
145
|
}
|
|
@@ -148,6 +160,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
148
160
|
type: AttributeType.Attribute,
|
|
149
161
|
descriptor: {
|
|
150
162
|
name: 'a_Size',
|
|
163
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
151
164
|
buffer: {
|
|
152
165
|
// give the WebGL driver a hint that this buffer may change
|
|
153
166
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -163,12 +176,13 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
163
176
|
}
|
|
164
177
|
});
|
|
165
178
|
|
|
166
|
-
// point layer
|
|
179
|
+
// point layer uv;
|
|
167
180
|
this.styleAttributeService.registerStyleAttribute({
|
|
168
181
|
name: 'uv',
|
|
169
182
|
type: AttributeType.Attribute,
|
|
170
183
|
descriptor: {
|
|
171
184
|
name: 'a_Uv',
|
|
185
|
+
shaderLocation: ShaderLocation.UV,
|
|
172
186
|
buffer: {
|
|
173
187
|
// give the WebGL driver a hint that this buffer may change
|
|
174
188
|
usage: gl.DYNAMIC_DRAW,
|
package/es/point/models/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import EarthExtrudeModel from "./earthExtrude";
|
|
|
4
4
|
import EarthFillModel from "./earthFill";
|
|
5
5
|
import ExtrudeModel from "./extrude";
|
|
6
6
|
import FillModel from "./fill";
|
|
7
|
-
import FillImageModel from "./
|
|
7
|
+
import FillImageModel from "./fillImage";
|
|
8
8
|
import IMageModel from "./image";
|
|
9
9
|
import NormalModel from "./normal";
|
|
10
10
|
import Radar from "./radar";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IEncodeFeature, IModel
|
|
1
|
+
import type { IEncodeFeature, IModel } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
|
-
import { IPointLayerStyleOptions } from '../../core/interface';
|
|
3
|
+
import type { IPointLayerStyleOptions } from '../../core/interface';
|
|
4
4
|
export declare function PointTriangulation(feature: IEncodeFeature): {
|
|
5
5
|
vertices: number[];
|
|
6
6
|
indices: number[];
|
|
@@ -8,7 +8,13 @@ export declare function PointTriangulation(feature: IEncodeFeature): {
|
|
|
8
8
|
};
|
|
9
9
|
export default class NormalModel extends BaseModel {
|
|
10
10
|
getDefaultStyle(): Partial<IPointLayerStyleOptions>;
|
|
11
|
-
|
|
11
|
+
protected getCommonUniformsInfo(): {
|
|
12
|
+
uniformsArray: number[];
|
|
13
|
+
uniformsLength: number;
|
|
14
|
+
uniformsOption: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
12
18
|
initModels(): Promise<IModel[]>;
|
|
13
19
|
buildModels(): Promise<IModel[]>;
|
|
14
20
|
clearModels(): void;
|
|
@@ -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 _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -12,9 +11,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
11
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
13
12
|
import BaseModel from "../../core/BaseModel";
|
|
14
13
|
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
15
|
-
/* babel-plugin-inline-import '../shaders/normal_frag.glsl' */
|
|
14
|
+
/* babel-plugin-inline-import '../shaders/normal/normal_frag.glsl' */
|
|
16
15
|
var normalFrag = "in vec4 v_color;\nout vec4 outputColor;\nvoid main() {\n outputColor = v_color;\n}";
|
|
17
|
-
/* babel-plugin-inline-import '../shaders/normal_vert.glsl' */
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/normal/normal_vert.glsl' */
|
|
18
17
|
var normalVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\n\nlayout(std140) uniform u_Common {\n float u_size_scale;\n};\n\nout vec4 v_color;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(a_Position, 1.0);\n } else {\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2., -a_Size /2., 0., 0.);\n gl_Position = project_common_position_to_clipspace(project_pos);\n }\n\n gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio;\n}\n";
|
|
19
18
|
export function PointTriangulation(feature) {
|
|
20
19
|
var coordinates = feature.coordinates;
|
|
@@ -39,21 +38,13 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
40
|
}, {
|
|
42
|
-
key: "
|
|
43
|
-
value: function
|
|
44
|
-
var
|
|
45
|
-
// FIXME: No need to update each frame
|
|
46
|
-
this.uniformBuffers[0].subData({
|
|
47
|
-
offset: 0,
|
|
48
|
-
data: new Uint8Array(new Float32Array([].concat(_toConsumableArray(attributes.u_stroke), _toConsumableArray(attributes.u_offsets), [attributes.u_opacity, attributes.u_rotation])).buffer)
|
|
49
|
-
});
|
|
50
|
-
this.uniformBuffers[1].subData({
|
|
51
|
-
offset: 0,
|
|
52
|
-
data: new Uint8Array(new Float32Array([0.5]).buffer)
|
|
53
|
-
});
|
|
54
|
-
return _objectSpread({
|
|
41
|
+
key: "getCommonUniformsInfo",
|
|
42
|
+
value: function getCommonUniformsInfo() {
|
|
43
|
+
var commonOptions = {
|
|
55
44
|
u_size_scale: 0.5
|
|
56
|
-
}
|
|
45
|
+
};
|
|
46
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
47
|
+
return commonBufferInfo;
|
|
57
48
|
}
|
|
58
49
|
}, {
|
|
59
50
|
key: "initModels",
|
|
@@ -78,21 +69,13 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
78
69
|
key: "buildModels",
|
|
79
70
|
value: function () {
|
|
80
71
|
var _buildModels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
81
|
-
var
|
|
72
|
+
var model;
|
|
82
73
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
83
74
|
while (1) switch (_context2.prev = _context2.next) {
|
|
84
75
|
case 0:
|
|
85
76
|
this.layer.triangulation = PointTriangulation;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
isUBO: true
|
|
89
|
-
});
|
|
90
|
-
commonBuffer = this.rendererService.createBuffer({
|
|
91
|
-
data: new Float32Array(4),
|
|
92
|
-
isUBO: true
|
|
93
|
-
});
|
|
94
|
-
this.uniformBuffers.push(uniformBuffer, commonBuffer);
|
|
95
|
-
_context2.next = 6;
|
|
77
|
+
this.initUniformsBuffer();
|
|
78
|
+
_context2.next = 4;
|
|
96
79
|
return this.layer.buildLayerModel({
|
|
97
80
|
moduleName: 'pointNormal',
|
|
98
81
|
vertexShader: normalVert,
|
|
@@ -105,10 +88,10 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
105
88
|
primitive: gl.POINTS,
|
|
106
89
|
pick: false
|
|
107
90
|
});
|
|
108
|
-
case
|
|
91
|
+
case 4:
|
|
109
92
|
model = _context2.sent;
|
|
110
93
|
return _context2.abrupt("return", [model]);
|
|
111
|
-
case
|
|
94
|
+
case 6:
|
|
112
95
|
case "end":
|
|
113
96
|
return _context2.stop();
|
|
114
97
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { IAnimateOption, IAttribute, IElements, IModel, IModelUniform } from '@antv/l7-core';
|
|
1
|
+
import type { IAnimateOption, IAttribute, IElements, IModel, IModelUniform } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class RadarModel extends BaseModel {
|
|
4
|
-
|
|
4
|
+
protected getCommonUniformsInfo(): {
|
|
5
|
+
uniformsArray: number[];
|
|
6
|
+
uniformsLength: number;
|
|
7
|
+
uniformsOption: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
5
11
|
getAnimateUniforms(): IModelUniform;
|
|
6
12
|
getAttribute(): {
|
|
7
13
|
attributes: {
|