@antv/l7-layers 2.21.10 → 2.21.11-beta.1
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/citybuliding/models/build.d.ts +16 -0
- package/es/citybuliding/models/build.js +18 -20
- package/es/citybuliding/shaders/build_frag.glsl +6 -6
- package/es/citybuliding/shaders/build_vert.glsl +8 -14
- package/es/core/BaseLayer.d.ts +0 -1
- package/es/core/BaseLayer.js +9 -19
- package/es/core/BaseModel.d.ts +15 -2
- package/es/core/BaseModel.js +98 -64
- package/es/core/CommonStyleAttribute.d.ts +14 -18
- package/es/core/CommonStyleAttribute.js +23 -67
- package/es/core/shape/extrude.js +6 -3
- package/es/core/triangulation.js +22 -50
- package/es/core/utils.d.ts +4 -0
- package/es/core/utils.js +33 -0
- package/es/earth/models/atmosphere.d.ts +15 -0
- package/es/earth/models/atmosphere.js +30 -24
- package/es/earth/models/base.d.ts +15 -0
- package/es/earth/models/base.js +30 -24
- package/es/earth/models/bloomsphere.d.ts +15 -0
- package/es/earth/models/bloomsphere.js +30 -24
- package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +7 -5
- package/es/earth/shaders/base/base_vert.glsl +3 -3
- package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +5 -4
- package/es/geometry/models/billboard.d.ts +15 -0
- package/es/geometry/models/billboard.js +14 -8
- package/es/geometry/models/plane.d.ts +14 -0
- package/es/geometry/models/plane.js +10 -10
- package/es/geometry/models/sprite.js +3 -9
- package/es/geometry/shaders/billboard_vert.glsl +28 -25
- package/es/geometry/shaders/plane_vert.glsl +6 -6
- package/es/geometry/shaders/sprite_vert.glsl +7 -9
- package/es/heatmap/models/grid.d.ts +14 -0
- package/es/heatmap/models/grid.js +10 -3
- package/es/heatmap/models/grid3d.d.ts +16 -0
- package/es/heatmap/models/grid3d.js +14 -6
- package/es/heatmap/models/heatmap.d.ts +20 -1
- package/es/heatmap/models/heatmap.js +96 -83
- package/es/heatmap/models/hexagon.d.ts +14 -0
- package/es/heatmap/models/hexagon.js +9 -3
- package/es/heatmap/shaders/grid/grid_vert.glsl +30 -42
- package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +14 -26
- package/es/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +19 -16
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +16 -22
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +3 -4
- package/es/heatmap/shaders/hexagon/hexagon_vert.glsl +13 -23
- package/es/image/models/image.d.ts +14 -0
- package/es/image/models/image.js +11 -7
- package/es/image/shaders/image_vert.glsl +7 -6
- package/es/line/models/arc.d.ts +18 -0
- package/es/line/models/arc.js +57 -8
- package/es/line/models/arc_3d.d.ts +18 -0
- package/es/line/models/arc_3d.js +55 -7
- package/es/line/models/flow.d.ts +17 -0
- package/es/line/models/flow.js +35 -7
- package/es/line/models/great_circle.d.ts +17 -0
- package/es/line/models/great_circle.js +34 -6
- package/es/line/models/line.d.ts +17 -0
- package/es/line/models/line.js +17 -8
- package/es/line/models/simple_line.d.ts +14 -0
- package/es/line/models/simple_line.js +12 -47
- package/es/line/models/wall.d.ts +17 -0
- package/es/line/models/wall.js +22 -48
- package/es/line/shaders/arc/line_arc_vert.glsl +44 -52
- package/es/line/shaders/arc3d/line_arc_3d_vert.glsl +15 -20
- package/es/line/shaders/flow/flow_line_vert.glsl +30 -48
- package/es/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +53 -74
- package/es/line/shaders/line/line_vert.glsl +31 -48
- package/es/line/shaders/simple/simpleline_vert.glsl +18 -23
- package/es/line/shaders/wall/wall_vert.glsl +36 -45
- package/es/mask/models/fill.js +2 -1
- package/es/mask/shaders/mask_vert.glsl +2 -7
- package/es/plugins/DataMappingPlugin.d.ts +0 -1
- package/es/plugins/DataMappingPlugin.js +1 -24
- package/es/plugins/PixelPickingPlugin.js +2 -2
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -1
- package/es/plugins/RegisterStyleAttributePlugin.js +3 -25
- package/es/plugins/ShaderUniformPlugin.d.ts +0 -5
- package/es/plugins/ShaderUniformPlugin.js +4 -35
- package/es/point/models/billboard_point.d.ts +14 -0
- package/es/point/models/billboard_point.js +11 -3
- package/es/point/models/earthExtrude.d.ts +16 -0
- package/es/point/models/earthExtrude.js +15 -8
- package/es/point/models/earthFill.d.ts +16 -0
- package/es/point/models/earthFill.js +13 -5
- package/es/point/models/extrude.d.ts +16 -0
- package/es/point/models/extrude.js +19 -12
- package/es/point/models/fill.d.ts +16 -0
- package/es/point/models/fill.js +16 -5
- package/es/point/models/fillImage.d.ts +16 -0
- package/es/point/models/fillImage.js +16 -16
- package/es/point/models/image.d.ts +15 -0
- package/es/point/models/image.js +14 -4
- package/es/point/models/normal.d.ts +14 -0
- package/es/point/models/normal.js +11 -3
- package/es/point/models/radar.d.ts +15 -0
- package/es/point/models/radar.js +13 -4
- package/es/point/models/text.d.ts +16 -0
- package/es/point/models/text.js +18 -11
- package/es/point/shaders/billboard/billboard_point_vert.glsl +10 -13
- package/es/point/shaders/earthExtrude/earthExtrude_vert.glsl +15 -25
- package/es/point/shaders/earthFill/earthFill_vert.glsl +6 -6
- package/es/point/shaders/extrude/extrude_vert.glsl +35 -39
- package/es/point/shaders/fill/fill_vert.glsl +12 -14
- package/es/point/shaders/fillImage/fillImage_vert.glsl +16 -28
- package/es/point/shaders/image/image_vert.glsl +15 -12
- package/es/point/shaders/normal/normal_vert.glsl +7 -10
- package/es/point/shaders/radar/radar_vert.glsl +11 -11
- package/es/point/shaders/text/text_vert.glsl +10 -9
- package/es/polygon/models/extrude.d.ts +16 -0
- package/es/polygon/models/extrude.js +26 -26
- package/es/polygon/models/extrusion.d.ts +16 -0
- package/es/polygon/models/extrusion.js +34 -4
- package/es/polygon/models/fill.d.ts +14 -0
- package/es/polygon/models/fill.js +12 -4
- package/es/polygon/models/ocean.d.ts +14 -0
- package/es/polygon/models/ocean.js +11 -6
- package/es/polygon/models/water.d.ts +14 -0
- package/es/polygon/models/water.js +11 -6
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +17 -15
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +22 -20
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +17 -17
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +8 -8
- package/es/polygon/shaders/fill/fill_linear_vert.glsl +7 -6
- package/es/polygon/shaders/fill/fill_vert.glsl +10 -12
- package/es/polygon/shaders/ocean/ocean_vert.glsl +3 -4
- package/es/polygon/shaders/water/polygon_water_vert.glsl +5 -5
- package/es/raster/index.d.ts +1 -1
- package/es/raster/index.js +1 -1
- package/es/raster/models/raster.d.ts +14 -0
- package/es/raster/models/raster.js +13 -3
- package/es/raster/models/rasterRgb.d.ts +14 -0
- package/es/raster/models/rasterRgb.js +12 -3
- package/es/raster/models/rasterTerrainRgb.d.ts +14 -0
- package/es/raster/models/rasterTerrainRgb.js +11 -3
- package/es/raster/shaders/raster/raster_2d_vert.glsl +6 -6
- package/es/raster/shaders/rgb/raster_rgb_vert.glsl +11 -11
- package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +11 -11
- package/es/tile/core/BaseLayer.js +0 -16
- package/es/utils/extrude_polyline.d.ts +0 -15
- package/es/utils/extrude_polyline.js +0 -217
- package/es/wind/models/wind.d.ts +14 -0
- package/es/wind/models/wind.js +9 -1
- package/es/wind/shaders/wind_vert.glsl +6 -5
- package/lib/citybuliding/models/build.d.ts +16 -0
- package/lib/citybuliding/models/build.js +18 -20
- package/lib/citybuliding/shaders/build_frag.glsl +6 -6
- package/lib/citybuliding/shaders/build_vert.glsl +8 -14
- package/lib/core/BaseLayer.d.ts +0 -1
- package/lib/core/BaseLayer.js +9 -19
- package/lib/core/BaseModel.d.ts +15 -2
- package/lib/core/BaseModel.js +96 -62
- package/lib/core/CommonStyleAttribute.d.ts +14 -18
- package/lib/core/CommonStyleAttribute.js +23 -68
- package/lib/core/shape/extrude.js +6 -3
- package/lib/core/triangulation.js +22 -50
- package/lib/core/utils.d.ts +4 -0
- package/lib/core/utils.js +35 -0
- package/lib/earth/models/atmosphere.d.ts +15 -0
- package/lib/earth/models/atmosphere.js +30 -24
- package/lib/earth/models/base.d.ts +15 -0
- package/lib/earth/models/base.js +30 -24
- package/lib/earth/models/bloomsphere.d.ts +15 -0
- package/lib/earth/models/bloomsphere.js +30 -24
- package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +7 -5
- package/lib/earth/shaders/base/base_vert.glsl +3 -3
- package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +5 -4
- package/lib/geometry/models/billboard.d.ts +15 -0
- package/lib/geometry/models/billboard.js +14 -8
- package/lib/geometry/models/plane.d.ts +14 -0
- package/lib/geometry/models/plane.js +10 -10
- package/lib/geometry/models/sprite.js +3 -9
- package/lib/geometry/shaders/billboard_vert.glsl +28 -25
- package/lib/geometry/shaders/plane_vert.glsl +6 -6
- package/lib/geometry/shaders/sprite_vert.glsl +7 -9
- package/lib/heatmap/models/grid.d.ts +14 -0
- package/lib/heatmap/models/grid.js +10 -3
- package/lib/heatmap/models/grid3d.d.ts +16 -0
- package/lib/heatmap/models/grid3d.js +14 -6
- package/lib/heatmap/models/heatmap.d.ts +20 -1
- package/lib/heatmap/models/heatmap.js +95 -82
- package/lib/heatmap/models/hexagon.d.ts +14 -0
- package/lib/heatmap/models/hexagon.js +9 -3
- package/lib/heatmap/shaders/grid/grid_vert.glsl +30 -42
- package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +14 -26
- package/lib/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +19 -16
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +16 -22
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +3 -4
- package/lib/heatmap/shaders/hexagon/hexagon_vert.glsl +13 -23
- package/lib/image/models/image.d.ts +14 -0
- package/lib/image/models/image.js +11 -7
- package/lib/image/shaders/image_vert.glsl +7 -6
- package/lib/line/models/arc.d.ts +18 -0
- package/lib/line/models/arc.js +56 -7
- package/lib/line/models/arc_3d.d.ts +18 -0
- package/lib/line/models/arc_3d.js +55 -7
- package/lib/line/models/flow.d.ts +17 -0
- package/lib/line/models/flow.js +35 -7
- package/lib/line/models/great_circle.d.ts +17 -0
- package/lib/line/models/great_circle.js +33 -5
- package/lib/line/models/line.d.ts +17 -0
- package/lib/line/models/line.js +17 -8
- package/lib/line/models/simple_line.d.ts +14 -0
- package/lib/line/models/simple_line.js +12 -47
- package/lib/line/models/wall.d.ts +17 -0
- package/lib/line/models/wall.js +22 -48
- package/lib/line/shaders/arc/line_arc_vert.glsl +44 -52
- package/lib/line/shaders/arc3d/line_arc_3d_vert.glsl +15 -20
- package/lib/line/shaders/flow/flow_line_vert.glsl +30 -48
- package/lib/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +53 -74
- package/lib/line/shaders/line/line_vert.glsl +31 -48
- package/lib/line/shaders/simple/simpleline_vert.glsl +18 -23
- package/lib/line/shaders/wall/wall_vert.glsl +36 -45
- package/lib/mask/models/fill.js +2 -1
- package/lib/mask/shaders/mask_vert.glsl +2 -7
- package/lib/plugins/DataMappingPlugin.d.ts +0 -1
- package/lib/plugins/DataMappingPlugin.js +0 -23
- package/lib/plugins/PixelPickingPlugin.js +1 -1
- package/lib/plugins/RegisterStyleAttributePlugin.d.ts +0 -1
- package/lib/plugins/RegisterStyleAttributePlugin.js +2 -24
- package/lib/plugins/ShaderUniformPlugin.d.ts +0 -5
- package/lib/plugins/ShaderUniformPlugin.js +4 -35
- package/lib/point/models/billboard_point.d.ts +14 -0
- package/lib/point/models/billboard_point.js +11 -3
- package/lib/point/models/earthExtrude.d.ts +16 -0
- package/lib/point/models/earthExtrude.js +14 -7
- package/lib/point/models/earthFill.d.ts +16 -0
- package/lib/point/models/earthFill.js +13 -5
- package/lib/point/models/extrude.d.ts +16 -0
- package/lib/point/models/extrude.js +18 -11
- package/lib/point/models/fill.d.ts +16 -0
- package/lib/point/models/fill.js +16 -5
- package/lib/point/models/fillImage.d.ts +16 -0
- package/lib/point/models/fillImage.js +16 -16
- package/lib/point/models/image.d.ts +15 -0
- package/lib/point/models/image.js +14 -4
- package/lib/point/models/normal.d.ts +14 -0
- package/lib/point/models/normal.js +11 -3
- package/lib/point/models/radar.d.ts +15 -0
- package/lib/point/models/radar.js +13 -4
- package/lib/point/models/text.d.ts +16 -0
- package/lib/point/models/text.js +18 -11
- package/lib/point/shaders/billboard/billboard_point_vert.glsl +10 -13
- package/lib/point/shaders/earthExtrude/earthExtrude_vert.glsl +15 -25
- package/lib/point/shaders/earthFill/earthFill_vert.glsl +6 -6
- package/lib/point/shaders/extrude/extrude_vert.glsl +35 -39
- package/lib/point/shaders/fill/fill_vert.glsl +12 -14
- package/lib/point/shaders/fillImage/fillImage_vert.glsl +16 -28
- package/lib/point/shaders/image/image_vert.glsl +15 -12
- package/lib/point/shaders/normal/normal_vert.glsl +7 -10
- package/lib/point/shaders/radar/radar_vert.glsl +11 -11
- package/lib/point/shaders/text/text_vert.glsl +10 -9
- package/lib/polygon/models/extrude.d.ts +16 -0
- package/lib/polygon/models/extrude.js +25 -25
- package/lib/polygon/models/extrusion.d.ts +16 -0
- package/lib/polygon/models/extrusion.js +34 -4
- package/lib/polygon/models/fill.d.ts +14 -0
- package/lib/polygon/models/fill.js +12 -4
- package/lib/polygon/models/ocean.d.ts +14 -0
- package/lib/polygon/models/ocean.js +11 -6
- package/lib/polygon/models/water.d.ts +14 -0
- package/lib/polygon/models/water.js +11 -6
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +17 -15
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +22 -20
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +17 -17
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +8 -8
- package/lib/polygon/shaders/fill/fill_linear_vert.glsl +7 -6
- package/lib/polygon/shaders/fill/fill_vert.glsl +10 -12
- package/lib/polygon/shaders/ocean/ocean_vert.glsl +3 -4
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +5 -5
- package/lib/raster/index.d.ts +1 -1
- package/lib/raster/index.js +2 -2
- package/lib/raster/models/raster.d.ts +14 -0
- package/lib/raster/models/raster.js +13 -3
- package/lib/raster/models/rasterRgb.d.ts +14 -0
- package/lib/raster/models/rasterRgb.js +12 -3
- package/lib/raster/models/rasterTerrainRgb.d.ts +14 -0
- package/lib/raster/models/rasterTerrainRgb.js +11 -3
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +6 -6
- package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +11 -11
- package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +11 -11
- package/lib/tile/core/BaseLayer.js +0 -16
- package/lib/utils/extrude_polyline.d.ts +0 -15
- package/lib/utils/extrude_polyline.js +0 -217
- package/lib/wind/models/wind.d.ts +14 -0
- package/lib/wind/models/wind.js +9 -1
- package/lib/wind/shaders/wind_vert.glsl +6 -5
- package/package.json +6 -6
|
@@ -5,13 +5,11 @@ precision highp float;
|
|
|
5
5
|
#define diffuseRatio 0.3
|
|
6
6
|
#define specularRatio 0.2
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
layout(location =
|
|
10
|
-
layout(location =
|
|
11
|
-
layout(location =
|
|
12
|
-
layout(location =
|
|
13
|
-
layout(location = 13) in vec3 a_Normal;
|
|
14
|
-
|
|
8
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
9
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
10
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in vec3 a_Size;
|
|
11
|
+
layout(location = ATTRIBUTE_LOCATION_POS) in vec3 a_Pos;
|
|
12
|
+
layout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;
|
|
15
13
|
|
|
16
14
|
layout(std140) uniform commonUniform {
|
|
17
15
|
vec4 u_sourceColor;
|
|
@@ -42,7 +40,7 @@ float getYRadian(float x, float z) {
|
|
|
42
40
|
} else if(x > 0.0 && z <= 0.0){
|
|
43
41
|
return atan(-z/x) + pi/2.0;
|
|
44
42
|
} else if(x <= 0.0 && z <= 0.0) {
|
|
45
|
-
return pi + atan(x/z); //atan(x/z) +
|
|
43
|
+
return pi + atan(x/z); //atan(x/z) +
|
|
46
44
|
} else {
|
|
47
45
|
return atan(z/-x) + pi*3.0/2.0;
|
|
48
46
|
}
|
|
@@ -62,15 +60,7 @@ void main() {
|
|
|
62
60
|
|
|
63
61
|
vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移
|
|
64
62
|
if(u_heightfixed < 1.0) { // 圆柱体不固定高度
|
|
65
|
-
|
|
66
|
-
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
67
|
-
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
|
68
|
-
offset = offset * pow(2.0, (19.0 - u_Zoom));
|
|
69
|
-
}
|
|
70
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
71
|
-
// P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3
|
|
72
|
-
offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));
|
|
73
|
-
}
|
|
63
|
+
//
|
|
74
64
|
} else {// 圆柱体固定高度 ( 处理 mapbox )
|
|
75
65
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
76
66
|
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
@@ -98,7 +88,7 @@ void main() {
|
|
|
98
88
|
}
|
|
99
89
|
v_color.a *= u_opacity;
|
|
100
90
|
|
|
101
|
-
|
|
91
|
+
|
|
102
92
|
// 在地球模式下,将原本垂直于 xy 平面的圆柱调整姿态到适应圆的角度
|
|
103
93
|
//旋转矩阵mx,创建绕x轴旋转矩阵
|
|
104
94
|
float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);
|
|
@@ -106,9 +96,9 @@ void main() {
|
|
|
106
96
|
float xcos = cos(xRadian);//求解旋转角度余弦值
|
|
107
97
|
float xsin = sin(xRadian);//求解旋转角度正弦值
|
|
108
98
|
mat4 mx = mat4(
|
|
109
|
-
1,0,0,0,
|
|
110
|
-
0,xcos,-xsin,0,
|
|
111
|
-
0,xsin,xcos,0,
|
|
99
|
+
1,0,0,0,
|
|
100
|
+
0,xcos,-xsin,0,
|
|
101
|
+
0,xsin,xcos,0,
|
|
112
102
|
0,0,0,1);
|
|
113
103
|
|
|
114
104
|
//旋转矩阵my,创建绕y轴旋转矩阵
|
|
@@ -116,13 +106,13 @@ void main() {
|
|
|
116
106
|
float ycos = cos(yRadian);//求解旋转角度余弦值
|
|
117
107
|
float ysin = sin(yRadian);//求解旋转角度正弦值
|
|
118
108
|
mat4 my = mat4(
|
|
119
|
-
ycos,0,-ysin,0,
|
|
120
|
-
0,1,0,0,
|
|
121
|
-
ysin,0,ycos,0,
|
|
109
|
+
ycos,0,-ysin,0,
|
|
110
|
+
0,1,0,0,
|
|
111
|
+
ysin,0,ycos,0,
|
|
122
112
|
0,0,0,1);
|
|
123
113
|
|
|
124
114
|
gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);
|
|
125
|
-
|
|
115
|
+
|
|
126
116
|
|
|
127
117
|
setPickingColor(a_PickingColor);
|
|
128
118
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
layout(location =
|
|
2
|
-
layout(location =
|
|
3
|
-
layout(location =
|
|
4
|
-
layout(location =
|
|
5
|
-
layout(location =
|
|
1
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
2
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
3
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;
|
|
4
|
+
layout(location = ATTRIBUTE_LOCATION_SHAPE) in float a_Shape;
|
|
5
|
+
layout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;
|
|
6
6
|
|
|
7
7
|
layout(std140) uniform commonUniform {
|
|
8
8
|
float u_additive;
|
|
@@ -43,4 +43,4 @@ void main() {
|
|
|
43
43
|
gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0);
|
|
44
44
|
|
|
45
45
|
setPickingColor(a_PickingColor);
|
|
46
|
-
}
|
|
46
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#define pi 3.1415926535
|
|
1
|
+
#define pi (3.1415926535)
|
|
2
2
|
|
|
3
|
-
layout(location =
|
|
4
|
-
layout(location =
|
|
5
|
-
layout(location =
|
|
6
|
-
layout(location =
|
|
7
|
-
layout(location =
|
|
3
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
4
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
5
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in vec3 a_Size;
|
|
6
|
+
layout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec4 a_Extrude;
|
|
7
|
+
layout(location = ATTRIBUTE_LOCATION_NORMAL) in vec3 a_Normal;
|
|
8
8
|
|
|
9
9
|
layout(std140) uniform commonUniforms {
|
|
10
10
|
float u_pickLight;
|
|
@@ -25,46 +25,41 @@ out float v_lightWeight;
|
|
|
25
25
|
#pragma include "picking"
|
|
26
26
|
|
|
27
27
|
float getYRadian(float x, float z) {
|
|
28
|
-
if(x > 0.0 && z > 0.0) {
|
|
29
|
-
return atan(x/z);
|
|
30
|
-
} else if(x > 0.0 && z <= 0.0){
|
|
31
|
-
return atan(-z/x) + pi/2.0;
|
|
32
|
-
} else if(x <= 0.0 && z <= 0.0) {
|
|
33
|
-
return
|
|
28
|
+
if (x > 0.0 && z > 0.0) {
|
|
29
|
+
return atan(x / z);
|
|
30
|
+
} else if (x > 0.0 && z <= 0.0) {
|
|
31
|
+
return atan(-z / x) + pi / 2.0;
|
|
32
|
+
} else if (x <= 0.0 && z <= 0.0) {
|
|
33
|
+
return pi + atan(x / z); //atan(x/z) +
|
|
34
34
|
} else {
|
|
35
|
-
return atan(z
|
|
35
|
+
return atan(z / -x) + pi * 3.0 / 2.0;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
float getXRadian(float y, float r) {
|
|
40
|
-
return atan(y/r);
|
|
40
|
+
return atan(y / r);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
void main() {
|
|
44
|
-
|
|
45
|
-
|
|
46
44
|
vec3 size = a_Size * a_Position;
|
|
47
45
|
|
|
48
46
|
vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移
|
|
49
47
|
|
|
50
|
-
if(u_heightfixed < 1.0) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
offset
|
|
59
|
-
}
|
|
60
|
-
} else {// 圆柱体固定高度 ( 处理 mapbox )
|
|
61
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
62
|
-
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
48
|
+
if (u_heightfixed < 1.0) {
|
|
49
|
+
// 圆柱体不固定高度
|
|
50
|
+
} else {
|
|
51
|
+
// 圆柱体固定高度 ( 处理 mapbox )
|
|
52
|
+
if (
|
|
53
|
+
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||
|
|
54
|
+
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET
|
|
55
|
+
) {
|
|
56
|
+
offset *= 4.0 / pow(2.0, 21.0 - u_Zoom);
|
|
63
57
|
}
|
|
64
58
|
}
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
vec2 positions = a_Extrude.xy;
|
|
61
|
+
vec2 positions64Low = a_Extrude.zw;
|
|
62
|
+
vec4 project_pos = project_position(vec4(positions, 0.0, 1.0), positions64Low);
|
|
68
63
|
|
|
69
64
|
// u_r 控制圆柱的生长
|
|
70
65
|
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
|
|
@@ -72,7 +67,8 @@ void main() {
|
|
|
72
67
|
// // 圆柱光照效果
|
|
73
68
|
float lightWeight = 1.0;
|
|
74
69
|
|
|
75
|
-
if(u_lightEnable > 0.0) {
|
|
70
|
+
if (u_lightEnable > 0.0) {
|
|
71
|
+
// 取消三元表达式,增强健壮性
|
|
76
72
|
lightWeight = calc_lighting(pos);
|
|
77
73
|
}
|
|
78
74
|
|
|
@@ -80,20 +76,20 @@ void main() {
|
|
|
80
76
|
|
|
81
77
|
v_color = a_Color;
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
if(u_linearColor == 1.0) {
|
|
79
|
+
// 设置圆柱的底色
|
|
80
|
+
if (u_linearColor == 1.0) {
|
|
81
|
+
// 使用渐变颜色
|
|
85
82
|
v_color = mix(u_sourceColor, u_targetColor, a_Position.z);
|
|
86
|
-
v_color.a =
|
|
83
|
+
v_color.a = v_color.a * opacity;
|
|
87
84
|
} else {
|
|
88
85
|
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
|
|
89
86
|
}
|
|
90
87
|
|
|
91
|
-
|
|
92
|
-
v_color.a *= u_opacitylinear_dir > 0.0 ?
|
|
88
|
+
if (u_opacitylinear > 0.0) {
|
|
89
|
+
v_color.a *= u_opacitylinear_dir > 0.0 ? 1.0 - a_Position.z : a_Position.z;
|
|
93
90
|
}
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
gl_Position = project_common_position_to_clipspace_v2(pos);
|
|
92
|
+
gl_Position = project_common_position_to_clipspace(pos);
|
|
97
93
|
|
|
98
94
|
setPickingColor(a_PickingColor);
|
|
99
95
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
layout(location =
|
|
2
|
-
layout(location =
|
|
3
|
-
layout(location =
|
|
4
|
-
layout(location =
|
|
5
|
-
layout(location =
|
|
1
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
2
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;
|
|
3
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
4
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;
|
|
5
|
+
layout(location = ATTRIBUTE_LOCATION_SHAPE) in float a_Shape;
|
|
6
|
+
layout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;
|
|
6
7
|
|
|
7
8
|
layout(std140) uniform commonUniforms {
|
|
8
9
|
vec3 u_blur_height_fixed;
|
|
@@ -11,7 +12,7 @@ layout(std140) uniform commonUniforms {
|
|
|
11
12
|
float u_stroke_opacity;
|
|
12
13
|
float u_size_unit;
|
|
13
14
|
float u_time;
|
|
14
|
-
vec4 u_animate;
|
|
15
|
+
vec4 u_animate;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
out vec4 v_color;
|
|
@@ -25,7 +26,7 @@ out float v_radius;
|
|
|
25
26
|
|
|
26
27
|
void main() {
|
|
27
28
|
// 透明度计算
|
|
28
|
-
v_stroke = stroke;
|
|
29
|
+
v_stroke = stroke;
|
|
29
30
|
vec3 extrude = a_Extrude;
|
|
30
31
|
float shape_type = a_Shape;
|
|
31
32
|
/*
|
|
@@ -51,17 +52,14 @@ void main() {
|
|
|
51
52
|
float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);
|
|
52
53
|
|
|
53
54
|
vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);
|
|
54
|
-
vec3 aPosition = a_Position;
|
|
55
55
|
|
|
56
56
|
offset = project_pixel(offset);
|
|
57
57
|
offset = rotate_matrix(offset,rotation);
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
// TODP: /abs(extrude.x) 是为了兼容地球模式
|
|
60
60
|
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
// vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));
|
|
64
|
-
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
62
|
+
vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);
|
|
65
63
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
|
|
66
64
|
|
|
67
65
|
float raisingHeight = u_blur_height_fixed.y;
|
|
@@ -74,8 +72,8 @@ void main() {
|
|
|
74
72
|
raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
|
-
|
|
78
|
-
gl_Position =
|
|
75
|
+
|
|
76
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
79
77
|
|
|
80
78
|
setPickingColor(a_PickingColor);
|
|
81
79
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
layout(location =
|
|
2
|
-
layout(location =
|
|
3
|
-
layout(location =
|
|
4
|
-
layout(location =
|
|
5
|
-
layout(location =
|
|
1
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
2
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;
|
|
3
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
4
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;
|
|
5
|
+
layout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;
|
|
6
|
+
layout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;
|
|
6
7
|
|
|
7
8
|
layout(std140) uniform commonUniform {
|
|
8
9
|
vec2 u_textSize;
|
|
9
|
-
float u_heightfixed
|
|
10
|
-
float u_raisingHeight
|
|
10
|
+
float u_heightfixed;
|
|
11
|
+
float u_raisingHeight;
|
|
11
12
|
float u_size_unit;
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -15,43 +16,30 @@ out vec2 v_uv;
|
|
|
15
16
|
out vec2 v_Iconuv;
|
|
16
17
|
out float v_opacity;
|
|
17
18
|
|
|
18
|
-
|
|
19
19
|
#pragma include "projection"
|
|
20
20
|
#pragma include "picking"
|
|
21
21
|
#pragma include "rotation_2d"
|
|
22
22
|
|
|
23
23
|
void main() {
|
|
24
24
|
vec3 extrude = a_Extrude;
|
|
25
|
-
v_uv = (a_Extrude.xy + 1.0)/2.0;
|
|
25
|
+
v_uv = (a_Extrude.xy + 1.0) / 2.0;
|
|
26
26
|
v_uv.y = 1.0 - v_uv.y;
|
|
27
27
|
v_Iconuv = a_Uv;
|
|
28
28
|
v_opacity = opacity;
|
|
29
29
|
float newSize = a_Size;
|
|
30
|
-
if(u_size_unit == 1.0) {
|
|
31
|
-
newSize = newSize
|
|
30
|
+
if (u_size_unit == 1.0) {
|
|
31
|
+
newSize = newSize * u_PixelsPerMeter.z;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
// vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
|
|
35
|
-
vec2 offset = (extrude.xy * (newSize) + offsets);
|
|
36
33
|
|
|
37
|
-
offset =
|
|
34
|
+
// vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
|
|
35
|
+
vec2 offset = extrude.xy * newSize + offsets;
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
offset = rotate_matrix(offset, rotation);
|
|
40
38
|
|
|
41
39
|
offset = project_pixel(offset);
|
|
42
40
|
|
|
43
|
-
vec4 project_pos = project_position(vec4(
|
|
44
|
-
|
|
45
|
-
if(u_heightfixed < 1.0) { // height fixed
|
|
46
|
-
raisingHeight = project_pixel(u_raisingHeight);
|
|
47
|
-
} else {
|
|
48
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
49
|
-
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
50
|
-
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
41
|
+
vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);
|
|
42
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
55
43
|
|
|
56
44
|
setPickingColor(a_PickingColor);
|
|
57
45
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
layout(location =
|
|
2
|
-
layout(location =
|
|
3
|
-
layout(location =
|
|
4
|
-
layout(location =
|
|
1
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
2
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;
|
|
3
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
4
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;
|
|
5
|
+
layout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;
|
|
5
6
|
|
|
6
7
|
layout(std140) uniform commonUniforms {
|
|
7
8
|
vec2 u_textSize;
|
|
@@ -17,27 +18,29 @@ out float v_opacity;
|
|
|
17
18
|
#pragma include "picking"
|
|
18
19
|
|
|
19
20
|
void main() {
|
|
20
|
-
|
|
21
21
|
// cal style mapping - 数据纹理映射部分的计算
|
|
22
22
|
v_color = a_Color;
|
|
23
23
|
v_opacity = opacity;
|
|
24
24
|
v_uv = a_Uv;
|
|
25
|
-
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
26
|
-
|
|
25
|
+
vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);
|
|
26
|
+
|
|
27
27
|
vec2 offset = project_pixel(offsets);
|
|
28
28
|
|
|
29
29
|
float raisingHeight = u_raisingHeight;
|
|
30
|
-
if(u_heightfixed < 1.0) {
|
|
30
|
+
if (u_heightfixed < 1.0) {
|
|
31
|
+
// false
|
|
31
32
|
raisingHeight = project_pixel(u_raisingHeight);
|
|
32
33
|
} else {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
if (
|
|
35
|
+
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||
|
|
36
|
+
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET
|
|
37
|
+
) {
|
|
38
|
+
float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);
|
|
35
39
|
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
43
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
41
44
|
|
|
42
45
|
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
43
46
|
setPickingColor(a_PickingColor);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
layout(location =
|
|
2
|
-
layout(location =
|
|
3
|
-
layout(location =
|
|
1
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
2
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;
|
|
3
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
4
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;
|
|
4
5
|
|
|
5
6
|
layout(std140) uniform u_Common {
|
|
6
7
|
float u_size_scale;
|
|
@@ -14,12 +15,8 @@ out vec4 v_color;
|
|
|
14
15
|
void main() {
|
|
15
16
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} else {
|
|
20
|
-
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2., -a_Size /2., 0., 0.);
|
|
21
|
-
gl_Position = project_common_position_to_clipspace(project_pos);
|
|
22
|
-
}
|
|
18
|
+
vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);
|
|
19
|
+
gl_Position = project_common_position_to_clipspace(project_pos);
|
|
23
20
|
|
|
24
|
-
gl_PointSize = a_Size * u_size_scale *
|
|
21
|
+
gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio;
|
|
25
22
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
layout(location =
|
|
2
|
-
layout(location =
|
|
3
|
-
layout(location =
|
|
4
|
-
layout(location =
|
|
1
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
2
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;
|
|
3
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
4
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;
|
|
5
|
+
layout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;
|
|
5
6
|
|
|
6
7
|
layout(std140) uniform commonUniorm {
|
|
7
8
|
float u_additive;
|
|
@@ -22,8 +23,8 @@ void main() {
|
|
|
22
23
|
float newSize = setPickingSize(a_Size);
|
|
23
24
|
|
|
24
25
|
float time = u_time * u_speed;
|
|
25
|
-
mat2 rotateMatrix = mat2(
|
|
26
|
-
cos(time), sin(time),
|
|
26
|
+
mat2 rotateMatrix = mat2(
|
|
27
|
+
cos(time), sin(time),
|
|
27
28
|
-sin(time), cos(time)
|
|
28
29
|
);
|
|
29
30
|
v_extrude = rotateMatrix * a_Extrude.xy;
|
|
@@ -40,14 +41,13 @@ void main() {
|
|
|
40
41
|
v_radius = newSize;
|
|
41
42
|
|
|
42
43
|
vec2 offset = (a_Extrude.xy * (newSize));
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
offset = project_pixel(offset);
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
v_data = vec4(a_Extrude.x, a_Extrude.y, antialiasblur, -1.0);
|
|
48
48
|
|
|
49
|
-
vec4 project_pos = project_position(vec4(
|
|
50
|
-
gl_Position =
|
|
49
|
+
vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);
|
|
50
|
+
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
|
|
51
51
|
|
|
52
52
|
setPickingColor(a_PickingColor);
|
|
53
53
|
}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
#define EDGE_GAMMA 0.105
|
|
3
3
|
#define FONT_SIZE 24.0
|
|
4
4
|
|
|
5
|
-
layout(location =
|
|
6
|
-
layout(location =
|
|
7
|
-
layout(location =
|
|
8
|
-
layout(location =
|
|
9
|
-
layout(location =
|
|
5
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;
|
|
6
|
+
layout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;
|
|
7
|
+
layout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;
|
|
8
|
+
layout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;
|
|
9
|
+
layout(location = ATTRIBUTE_LOCATION_TEXT_OFFSETS) in vec2 a_textOffsets;
|
|
10
|
+
layout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_tex;
|
|
10
11
|
|
|
11
12
|
layout(std140) uniform commonUniforms {
|
|
12
13
|
vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
@@ -29,7 +30,7 @@ out float v_fontScale;
|
|
|
29
30
|
|
|
30
31
|
void main() {
|
|
31
32
|
// cal style mapping - 数据纹理映射部分的计算
|
|
32
|
-
|
|
33
|
+
|
|
33
34
|
v_uv = a_tex / u_sdf_map_size;
|
|
34
35
|
|
|
35
36
|
|
|
@@ -41,11 +42,11 @@ void main() {
|
|
|
41
42
|
float fontScale = a_Size / FONT_SIZE;
|
|
42
43
|
v_fontScale = fontScale;
|
|
43
44
|
|
|
44
|
-
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
45
|
+
vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);
|
|
45
46
|
// vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
46
47
|
|
|
47
48
|
vec2 offset = rotate_matrix(a_textOffsets,rotation);
|
|
48
|
-
|
|
49
|
+
|
|
49
50
|
// gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
50
51
|
|
|
51
52
|
float raiseHeight = u_raisingHeight;
|
|
@@ -54,7 +55,7 @@ void main() {
|
|
|
54
55
|
raiseHeight = u_raisingHeight * mapboxZoomScale;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
vec4 projected_position =
|
|
58
|
+
vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
|
|
58
59
|
|
|
59
60
|
gl_Position = vec4(
|
|
60
61
|
projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import type { IModel, ITexture2D } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class ExtrudeModel extends BaseModel {
|
|
4
|
+
protected get attributeLocation(): {
|
|
5
|
+
readonly POSITION: 0;
|
|
6
|
+
readonly POSITION_64LOW: 1;
|
|
7
|
+
readonly COLOR: 2;
|
|
8
|
+
readonly PICKING_COLOR: 3;
|
|
9
|
+
readonly STROKE: 4;
|
|
10
|
+
readonly OPACITY: 5;
|
|
11
|
+
readonly OFFSETS: 6;
|
|
12
|
+
readonly ROTATION: 7;
|
|
13
|
+
readonly MAX: 8;
|
|
14
|
+
} & Record<string, number> & {
|
|
15
|
+
MAX: 8;
|
|
16
|
+
SIZE: number;
|
|
17
|
+
NORMAL: number;
|
|
18
|
+
UV: number;
|
|
19
|
+
};
|
|
4
20
|
protected texture: ITexture2D;
|
|
5
21
|
getUninforms(): {
|
|
6
22
|
[x: string]: any;
|