@antv/l7-layers 2.16.0 → 2.16.2

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.
Files changed (218) hide show
  1. package/es/core/BaseLayer.d.ts +3 -0
  2. package/es/core/BaseLayer.js +76 -80
  3. package/es/core/BaseModel.d.ts +9 -71
  4. package/es/core/BaseModel.js +75 -357
  5. package/es/core/CommonStyleAttribute.d.ts +2 -0
  6. package/es/core/CommonStyleAttribute.js +66 -0
  7. package/es/core/interface.d.ts +13 -3
  8. package/es/core/shape/extrude.js +18 -6
  9. package/es/core/triangulation.d.ts +12 -0
  10. package/es/core/triangulation.js +70 -0
  11. package/es/heatmap/models/grid.js +1 -1
  12. package/es/heatmap/models/grid3d.js +1 -1
  13. package/es/heatmap/models/heatmap.d.ts +1 -0
  14. package/es/heatmap/models/heatmap.js +17 -13
  15. package/es/heatmap/models/hexagon.js +1 -1
  16. package/es/heatmap/shaders/grid_vert.glsl +2 -2
  17. package/es/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
  18. package/es/heatmap/shaders/hexagon_vert.glsl +2 -2
  19. package/es/line/index.d.ts +1 -0
  20. package/es/line/index.js +3 -2
  21. package/es/line/models/arc.js +9 -45
  22. package/es/line/models/arc_3d.js +12 -45
  23. package/es/line/models/earthArc_3d.js +6 -40
  24. package/es/line/models/{half.d.ts → flow.d.ts} +1 -11
  25. package/es/line/models/flow.js +167 -0
  26. package/es/line/models/great_circle.js +4 -38
  27. package/es/line/models/index.d.ts +1 -1
  28. package/es/line/models/index.js +3 -3
  29. package/es/line/models/line.js +7 -41
  30. package/es/line/models/linearline.js +4 -38
  31. package/es/line/models/simpleLine.d.ts +0 -1
  32. package/es/line/models/simpleLine.js +4 -43
  33. package/es/line/shaders/dash/arc_dash_frag.glsl +3 -6
  34. package/es/line/shaders/dash/arc_dash_vert.glsl +6 -46
  35. package/es/line/shaders/dash/line_dash_frag.glsl +4 -7
  36. package/es/line/shaders/dash/line_dash_vert.glsl +3 -33
  37. package/es/line/shaders/flow/flow_line_frag.glsl +13 -0
  38. package/es/line/shaders/flow/flow_line_vert.glsl +83 -0
  39. package/es/line/shaders/line_arc_3d_frag.glsl +6 -6
  40. package/es/line/shaders/line_arc_3d_vert.glsl +4 -34
  41. package/es/line/shaders/line_arc_frag.glsl +7 -11
  42. package/es/line/shaders/line_arc_great_circle_frag.glsl +5 -6
  43. package/es/line/shaders/line_arc_great_circle_vert.glsl +4 -32
  44. package/es/line/shaders/line_arc_vert.glsl +9 -45
  45. package/es/line/shaders/line_frag.glsl +15 -17
  46. package/es/line/shaders/line_vert.glsl +3 -34
  47. package/es/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
  48. package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
  49. package/es/line/shaders/linear/arc_linear_frag.glsl +2 -30
  50. package/es/line/shaders/linear/arc_linear_vert.glsl +9 -45
  51. package/es/line/shaders/linear/line_linear_frag.glsl +5 -6
  52. package/es/line/shaders/linearLine/line_linear_frag.glsl +2 -14
  53. package/es/line/shaders/linearLine/line_linear_vert.glsl +14 -32
  54. package/es/line/shaders/simple/simpleline_frag.glsl +1 -5
  55. package/es/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
  56. package/es/line/shaders/simple/simpleline_vert.glsl +7 -33
  57. package/es/plugins/DataMappingPlugin.js +20 -34
  58. package/es/plugins/LayerModelPlugin.js +13 -1
  59. package/es/plugins/ShaderUniformPlugin.js +3 -3
  60. package/es/point/index.d.ts +1 -0
  61. package/es/point/index.js +1 -0
  62. package/es/point/models/earthExtrude.d.ts +0 -3
  63. package/es/point/models/earthExtrude.js +2 -40
  64. package/es/point/models/earthFill.d.ts +0 -1
  65. package/es/point/models/earthFill.js +9 -60
  66. package/es/point/models/extrude.d.ts +0 -3
  67. package/es/point/models/extrude.js +3 -42
  68. package/es/point/models/fill.d.ts +0 -1
  69. package/es/point/models/fill.js +15 -76
  70. package/es/point/models/fillmage.js +6 -43
  71. package/es/point/models/image.js +7 -41
  72. package/es/point/models/normal.js +2 -2
  73. package/es/point/models/radar.d.ts +0 -1
  74. package/es/point/models/radar.js +4 -13
  75. package/es/point/models/simplePoint.d.ts +0 -1
  76. package/es/point/models/simplePoint.js +8 -49
  77. package/es/point/models/text.js +17 -47
  78. package/es/point/shaders/animate/wave_frag.glsl +1 -11
  79. package/es/point/shaders/earth/extrude_frag.glsl +5 -17
  80. package/es/point/shaders/earth/extrude_vert.glsl +14 -29
  81. package/es/point/shaders/earth/fill_frag.glsl +5 -14
  82. package/es/point/shaders/earth/fill_vert.glsl +1 -75
  83. package/es/point/shaders/extrude/extrude_frag.glsl +3 -29
  84. package/es/point/shaders/extrude/extrude_vert.glsl +27 -35
  85. package/es/point/shaders/fill_frag.glsl +9 -20
  86. package/es/point/shaders/fill_vert.glsl +16 -101
  87. package/es/point/shaders/image/fillImage_frag.glsl +2 -5
  88. package/es/point/shaders/image/fillImage_vert.glsl +4 -47
  89. package/es/point/shaders/image_frag.glsl +1 -5
  90. package/es/point/shaders/image_vert.glsl +1 -44
  91. package/es/point/shaders/normal_frag.glsl +0 -2
  92. package/es/point/shaders/normal_vert.glsl +2 -1
  93. package/es/point/shaders/radar/radar_vert.glsl +2 -2
  94. package/es/point/shaders/simplePoint_frag.glsl +0 -7
  95. package/es/point/shaders/simplePoint_vert.glsl +3 -45
  96. package/es/point/shaders/text_frag.glsl +6 -19
  97. package/es/point/shaders/text_vert.glsl +5 -66
  98. package/es/polygon/index.d.ts +1 -0
  99. package/es/polygon/index.js +1 -0
  100. package/es/polygon/models/extrude.d.ts +0 -3
  101. package/es/polygon/models/extrude.js +86 -82
  102. package/es/polygon/models/fill.d.ts +0 -4
  103. package/es/polygon/models/fill.js +8 -47
  104. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
  105. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
  106. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
  107. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
  108. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
  109. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
  110. package/es/polygon/shaders/polygon_frag.glsl +0 -5
  111. package/es/polygon/shaders/polygon_linear_frag.glsl +0 -8
  112. package/es/polygon/shaders/polygon_linear_vert.glsl +0 -32
  113. package/es/polygon/shaders/polygon_vert.glsl +1 -27
  114. package/es/utils/layerData.js +2 -2
  115. package/lib/core/BaseLayer.js +74 -78
  116. package/lib/core/BaseModel.js +74 -356
  117. package/lib/core/CommonStyleAttribute.js +72 -0
  118. package/lib/core/shape/extrude.js +18 -6
  119. package/lib/core/triangulation.js +72 -0
  120. package/lib/heatmap/models/grid.js +1 -1
  121. package/lib/heatmap/models/grid3d.js +1 -1
  122. package/lib/heatmap/models/heatmap.js +17 -13
  123. package/lib/heatmap/models/hexagon.js +1 -1
  124. package/lib/heatmap/shaders/grid_vert.glsl +2 -2
  125. package/lib/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
  126. package/lib/heatmap/shaders/hexagon_vert.glsl +2 -2
  127. package/lib/line/index.js +3 -2
  128. package/lib/line/models/arc.js +9 -45
  129. package/lib/line/models/arc_3d.js +12 -45
  130. package/lib/line/models/earthArc_3d.js +6 -40
  131. package/lib/line/models/flow.js +174 -0
  132. package/lib/line/models/great_circle.js +4 -38
  133. package/lib/line/models/index.js +3 -3
  134. package/lib/line/models/line.js +7 -41
  135. package/lib/line/models/linearline.js +4 -38
  136. package/lib/line/models/simpleLine.js +4 -43
  137. package/lib/line/shaders/dash/arc_dash_frag.glsl +3 -6
  138. package/lib/line/shaders/dash/arc_dash_vert.glsl +6 -46
  139. package/lib/line/shaders/dash/line_dash_frag.glsl +4 -7
  140. package/lib/line/shaders/dash/line_dash_vert.glsl +3 -33
  141. package/lib/line/shaders/flow/flow_line_frag.glsl +13 -0
  142. package/lib/line/shaders/flow/flow_line_vert.glsl +83 -0
  143. package/lib/line/shaders/line_arc_3d_frag.glsl +6 -6
  144. package/lib/line/shaders/line_arc_3d_vert.glsl +4 -34
  145. package/lib/line/shaders/line_arc_frag.glsl +7 -11
  146. package/lib/line/shaders/line_arc_great_circle_frag.glsl +5 -6
  147. package/lib/line/shaders/line_arc_great_circle_vert.glsl +4 -32
  148. package/lib/line/shaders/line_arc_vert.glsl +9 -45
  149. package/lib/line/shaders/line_frag.glsl +15 -17
  150. package/lib/line/shaders/line_vert.glsl +3 -34
  151. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
  152. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
  153. package/lib/line/shaders/linear/arc_linear_frag.glsl +2 -30
  154. package/lib/line/shaders/linear/arc_linear_vert.glsl +9 -45
  155. package/lib/line/shaders/linear/line_linear_frag.glsl +5 -6
  156. package/lib/line/shaders/linearLine/line_linear_frag.glsl +2 -14
  157. package/lib/line/shaders/linearLine/line_linear_vert.glsl +14 -32
  158. package/lib/line/shaders/simple/simpleline_frag.glsl +1 -5
  159. package/lib/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
  160. package/lib/line/shaders/simple/simpleline_vert.glsl +7 -33
  161. package/lib/plugins/DataMappingPlugin.js +20 -34
  162. package/lib/plugins/LayerModelPlugin.js +13 -1
  163. package/lib/plugins/ShaderUniformPlugin.js +3 -3
  164. package/lib/point/index.js +1 -0
  165. package/lib/point/models/earthExtrude.js +2 -40
  166. package/lib/point/models/earthFill.js +9 -60
  167. package/lib/point/models/extrude.js +3 -42
  168. package/lib/point/models/fill.js +15 -76
  169. package/lib/point/models/fillmage.js +6 -43
  170. package/lib/point/models/image.js +7 -41
  171. package/lib/point/models/normal.js +2 -2
  172. package/lib/point/models/radar.js +4 -13
  173. package/lib/point/models/simplePoint.js +8 -49
  174. package/lib/point/models/text.js +15 -45
  175. package/lib/point/shaders/animate/wave_frag.glsl +1 -11
  176. package/lib/point/shaders/earth/extrude_frag.glsl +5 -17
  177. package/lib/point/shaders/earth/extrude_vert.glsl +14 -29
  178. package/lib/point/shaders/earth/fill_frag.glsl +5 -14
  179. package/lib/point/shaders/earth/fill_vert.glsl +1 -75
  180. package/lib/point/shaders/extrude/extrude_frag.glsl +3 -29
  181. package/lib/point/shaders/extrude/extrude_vert.glsl +27 -35
  182. package/lib/point/shaders/fill_frag.glsl +9 -20
  183. package/lib/point/shaders/fill_vert.glsl +16 -101
  184. package/lib/point/shaders/image/fillImage_frag.glsl +2 -5
  185. package/lib/point/shaders/image/fillImage_vert.glsl +4 -47
  186. package/lib/point/shaders/image_frag.glsl +1 -5
  187. package/lib/point/shaders/image_vert.glsl +1 -44
  188. package/lib/point/shaders/normal_frag.glsl +0 -2
  189. package/lib/point/shaders/normal_vert.glsl +2 -1
  190. package/lib/point/shaders/radar/radar_vert.glsl +2 -2
  191. package/lib/point/shaders/simplePoint_frag.glsl +0 -7
  192. package/lib/point/shaders/simplePoint_vert.glsl +3 -45
  193. package/lib/point/shaders/text_frag.glsl +6 -19
  194. package/lib/point/shaders/text_vert.glsl +5 -66
  195. package/lib/polygon/index.js +1 -0
  196. package/lib/polygon/models/extrude.js +86 -82
  197. package/lib/polygon/models/fill.js +8 -47
  198. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
  199. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
  200. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
  201. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
  202. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
  203. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
  204. package/lib/polygon/shaders/polygon_frag.glsl +0 -5
  205. package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -8
  206. package/lib/polygon/shaders/polygon_linear_vert.glsl +0 -32
  207. package/lib/polygon/shaders/polygon_vert.glsl +1 -27
  208. package/lib/utils/layerData.js +2 -2
  209. package/package.json +7 -7
  210. package/es/line/models/half.js +0 -267
  211. package/es/line/shaders/half/line_half_frag.glsl +0 -53
  212. package/es/line/shaders/half/line_half_vert.glsl +0 -169
  213. package/es/utils/dataMappingStyle.d.ts +0 -31
  214. package/es/utils/dataMappingStyle.js +0 -137
  215. package/lib/line/models/half.js +0 -274
  216. package/lib/line/shaders/half/line_half_frag.glsl +0 -53
  217. package/lib/line/shaders/half/line_half_vert.glsl +0 -169
  218. package/lib/utils/dataMappingStyle.js +0 -140
