@antv/l7-layers 2.20.3 → 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 +56 -10
- package/es/core/BaseModel.d.ts +21 -1
- package/es/core/BaseModel.js +99 -2
- package/es/core/CommonStyleAttribute.d.ts +5 -2
- package/es/core/CommonStyleAttribute.js +4 -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.d.ts +4 -0
- package/es/core/utils.js +15 -0
- 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 +51 -36
- 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 +7 -12
- package/es/point/models/extrude.js +18 -13
- 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 -21
- 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_frag.glsl +19 -7
- package/es/point/shaders/extrude/extrude_vert.glsl +23 -30
- 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 +56 -10
- package/lib/core/BaseModel.js +99 -2
- package/lib/core/CommonStyleAttribute.js +4 -0
- package/lib/core/triangulation.js +12 -6
- package/lib/core/utils.js +22 -0
- 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 +51 -36
- 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 +18 -13
- 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 -21
- 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_frag.glsl +19 -7
- package/lib/point/shaders/extrude/extrude_vert.glsl +23 -30
- 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
|
@@ -11,10 +11,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
11
11
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
12
12
|
import BaseModel from "../../core/BaseModel";
|
|
13
13
|
import { rgb2arr } from '@antv/l7-utils';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
15
|
+
/* babel-plugin-inline-import '../shaders/billboard/billboard_point_frag.glsl' */
|
|
16
|
+
var simplePointFrag = "\nlayout(std140) uniform commonUniorm {\n vec4 u_stroke_color;\n float u_additive;\n float u_stroke_opacity;\n float u_stroke_width;\n};\n\nin vec4 v_color;\nin float v_blur;\nin float v_innerRadius;\n\nout vec4 outputColor;\n\n#pragma include \"picking\"\nvoid main() {\n vec2 center = vec2(0.5);\n\n // Tip: \u7247\u5143\u5230\u4E2D\u5FC3\u70B9\u7684\u8DDD\u79BB 0 - 1\n float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;\n // Tip: \u7247\u5143\u7684\u526A\u5207\u6210\u5706\u5F62\n float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);\n\n\n if(v_innerRadius < 0.99) {\n // \u5F53\u5B58\u5728 stroke \u4E14 stroke > 0.01\n float blurWidth = (1.0 - v_blur)/2.0;\n vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);\n if(fragmengTocenter > v_innerRadius + blurWidth) {\n outputColor = stroke;\n } else if(fragmengTocenter > v_innerRadius - blurWidth){\n float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);\n outputColor = mix(v_color, stroke, mixR);\n } else {\n outputColor = v_color;\n }\n } else {\n // \u5F53\u4E0D\u5B58\u5728 stroke \u6216 stroke <= 0.01\n outputColor = v_color;\n }\n\n outputColor = filterColor(outputColor);\n \n if(u_additive > 0.0) {\n outputColor *= circleClipOpacity;\n } else {\n outputColor.a *= circleClipOpacity;\n }\n\n}\n";
|
|
17
|
+
/* babel-plugin-inline-import '../shaders/billboard/billboard_point_vert.glsl' */
|
|
18
|
+
var simplePointVert = "\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_stroke_color;\n float u_additive;\n float u_stroke_opacity;\n float u_stroke_width;\n};\n\nout vec4 v_color;\nout float v_blur;\nout float v_innerRadius;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"project\"\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_blur = 1.0 - max(2.0/a_Size, 0.05);\n v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);\n \n vec2 offset = project_pixel(u_offsets);\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);\n } else { // 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(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\n }\n \n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n";
|
|
18
19
|
export function PointTriangulation(feature) {
|
|
19
20
|
var coordinates = feature.coordinates;
|
|
20
21
|
return {
|
|
@@ -38,13 +39,9 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
}, {
|
|
41
|
-
key: "
|
|
42
|
-
value: function
|
|
42
|
+
key: "getCommonUniformsInfo",
|
|
43
|
+
value: function getCommonUniformsInfo() {
|
|
43
44
|
var _ref = this.layer.getLayerConfig(),
|
|
44
|
-
_ref$opacity = _ref.opacity,
|
|
45
|
-
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
46
|
-
_ref$offsets = _ref.offsets,
|
|
47
|
-
offsets = _ref$offsets === void 0 ? [0, 0] : _ref$offsets,
|
|
48
45
|
blend = _ref.blend,
|
|
49
46
|
_ref$strokeOpacity = _ref.strokeOpacity,
|
|
50
47
|
strokeOpacity = _ref$strokeOpacity === void 0 ? 1 : _ref$strokeOpacity,
|
|
@@ -52,14 +49,14 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
52
49
|
strokeWidth = _ref$strokeWidth === void 0 ? 0 : _ref$strokeWidth,
|
|
53
50
|
_ref$stroke = _ref.stroke,
|
|
54
51
|
stroke = _ref$stroke === void 0 ? '#fff' : _ref$stroke;
|
|
55
|
-
|
|
52
|
+
var commonOptions = {
|
|
53
|
+
u_stroke_color: rgb2arr(stroke),
|
|
56
54
|
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
57
|
-
u_opacity: opacity,
|
|
58
|
-
u_offsets: offsets,
|
|
59
55
|
u_stroke_opacity: strokeOpacity,
|
|
60
|
-
u_stroke_width: strokeWidth
|
|
61
|
-
u_stroke_color: rgb2arr(stroke)
|
|
56
|
+
u_stroke_width: strokeWidth
|
|
62
57
|
};
|
|
58
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
59
|
+
return commonBufferInfo;
|
|
63
60
|
}
|
|
64
61
|
}, {
|
|
65
62
|
key: "initModels",
|
|
@@ -89,21 +86,23 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
89
86
|
while (1) switch (_context2.prev = _context2.next) {
|
|
90
87
|
case 0:
|
|
91
88
|
this.layer.triangulation = PointTriangulation;
|
|
92
|
-
|
|
89
|
+
this.initUniformsBuffer();
|
|
90
|
+
_context2.next = 4;
|
|
93
91
|
return this.layer.buildLayerModel({
|
|
94
92
|
moduleName: 'pointSimple',
|
|
95
93
|
vertexShader: simplePointVert,
|
|
96
94
|
fragmentShader: simplePointFrag,
|
|
95
|
+
inject: this.getInject(),
|
|
97
96
|
triangulation: PointTriangulation,
|
|
98
97
|
depth: {
|
|
99
98
|
enable: false
|
|
100
99
|
},
|
|
101
100
|
primitive: gl.POINTS
|
|
102
101
|
});
|
|
103
|
-
case
|
|
102
|
+
case 4:
|
|
104
103
|
model = _context2.sent;
|
|
105
104
|
return _context2.abrupt("return", [model]);
|
|
106
|
-
case
|
|
105
|
+
case 6:
|
|
107
106
|
case "end":
|
|
108
107
|
return _context2.stop();
|
|
109
108
|
}
|
|
@@ -122,6 +121,7 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
122
121
|
type: AttributeType.Attribute,
|
|
123
122
|
descriptor: {
|
|
124
123
|
name: 'a_Size',
|
|
124
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
125
125
|
buffer: {
|
|
126
126
|
usage: gl.DYNAMIC_DRAW,
|
|
127
127
|
data: [],
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { IModel } from '@antv/l7-core';
|
|
1
|
+
import type { IModel } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class ExtrudeModel extends BaseModel {
|
|
4
4
|
private raiseCount;
|
|
5
5
|
private raiseRepeat;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
u_sourceColor: number[];
|
|
13
|
-
u_targetColor: number[];
|
|
14
|
-
u_opacitylinear: number;
|
|
15
|
-
u_opacitylinear_dir: number;
|
|
16
|
-
u_lightEnable: number;
|
|
6
|
+
protected getCommonUniformsInfo(): {
|
|
7
|
+
uniformsArray: number[];
|
|
8
|
+
uniformsLength: number;
|
|
9
|
+
uniformsOption: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
17
12
|
};
|
|
18
13
|
initModels(): Promise<IModel[]>;
|
|
19
14
|
buildModels(): Promise<IModel[]>;
|
|
@@ -14,10 +14,11 @@ import { calculateCentroid, getCullFace, lodashUtil, rgb2arr } from '@antv/l7-ut
|
|
|
14
14
|
import BaseModel from "../../core/BaseModel";
|
|
15
15
|
import { PointExtrudeTriangulation } from "../../core/triangulation";
|
|
16
16
|
import { lglt2xyz } from "../../earth/utils";
|
|
17
|
-
/* babel-plugin-inline-import '../shaders/
|
|
18
|
-
var pointExtrudeFrag = "
|
|
19
|
-
/* babel-plugin-inline-import '../shaders/
|
|
20
|
-
var pointExtrudeVert = "precision highp float;\n\n#define pi 3.1415926535\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\
|
|
17
|
+
/* babel-plugin-inline-import '../shaders/earthExtrude/earthExtrude_frag.glsl' */
|
|
18
|
+
var pointExtrudeFrag = "precision highp float;\nin vec4 v_color;\n\n#pragma include \"picking\"\n\nlayout(std140) uniform commonUniform {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor: 0;\n float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\n float u_globel;\n float u_r;\n float u_pickLight: 0.0;\n float u_opacitylinear: 0.0;\n float u_opacitylinear_dir: 1.0;\n float u_lightEnable: 1.0;\n};\nin float v_lightWeight;\nin float v_barLinearZ;\nout vec4 outputColor;\nvoid main() {\n\n outputColor = v_color;\n\n // \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8\n if(u_opacitylinear > 0.0) {\n outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;\n }\n\n // picking\n if(u_pickLight > 0.0) {\n outputColor = filterColorAlpha(outputColor, v_lightWeight);\n } else {\n outputColor = filterColor(outputColor);\n }\n}\n";
|
|
19
|
+
/* babel-plugin-inline-import '../shaders/earthExtrude/earthExtrude_vert.glsl' */
|
|
20
|
+
var pointExtrudeVert = "precision highp float;\n\n#define pi 3.1415926535\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\n\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in vec3 a_Size;\nlayout(location = 11) in vec3 a_Pos;\nlayout(location = 13) in vec3 a_Normal;\n\n\nlayout(std140) uniform commonUniform {\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_linearColor: 0;\n float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\n float u_globel;\n float u_r;\n float u_pickLight: 0.0;\n float u_opacitylinear: 0.0;\n float u_opacitylinear_dir: 1.0;\n float u_lightEnable: 1.0;\n};\n\nout vec4 v_color;\nout float v_lightWeight;\nout float v_barLinearZ;\n// \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nfloat getYRadian(float x, float z) {\n if(x > 0.0 && z > 0.0) {\n return atan(x/z);\n } else if(x > 0.0 && z <= 0.0){\n return atan(-z/x) + pi/2.0;\n } else if(x <= 0.0 && z <= 0.0) {\n return pi + atan(x/z); //atan(x/z) + \n } else {\n return atan(z/-x) + pi*3.0/2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y/r);\n}\n\nvoid main() {\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n vec3 size = a_Size * a_Position;\n\n // a_Position.z \u662F\u5728\u6784\u5EFA\u7F51\u683C\u7684\u65F6\u5019\u4F20\u5165\u7684\u6807\u51C6\u503C 0 - 1\uFF0C\u5728\u63D2\u503C\u5668\u63D2\u503C\u53EF\u4EE5\u83B7\u53D6 0\uFF5E1 \u7EBF\u6027\u6E10\u53D8\u7684\u503C\n v_barLinearZ = a_Position.z;\n\n vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB\n if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6\n \n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1\n offset = offset * pow(2.0, (19.0 - u_Zoom));\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3\n offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));\n }\n } else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n offset *= 4.0/pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n\n vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));\n\n // u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // \u5706\u67F1\u5149\u7167\u6548\u679C\n float lightWeight = 1.0;\n if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027\n lightWeight = calc_lighting(pos);\n }\n v_lightWeight = lightWeight;\n // \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n v_color = mix(u_sourceColor, u_targetColor, v_barLinearZ);\n v_color.rgb *= lightWeight;\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n v_color = a_Color;\n }\n v_color.a *= u_opacity;\n\n \n // \u5728\u5730\u7403\u6A21\u5F0F\u4E0B\uFF0C\u5C06\u539F\u672C\u5782\u76F4\u4E8E xy \u5E73\u9762\u7684\u5706\u67F1\u8C03\u6574\u59FF\u6001\u5230\u9002\u5E94\u5706\u7684\u89D2\u5EA6\n //\u65CB\u8F6C\u77E9\u9635mx\uFF0C\u521B\u5EFA\u7ED5x\u8F74\u65CB\u8F6C\u77E9\u9635\n float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);\n float xRadian = getXRadian(a_Pos.y, r);\n float xcos = cos(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C\n float xsin = sin(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C\n mat4 mx = mat4(\n 1,0,0,0, \n 0,xcos,-xsin,0, \n 0,xsin,xcos,0, \n 0,0,0,1);\n\n //\u65CB\u8F6C\u77E9\u9635my\uFF0C\u521B\u5EFA\u7ED5y\u8F74\u65CB\u8F6C\u77E9\u9635\n float yRadian = getYRadian(a_Pos.x, a_Pos.z);\n float ycos = cos(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C\n float ysin = sin(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C\n mat4 my = mat4(\n ycos,0,-ysin,0, \n 0,1,0,0, \n ysin,0,ycos,0, \n 0,0,0,1);\n\n gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);\n \n\n setPickingColor(a_PickingColor);\n}\n";
|
|
21
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
21
22
|
var isNumber = lodashUtil.isNumber;
|
|
22
23
|
var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
23
24
|
_inherits(ExtrudeModel, _BaseModel);
|
|
@@ -34,8 +35,8 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
34
35
|
return _this;
|
|
35
36
|
}
|
|
36
37
|
_createClass(ExtrudeModel, [{
|
|
37
|
-
key: "
|
|
38
|
-
value: function
|
|
38
|
+
key: "getCommonUniformsInfo",
|
|
39
|
+
value: function getCommonUniformsInfo() {
|
|
39
40
|
var _ref = this.layer.getLayerConfig(),
|
|
40
41
|
_ref$animateOption = _ref.animateOption,
|
|
41
42
|
animateOption = _ref$animateOption === void 0 ? {
|
|
@@ -50,7 +51,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
50
51
|
_ref$pickLight = _ref.pickLight,
|
|
51
52
|
pickLight = _ref$pickLight === void 0 ? false : _ref$pickLight,
|
|
52
53
|
_ref$heightfixed = _ref.heightfixed,
|
|
53
|
-
heightfixed = _ref$heightfixed === void 0 ?
|
|
54
|
+
heightfixed = _ref$heightfixed === void 0 ? true : _ref$heightfixed,
|
|
54
55
|
_ref$opacityLinear = _ref.opacityLinear,
|
|
55
56
|
opacityLinear = _ref$opacityLinear === void 0 ? {
|
|
56
57
|
enable: false,
|
|
@@ -83,23 +84,25 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
+
var commonOptions = {
|
|
88
|
+
u_sourceColor: sourceColorArr,
|
|
89
|
+
u_targetColor: targetColorArr,
|
|
90
|
+
// 渐变色支持参数
|
|
91
|
+
u_linearColor: useLinearColor,
|
|
87
92
|
// 圆柱体的拾取高亮是否要计算光照
|
|
88
93
|
u_pickLight: Number(pickLight),
|
|
89
94
|
// 圆柱体是否固定高度
|
|
90
95
|
u_heightfixed: Number(heightfixed),
|
|
91
96
|
u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
|
|
92
97
|
u_opacity: isNumber(opacity) ? opacity : 1.0,
|
|
93
|
-
// 渐变色支持参数
|
|
94
|
-
u_linearColor: useLinearColor,
|
|
95
|
-
u_sourceColor: sourceColorArr,
|
|
96
|
-
u_targetColor: targetColorArr,
|
|
97
98
|
// 透明度渐变
|
|
98
99
|
u_opacitylinear: Number(opacityLinear.enable),
|
|
99
100
|
u_opacitylinear_dir: opacityLinear.dir === 'up' ? 1.0 : 0.0,
|
|
100
101
|
// 光照计算开关
|
|
101
102
|
u_lightEnable: Number(lightEnable)
|
|
102
103
|
};
|
|
104
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
105
|
+
return commonBufferInfo;
|
|
103
106
|
}
|
|
104
107
|
}, {
|
|
105
108
|
key: "initModels",
|
|
@@ -108,8 +111,9 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
108
111
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
109
112
|
while (1) switch (_context.prev = _context.next) {
|
|
110
113
|
case 0:
|
|
114
|
+
this.initUniformsBuffer();
|
|
111
115
|
return _context.abrupt("return", this.buildModels());
|
|
112
|
-
case
|
|
116
|
+
case 2:
|
|
113
117
|
case "end":
|
|
114
118
|
return _context.stop();
|
|
115
119
|
}
|
|
@@ -140,6 +144,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
140
144
|
depth: {
|
|
141
145
|
enable: true
|
|
142
146
|
},
|
|
147
|
+
inject: this.getInject(),
|
|
143
148
|
cull: {
|
|
144
149
|
enable: true,
|
|
145
150
|
face: getCullFace(this.mapService.version)
|
|
@@ -168,6 +173,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
168
173
|
type: AttributeType.Attribute,
|
|
169
174
|
descriptor: {
|
|
170
175
|
name: 'a_Size',
|
|
176
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
171
177
|
buffer: {
|
|
172
178
|
usage: gl.DYNAMIC_DRAW,
|
|
173
179
|
data: [],
|
|
@@ -198,6 +204,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
198
204
|
type: AttributeType.Attribute,
|
|
199
205
|
descriptor: {
|
|
200
206
|
name: 'a_Normal',
|
|
207
|
+
shaderLocation: ShaderLocation.NORMAL,
|
|
201
208
|
buffer: {
|
|
202
209
|
// give the WebGL driver a hint that this buffer may change
|
|
203
210
|
usage: gl.STATIC_DRAW,
|
|
@@ -215,6 +222,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
215
222
|
type: AttributeType.Attribute,
|
|
216
223
|
descriptor: {
|
|
217
224
|
name: 'a_Pos',
|
|
225
|
+
shaderLocation: 15,
|
|
218
226
|
buffer: {
|
|
219
227
|
usage: gl.DYNAMIC_DRAW,
|
|
220
228
|
data: [],
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { IAnimateOption, IModel
|
|
1
|
+
import type { IAnimateOption, IModel } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class FillModel extends BaseModel {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
protected getCommonUniformsInfo(): {
|
|
5
|
+
uniformsArray: number[];
|
|
6
|
+
uniformsLength: number;
|
|
7
|
+
uniformsOption: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
6
11
|
initModels(): Promise<IModel[]>;
|
|
7
12
|
buildModels(): Promise<IModel[]>;
|
|
8
13
|
protected animateOption2Array(option: Partial<IAnimateOption>): number[];
|
|
@@ -12,12 +12,12 @@ 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 { GlobelPointFillTriangulation } from "../../core/triangulation";
|
|
15
|
-
/* babel-plugin-inline-import '../shaders/
|
|
16
|
-
var pointFillFrag = "
|
|
17
|
-
/* babel-plugin-inline-import '../shaders/
|
|
18
|
-
var pointFillVert = "
|
|
19
|
-
import { rgb2arr } from '@antv/l7-utils';
|
|
15
|
+
/* babel-plugin-inline-import '../shaders/earthFill/earthFill_frag.glsl' */
|
|
16
|
+
var pointFillFrag = "in vec4 v_data;\nin vec4 v_color;\nin float v_radius;\n\nlayout(std140) uniform commonUniform {\n float u_additive;\n float u_stroke_opacity : 1;\n float u_stroke_width : 2;\n float u_blur : 0.0;\n};\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\n vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke;\n\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 if(outer_df > antialiasblur + 0.018) discard;\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 = vec4(v_color.rgb, v_color.a * u_opacity);\n } else {\n outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * 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}\n";
|
|
17
|
+
/* babel-plugin-inline-import '../shaders/earthFill/earthFill_vert.glsl' */
|
|
18
|
+
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 = 10) in float a_Shape;\nlayout(location = 11) in vec3 a_Extrude;\n\nlayout(std140) uniform commonUniform {\n float u_additive;\n float u_stroke_opacity : 1;\n float u_stroke_width : 2;\n float u_blur : 0.0;\n};\nout vec4 v_data;\nout vec4 v_color;\nout float v_radius;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\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);\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 gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0);\n\n setPickingColor(a_PickingColor);\n}";
|
|
20
19
|
import { mat4, vec3 } from 'gl-matrix';
|
|
20
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
21
21
|
var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
22
22
|
_inherits(FillModel, _BaseModel);
|
|
23
23
|
var _super = _createSuper(FillModel);
|
|
@@ -26,42 +26,25 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
26
26
|
return _super.apply(this, arguments);
|
|
27
27
|
}
|
|
28
28
|
_createClass(FillModel, [{
|
|
29
|
-
key: "
|
|
30
|
-
value: function
|
|
29
|
+
key: "getCommonUniformsInfo",
|
|
30
|
+
value: function getCommonUniformsInfo() {
|
|
31
31
|
var _ref = this.layer.getLayerConfig(),
|
|
32
|
-
_ref$opacity = _ref.opacity,
|
|
33
|
-
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
34
32
|
_ref$strokeOpacity = _ref.strokeOpacity,
|
|
35
33
|
strokeOpacity = _ref$strokeOpacity === void 0 ? 1 : _ref$strokeOpacity,
|
|
36
34
|
_ref$strokeWidth = _ref.strokeWidth,
|
|
37
35
|
strokeWidth = _ref$strokeWidth === void 0 ? 0 : _ref$strokeWidth,
|
|
38
|
-
_ref$stroke = _ref.stroke,
|
|
39
|
-
stroke = _ref$stroke === void 0 ? 'rgba(0,0,0,0)' : _ref$stroke,
|
|
40
36
|
blend = _ref.blend,
|
|
41
37
|
_ref$blur = _ref.blur,
|
|
42
38
|
blur = _ref$blur === void 0 ? 0 : _ref$blur;
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
this.layer.getLayerConfig();
|
|
40
|
+
var commonOptions = {
|
|
45
41
|
u_additive: blend === 'additive' ? 1.0 : 0.0,
|
|
46
|
-
u_opacity: opacity,
|
|
47
42
|
u_stroke_opacity: strokeOpacity,
|
|
48
43
|
u_stroke_width: strokeWidth,
|
|
49
|
-
|
|
50
|
-
// u_offsets: offsets,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "getAnimateUniforms",
|
|
55
|
-
value: function getAnimateUniforms() {
|
|
56
|
-
var _ref2 = this.layer.getLayerConfig(),
|
|
57
|
-
_ref2$animateOption = _ref2.animateOption,
|
|
58
|
-
animateOption = _ref2$animateOption === void 0 ? {
|
|
59
|
-
enable: false
|
|
60
|
-
} : _ref2$animateOption;
|
|
61
|
-
return {
|
|
62
|
-
u_animate: this.animateOption2Array(animateOption),
|
|
63
|
-
u_time: this.layer.getLayerAnimateTime()
|
|
44
|
+
u_blur: blur
|
|
64
45
|
};
|
|
46
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
47
|
+
return commonBufferInfo;
|
|
65
48
|
}
|
|
66
49
|
}, {
|
|
67
50
|
key: "initModels",
|
|
@@ -70,8 +53,9 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
70
53
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
71
54
|
while (1) switch (_context.prev = _context.next) {
|
|
72
55
|
case 0:
|
|
56
|
+
this.initUniformsBuffer();
|
|
73
57
|
return _context.abrupt("return", this.buildModels());
|
|
74
|
-
case
|
|
58
|
+
case 2:
|
|
75
59
|
case "end":
|
|
76
60
|
return _context.stop();
|
|
77
61
|
}
|
|
@@ -97,6 +81,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
97
81
|
vertexShader: pointFillVert,
|
|
98
82
|
fragmentShader: pointFillFrag,
|
|
99
83
|
triangulation: GlobelPointFillTriangulation,
|
|
84
|
+
inject: this.getInject(),
|
|
100
85
|
depth: {
|
|
101
86
|
enable: true
|
|
102
87
|
},
|
|
@@ -130,6 +115,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
130
115
|
type: AttributeType.Attribute,
|
|
131
116
|
descriptor: {
|
|
132
117
|
name: 'a_Extrude',
|
|
118
|
+
shaderLocation: ShaderLocation.EXTRUDE,
|
|
133
119
|
buffer: {
|
|
134
120
|
// give the WebGL driver a hint that this buffer may change
|
|
135
121
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -174,6 +160,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
174
160
|
type: AttributeType.Attribute,
|
|
175
161
|
descriptor: {
|
|
176
162
|
name: 'a_Size',
|
|
163
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
177
164
|
buffer: {
|
|
178
165
|
// give the WebGL driver a hint that this buffer may change
|
|
179
166
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -195,6 +182,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
195
182
|
type: AttributeType.Attribute,
|
|
196
183
|
descriptor: {
|
|
197
184
|
name: 'a_Shape',
|
|
185
|
+
shaderLocation: ShaderLocation.SHAPE,
|
|
198
186
|
buffer: {
|
|
199
187
|
// give the WebGL driver a hint that this buffer may change
|
|
200
188
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { IModel } from '@antv/l7-core';
|
|
1
|
+
import type { IModel } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class ExtrudeModel extends BaseModel {
|
|
4
4
|
private raiseCount;
|
|
5
5
|
private raiseRepeat;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
u_sourceColor: number[];
|
|
13
|
-
u_targetColor: number[];
|
|
14
|
-
u_opacitylinear: number;
|
|
15
|
-
u_opacitylinear_dir: number;
|
|
16
|
-
u_lightEnable: number;
|
|
6
|
+
protected getCommonUniformsInfo(): {
|
|
7
|
+
uniformsArray: number[];
|
|
8
|
+
uniformsLength: number;
|
|
9
|
+
uniformsOption: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
17
12
|
};
|
|
18
13
|
initModels(): Promise<IModel[]>;
|
|
19
14
|
buildModels(): Promise<IModel[]>;
|
|
@@ -12,11 +12,12 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
13
13
|
import { calculateCentroid, getCullFace, rgb2arr } from '@antv/l7-utils';
|
|
14
14
|
import BaseModel from "../../core/BaseModel";
|
|
15
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
15
16
|
import { PointExtrudeTriangulation } from "../../core/triangulation";
|
|
16
17
|
/* babel-plugin-inline-import '../shaders/extrude/extrude_frag.glsl' */
|
|
17
|
-
var pointExtrudeFrag = "
|
|
18
|
+
var pointExtrudeFrag = "in vec4 v_color;\nin float v_lightWeight;\nout vec4 outputColor;\n\n\nlayout(std140) uniform commonUniforms {\n float u_pickLight;\n float u_heightfixed;\n float u_r;\n float u_linearColor;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_opacitylinear;\n float u_opacitylinear_dir;\n float u_lightEnable;\n};\n\n#pragma include \"picking\"\n\nvoid main() {\n\n outputColor = v_color;\n // \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8\n // picking\n if(u_pickLight > 0.0) {\n outputColor = filterColorAlpha(outputColor, v_lightWeight);\n } else {\n outputColor = filterColor(outputColor);\n }\n}\n";
|
|
18
19
|
/* babel-plugin-inline-import '../shaders/extrude/extrude_vert.glsl' */
|
|
19
|
-
var pointExtrudeVert = "
|
|
20
|
+
var pointExtrudeVert = "#define pi 3.1415926535\n\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in vec3 a_Size;\nlayout(location = 11) in vec3 a_Extrude;\nlayout(location = 13) in vec3 a_Normal;\n\nlayout(std140) uniform commonUniforms {\n float u_pickLight;\n float u_heightfixed;\n float u_r;\n float u_linearColor;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n float u_opacitylinear;\n float u_opacitylinear_dir;\n float u_lightEnable;\n};\nout vec4 v_color;\nout float v_lightWeight;\nout float v_barLinearZ;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nfloat getYRadian(float x, float z) {\n if(x > 0.0 && z > 0.0) {\n return atan(x/z);\n } else if(x > 0.0 && z <= 0.0){\n return atan(-z/x) + pi/2.0;\n } else if(x <= 0.0 && z <= 0.0) {\n return pi + atan(x/z); //atan(x/z) + \n } else {\n return atan(z/-x) + pi*3.0/2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y/r);\n}\n\nvoid main() {\n\n\n vec3 size = a_Size * a_Position;\n\n vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB\n\n if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6\n \n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1\n offset = offset * pow(2.0, (19.0 - u_Zoom));\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3\n offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));\n }\n } else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n offset *= 4.0/pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n\n vec4 project_pos = project_position(vec4(a_Extrude.xy, 0., 1.0));\n\n // u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // // \u5706\u67F1\u5149\u7167\u6548\u679C\n float lightWeight = 1.0;\n\n if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027\n lightWeight = calc_lighting(pos);\n }\n\n v_lightWeight = lightWeight;\n\n v_color = a_Color;\n\n // \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n v_color = mix(u_sourceColor, u_targetColor, a_Position.z);\n v_color.a = v_color.a * opacity;\n } else {\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);\n }\n\n if(u_opacitylinear > 0.0) {\n v_color.a *= u_opacitylinear_dir > 0.0 ? (1.0 - a_Position.z): a_Position.z;\n }\n\n\n gl_Position = project_common_position_to_clipspace_v2(pos);\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
20
21
|
var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
21
22
|
_inherits(ExtrudeModel, _BaseModel);
|
|
22
23
|
var _super = _createSuper(ExtrudeModel);
|
|
@@ -32,8 +33,8 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
32
33
|
return _this;
|
|
33
34
|
}
|
|
34
35
|
_createClass(ExtrudeModel, [{
|
|
35
|
-
key: "
|
|
36
|
-
value: function
|
|
36
|
+
key: "getCommonUniformsInfo",
|
|
37
|
+
value: function getCommonUniformsInfo() {
|
|
37
38
|
var _ref = this.layer.getLayerConfig(),
|
|
38
39
|
_ref$animateOption = _ref.animateOption,
|
|
39
40
|
animateOption = _ref$animateOption === void 0 ? {
|
|
@@ -41,8 +42,6 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
41
42
|
speed: 0.01,
|
|
42
43
|
repeat: false
|
|
43
44
|
} : _ref$animateOption,
|
|
44
|
-
_ref$opacity = _ref.opacity,
|
|
45
|
-
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
46
45
|
sourceColor = _ref.sourceColor,
|
|
47
46
|
targetColor = _ref.targetColor,
|
|
48
47
|
_ref$pickLight = _ref.pickLight,
|
|
@@ -81,13 +80,12 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
|
|
83
|
+
var commonOptions = {
|
|
85
84
|
// 圆柱体的拾取高亮是否要计算光照
|
|
86
85
|
u_pickLight: Number(pickLight),
|
|
87
86
|
// 圆柱体是否固定高度
|
|
88
87
|
u_heightfixed: Number(heightfixed),
|
|
89
88
|
u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
|
|
90
|
-
u_opacity: opacity,
|
|
91
89
|
// 渐变色支持参数
|
|
92
90
|
u_linearColor: useLinearColor,
|
|
93
91
|
u_sourceColor: sourceColorArr,
|
|
@@ -98,6 +96,8 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
98
96
|
// 光照计算开关
|
|
99
97
|
u_lightEnable: Number(lightEnable)
|
|
100
98
|
};
|
|
99
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
100
|
+
return commonBufferInfo;
|
|
101
101
|
}
|
|
102
102
|
}, {
|
|
103
103
|
key: "initModels",
|
|
@@ -129,12 +129,14 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
129
129
|
// GAODE1.x GAODE2.x MAPBOX
|
|
130
130
|
_ref2 = this.layer.getLayerConfig(), _ref2$depth = _ref2.depth, depth = _ref2$depth === void 0 ? true : _ref2$depth, _ref2$animateOption$r = _ref2.animateOption.repeat, repeat = _ref2$animateOption$r === void 0 ? 1 : _ref2$animateOption$r;
|
|
131
131
|
this.raiseRepeat = repeat;
|
|
132
|
-
|
|
132
|
+
this.initUniformsBuffer();
|
|
133
|
+
_context2.next = 5;
|
|
133
134
|
return this.layer.buildLayerModel({
|
|
134
135
|
moduleName: 'pointExtrude',
|
|
135
136
|
vertexShader: pointExtrudeVert,
|
|
136
137
|
fragmentShader: pointExtrudeFrag,
|
|
137
138
|
triangulation: PointExtrudeTriangulation,
|
|
139
|
+
inject: this.getInject(),
|
|
138
140
|
cull: {
|
|
139
141
|
enable: true,
|
|
140
142
|
face: getCullFace(this.mapService.version)
|
|
@@ -143,10 +145,10 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
143
145
|
enable: depth
|
|
144
146
|
}
|
|
145
147
|
});
|
|
146
|
-
case
|
|
148
|
+
case 5:
|
|
147
149
|
model = _context2.sent;
|
|
148
150
|
return _context2.abrupt("return", [model]);
|
|
149
|
-
case
|
|
151
|
+
case 7:
|
|
150
152
|
case "end":
|
|
151
153
|
return _context2.stop();
|
|
152
154
|
}
|
|
@@ -166,6 +168,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
166
168
|
type: AttributeType.Attribute,
|
|
167
169
|
descriptor: {
|
|
168
170
|
name: 'a_Size',
|
|
171
|
+
shaderLocation: ShaderLocation.SIZE,
|
|
169
172
|
buffer: {
|
|
170
173
|
usage: gl.DYNAMIC_DRAW,
|
|
171
174
|
data: [],
|
|
@@ -196,6 +199,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
196
199
|
type: AttributeType.Attribute,
|
|
197
200
|
descriptor: {
|
|
198
201
|
name: 'a_Normal',
|
|
202
|
+
shaderLocation: ShaderLocation.NORMAL,
|
|
199
203
|
buffer: {
|
|
200
204
|
// give the WebGL driver a hint that this buffer may change
|
|
201
205
|
usage: gl.STATIC_DRAW,
|
|
@@ -209,10 +213,11 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
209
213
|
}
|
|
210
214
|
});
|
|
211
215
|
this.styleAttributeService.registerStyleAttribute({
|
|
212
|
-
name: '
|
|
216
|
+
name: 'extrude',
|
|
213
217
|
type: AttributeType.Attribute,
|
|
214
218
|
descriptor: {
|
|
215
|
-
name: '
|
|
219
|
+
name: 'a_Extrude',
|
|
220
|
+
shaderLocation: ShaderLocation.EXTRUDE,
|
|
216
221
|
buffer: {
|
|
217
222
|
// give the WebGL driver a hint that this buffer may change
|
|
218
223
|
usage: gl.DYNAMIC_DRAW,
|
|
@@ -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 FillModel 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: {
|