@antv/l7-layers 2.20.5 → 2.20.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/canvas/index.d.ts +3 -3
- package/es/citybuliding/models/build.d.ts +7 -12
- package/es/citybuliding/models/build.js +22 -11
- package/es/citybuliding/shaders/build_frag.glsl +26 -23
- package/es/citybuliding/shaders/build_vert.glsl +24 -16
- package/es/core/BaseLayer.d.ts +14 -2
- package/es/core/BaseLayer.js +53 -9
- package/es/core/BaseModel.d.ts +1 -1
- package/es/core/BaseModel.js +41 -15
- package/es/core/CommonStyleAttribute.d.ts +4 -2
- package/es/core/CommonStyleAttribute.js +3 -0
- package/es/core/LayerPickService.d.ts +1 -1
- package/es/core/TextureService.d.ts +2 -2
- package/es/core/interface.d.ts +7 -3
- package/es/core/interface.js +0 -1
- package/es/core/line_trangluation.d.ts +1 -1
- package/es/core/shape/arrow.d.ts +1 -1
- package/es/core/shape/extrude.d.ts +1 -1
- package/es/core/triangulation.d.ts +1 -1
- package/es/core/triangulation.js +13 -7
- package/es/core/utils.js +1 -1
- package/es/earth/index.d.ts +1 -1
- package/es/earth/models/atmosphere.d.ts +8 -2
- package/es/earth/models/atmosphere.js +15 -8
- package/es/earth/models/base.d.ts +8 -2
- package/es/earth/models/base.js +21 -12
- package/es/earth/models/bloomsphere.d.ts +8 -2
- package/es/earth/models/bloomsphere.js +15 -8
- package/es/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -0
- package/es/earth/shaders/base/base_frag.glsl +11 -0
- package/es/earth/shaders/base/base_vert.glsl +52 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +16 -0
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
- package/es/geometry/index.d.ts +2 -2
- package/es/geometry/models/billboard.d.ts +8 -1
- package/es/geometry/models/billboard.js +26 -11
- package/es/geometry/models/plane.d.ts +8 -1
- package/es/geometry/models/plane.js +23 -6
- package/es/geometry/models/sprite.d.ts +12 -2
- package/es/geometry/models/sprite.js +44 -18
- package/es/geometry/shaders/billboard_frag.glsl +11 -6
- package/es/geometry/shaders/billboard_vert.glsl +12 -15
- package/es/geometry/shaders/plane_frag.glsl +14 -10
- package/es/geometry/shaders/plane_vert.glsl +11 -10
- package/es/geometry/shaders/sprite_frag.glsl +11 -7
- package/es/geometry/shaders/sprite_vert.glsl +10 -9
- package/es/heatmap/index.d.ts +3 -3
- package/es/heatmap/models/grid.d.ts +8 -1
- package/es/heatmap/models/grid.js +25 -12
- package/es/heatmap/models/grid3d.d.ts +8 -1
- package/es/heatmap/models/grid3d.js +29 -13
- package/es/heatmap/models/heatmap.d.ts +6 -4
- package/es/heatmap/models/heatmap.js +123 -75
- package/es/heatmap/models/hexagon.d.ts +8 -1
- package/es/heatmap/models/hexagon.js +25 -12
- package/es/heatmap/shaders/grid/grid_frag.glsl +8 -0
- package/es/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
- package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
- package/{lib/heatmap/shaders/hexagon_3d_vert.glsl → es/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
- package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
- package/es/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
- package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
- package/{lib/heatmap/shaders → es/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
- package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/es/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
- package/es/image/index.d.ts +2 -2
- package/es/image/models/image.d.ts +9 -2
- package/es/image/models/image.js +83 -44
- package/es/image/shaders/image_frag.glsl +34 -7
- package/es/image/shaders/image_vert.glsl +11 -5
- package/es/line/index.d.ts +4 -4
- package/es/line/index.js +2 -1
- package/es/line/models/arc.d.ts +8 -3
- package/es/line/models/arc.js +57 -76
- package/es/line/models/arc_3d.d.ts +8 -3
- package/es/line/models/arc_3d.js +46 -57
- package/es/line/models/flow.d.ts +8 -2
- package/es/line/models/flow.js +14 -12
- package/es/line/models/great_circle.d.ts +8 -3
- package/es/line/models/great_circle.js +40 -29
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +3 -6
- package/es/line/models/line.d.ts +8 -3
- package/es/line/models/line.js +67 -140
- package/es/line/models/{simpleLine.d.ts → simple_line.d.ts} +8 -2
- package/es/line/models/simple_line.js +204 -0
- package/es/line/models/wall.d.ts +8 -3
- package/es/line/models/wall.js +35 -27
- package/es/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
- package/es/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
- package/es/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
- package/{lib/line/shaders → es/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
- package/es/line/shaders/flow/flow_line_frag.glsl +5 -4
- package/es/line/shaders/flow/flow_line_vert.glsl +17 -18
- package/es/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
- package/{lib/line/shaders → es/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
- package/es/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
- package/es/line/shaders/line/line_vert.glsl +114 -0
- package/es/line/shaders/simple/simpleline_frag.glsl +27 -3
- package/es/line/shaders/simple/simpleline_vert.glsl +20 -20
- package/es/line/shaders/wall/wall_frag.glsl +31 -26
- package/es/line/shaders/wall/wall_vert.glsl +29 -22
- package/es/mask/index.d.ts +2 -2
- package/es/mask/models/fill.d.ts +1 -1
- package/es/plugins/DataMappingPlugin.d.ts +1 -1
- package/es/plugins/DataMappingPlugin.js +1 -3
- package/es/plugins/DataSourcePlugin.d.ts +1 -1
- package/es/plugins/FeatureScalePlugin.d.ts +1 -1
- package/es/plugins/FeatureScalePlugin.js +14 -3
- package/es/plugins/LayerAnimateStylePlugin.d.ts +1 -1
- package/es/plugins/LayerMaskPlugin.d.ts +1 -1
- package/es/plugins/LayerModelPlugin.d.ts +1 -1
- package/es/plugins/LayerStylePlugin.d.ts +1 -1
- package/es/plugins/LightingPlugin.d.ts +1 -1
- package/es/plugins/MultiPassRendererPlugin.d.ts +1 -1
- package/es/plugins/PixelPickingPlugin.d.ts +6 -2
- package/es/plugins/PixelPickingPlugin.js +36 -49
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +1 -1
- package/es/plugins/ShaderUniformPlugin.d.ts +1 -1
- package/es/plugins/ShaderUniformPlugin.js +11 -6
- package/es/plugins/UpdateModelPlugin.d.ts +1 -1
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +1 -1
- package/es/point/index.d.ts +2 -2
- package/es/point/index.js +1 -0
- package/es/point/models/billboard_point.d.ts +9 -3
- package/es/point/models/billboard_point.js +18 -18
- package/es/point/models/earthExtrude.d.ts +7 -12
- package/es/point/models/earthExtrude.js +21 -13
- package/es/point/models/earthFill.d.ts +8 -3
- package/es/point/models/earthFill.js +18 -30
- package/es/point/models/extrude.d.ts +1 -4
- package/es/point/models/extrude.js +2 -11
- package/es/point/models/fill.d.ts +8 -2
- package/es/point/models/fill.js +33 -84
- package/es/point/models/{fillmage.d.ts → fillImage.d.ts} +8 -2
- package/es/point/models/{fillmage.js → fillImage.js} +23 -15
- package/es/point/models/image.d.ts +8 -1
- package/es/point/models/image.js +31 -17
- package/es/point/models/index.js +1 -1
- package/es/point/models/normal.d.ts +9 -3
- package/es/point/models/normal.js +13 -30
- package/es/point/models/radar.d.ts +8 -2
- package/es/point/models/radar.js +23 -45
- package/es/point/models/text.d.ts +9 -2
- package/es/point/models/text.js +31 -32
- package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
- package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
- package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/{lib/point/shaders/earth/extrude_vert.glsl → es/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
- package/{lib/point/shaders/earth/fill_frag.glsl → es/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
- package/{lib/point/shaders/earth/fill_vert.glsl → es/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
- package/es/point/shaders/extrude/extrude_vert.glsl +0 -3
- package/{lib/point/shaders → es/point/shaders/fill}/fill_frag.glsl +18 -1
- package/es/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
- package/es/point/shaders/fillImage/fillImage_frag.glsl +24 -0
- package/{lib/point/shaders/image → es/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
- package/es/point/shaders/image/image_frag.glsl +42 -0
- package/{lib/point/shaders → es/point/shaders/image}/image_vert.glsl +14 -13
- package/es/point/shaders/radar/radar_frag.glsl +19 -14
- package/es/point/shaders/radar/radar_vert.glsl +21 -24
- package/es/point/shaders/text/text_frag.glsl +44 -0
- package/es/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
- package/es/point/shape/extrude.d.ts +1 -1
- package/es/polygon/index.d.ts +2 -2
- package/es/polygon/models/extrude.d.ts +9 -9
- package/es/polygon/models/extrude.js +38 -15
- package/es/polygon/models/extrusion.d.ts +8 -1
- package/es/polygon/models/extrusion.js +24 -7
- package/es/polygon/models/fill.d.ts +9 -4
- package/es/polygon/models/fill.js +26 -13
- package/es/polygon/models/ocean.d.ts +9 -7
- package/es/polygon/models/ocean.js +30 -14
- package/es/polygon/models/water.d.ts +9 -4
- package/es/polygon/models/water.js +26 -10
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
- package/es/polygon/shaders/fill/fill_frag.glsl +7 -0
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
- package/{lib/polygon/shaders/polygon_linear_vert.glsl → es/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
- package/es/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
- package/es/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
- package/es/polygon/shaders/ocean/ocean_vert.glsl +22 -0
- package/es/polygon/shaders/water/polygon_water_frag.glsl +14 -12
- package/es/polygon/shaders/water/polygon_water_vert.glsl +10 -10
- package/es/raster/buffers/triangulation.d.ts +1 -1
- package/es/raster/index.d.ts +2 -2
- package/es/raster/models/raster.d.ts +9 -8
- package/es/raster/models/raster.js +54 -38
- package/es/raster/models/rasterRgb.d.ts +9 -7
- package/es/raster/models/rasterRgb.js +36 -19
- package/es/raster/models/rasterTerrainRgb.d.ts +1 -1
- package/es/raster/models/rasterTerrainRgb.js +2 -2
- package/es/raster/shaders/raster/raster_2d_frag.glsl +34 -0
- package/es/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/es/tile/core/BaseLayer.d.ts +2 -2
- package/es/tile/core/TileDebugLayer.d.ts +1 -1
- package/es/tile/interaction/getRasterData.d.ts +2 -2
- package/es/tile/interaction/utils.d.ts +1 -1
- package/es/tile/interface.d.ts +2 -2
- package/es/tile/service/TileLayerService.d.ts +2 -2
- package/es/tile/service/TilePickService.d.ts +2 -2
- package/es/tile/service/TileSourceService.d.ts +1 -1
- package/es/tile/tile/Tile.d.ts +2 -3
- package/es/tile/tile/VectorTile.d.ts +1 -1
- package/es/tile/tile/index.d.ts +1 -1
- package/es/tile/utils/constants.js +1 -1
- package/es/tile/utils/utils.d.ts +1 -1
- package/es/utils/blend.d.ts +1 -1
- package/es/utils/multiPassRender.d.ts +1 -1
- package/es/utils/stencil.d.ts +1 -1
- package/es/wind/index.d.ts +3 -3
- package/es/wind/models/wind.d.ts +1 -1
- package/lib/citybuliding/models/build.js +22 -11
- package/lib/citybuliding/shaders/build_frag.glsl +26 -23
- package/lib/citybuliding/shaders/build_vert.glsl +24 -16
- package/lib/core/BaseLayer.js +53 -9
- package/lib/core/BaseModel.js +41 -15
- package/lib/core/CommonStyleAttribute.js +3 -0
- package/lib/core/triangulation.js +12 -6
- package/lib/core/utils.js +1 -1
- package/lib/earth/models/atmosphere.js +15 -8
- package/lib/earth/models/base.js +21 -12
- package/lib/earth/models/bloomsphere.js +15 -8
- package/lib/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -0
- package/lib/earth/shaders/base/base_frag.glsl +11 -0
- package/lib/earth/shaders/base/base_vert.glsl +52 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +16 -0
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
- package/lib/geometry/models/billboard.js +26 -11
- package/lib/geometry/models/plane.js +23 -6
- package/lib/geometry/models/sprite.js +44 -18
- package/lib/geometry/shaders/billboard_frag.glsl +11 -6
- package/lib/geometry/shaders/billboard_vert.glsl +12 -15
- package/lib/geometry/shaders/plane_frag.glsl +14 -10
- package/lib/geometry/shaders/plane_vert.glsl +11 -10
- package/lib/geometry/shaders/sprite_frag.glsl +11 -7
- package/lib/geometry/shaders/sprite_vert.glsl +10 -9
- package/lib/heatmap/models/grid.js +25 -12
- package/lib/heatmap/models/grid3d.js +29 -13
- package/lib/heatmap/models/heatmap.js +122 -74
- package/lib/heatmap/models/hexagon.js +25 -12
- package/lib/heatmap/shaders/grid/grid_frag.glsl +8 -0
- package/lib/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
- package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
- package/{es/heatmap/shaders/hexagon_3d_vert.glsl → lib/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
- package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
- package/lib/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
- package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
- package/{es/heatmap/shaders → lib/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
- package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
- package/lib/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
- package/lib/image/models/image.js +83 -44
- package/lib/image/shaders/image_frag.glsl +34 -7
- package/lib/image/shaders/image_vert.glsl +11 -5
- package/lib/line/index.js +2 -1
- package/lib/line/models/arc.js +57 -76
- package/lib/line/models/arc_3d.js +47 -59
- package/lib/line/models/flow.js +14 -12
- package/lib/line/models/great_circle.js +40 -29
- package/lib/line/models/index.js +4 -7
- package/lib/line/models/line.js +67 -142
- package/lib/line/models/{simpleLine.js → simple_line.js} +84 -74
- package/lib/line/models/wall.js +35 -27
- package/lib/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
- package/lib/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
- package/lib/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
- package/{es/line/shaders → lib/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
- package/lib/line/shaders/flow/flow_line_frag.glsl +5 -4
- package/lib/line/shaders/flow/flow_line_vert.glsl +17 -18
- package/lib/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
- package/{es/line/shaders → lib/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
- package/lib/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
- package/lib/line/shaders/line/line_vert.glsl +114 -0
- package/lib/line/shaders/simple/simpleline_frag.glsl +27 -3
- package/lib/line/shaders/simple/simpleline_vert.glsl +20 -20
- package/lib/line/shaders/wall/wall_frag.glsl +31 -26
- package/lib/line/shaders/wall/wall_vert.glsl +29 -22
- package/lib/plugins/DataMappingPlugin.js +1 -3
- package/lib/plugins/FeatureScalePlugin.js +14 -3
- package/lib/plugins/PixelPickingPlugin.js +35 -48
- package/lib/plugins/ShaderUniformPlugin.js +11 -6
- package/lib/point/index.js +1 -0
- package/lib/point/models/billboard_point.js +18 -18
- package/lib/point/models/earthExtrude.js +21 -13
- package/lib/point/models/earthFill.js +18 -30
- package/lib/point/models/extrude.js +2 -11
- package/lib/point/models/fill.js +33 -84
- package/lib/point/models/{fillmage.js → fillImage.js} +24 -17
- package/lib/point/models/image.js +31 -17
- package/lib/point/models/index.js +2 -2
- package/lib/point/models/normal.js +13 -30
- package/lib/point/models/radar.js +23 -45
- package/lib/point/models/text.js +31 -32
- package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
- package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
- package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
- package/{es/point/shaders/earth/extrude_vert.glsl → lib/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
- package/{es/point/shaders/earth/fill_frag.glsl → lib/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
- package/{es/point/shaders/earth/fill_vert.glsl → lib/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
- package/lib/point/shaders/extrude/extrude_vert.glsl +0 -3
- package/{es/point/shaders → lib/point/shaders/fill}/fill_frag.glsl +18 -1
- package/lib/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
- package/lib/point/shaders/fillImage/fillImage_frag.glsl +24 -0
- package/{es/point/shaders/image → lib/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
- package/lib/point/shaders/image/image_frag.glsl +42 -0
- package/{es/point/shaders → lib/point/shaders/image}/image_vert.glsl +14 -13
- package/lib/point/shaders/radar/radar_frag.glsl +19 -14
- package/lib/point/shaders/radar/radar_vert.glsl +21 -24
- package/lib/point/shaders/text/text_frag.glsl +44 -0
- package/lib/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
- package/lib/polygon/models/extrude.js +38 -15
- package/lib/polygon/models/extrusion.js +24 -7
- package/lib/polygon/models/fill.js +26 -13
- package/lib/polygon/models/ocean.js +30 -14
- package/lib/polygon/models/water.js +26 -10
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
- package/lib/polygon/shaders/fill/fill_frag.glsl +7 -0
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
- package/{es/polygon/shaders/polygon_linear_vert.glsl → lib/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
- package/lib/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
- package/lib/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +22 -0
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +14 -12
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +10 -10
- package/lib/raster/models/raster.js +54 -38
- package/lib/raster/models/rasterRgb.js +36 -19
- package/lib/raster/models/rasterTerrainRgb.js +2 -2
- package/lib/raster/shaders/raster/raster_2d_frag.glsl +34 -0
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +21 -0
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
- package/lib/tile/utils/constants.js +1 -1
- package/package.json +7 -7
- package/es/earth/shaders/atmosphere_vert.glsl +0 -26
- package/es/earth/shaders/base_frag.glsl +0 -13
- package/es/earth/shaders/base_vert.glsl +0 -52
- package/es/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/es/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/es/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/es/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/es/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/es/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/es/line/models/earthArc_3d.d.ts +0 -17
- package/es/line/models/earthArc_3d.js +0 -285
- package/es/line/models/linearline.d.ts +0 -11
- package/es/line/models/linearline.js +0 -241
- package/es/line/models/simpleLine.js +0 -194
- package/es/line/shaders/arc_chunks.vert.glsl +0 -21
- package/es/line/shaders/dash/arc_dash_frag.glsl +0 -21
- package/es/line/shaders/dash/arc_dash_vert.glsl +0 -102
- package/es/line/shaders/dash/line_dash_frag.glsl +0 -27
- package/es/line/shaders/dash/line_dash_vert.glsl +0 -82
- package/es/line/shaders/line_arc2d_vert.glsl +0 -114
- package/es/line/shaders/line_bezier_vert.glsl +0 -85
- package/es/line/shaders/line_vert.glsl +0 -165
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
- package/es/line/shaders/linear/arc_linear_frag.glsl +0 -10
- package/es/line/shaders/linear/arc_linear_vert.glsl +0 -98
- package/es/line/shaders/linear/line_linear_frag.glsl +0 -25
- package/es/line/shaders/linearLine/line_linear_frag.glsl +0 -8
- package/es/line/shaders/linearLine/line_linear_vert.glsl +0 -93
- package/es/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
- package/es/point/shaders/animate/wave_frag.glsl +0 -55
- package/es/point/shaders/earth/extrude_frag.glsl +0 -32
- package/es/point/shaders/image/fillImage_frag.glsl +0 -18
- package/es/point/shaders/image_frag.glsl +0 -37
- package/es/point/shaders/text_frag.glsl +0 -39
- package/es/polygon/shaders/polygon_frag.glsl +0 -7
- package/es/polygon/shaders/polygon_linear_frag.glsl +0 -15
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
- package/es/raster/shaders/raster_2d_frag.glsl +0 -32
- package/es/raster/shaders/raster_2d_vert.glsl +0 -13
- package/es/raster/shaders/raster_frag.glsl +0 -11
- package/es/raster/shaders/raster_rgb_frag.glsl +0 -20
- package/es/raster/shaders/raster_vert.glsl +0 -34
- package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
- package/lib/earth/shaders/base_frag.glsl +0 -13
- package/lib/earth/shaders/base_vert.glsl +0 -52
- package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
- package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
- package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
- package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
- package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
- package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
- package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
- package/lib/line/models/earthArc_3d.js +0 -291
- package/lib/line/models/linearline.js +0 -247
- package/lib/line/shaders/arc_chunks.vert.glsl +0 -21
- package/lib/line/shaders/dash/arc_dash_frag.glsl +0 -21
- package/lib/line/shaders/dash/arc_dash_vert.glsl +0 -102
- package/lib/line/shaders/dash/line_dash_frag.glsl +0 -27
- package/lib/line/shaders/dash/line_dash_vert.glsl +0 -82
- package/lib/line/shaders/line_arc2d_vert.glsl +0 -114
- package/lib/line/shaders/line_bezier_vert.glsl +0 -85
- package/lib/line/shaders/line_vert.glsl +0 -165
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
- package/lib/line/shaders/linear/arc_linear_frag.glsl +0 -10
- package/lib/line/shaders/linear/arc_linear_vert.glsl +0 -98
- package/lib/line/shaders/linear/line_linear_frag.glsl +0 -25
- package/lib/line/shaders/linearLine/line_linear_frag.glsl +0 -8
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +0 -93
- package/lib/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
- package/lib/point/shaders/animate/wave_frag.glsl +0 -55
- package/lib/point/shaders/earth/extrude_frag.glsl +0 -32
- package/lib/point/shaders/image/fillImage_frag.glsl +0 -18
- package/lib/point/shaders/image_frag.glsl +0 -37
- package/lib/point/shaders/text_frag.glsl +0 -39
- package/lib/polygon/shaders/polygon_frag.glsl +0 -7
- package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -15
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
- package/lib/raster/shaders/raster_2d_frag.glsl +0 -32
- package/lib/raster/shaders/raster_2d_vert.glsl +0 -13
- package/lib/raster/shaders/raster_frag.glsl +0 -11
- package/lib/raster/shaders/raster_rgb_frag.glsl +0 -20
- package/lib/raster/shaders/raster_vert.glsl +0 -34
- /package/es/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
- /package/es/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
- /package/es/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
- /package/es/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
- /package/lib/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
- /package/lib/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
- /package/lib/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
- /package/lib/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
package/es/core/interface.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IAnimateOption, IMapService, ITexture2D, StyleAttributeField, StyleAttributeOption } from '@antv/l7-core';
|
|
2
|
-
import { IColorRamp } from '@antv/l7-utils';
|
|
3
|
-
import { anchorType } from '../utils/symbol-layout';
|
|
1
|
+
import type { IAnimateOption, IMapService, ITexture2D, StyleAttributeField, StyleAttributeOption } from '@antv/l7-core';
|
|
2
|
+
import type { IColorRamp } from '@antv/l7-utils';
|
|
3
|
+
import type { anchorType } from '../utils/symbol-layout';
|
|
4
4
|
export declare enum lineStyleType {
|
|
5
5
|
'solid' = 0,
|
|
6
6
|
'dash' = 1
|
|
@@ -147,6 +147,10 @@ export interface IImageLayerStyleOptions extends IBaseLayerStyleOptions {
|
|
|
147
147
|
clampHigh?: boolean;
|
|
148
148
|
rampColors?: IColorRamp;
|
|
149
149
|
colorTexture?: ITexture2D;
|
|
150
|
+
brightness?: number;
|
|
151
|
+
contrast?: number;
|
|
152
|
+
saturation?: number;
|
|
153
|
+
gamma?: number;
|
|
150
154
|
}
|
|
151
155
|
export interface ICityBuildLayerStyleOptions {
|
|
152
156
|
opacity: number;
|
package/es/core/interface.js
CHANGED
package/es/core/shape/arrow.d.ts
CHANGED
package/es/core/triangulation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import { calculateCentroid, calculatePointsCenterAndRadius, lngLatToMeters } from '@antv/l7-utils';
|
|
3
|
+
import { calculateCentroid, calculatePointsCenterAndRadius, lngLatToMeters, aProjectFlat } from '@antv/l7-utils';
|
|
4
4
|
import earcut from 'earcut';
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import { vec3 } from 'gl-matrix';
|
|
@@ -162,7 +162,8 @@ export function FlowLineFillTriangulation(feature) {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
export function SimpleLineTriangulation(feature) {
|
|
165
|
-
var coordinates = feature.coordinates
|
|
165
|
+
var coordinates = feature.coordinates,
|
|
166
|
+
originCoordinates = feature.originCoordinates;
|
|
166
167
|
var pos = [];
|
|
167
168
|
if (!Array.isArray(coordinates[0])) {
|
|
168
169
|
return {
|
|
@@ -173,7 +174,7 @@ export function SimpleLineTriangulation(feature) {
|
|
|
173
174
|
count: 0
|
|
174
175
|
};
|
|
175
176
|
}
|
|
176
|
-
var _getSimpleLineVertice = getSimpleLineVertices(coordinates),
|
|
177
|
+
var _getSimpleLineVertice = getSimpleLineVertices(coordinates, originCoordinates),
|
|
177
178
|
results = _getSimpleLineVertice.results,
|
|
178
179
|
totalDistance = _getSimpleLineVertice.totalDistance;
|
|
179
180
|
results.map(function (point) {
|
|
@@ -224,12 +225,17 @@ function pushDis(point, n) {
|
|
|
224
225
|
}
|
|
225
226
|
return point;
|
|
226
227
|
}
|
|
227
|
-
function getSimpleLineVertices(coordinates) {
|
|
228
|
+
function getSimpleLineVertices(coordinates, originCoordinates) {
|
|
228
229
|
var points = coordinates;
|
|
230
|
+
//除了amap2.0以外 coordinates就是经纬度数据
|
|
231
|
+
var originPoints = originCoordinates || coordinates;
|
|
229
232
|
if (Array.isArray(points) && Array.isArray(points[0]) && Array.isArray(points[0][0])) {
|
|
230
233
|
// @ts-ignore
|
|
231
|
-
points =
|
|
234
|
+
points = originCoordinates.flat();
|
|
235
|
+
// @ts-ignore
|
|
236
|
+
originPoints = originCoordinates.flat();
|
|
232
237
|
}
|
|
238
|
+
//修改计算距离的方式,与普通线的计算方式保持一致 edit by huyang 20231214
|
|
233
239
|
var distance = 0;
|
|
234
240
|
if (points.length < 2) {
|
|
235
241
|
return {
|
|
@@ -241,13 +247,13 @@ function getSimpleLineVertices(coordinates) {
|
|
|
241
247
|
var point = pushDis(points[0], distance);
|
|
242
248
|
results.push(point);
|
|
243
249
|
for (var i = 1; i < points.length - 1; i++) {
|
|
244
|
-
var subDistance = lineSegmentDistance(
|
|
250
|
+
var subDistance = lineSegmentDistance(aProjectFlat(originPoints[i - 1]), aProjectFlat(originPoints[i]));
|
|
245
251
|
distance += subDistance;
|
|
246
252
|
var mulPoint = pushDis(points[i], distance);
|
|
247
253
|
results.push(mulPoint);
|
|
248
254
|
results.push(mulPoint);
|
|
249
255
|
}
|
|
250
|
-
var pointDistance = lineSegmentDistance(
|
|
256
|
+
var pointDistance = lineSegmentDistance(aProjectFlat(originPoints[originPoints.length - 2]), aProjectFlat(originPoints[originPoints.length - 1]));
|
|
251
257
|
distance += pointDistance;
|
|
252
258
|
results.push(pushDis(points[points.length - 1], distance));
|
|
253
259
|
return {
|
package/es/core/utils.js
CHANGED
package/es/earth/index.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { IModel
|
|
1
|
+
import type { IModel } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class EarthAtomSphereModel extends BaseModel {
|
|
4
|
-
|
|
4
|
+
protected getCommonUniformsInfo(): {
|
|
5
|
+
uniformsArray: number[];
|
|
6
|
+
uniformsLength: number;
|
|
7
|
+
uniformsOption: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
5
11
|
initModels(): Promise<IModel[]>;
|
|
6
12
|
clearModels(): string;
|
|
7
13
|
buildModels(): Promise<IModel[]>;
|
|
@@ -11,10 +11,11 @@ import { AttributeType, gl } from '@antv/l7-core';
|
|
|
11
11
|
import { lodashUtil } from '@antv/l7-utils';
|
|
12
12
|
import BaseModel from "../../core/BaseModel";
|
|
13
13
|
import { earthTriangulation } from "../../core/triangulation";
|
|
14
|
-
/* babel-plugin-inline-import '../shaders/atmosphere_frag.glsl' */
|
|
15
|
-
var atmoSphereFrag = "\
|
|
16
|
-
/* babel-plugin-inline-import '../shaders/atmosphere_vert.glsl' */
|
|
17
|
-
var atmoSphereVert = "
|
|
14
|
+
/* babel-plugin-inline-import '../shaders/atmosphere/atmosphere_frag.glsl' */
|
|
15
|
+
var atmoSphereFrag = "\nlayout(std140) uniform commonUniforms {\n float u_opacity;\n};\nin vec3 vVertexNormal;\nin float v_offset;\nin vec4 v_Color;\n\n#pragma include \"scene_uniforms\"\nout vec4 outputColor;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/atmosphere/atmosphere_vert.glsl' */
|
|
17
|
+
var atmoSphereVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) vec4 a_Color;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_Uv;\nlayout(std140) uniform commonUniforms {\n float u_opacity;\n};\n#pragma include \"scene_uniforms\"\nout vec3 vVertexNormal;\nout vec4 v_Color;\nout float v_offset;\n\nvoid main() {\n float EARTH_RADIUS = 100.0;\n \n v_Color = a_Color;\n\n v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
|
|
18
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
18
19
|
var isNumber = lodashUtil.isNumber;
|
|
19
20
|
var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
20
21
|
_inherits(EarthAtomSphereModel, _BaseModel);
|
|
@@ -24,14 +25,16 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
24
25
|
return _super.apply(this, arguments);
|
|
25
26
|
}
|
|
26
27
|
_createClass(EarthAtomSphereModel, [{
|
|
27
|
-
key: "
|
|
28
|
-
value: function
|
|
28
|
+
key: "getCommonUniformsInfo",
|
|
29
|
+
value: function getCommonUniformsInfo() {
|
|
29
30
|
var _ref = this.layer.getLayerConfig(),
|
|
30
31
|
_ref$opacity = _ref.opacity,
|
|
31
32
|
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
|
|
32
|
-
|
|
33
|
+
var commonOptions = {
|
|
33
34
|
u_opacity: isNumber(opacity) ? opacity : 1.0
|
|
34
35
|
};
|
|
36
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
37
|
+
return commonBufferInfo;
|
|
35
38
|
}
|
|
36
39
|
}, {
|
|
37
40
|
key: "initModels",
|
|
@@ -40,8 +43,9 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
40
43
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
41
44
|
while (1) switch (_context.prev = _context.next) {
|
|
42
45
|
case 0:
|
|
46
|
+
this.initUniformsBuffer();
|
|
43
47
|
return _context.abrupt("return", this.buildModels());
|
|
44
|
-
case
|
|
48
|
+
case 2:
|
|
45
49
|
case "end":
|
|
46
50
|
return _context.stop();
|
|
47
51
|
}
|
|
@@ -101,6 +105,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
101
105
|
type: AttributeType.Attribute,
|
|
102
106
|
descriptor: {
|
|
103
107
|
name: 'a_Size',
|
|
108
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
104
109
|
buffer: {
|
|
105
110
|
usage: gl.DYNAMIC_DRAW,
|
|
106
111
|
data: [],
|
|
@@ -119,6 +124,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
119
124
|
type: AttributeType.Attribute,
|
|
120
125
|
descriptor: {
|
|
121
126
|
name: 'a_Normal',
|
|
127
|
+
shaderLocation: ShaderLocation.NORMAL,
|
|
122
128
|
buffer: {
|
|
123
129
|
usage: gl.STATIC_DRAW,
|
|
124
130
|
data: [],
|
|
@@ -135,6 +141,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
135
141
|
type: AttributeType.Attribute,
|
|
136
142
|
descriptor: {
|
|
137
143
|
name: 'a_Uv',
|
|
144
|
+
shaderLocation: ShaderLocation.UV,
|
|
138
145
|
buffer: {
|
|
139
146
|
usage: gl.DYNAMIC_DRAW,
|
|
140
147
|
data: [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IModel,
|
|
1
|
+
import type { IModel, ITexture2D } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class BaseEarthModel extends BaseModel {
|
|
4
4
|
protected texture: ITexture2D;
|
|
@@ -7,7 +7,13 @@ export default class BaseEarthModel extends BaseModel {
|
|
|
7
7
|
private sunY;
|
|
8
8
|
private sunZ;
|
|
9
9
|
private sunRadius;
|
|
10
|
-
|
|
10
|
+
protected getCommonUniformsInfo(): {
|
|
11
|
+
uniformsArray: number[];
|
|
12
|
+
uniformsLength: number;
|
|
13
|
+
uniformsOption: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
11
17
|
setEarthTime(time: number): void;
|
|
12
18
|
initModels(): Promise<IModel[]>;
|
|
13
19
|
clearModels(): string;
|
package/es/earth/models/base.js
CHANGED
|
@@ -12,10 +12,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
13
13
|
import BaseModel from "../../core/BaseModel";
|
|
14
14
|
import { earthTriangulation } from "../../core/triangulation";
|
|
15
|
-
/* babel-plugin-inline-import '../shaders/base_frag.glsl' */
|
|
16
|
-
var baseFrag = "
|
|
17
|
-
/* babel-plugin-inline-import '../shaders/base_vert.glsl' */
|
|
18
|
-
var baseVert = "// attribute vec4 a_Color;\
|
|
15
|
+
/* babel-plugin-inline-import '../shaders/base/base_frag.glsl' */
|
|
16
|
+
var baseFrag = "uniform sampler2D u_texture;\n\nin vec2 v_texCoord;\nin float v_lightWeight;\nout vec4 outputColor;\n\nvoid main() {\n vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y));\n color.xyz = color.xyz * v_lightWeight;\n outputColor = color;\n}\n";
|
|
17
|
+
/* babel-plugin-inline-import '../shaders/base/base_vert.glsl' */
|
|
18
|
+
var baseVert = "// attribute vec4 a_Color;\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_Uv;\n\n// attribute vec2 a_Extrude;\n// attribute float a_Size;\n// attribute float a_Shape;\n\nlayout(std140) uniform commonUniforms {\n\tvec4 u_sunLight: [1.0, -10.5, 12.0,0.0];\n\tfloat u_ambientRatio : 0.5;\n\tfloat u_diffuseRatio : 0.3;\n\tfloat u_specularRatio : 0.2;\n};\n\n#pragma include \"scene_uniforms\"\n\nout vec2 v_texCoord;\nout float v_lightWeight;\n\nfloat calc_lighting(vec4 pos) {\n\n\tvec3 worldPos = vec3(pos * u_ModelMatrix);\n\n\tvec3 worldNormal = a_Normal;\n\n\t// cal light weight\n\tvec3 viewDir = normalize(u_CameraPosition - worldPos);\n\n\tvec3 lightDir = normalize(u_sunLight.xyz);\n\n\tvec3 halfDir = normalize(viewDir+lightDir);\n\t// lambert\n\tfloat lambert = dot(worldNormal, lightDir);\n\t// specular\n\tfloat specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);\n\t//sum to light weight\n\tfloat lightWeight = u_ambientRatio + u_diffuseRatio * lambert + u_specularRatio * specular;\n\n\treturn lightWeight;\n}\n\nvoid main() {\n\n\tv_texCoord = a_Uv;\n\n\tfloat lightWeight = calc_lighting(vec4(a_Position, 1.0));\n\tv_lightWeight = lightWeight;\n\n\tgl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
|
|
19
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
19
20
|
var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
20
21
|
_inherits(BaseEarthModel, _BaseModel);
|
|
21
22
|
var _super = _createSuper(BaseEarthModel);
|
|
@@ -35,8 +36,8 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
35
36
|
return _this;
|
|
36
37
|
}
|
|
37
38
|
_createClass(BaseEarthModel, [{
|
|
38
|
-
key: "
|
|
39
|
-
value: function
|
|
39
|
+
key: "getCommonUniformsInfo",
|
|
40
|
+
value: function getCommonUniformsInfo() {
|
|
40
41
|
var _this$layer$getLayerC = this.layer.getLayerConfig(),
|
|
41
42
|
animateOption = _this$layer$getLayerC.animateOption,
|
|
42
43
|
globalOptions = _this$layer$getLayerC.globalOptions;
|
|
@@ -51,16 +52,19 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
51
52
|
this.sunX = Math.cos(this.earthTime) * (this.sunRadius - this.sunY);
|
|
52
53
|
this.sunZ = Math.sin(this.earthTime) * (this.sunRadius - this.sunY);
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
+
var commonOptions = {
|
|
56
|
+
u_sunLight: [this.sunX, this.sunY, this.sunZ, 0.0],
|
|
55
57
|
u_ambientRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.ambientRatio) || 0.6,
|
|
56
58
|
// 环境光
|
|
57
59
|
u_diffuseRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.diffuseRatio) || 0.4,
|
|
58
60
|
// 漫反射
|
|
59
|
-
u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1
|
|
60
|
-
//
|
|
61
|
-
u_sunLight: [this.sunX, this.sunY, this.sunZ],
|
|
62
|
-
u_texture: this.texture
|
|
61
|
+
u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1 // 高光反射
|
|
62
|
+
// u_texture: this.texture,
|
|
63
63
|
};
|
|
64
|
+
|
|
65
|
+
this.textures = [this.texture];
|
|
66
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
67
|
+
return commonBufferInfo;
|
|
64
68
|
}
|
|
65
69
|
}, {
|
|
66
70
|
key: "setEarthTime",
|
|
@@ -96,10 +100,12 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
96
100
|
width: imageData[0].width,
|
|
97
101
|
height: imageData[0].height
|
|
98
102
|
});
|
|
103
|
+
_this2.textures = [_this2.texture];
|
|
99
104
|
_this2.layerService.reRender();
|
|
100
105
|
});
|
|
106
|
+
this.initUniformsBuffer();
|
|
101
107
|
return _context.abrupt("return", this.buildModels());
|
|
102
|
-
case
|
|
108
|
+
case 8:
|
|
103
109
|
case "end":
|
|
104
110
|
return _context.stop();
|
|
105
111
|
}
|
|
@@ -158,6 +164,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
158
164
|
type: AttributeType.Attribute,
|
|
159
165
|
descriptor: {
|
|
160
166
|
name: 'a_Size',
|
|
167
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
161
168
|
buffer: {
|
|
162
169
|
usage: gl.DYNAMIC_DRAW,
|
|
163
170
|
data: [],
|
|
@@ -176,6 +183,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
176
183
|
type: AttributeType.Attribute,
|
|
177
184
|
descriptor: {
|
|
178
185
|
name: 'a_Normal',
|
|
186
|
+
shaderLocation: ShaderLocation.NORMAL,
|
|
179
187
|
buffer: {
|
|
180
188
|
usage: gl.STATIC_DRAW,
|
|
181
189
|
data: [],
|
|
@@ -192,6 +200,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
192
200
|
type: AttributeType.Attribute,
|
|
193
201
|
descriptor: {
|
|
194
202
|
name: 'a_Uv',
|
|
203
|
+
shaderLocation: ShaderLocation.UV,
|
|
195
204
|
buffer: {
|
|
196
205
|
// give the WebGL driver a hint that this buffer may change
|
|
197
206
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { IModel
|
|
1
|
+
import type { IModel } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class EarthBloomSphereModel extends BaseModel {
|
|
4
|
-
|
|
4
|
+
protected getCommonUniformsInfo(): {
|
|
5
|
+
uniformsArray: number[];
|
|
6
|
+
uniformsLength: number;
|
|
7
|
+
uniformsOption: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
5
11
|
initModels(): Promise<IModel[]>;
|
|
6
12
|
clearModels(): string;
|
|
7
13
|
buildModels(): Promise<IModel[]>;
|
|
@@ -11,10 +11,11 @@ import { AttributeType, gl } from '@antv/l7-core';
|
|
|
11
11
|
import { lodashUtil } from '@antv/l7-utils';
|
|
12
12
|
import BaseModel from "../../core/BaseModel";
|
|
13
13
|
import { earthOuterTriangulation } from "../../core/triangulation";
|
|
14
|
-
/* babel-plugin-inline-import '../shaders/bloomsphere_frag.glsl' */
|
|
15
|
-
var bloomSphereFrag = "\
|
|
16
|
-
/* babel-plugin-inline-import '../shaders/bloomsphere_vert.glsl' */
|
|
17
|
-
var bloomSphereVert = "
|
|
14
|
+
/* babel-plugin-inline-import '../shaders/bloomshpere/bloomsphere_frag.glsl' */
|
|
15
|
+
var bloomSphereFrag = "\nin vec3 vVertexNormal;\nin vec4 v_Color;\n\nlayout(std140) uniform commonUniforms {\n float u_opacity;\n};\nout vec4 outputColor;\n#pragma include \"scene_uniforms\"\nvoid main() {\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
|
|
16
|
+
/* babel-plugin-inline-import '../shaders/bloomshpere/bloomsphere_vert.glsl' */
|
|
17
|
+
var bloomSphereVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) vec4 a_Color;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_Uv;\nlayout(std140) uniform commonUniforms {\n float u_opacity;\n};\n#pragma include \"scene_uniforms\"\n\nout vec3 vVertexNormal;\nout vec4 v_Color;\n\nvoid main() {\n v_Color = a_Color;\n\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
|
|
18
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
18
19
|
var isNumber = lodashUtil.isNumber;
|
|
19
20
|
var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
20
21
|
_inherits(EarthBloomSphereModel, _BaseModel);
|
|
@@ -24,14 +25,16 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
24
25
|
return _super.apply(this, arguments);
|
|
25
26
|
}
|
|
26
27
|
_createClass(EarthBloomSphereModel, [{
|
|
27
|
-
key: "
|
|
28
|
-
value: function
|
|
28
|
+
key: "getCommonUniformsInfo",
|
|
29
|
+
value: function getCommonUniformsInfo() {
|
|
29
30
|
var _ref = this.layer.getLayerConfig(),
|
|
30
31
|
_ref$opacity = _ref.opacity,
|
|
31
32
|
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
|
|
32
|
-
|
|
33
|
+
var commonOptions = {
|
|
33
34
|
u_opacity: isNumber(opacity) ? opacity : 1.0
|
|
34
35
|
};
|
|
36
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
37
|
+
return commonBufferInfo;
|
|
35
38
|
}
|
|
36
39
|
}, {
|
|
37
40
|
key: "initModels",
|
|
@@ -40,8 +43,9 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
40
43
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
41
44
|
while (1) switch (_context.prev = _context.next) {
|
|
42
45
|
case 0:
|
|
46
|
+
this.initUniformsBuffer();
|
|
43
47
|
return _context.abrupt("return", this.buildModels());
|
|
44
|
-
case
|
|
48
|
+
case 2:
|
|
45
49
|
case "end":
|
|
46
50
|
return _context.stop();
|
|
47
51
|
}
|
|
@@ -100,6 +104,7 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
100
104
|
type: AttributeType.Attribute,
|
|
101
105
|
descriptor: {
|
|
102
106
|
name: 'a_Size',
|
|
107
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
103
108
|
buffer: {
|
|
104
109
|
usage: gl.DYNAMIC_DRAW,
|
|
105
110
|
data: [],
|
|
@@ -118,6 +123,7 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
118
123
|
type: AttributeType.Attribute,
|
|
119
124
|
descriptor: {
|
|
120
125
|
name: 'a_Normal',
|
|
126
|
+
shaderLocation: ShaderLocation.NORMAL,
|
|
121
127
|
buffer: {
|
|
122
128
|
usage: gl.STATIC_DRAW,
|
|
123
129
|
data: [],
|
|
@@ -134,6 +140,7 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
134
140
|
type: AttributeType.Attribute,
|
|
135
141
|
descriptor: {
|
|
136
142
|
name: 'a_Uv',
|
|
143
|
+
shaderLocation: ShaderLocation.UV,
|
|
137
144
|
buffer: {
|
|
138
145
|
usage: gl.DYNAMIC_DRAW,
|
|
139
146
|
data: [],
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
uniform
|
|
3
|
-
|
|
2
|
+
layout(std140) uniform commonUniforms {
|
|
3
|
+
float u_opacity;
|
|
4
|
+
};
|
|
5
|
+
in vec3 vVertexNormal;
|
|
6
|
+
in float v_offset;
|
|
7
|
+
in vec4 v_Color;
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
varying vec4 v_Color;
|
|
9
|
+
#pragma include "scene_uniforms"
|
|
10
|
+
out vec4 outputColor;
|
|
8
11
|
void main() {
|
|
9
12
|
|
|
10
13
|
|
|
@@ -13,5 +16,5 @@ void main() {
|
|
|
13
16
|
// 去除背面
|
|
14
17
|
if(intensity > 1.0) intensity = 0.0;
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);
|
|
17
20
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
layout(location = 0) in vec3 a_Position;
|
|
2
|
+
layout(location = 1) vec4 a_Color;
|
|
3
|
+
layout(location = 13) in vec3 a_Normal;
|
|
4
|
+
layout(location = 14) in vec2 a_Uv;
|
|
5
|
+
layout(std140) uniform commonUniforms {
|
|
6
|
+
float u_opacity;
|
|
7
|
+
};
|
|
8
|
+
#pragma include "scene_uniforms"
|
|
9
|
+
out vec3 vVertexNormal;
|
|
10
|
+
out vec4 v_Color;
|
|
11
|
+
out float v_offset;
|
|
12
|
+
|
|
13
|
+
void main() {
|
|
14
|
+
float EARTH_RADIUS = 100.0;
|
|
15
|
+
|
|
16
|
+
v_Color = a_Color;
|
|
17
|
+
|
|
18
|
+
v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);
|
|
19
|
+
vVertexNormal = a_Normal;
|
|
20
|
+
|
|
21
|
+
gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
uniform sampler2D u_texture;
|
|
2
|
+
|
|
3
|
+
in vec2 v_texCoord;
|
|
4
|
+
in float v_lightWeight;
|
|
5
|
+
out vec4 outputColor;
|
|
6
|
+
|
|
7
|
+
void main() {
|
|
8
|
+
vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y));
|
|
9
|
+
color.xyz = color.xyz * v_lightWeight;
|
|
10
|
+
outputColor = color;
|
|
11
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// attribute vec4 a_Color;
|
|
2
|
+
layout(location = 0) in vec3 a_Position;
|
|
3
|
+
layout(location = 13) in vec3 a_Normal;
|
|
4
|
+
layout(location = 14) in vec2 a_Uv;
|
|
5
|
+
|
|
6
|
+
// attribute vec2 a_Extrude;
|
|
7
|
+
// attribute float a_Size;
|
|
8
|
+
// attribute float a_Shape;
|
|
9
|
+
|
|
10
|
+
layout(std140) uniform commonUniforms {
|
|
11
|
+
vec4 u_sunLight: [1.0, -10.5, 12.0,0.0];
|
|
12
|
+
float u_ambientRatio : 0.5;
|
|
13
|
+
float u_diffuseRatio : 0.3;
|
|
14
|
+
float u_specularRatio : 0.2;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
#pragma include "scene_uniforms"
|
|
18
|
+
|
|
19
|
+
out vec2 v_texCoord;
|
|
20
|
+
out float v_lightWeight;
|
|
21
|
+
|
|
22
|
+
float calc_lighting(vec4 pos) {
|
|
23
|
+
|
|
24
|
+
vec3 worldPos = vec3(pos * u_ModelMatrix);
|
|
25
|
+
|
|
26
|
+
vec3 worldNormal = a_Normal;
|
|
27
|
+
|
|
28
|
+
// cal light weight
|
|
29
|
+
vec3 viewDir = normalize(u_CameraPosition - worldPos);
|
|
30
|
+
|
|
31
|
+
vec3 lightDir = normalize(u_sunLight.xyz);
|
|
32
|
+
|
|
33
|
+
vec3 halfDir = normalize(viewDir+lightDir);
|
|
34
|
+
// lambert
|
|
35
|
+
float lambert = dot(worldNormal, lightDir);
|
|
36
|
+
// specular
|
|
37
|
+
float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);
|
|
38
|
+
//sum to light weight
|
|
39
|
+
float lightWeight = u_ambientRatio + u_diffuseRatio * lambert + u_specularRatio * specular;
|
|
40
|
+
|
|
41
|
+
return lightWeight;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
void main() {
|
|
45
|
+
|
|
46
|
+
v_texCoord = a_Uv;
|
|
47
|
+
|
|
48
|
+
float lightWeight = calc_lighting(vec4(a_Position, 1.0));
|
|
49
|
+
v_lightWeight = lightWeight;
|
|
50
|
+
|
|
51
|
+
gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);
|
|
52
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
in vec3 vVertexNormal;
|
|
3
|
+
in vec4 v_Color;
|
|
4
|
+
|
|
5
|
+
layout(std140) uniform commonUniforms {
|
|
6
|
+
float u_opacity;
|
|
7
|
+
};
|
|
8
|
+
out vec4 outputColor;
|
|
9
|
+
#pragma include "scene_uniforms"
|
|
10
|
+
void main() {
|
|
11
|
+
float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));
|
|
12
|
+
// 去除背面
|
|
13
|
+
if(intensity > 1.0) intensity = 0.0;
|
|
14
|
+
|
|
15
|
+
outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
layout(location = 0) in vec3 a_Position;
|
|
2
|
+
layout(location = 1) vec4 a_Color;
|
|
3
|
+
layout(location = 13) in vec3 a_Normal;
|
|
4
|
+
layout(location = 14) in vec2 a_Uv;
|
|
5
|
+
layout(std140) uniform commonUniforms {
|
|
6
|
+
float u_opacity;
|
|
7
|
+
};
|
|
8
|
+
#pragma include "scene_uniforms"
|
|
9
|
+
|
|
10
|
+
out vec3 vVertexNormal;
|
|
11
|
+
out vec4 v_Color;
|
|
12
|
+
|
|
13
|
+
void main() {
|
|
14
|
+
v_Color = a_Color;
|
|
15
|
+
|
|
16
|
+
vVertexNormal = a_Normal;
|
|
17
|
+
|
|
18
|
+
gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);
|
|
19
|
+
}
|
package/es/geometry/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseLayer from '../core/BaseLayer';
|
|
2
|
-
import { IGeometryLayerStyleOptions } from '../core/interface';
|
|
3
|
-
import { GeometryModelType } from './models';
|
|
2
|
+
import type { IGeometryLayerStyleOptions } from '../core/interface';
|
|
3
|
+
import type { GeometryModelType } from './models';
|
|
4
4
|
export default class GeometryLayer extends BaseLayer<IGeometryLayerStyleOptions> {
|
|
5
5
|
type: string;
|
|
6
6
|
defaultSourceConfig: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
1
|
+
import type { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class BillBoardModel extends BaseModel {
|
|
4
4
|
protected texture: ITexture2D;
|
|
@@ -9,6 +9,13 @@ export default class BillBoardModel extends BaseModel {
|
|
|
9
9
|
vertices: number[];
|
|
10
10
|
};
|
|
11
11
|
getUninforms(): IModelUniform;
|
|
12
|
+
protected getCommonUniformsInfo(): {
|
|
13
|
+
uniformsArray: number[];
|
|
14
|
+
uniformsLength: number;
|
|
15
|
+
uniformsOption: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
12
19
|
clearModels(): void;
|
|
13
20
|
initModels(): Promise<IModel[]>;
|
|
14
21
|
buildModels(): Promise<IModel[]>;
|