@@ -3,9 +3,6 @@ attribute vec3 a_Position;
3
3
  attribute vec3 a_Extrude;
4
4
  attribute float a_Size;
5
5
  attribute float a_Shape;
6
-
7
- varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
8
-
9
6
  uniform mat4 u_ModelMatrix;
10
7
  uniform mat4 u_Mvp;
11
8
 
@@ -21,11 +18,6 @@ uniform vec2 u_offsets;
21
18
 
22
19
  uniform float u_blur : 0.0;
23
20
 
24
- #pragma include "styleMapping"
25
- #pragma include "styleMappingCalOpacity"
26
- #pragma include "styleMappingCalStrokeOpacity"
27
- #pragma include "styleMappingCalStrokeWidth"
28
-
29
21
  #pragma include "projection"
30
22
  #pragma include "picking"
31
23
 
@@ -39,72 +31,6 @@ void main() {
39
31
  float newSize = setPickingSize(a_Size);
40
32
  // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
41
33
 
42
- // cal style mapping - 数据纹理映射部分的计算
43
- styleMappingMat = mat4(
44
- 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
45
- 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
46
- 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
47
- 0.0, 0.0, 0.0, 0.0
48
- );
49
-
50
- float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
51
- float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
52
- float columnWidth = 1.0/columnCount; // 列宽
53
- float rowHeight = 1.0/rowCount; // 行高
54
- float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
55
- float id = a_vertexId; // 第n个顶点
56
- float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
57
- float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
58
-
59
- // cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
60
- // 按顺序从 cell 中取值、若没有则自动往下取值
61
- float textureOffset = 0.0; // 在 cell 中取值的偏移量
62
-
63
- vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
64
- styleMappingMat[0][0] = opacityAndOffset.r;
65
- textureOffset = opacityAndOffset.g;
66
-
67
- vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
68
- styleMappingMat[0][1] = strokeOpacityAndOffset.r;
69
- textureOffset = strokeOpacityAndOffset.g;
70
-
71
- vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
72
- styleMappingMat[0][2] = strokeWidthAndOffset.r;
73
- textureOffset = strokeWidthAndOffset.g;
74
-
75
- vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);
76
- if(hasStroke()) {
77
- vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
78
- styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R
79
- textureOffset += 1.0;
80
-
81
- vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
82
- styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G
83
- textureOffset += 1.0;
84
-
85
- vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
86
- styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B
87
- textureOffset += 1.0;
88
-
89
- vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
90
- styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A
91
- textureOffset += 1.0;
92
- } else {
93
- if(u_stroke_color == vec4(0.0)) {
94
- styleMappingMat[1][0] = v_color.r;
95
- styleMappingMat[1][1] = v_color.g;
96
- styleMappingMat[1][2] = v_color.b;
97
- styleMappingMat[1][3] = v_color.a;
98
- } else {
99
- styleMappingMat[1][0] = u_stroke_color.r;
100
- styleMappingMat[1][1] = u_stroke_color.g;
101
- styleMappingMat[1][2] = u_stroke_color.b;
102
- styleMappingMat[1][3] = u_stroke_color.a;
103
- }
104
- }
105
-
106
- // cal style mapping
107
-
108
34
  // unpack color(vec2)
109
35
  v_color = a_Color;
110
36
 
@@ -119,7 +45,7 @@ void main() {
119
45
  v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
120
46
 
121
47
 
122
- gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1, 1.0);
48
+ gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + u_offsets, 1.0);
123
49
 
124
50
  setPickingColor(a_PickingColor);
125
51
  }
@@ -1,43 +1,17 @@
1
1
  varying vec4 v_color;
2
- uniform float u_opacity: 1.0;
3
-
2
+ varying float v_lightWeight;
4
3
  uniform float u_pickLight: 0.0;
5
4
 
6
5
  #pragma include "picking"
7
6
 
8
- varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
9
-
10
- uniform float u_linearColor: 0;
11
- uniform vec4 u_sourceColor;
12
- uniform vec4 u_targetColor;
13
-
14
- uniform float u_opacitylinear: 0.0;
15
- uniform float u_opacitylinear_dir: 1.0;
16
7
 
17
8
  void main() {
18
- float opacity = styleMappingMat[0][0];
19
- float lightWeight = styleMappingMat[1][3];
20
- float barLinearZ = styleMappingMat[2][3];
21
-
22
- // 设置圆柱的底色
23
- if(u_linearColor == 1.0) { // 使用渐变颜色
24
- gl_FragColor = mix(u_sourceColor, u_targetColor, barLinearZ);
25
- gl_FragColor.rgb *= lightWeight;
26
- } else { // 使用 color 方法传入的颜色
27
- gl_FragColor = v_color;
28
- }
29
-
30
- // 应用透明度
31
- gl_FragColor.a *= opacity;
32
9
 
10
+ gl_FragColor = v_color;
33
11
  // 开启透明度渐变
34
- if(u_opacitylinear > 0.0) {
35
- gl_FragColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - barLinearZ): barLinearZ;
36
- }
37
-
38
12
  // picking
39
13
  if(u_pickLight > 0.0) {
40
- gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);
14
+ gl_FragColor = filterColorAlpha(gl_FragColor, v_lightWeight);
41
15
  } else {
42
16
  gl_FragColor = filterColor(gl_FragColor);
43
17
  }
@@ -16,14 +16,17 @@ uniform float u_r;
16
16
  uniform mat4 u_ModelMatrix;
17
17
  uniform mat4 u_Mvp;
18
18
  varying vec4 v_color;
19
+ varying float v_lightWeight;
20
+ varying float v_barLinearZ;
19
21
 
20
22
  uniform float u_opacity : 1;
21
23
  uniform float u_lightEnable: 1;
24
+ uniform float u_opacitylinear: 0.0;
25
+ uniform vec4 u_sourceColor;
26
+ uniform vec4 u_targetColor;
27
+ uniform float u_opacitylinear_dir: 1.0;
28
+ uniform float u_linearColor: 0.0;
22
29
 
23
- varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
24
-
25
- #pragma include "styleMapping"
26
- #pragma include "styleMappingCalOpacity"
27
30
 
28
31
  #pragma include "projection"
29
32
  #pragma include "light"
@@ -47,37 +50,11 @@ float getXRadian(float y, float r) {
47
50
 
48
51
  void main() {
49
52
 
50
- // cal style mapping - 数据纹理映射部分的计算
51
- styleMappingMat = mat4(
52
- 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
53
- 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA - lightWeight
54
- 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1] - linearZ(垂直方向 0 - 1 的值)
55
- 0.0, 0.0, 0.0, 0.0
56
- );
57
-
58
- float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
59
- float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
60
- float columnWidth = 1.0/columnCount; // 列宽
61
- float rowHeight = 1.0/rowCount; // 行高
62
- float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
63
- float id = a_vertexId; // 第n个顶点
64
- float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
65
- float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
66
-
67
- // cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
68
- // 按顺序从 cell 中取值、若没有则自动往下取值
69
- float textureOffset = 0.0; // 在 cell 中取值的偏移量
70
-
71
- vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
72
- styleMappingMat[0][0] = opacityAndOffset.r;
73
- textureOffset = opacityAndOffset.g;
74
- // cal style mapping - 数据纹理映射部分的计算
75
- vec3 size = a_Size * a_Position;
76
53
 
77
- // a_Position.z 是在构建网格的时候传入的标准值 0 - 1,在插值器插值可以获取 0~1 线性渐变的值
78
- styleMappingMat[2][3] = a_Position.z;
54
+ vec3 size = a_Size * a_Position;
79
55
 
80
56
  vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移
57
+
81
58
  if(u_heightfixed < 1.0) { // 圆柱体不固定高度
82
59
 
83
60
  if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
@@ -100,14 +77,29 @@ void main() {
100
77
  // u_r 控制圆柱的生长
101
78
  vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
102
79
 
103
- // 圆柱光照效果
80
+ // // 圆柱光照效果
104
81
  float lightWeight = 1.0;
82
+
105
83
  if(u_lightEnable > 0.0) { // 取消三元表达式,增强健壮性
106
84
  lightWeight = calc_lighting(pos);
107
85
  }
108
- styleMappingMat[1][3] = lightWeight;
109
86
 
110
- v_color =vec4(a_Color.rgb * lightWeight, a_Color.w);
87
+ v_lightWeight = lightWeight;
88
+
89
+ v_color = a_Color;
90
+
91
+ // 设置圆柱的底色
92
+ if(u_linearColor == 1.0) { // 使用渐变颜色
93
+ v_color = mix(u_sourceColor, u_targetColor, a_Position.z);
94
+ v_color.a = v_color.a * u_opacity;
95
+ } else {
96
+ v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * u_opacity);
97
+ }
98
+
99
+ if(u_opacitylinear > 0.0) {
100
+ v_color.a *= u_opacitylinear_dir > 0.0 ? (1.0 - a_Position.z): a_Position.z;
101
+ }
102
+
111
103
 
112
104
  // gl_Position = project_common_position_to_clipspace(pos);
113
105
 
@@ -1,10 +1,12 @@
1
1
  uniform float u_additive;
2
-
3
- varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
2
+ uniform float u_stroke_opacity : 1;
3
+ uniform float u_stroke_width : 2;
4
4
 
5
5
  varying vec4 v_data;
6
6
  varying vec4 v_color;
7
7
  varying float v_radius;
8
+ varying vec4 v_stroke;
9
+
8
10
 
9
11
  #pragma include "sdf_2d"
10
12
  #pragma include "picking"
@@ -12,21 +14,8 @@ varying float v_radius;
12
14
 
13
15
  void main() {
14
16
  int shape = int(floor(v_data.w + 0.5));
15
-
16
- vec4 textrueStroke = vec4(
17
- styleMappingMat[1][0],
18
- styleMappingMat[1][1],
19
- styleMappingMat[1][2],
20
- styleMappingMat[1][3]
21
- );
22
-
23
- float opacity = styleMappingMat[0][0];
24
- float stroke_opacity = styleMappingMat[0][1];
25
- float strokeWidth = styleMappingMat[0][2];
26
- vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;
27
-
28
17
  lowp float antialiasblur = v_data.z;
29
- float r = v_radius / (v_radius + strokeWidth);
18
+ float r = v_radius / (v_radius + u_stroke_width);
30
19
 
31
20
  float outer_df;
32
21
  float inner_df;
@@ -62,16 +51,16 @@ void main() {
62
51
 
63
52
  float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
64
53
 
65
- float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(
54
+ float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
66
55
  antialiasblur,
67
56
  0.0,
68
57
  inner_df
69
58
  );
70
59
 
71
- if(strokeWidth < 0.01) {
72
- gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);
60
+ if(u_stroke_width < 0.01) {
61
+ gl_FragColor = v_color;
73
62
  } else {
74
- gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);
63
+ gl_FragColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);
75
64
  }
76
65
 
77
66
  if(u_additive > 0.0) {
@@ -4,36 +4,27 @@ attribute vec3 a_Extrude;
4
4
  attribute float a_Size;
5
5
  attribute float a_Shape;
6
6
 
7
- varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
8
-
9
7
  uniform mat4 u_ModelMatrix;
10
8
  uniform mat4 u_Mvp;
11
- uniform int u_Size_Unit;
9
+ uniform int u_size_unit;
12
10
 
13
11
  varying vec4 v_data;
14
12
  varying vec4 v_color;
15
13
  varying float v_radius;
14
+ varying vec4 v_stroke;
16
15
 
17
- uniform float u_opacity : 1;
18
- uniform float u_stroke_opacity : 1;
19
- uniform float u_stroke_width : 2;
20
- uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
21
- uniform vec2 u_offsets;
22
-
23
- uniform float u_blur : 0.0;
24
- uniform float u_raisingHeight: 0.0;
25
- uniform float u_heightfixed: 0.0;
16
+ // uniform float u_opacity : 1;
17
+ uniform float u_stroke_width: 2;
18
+ uniform vec3 u_blur_height_fixed: [0, 0, 0];
26
19
 
27
- #pragma include "styleMapping"
28
- #pragma include "styleMappingCalOpacity"
29
- #pragma include "styleMappingCalStrokeOpacity"
30
- #pragma include "styleMappingCalStrokeWidth"
31
20
 
32
21
  #pragma include "projection"
33
22
  #pragma include "picking"
34
23
 
35
24
 
36
25
  void main() {
26
+ // 透明度计算
27
+ v_stroke = stroke;
37
28
  vec3 extrude = a_Extrude;
38
29
  float shape_type = a_Shape;
39
30
  /*
@@ -43,88 +34,12 @@ void main() {
43
34
  float newSize = setPickingSize(a_Size);
44
35
  // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
45
36
 
46
- // cal style mapping - 数据纹理映射部分的计算
47
- styleMappingMat = mat4(
48
- 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
49
- 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
50
- 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
51
- 0.0, 0.0, 0.0, 0.0
52
- );
53
-
54
- float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
55
- float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
56
- float columnWidth = 1.0/columnCount; // 列宽
57
- float rowHeight = 1.0/rowCount; // 行高
58
- float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
59
- float id = a_vertexId; // 第n个顶点
60
- float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
61
- float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
62
-
63
- // cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
64
- // 按顺序从 cell 中取值、若没有则自动往下取值
65
- float textureOffset = 0.0; // 在 cell 中取值的偏移量
66
-
67
- vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
68
- styleMappingMat[0][0] = opacityAndOffset.r;
69
- textureOffset = opacityAndOffset.g;
70
-
71
- vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
72
- styleMappingMat[0][1] = strokeOpacityAndOffset.r;
73
- textureOffset = strokeOpacityAndOffset.g;
74
-
75
- vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
76
- styleMappingMat[0][2] = strokeWidthAndOffset.r;
77
- textureOffset = strokeWidthAndOffset.g;
78
-
79
- vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);
80
- if(hasStroke()) {
81
- vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
82
- styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R
83
- textureOffset += 1.0;
84
-
85
- vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
86
- styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G
87
- textureOffset += 1.0;
88
-
89
- vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
90
- styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B
91
- textureOffset += 1.0;
92
-
93
- vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
94
- styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A
95
- textureOffset += 1.0;
96
- } else {
97
- if(u_stroke_color == vec4(0.0)) {
98
- styleMappingMat[1][0] = v_color.r;
99
- styleMappingMat[1][1] = v_color.g;
100
- styleMappingMat[1][2] = v_color.b;
101
- styleMappingMat[1][3] = v_color.a;
102
- } else {
103
- styleMappingMat[1][0] = u_stroke_color.r;
104
- styleMappingMat[1][1] = u_stroke_color.g;
105
- styleMappingMat[1][2] = u_stroke_color.b;
106
- styleMappingMat[1][3] = u_stroke_color.a;
107
- }
108
- }
109
37
 
110
- vec2 textrueOffsets = vec2(0.0, 0.0);
111
- if(hasOffsets()) {
112
- vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
113
- textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x
114
- textureOffset += 1.0;
115
-
116
- vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
117
- textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x
118
- textureOffset += 1.0;
119
- } else {
120
- textrueOffsets = u_offsets;
121
- }
122
-
123
- // cal style mapping
124
38
 
125
39
  // unpack color(vec2)
126
- v_color = a_Color;
127
- if(u_Size_Unit == 1) {
40
+ v_color = vec4(a_Color.xyz, a_Color.w * opacity);
41
+
42
+ if(u_size_unit == 1) {
128
43
  newSize = newSize * u_PixelsPerMeter.z;
129
44
  }
130
45
 
@@ -132,9 +47,9 @@ if(u_Size_Unit == 1) {
132
47
 
133
48
  // anti-alias
134
49
  // float antialiased_blur = -max(u_blur, antialiasblur);
135
- float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);
50
+ float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);
136
51
 
137
- vec2 offset = (extrude.xy * (newSize + u_stroke_width) + textrueOffsets);
52
+ vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);
138
53
  vec3 aPosition = a_Position;
139
54
 
140
55
  offset = project_pixel(offset);
@@ -147,14 +62,14 @@ if(u_Size_Unit == 1) {
147
62
  vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
148
63
  // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
149
64
 
150
- float raisingHeight = u_raisingHeight;
65
+ float raisingHeight = u_blur_height_fixed.y;
151
66
 
152
- if(u_heightfixed < 1.0) { // false
153
- raisingHeight = project_pixel(u_raisingHeight);
67
+ if(u_blur_height_fixed.z < 1.0) { // false
68
+ raisingHeight = project_pixel(u_blur_height_fixed.y);
154
69
  } else {
155
70
  if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
156
71
  float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
157
- raisingHeight = u_raisingHeight * mapboxZoomScale;
72
+ raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;
158
73
  }
159
74
  }
160
75
 
@@ -1,7 +1,6 @@
1
1
  uniform sampler2D u_texture;
2
2
  uniform vec2 u_textSize;
3
-
4
- varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
3
+ uniform float u_opacity : 1;
5
4
 
6
5
  #pragma include "sdf_2d"
7
6
  #pragma include "picking"
@@ -10,11 +9,9 @@ varying vec2 v_Iconuv;
10
9
 
11
10
  void main() {
12
11
 
13
- float opacity = styleMappingMat[0][0];
14
-
15
12
  vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;
16
13
  gl_FragColor = texture2D(u_texture, pos);
17
- gl_FragColor.a *= opacity;
14
+ gl_FragColor.a *= u_opacity;
18
15
 
19
16
  gl_FragColor = filterColor(gl_FragColor);
20
17
  }
@@ -5,12 +5,10 @@ attribute float a_Size;
5
5
  attribute vec2 a_Uv;
6
6
  attribute float a_Rotate;
7
7
 
8
- varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
9
-
10
8
  uniform mat4 u_ModelMatrix;
11
9
  uniform mat4 u_Mvp;
12
10
  uniform mat2 u_RotateMatrix;
13
- uniform int u_Size_Unit;
11
+ uniform int u_size_unit;
14
12
 
15
13
  varying vec2 v_uv; // 本身的 uv 坐标
16
14
  varying vec2 v_Iconuv; // icon 贴图的 uv 坐标
@@ -20,69 +18,28 @@ uniform float u_heightfixed: 0.0;
20
18
  uniform float u_opacity : 1;
21
19
  uniform vec2 u_offsets;
22
20
 
23
- #pragma include "styleMapping"
24
- #pragma include "styleMappingCalOpacity"
21
+
25
22
 
26
23
  #pragma include "projection"
27
24
  #pragma include "picking"
28
25
 
29
26
  void main() {
30
27
  vec3 extrude = a_Extrude;
31
-
32
28
  v_uv = (a_Extrude.xy + 1.0)/2.0;
33
29
  v_uv.y = 1.0 - v_uv.y;
34
30
  v_Iconuv = a_Uv;
35
31
 
36
- // cal style mapping - 数据纹理映射部分的计算
37
- styleMappingMat = mat4(
38
- 0.0, 0.0, 0.0, 0.0, // opacity - empty - empty - empty
39
- 0.0, 0.0, 0.0, 0.0, // empty - empty - empty - empty
40
- 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
41
- 0.0, 0.0, 0.0, 0.0
42
- );
43
-
44
- float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
45
- float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
46
- float columnWidth = 1.0/columnCount; // 列宽
47
- float rowHeight = 1.0/rowCount; // 行高
48
- float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
49
- float id = a_vertexId; // 第n个顶点
50
- float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
51
- float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
52
-
53
- // cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
54
- // 按顺序从 cell 中取值、若没有则自动往下取值
55
- float textureOffset = 0.0; // 在 cell 中取值的偏移量
56
-
57
- vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
58
- styleMappingMat[0][0] = opacityAndOffset.r;
59
- textureOffset = opacityAndOffset.g;
60
-
61
- vec2 textrueOffsets = vec2(0.0, 0.0);
62
- if(hasOffsets()) {
63
- vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
64
- textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x
65
- textureOffset += 1.0;
66
-
67
- vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
68
- textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x
69
- textureOffset += 1.0;
70
- } else {
71
- textrueOffsets = u_offsets;
72
- }
73
-
74
- // cal style mapping
75
32
 
76
33
  highp float angle_sin = sin(a_Rotate);
77
34
  highp float angle_cos = cos(a_Rotate);
78
35
  mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);
79
36
  float newSize = a_Size;
80
- if(u_Size_Unit == 1) {
37
+ if(u_size_unit == 1) {
81
38
  newSize = newSize * u_PixelsPerMeter.z;
82
39
  }
83
40
 
84
41
  // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
85
- vec2 offset = (rotation_matrix * u_RotateMatrix * extrude.xy * (newSize) + textrueOffsets);
42
+ vec2 offset = (rotation_matrix * u_RotateMatrix * extrude.xy * (newSize) + u_offsets);
86
43
  vec3 aPosition = a_Position;
87
44
 
88
45
  offset = project_pixel(offset);
@@ -5,13 +5,9 @@ varying vec2 v_uv;
5
5
  uniform vec2 u_textSize;
6
6
  uniform float u_opacity : 1;
7
7
 
8
- varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
9
-
10
8
  #pragma include "picking"
11
9
 
12
10
  void main(){
13
- float opacity = styleMappingMat[0][0];
14
- float size = styleMappingMat[1][0];
15
11
  vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;
16
12
  vec4 textureColor;
17
13
 
@@ -34,7 +30,7 @@ void main(){
34
30
  gl_FragColor= step(0.01, textureColor.z) * v_color;
35
31
  }
36
32
 
37
- gl_FragColor.a = gl_FragColor.a * opacity;
33
+ gl_FragColor.a = gl_FragColor.a * u_opacity;
38
34
 
39
35
  if (gl_FragColor.a < 0.01) {
40
36
  discard;
@@ -13,61 +13,18 @@ uniform float u_opacity : 1;
13
13
  uniform float u_raisingHeight: 0.0;
14
14
  uniform float u_heightfixed: 0.0;
15
15
 
16
- varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
17
-
18
- #pragma include "styleMapping"
19
- #pragma include "styleMappingCalOpacity"
20
16
 
21
17
  #pragma include "projection"
22
18
  #pragma include "picking"
23
19
 
24
20
  void main() {
25
- // cal style mapping - 数据纹理映射部分的计算
26
- styleMappingMat = mat4(
27
- 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
28
- 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
29
- 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
30
- 0.0, 0.0, 0.0, 0.0
31
- );
32
-
33
- float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
34
- float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
35
- float columnWidth = 1.0/columnCount; // 列宽
36
- float rowHeight = 1.0/rowCount; // 行高
37
- float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
38
- float id = a_vertexId; // 第n个顶点
39
- float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
40
- float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
41
-
42
- // cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
43
- // 按顺序从 cell 中取值、若没有则自动往下取值
44
- float textureOffset = 0.0; // 在 cell 中取值的偏移量
45
-
46
- vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
47
- styleMappingMat[0][0] = opacityAndOffset.r;
48
- textureOffset = opacityAndOffset.g;
49
-
50
- styleMappingMat[1][0] = a_Size;
51
-
52
- vec2 textrueOffsets = vec2(0.0, 0.0);
53
- if(hasOffsets()) {
54
- vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
55
- textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x
56
- textureOffset += 1.0;
57
-
58
- vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);
59
- textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x
60
- textureOffset += 1.0;
61
- } else {
62
- textrueOffsets = u_offsets;
63
- }
64
21
 
65
22
  // cal style mapping - 数据纹理映射部分的计算
66
23
  v_color = a_Color;
67
24
  v_uv = a_Uv;
68
25
  vec4 project_pos = project_position(vec4(a_Position, 1.0));
69
26
 
70
- vec2 offset = project_pixel(textrueOffsets);
27
+ vec2 offset = project_pixel(u_offsets);
71
28
 
72
29
  float raisingHeight = u_raisingHeight;
73
30
  if(u_heightfixed < 1.0) { // false
@@ -1,6 +1,4 @@
1
- uniform float u_opacity : 1;
2
1
  varying vec4 v_color;
3
2
  void main() {
4
3
  gl_FragColor = v_color;
5
- gl_FragColor.a *= u_opacity;
6
4
  }