@maptalks/vt 0.124.3 → 0.124.4

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @maptalks/vt v0.124.3
2
+ * @maptalks/vt v0.124.4
3
3
  * LICENSE : undefined
4
4
  * (c) 2016-2026 maptalks.org
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @maptalks/vt v0.124.3
2
+ * @maptalks/vt v0.124.4
3
3
  * LICENSE : undefined
4
4
  * (c) 2016-2026 maptalks.org
5
5
  */
@@ -12542,7 +12542,7 @@ class kn {
12542
12542
  }
12543
12543
  addMesh(e, t, n) {
12544
12544
  const i = n.isRenderingTerrain && this.isTerrainVector(), r = this.getRenderFBO(n);
12545
- e = e.filter((e => this.isMeshVisible(e))), i && (e = e.filter((e => e.geometry && e.geometry.data.aTerrainAltitude)));
12545
+ e = e.filter((e => this.isMeshVisible(e))), i && (e = e.filter((e => e.geometry && e.geometry.data.aTerrainAltitude || e instanceof g.InstancedMesh && e.instancedData.aTerrainAltitude)));
12546
12546
  const s = void 0 === this.sceneConfig.castShadow || !!this.sceneConfig.castShadow, o = !(!n || !n.bloom);
12547
12547
  for (let t = 0, a = e.length; t < a; t++) {
12548
12548
  const a = e[t], l = this.isBloom(a) && o;
@@ -13822,7 +13822,7 @@ class ai extends Rn {
13822
13822
  n.LINESOFAR_TYPE = r ? "u32" : "f32", this.shader = new g.MeshShader({
13823
13823
  name: "vt-line",
13824
13824
  vert: ri,
13825
- frag: "#define SHADER_NAME LINE\n#define DEVICE_PIXEL_RATIO 1.0\nprecision highp float;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_frag>\n#endif\nuniform lowp float blendSrcIsOne;\nuniform lowp float lineBlur;\nuniform float isRenderingTerrain;\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform lowp vec4 lineColor;\n#endif\n#include <highlight_frag>\n#ifdef HAS_STROKE_COLOR\nvarying vec4 vStrokeColor;\n#else\nuniform lowp vec4 lineStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvarying float vOpacity;\n#else\nuniform lowp float lineOpacity;\n#endif\nuniform float layerOpacity;\n#ifdef HAS_PATTERN\nuniform sampler2D linePatternFile;\nuniform vec2 atlasSize;\nuniform float flipY;\n#ifdef HAS_PATTERN_ANIM\nvarying float vLinePatternAnimSpeed;\n#else\nuniform float linePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nvarying float vLinePatternGap;\n#else\nuniform float linePatternGap;\n#endif\nuniform vec4 linePatterGapColor;\nvarying vec4 vTexInfo;\nvec2 c(vec2 d) {\n vec2 e = mod(d, 1.);\n vec2 f = vTexInfo.xy;\n vec2 h = vTexInfo.zw;\n return (f + e * h) / atlasSize;\n}\n#endif\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\nuniform float tileExtent;\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvarying vec4 vDasharray;\n#else\nuniform vec4 lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvarying vec4 vDashColor;\n#else\nuniform vec4 lineDashColor;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nvarying highp float vLinesofar;\n#endif\n#ifdef HAS_TRAIL\nuniform float trailSpeed;\nuniform float trailLength;\nuniform float trailCircle;\n#endif\n#if defined(HAS_TRAIL) || defined(HAS_PATTERN)\nuniform float currentTime;\n#endif\nfloat i(float j, float k) {\n float l = k / 2.;\n float m = abs(j - l);\n float n = (.1 + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n return clamp(min(m + n, l - m) / n, .0, 1.);\n}\nvarying vec3 vVertex;\nuniform vec3 cameraPosition;\nuniform float cameraToCenterDistance;\nuniform float fogFactor;\nvoid main() {\n \n#ifndef ENABLE_TILE_STENCIL\nfloat o = sign(tileExtent - min(tileExtent, abs(vPosition.x))) * sign(1. + sign(vPosition.x)) * sign(tileExtent - min(tileExtent, abs(vPosition.y))) * sign(1. + sign(vPosition.y));\n if(o == .0) {\n discard;\n }\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nfloat u = vLinesofar;\n#endif\nfloat v = length(vNormal) * vWidth.s;\n#ifdef HAS_PATTERN\nvec2 h = vTexInfo.zw;\n float A = sign(h.x * h.y);\n float B = mix(lineBlur, .0, A);\n#else\nfloat B = lineBlur;\n#endif\nfloat n = (B + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n float C = clamp(min(v - (vWidth.t - n), vWidth.s - v) / n, .0, 1.);\n#ifdef HAS_COLOR\nvec4 D = vColor / 255.;\n#else\nvec4 D = lineColor;\n#endif\n#ifdef HAS_PATTERN\nif(A == 1.) {\n \n#ifdef HAS_PATTERN_GAP\nfloat E = vLinePatternGap;\n#else\nfloat E = linePatternGap;\n#endif\n#ifdef HAS_PATTERN_ANIM\nfloat F = vLinePatternAnimSpeed;\n#else\nfloat F = linePatternAnimSpeed;\n#endif\nfloat G = h.x * vWidth.s * 2. / h.y;\n float H = G * (1. + E);\n u += mod(currentTime * -F * .2, H);\n float I = mod(u / H, 1.);\n float J = mod((flipY * vNormal.y + 1.) / 2., 1.);\n vec4 K = texture2D(linePatternFile, c(vec2(I * (1. + E), J)));\n float L = clamp(sign(1. / (1. + E) - I) + .000001, .0, 1.);\n K = mix(linePatterGapColor, K, L);\n D *= K;\n }\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvec4 M = vDasharray;\n#else\nvec4 M = lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvec4 N = vDashColor;\n#else\nvec4 N = lineDashColor;\n#endif\nfloat k = M[0] + M[1] + M[2] + M[3];\n float j = mod(u, k);\n float O = max(sign(M[0] - j), .0);\n float P = j - M[0] - M[1];\n float Q = max(sign(P), .0) * max(sign(M[2] - P), .0);\n float R = O + Q;\n float S = i(j, M[0]);\n float T = i(P, M[2]);\n float U = S * O + T * Q;\n D = D * (1. - U) + N * U;\n#endif\n#ifdef HAS_STROKE_COLOR\nvec4 V = vStrokeColor / 255.;\n#else\nvec4 V = lineStrokeColor;\n#endif\nV = mix(D, V, sign(vWidth.t));\n D = V * C + max(sign(vWidth.t - v), .0) * D * (1. - C);\n#ifdef HAS_TRAIL\nfloat W = mod(u - currentTime * trailSpeed * .1, trailCircle);\n float X = W < trailLength ? mix(.0, 1., W / trailLength) : .0;\n D *= X;\n#endif\n#ifdef HAS_OPACITY\nfloat Y = vOpacity;\n#else\nfloat Y = lineOpacity;\n#endif\ngl_FragColor = D * Y * layerOpacity;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nfloat Z = shadow_computeShadow();\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, Z);\n#endif\nfloat ba;\n if(isRenderingTerrain == 1.) {\n ba = 1.;\n } else {\n ba = clamp(cameraToCenterDistance * 1.5 / distance(vVertex, cameraPosition), .0, 1.);\n }\n gl_FragColor *= ba;\n gl_FragColor = highlight_blendColor(gl_FragColor);\n if(fogFactor > .0) {\n vec3 bb = vec3(vVertex[0] - cameraPosition[0], vVertex[1] - cameraPosition[1], vVertex[2] - cameraPosition[2]);\n float bc = length(bb);\n float bd = clamp(1. - (bc * 1.2) / fogFactor, .0, 1.);\n gl_FragColor *= bd;\n }\n}",
13825
+ frag: "#define SHADER_NAME LINE\n#define DEVICE_PIXEL_RATIO 1.0\nprecision highp float;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_frag>\n#endif\nuniform lowp float blendSrcIsOne;\nuniform lowp float lineBlur;\nuniform float isRenderingTerrain;\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform lowp vec4 lineColor;\n#endif\n#include <highlight_frag>\n#ifdef HAS_STROKE_COLOR\nvarying vec4 vStrokeColor;\n#else\nuniform lowp vec4 lineStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvarying float vOpacity;\n#else\nuniform lowp float lineOpacity;\n#endif\nuniform float layerOpacity;\n#ifdef HAS_PATTERN\nuniform sampler2D linePatternFile;\nuniform vec2 atlasSize;\nuniform float flipY;\n#ifdef HAS_PATTERN_ANIM\nvarying float vLinePatternAnimSpeed;\n#else\nuniform float linePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nvarying float vLinePatternGap;\n#else\nuniform float linePatternGap;\n#endif\nuniform vec4 linePatterGapColor;\nvarying vec4 vTexInfo;\nvec2 c(vec2 d) {\n vec2 e = mod(d, 1.);\n vec2 f = vTexInfo.xy;\n vec2 h = vTexInfo.zw;\n return (f + e * h) / atlasSize;\n}\n#endif\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\nuniform float tileExtent;\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvarying vec4 vDasharray;\n#else\nuniform vec4 lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvarying vec4 vDashColor;\n#else\nuniform vec4 lineDashColor;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nvarying highp float vLinesofar;\n#endif\n#ifdef HAS_TRAIL\nuniform float trailSpeed;\nuniform float trailLength;\nuniform float trailCircle;\n#endif\n#if defined(HAS_TRAIL) || defined(HAS_PATTERN)\nuniform float currentTime;\n#endif\nfloat i(float j, float k) {\n float l = k / 2.;\n float m = abs(j - l);\n float n = (.1 + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n return clamp(min(m + n, l - m) / n, .0, 1.);\n}\nvarying vec3 vVertex;\nuniform vec3 cameraPosition;\nuniform float cameraToCenterDistance;\nuniform float fogFactor;\nvoid main() {\n \n#ifndef ENABLE_TILE_STENCIL\nfloat o = sign(tileExtent - min(tileExtent, abs(vPosition.x))) * sign(1. + sign(vPosition.x)) * sign(tileExtent - min(tileExtent, abs(vPosition.y))) * sign(1. + sign(vPosition.y));\n if(o == .0) {\n discard;\n }\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nfloat u = vLinesofar;\n#endif\nfloat v = length(vNormal) * vWidth.s;\n#ifdef HAS_PATTERN\nvec2 h = vTexInfo.zw;\n float A = sign(h.x * h.y);\n float B = mix(lineBlur, .0, A);\n#else\nfloat B = lineBlur;\n#endif\nfloat n = (B + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n float C = clamp(min(v - (vWidth.t - n), vWidth.s - v) / n, .0, 1.);\n if(lineBlur == .0) {\n C = 1.;\n }\n#ifdef HAS_COLOR\nvec4 D = vColor / 255.;\n#else\nvec4 D = lineColor;\n#endif\n#ifdef HAS_PATTERN\nif(A == 1.) {\n \n#ifdef HAS_PATTERN_GAP\nfloat E = vLinePatternGap;\n#else\nfloat E = linePatternGap;\n#endif\n#ifdef HAS_PATTERN_ANIM\nfloat F = vLinePatternAnimSpeed;\n#else\nfloat F = linePatternAnimSpeed;\n#endif\nfloat G = h.x * vWidth.s * 2. / h.y;\n float H = G * (1. + E);\n u += mod(currentTime * -F * .2, H);\n float I = mod(u / H, 1.);\n float J = mod((flipY * vNormal.y + 1.) / 2., 1.);\n vec4 K = texture2D(linePatternFile, c(vec2(I * (1. + E), J)));\n float L = clamp(sign(1. / (1. + E) - I) + .000001, .0, 1.);\n K = mix(linePatterGapColor, K, L);\n D *= K;\n }\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvec4 M = vDasharray;\n#else\nvec4 M = lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvec4 N = vDashColor;\n#else\nvec4 N = lineDashColor;\n#endif\nfloat k = M[0] + M[1] + M[2] + M[3];\n float j = mod(u, k);\n float O = max(sign(M[0] - j), .0);\n float P = j - M[0] - M[1];\n float Q = max(sign(P), .0) * max(sign(M[2] - P), .0);\n float R = O + Q;\n float S = i(j, M[0]);\n float T = i(P, M[2]);\n float U = S * O + T * Q;\n D = D * (1. - U) + N * U;\n#endif\n#ifdef HAS_STROKE_COLOR\nvec4 V = vStrokeColor / 255.;\n#else\nvec4 V = lineStrokeColor;\n#endif\nV = mix(D, V, sign(vWidth.t));\n D = V * C + max(sign(vWidth.t - v), .0) * D * (1. - C);\n#ifdef HAS_TRAIL\nfloat W = mod(u - currentTime * trailSpeed * .1, trailCircle);\n float X = W < trailLength ? mix(.0, 1., W / trailLength) : .0;\n D *= X;\n#endif\n#ifdef HAS_OPACITY\nfloat Y = vOpacity;\n#else\nfloat Y = lineOpacity;\n#endif\ngl_FragColor = D * Y * layerOpacity;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nfloat Z = shadow_computeShadow();\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, Z);\n#endif\nfloat ba;\n if(isRenderingTerrain == 1.) {\n ba = 1.;\n } else {\n ba = clamp(cameraToCenterDistance * 1.5 / distance(vVertex, cameraPosition), .0, 1.);\n }\n gl_FragColor *= ba;\n gl_FragColor = highlight_blendColor(gl_FragColor);\n if(fogFactor > .0) {\n vec3 bb = vec3(vVertex[0] - cameraPosition[0], vVertex[1] - cameraPosition[1], vVertex[2] - cameraPosition[2]);\n float bc = length(bb);\n float bd = clamp(1. - (bc * 1.2) / fogFactor, .0, 1.);\n gl_FragColor *= bd;\n }\n}",
13826
13826
  wgslVert: A("vt_line_vert"),
13827
13827
  wgslFrag: A("vt_line_frag"),
13828
13828
  uniforms: t,
@@ -16531,16 +16531,18 @@ const ls = [], hs = [];
16531
16531
 
16532
16532
  function cs(e, t, n, i, r, s, o, a, l, h, c, u, f) {
16533
16533
  const {aVertical: d} = n.geometry.properties, p = d[s];
16534
- let g, y, x = as.call(this, ls, n, i, r, s, a, l, h, !1);
16535
- if (!x) return null;
16536
- if (m.copy(e, x), x = as.call(this, hs, n, i, r, o, a, l, h, !1), f = Math.PI * f / 180,
16537
- !x || Math.abs(x[2]) > f) return null;
16538
- if (m.copy(t, x), u && (T.transformMat2(ls, ls, u), T.transformMat2(hs, hs, u)),
16534
+ let g = as.call(this, ls, n, i, r, s, a, l, h, !1);
16535
+ if (!g) return null;
16536
+ if (m.copy(e, g), g = as.call(this, hs, n, i, r, o, a, l, h, !1), f = Math.PI * f / 180,
16537
+ !g) return null;
16538
+ let y, x, _ = Math.abs(g[2] - e[2]);
16539
+ if (_ > Math.PI && (_ = 2 * Math.PI - _), _ > f) return null;
16540
+ if (m.copy(t, g), u && (T.transformMat2(ls, ls, u), T.transformMat2(hs, hs, u)),
16539
16541
  p) {
16540
16542
  const e = Math.abs(hs[1] - ls[1]), t = Math.abs(hs[0] - ls[0]) * c;
16541
- y = ls[0] > hs[0] ? 1 : 0, e > t ? (g = 1, y = ls[1] < hs[1] ? 0 : 1) : g = 0;
16542
- } else g = 0, y = ls[0] > hs[0] ? 1 : 0;
16543
- return 2 * y + g;
16543
+ x = ls[0] > hs[0] ? 1 : 0, e > t ? (y = 1, x = ls[1] < hs[1] ? 0 : 1) : y = 0;
16544
+ } else y = 0, x = ls[0] > hs[0] ? 1 : 0;
16545
+ return 2 * x + y;
16544
16546
  }
16545
16547
 
16546
16548
  var us = "#define SHADER_NAME TEXT_VERT\n#define RAD 0.0174532925\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aShape;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float textPitchWithMap;\n#endif\n#if defined(HAS_TEXT_ROTATION_ALIGN)\nattribute float aRotationAlign;\n#else\nuniform float textRotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_TEXT_ROTATION)\nattribute float aRotation;\n#else\nuniform float textRotation;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform vec2 glyphTexSize;\nuniform vec2 canvasSize;\nuniform float glyphSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vTextSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nattribute vec2 aTextHalo;\nvarying vec2 vTextHalo;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aTextDx;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aTextDy;\n#else\nfloat f = textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nfloat h = aPitchAlign;\n#else\nfloat h = textPitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nfloat i = aRotationAlign;\n#else\nfloat i = textRotateWithMap;\n#endif\ngl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n float j = gl_Position.w;\n float k;\n if(isRenderingTerrain == 1. && h == 1.) {\n k = 1.;\n } else {\n float l = (1. - cameraToCenterDistance / j) * textPerspectiveRatio;\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\n }\n#ifdef HAS_TEXT_ROTATION\nfloat m = -aRotation / 9362. - mapRotation * i;\n#else\nfloat m = -textRotation - mapRotation * i;\n#endif\nif(h == 1.) {\n \n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\nm += mapRotation;\n#else\nm -= mapRotation;\n#endif\n }\n float n = sin(m);\n float o = cos(m);\n mat2 u = mat2(o, -1. * n, n, o);\n vec2 v = aShape.xy / 10.0;\n if(h == 1. && flipY == .0) {\n v = v * vec2(1., -1.);\n }\n vec2 A = aShape.zw;\n v = u * (v / glyphSize * d);\n float B;\n if(isRenderingTerrain == 1.) {\n B = 1.;\n } else {\n B = j / cameraToCenterDistance;\n }\n if(h == .0) {\n vec2 C = v * 2. / canvasSize;\n gl_Position.xy += C * k * j;\n } else {\n float D;\n if(isRenderingTerrain == 1.) {\n D = tileRatio / zoomScale;\n } else {\n D = tileRatio / zoomScale * B * k;\n }\n vec2 C = v;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(C, .0) * D, 1.);\n }\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * j;\n#ifndef PICKING_MODE\nif(h == .0) {\n vGammaScale = mix(1., B, textPerspectiveRatio);\n } else {\n vGammaScale = B + mapPitch / 4.;\n }\n vTexCoord = A / glyphTexSize;\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vTextSize = d;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nvTextHalo = aTextHalo;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool E = aOpacity == 255.;\n#else\nbool E = true;\n#endif\nfbo_picking_setData(gl_Position.w, E);\n#endif\n}", fs = "#define SHADER_NAME TEXT_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec2 aTexCoord;\n#ifdef HAS_OFFSET_Z\nattribute vec3 aOffset;\nuniform float altitudeScale;\n#else\nattribute vec2 aOffset;\n#endif\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float textPitchWithMap;\n#endif\nuniform float zoomScale;\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform float mapPitch;\nuniform vec2 glyphTexSize;\nuniform vec2 canvasSize;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\nuniform float textPitchFilter;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vTextSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nattribute vec2 aTextHalo;\nvarying vec2 vTextHalo;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_DX\nfloat d = aTextDx;\n#else\nfloat d = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat e = aTextDy;\n#else\nfloat e = textDy;\n#endif\n#ifdef HAS_TEXT_SIZE\nfloat f = aTextSize * layerScale;\n#else\nfloat f = textSize * layerScale;\n#endif\n#ifdef HAS_PITCH_ALIGN\nfloat h = aPitchAlign;\n#else\nfloat h = textPitchWithMap;\n#endif\ngl_Position = projViewModelMatrix * vec4(c, 1.);\n float i = gl_Position.w;\n float j = i / cameraToCenterDistance;\n float k;\n if(isRenderingTerrain == 1.) {\n k = 1.;\n } else {\n float l = (1. - cameraToCenterDistance / i) * textPerspectiveRatio;\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\n }\n#ifdef HAS_OFFSET_Z\nvec3 m = aOffset / 10.0;\n m[2] /= altitudeScale;\n#else\nvec3 m = vec3(aOffset / 10.0, .0);\n#endif\nvec2 n = aTexCoord;\n if(h == 1.) {\n float o;\n if(isRenderingTerrain == 1.) {\n o = tileRatio;\n } else {\n o = tileRatio / zoomScale * j * k;\n }\n m.xy *= o;\n gl_Position = projViewModelMatrix * vec4(c + m, 1.);\n } else {\n gl_Position.xy += m.xy * 2. / canvasSize * k * i;\n }\n gl_Position.xy += vec2(d, -e) * 2. / canvasSize * i;\n if(textPitchFilter > .0) {\n if(textPitchFilter == 1. && h == .0 || textPitchFilter == 2. && h == 1.) {\n gl_Position = vec4(-9999., -9999., .0, 1.);\n }\n }\n#ifndef PICKING_MODE\nif(h == 1.) {\n vGammaScale = j + mapPitch / 4.;\n } else {\n vGammaScale = mix(1., j, textPerspectiveRatio);\n }\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vTexCoord = n / glyphTexSize;\n vTextSize = f;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nvTextHalo = aTextHalo;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool u = aOpacity == 255.;\n#else\nbool u = true;\n#endif\nfbo_picking_setData(gl_Position.w, u);\n#endif\n}", ds = "#define SHADER_NAME TEXT_FRAG\nprecision mediump float;\nuniform float layerOpacity;\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nuniform float alphaTest;\n#include <text_render_frag>\n#include <highlight_frag>\nvoid main() {\n gl_FragColor = renderText(vTexCoord) * vOpacity * layerOpacity;\n if(gl_FragColor.a < alphaTest) {\n discard;\n }\n gl_FragColor = highlight_blendColor(gl_FragColor);\n}";
@@ -16996,18 +16998,21 @@ class Ks extends Rn {
16996
16998
  };
16997
16999
  let h;
16998
17000
  if (this.isWebGPU()) {
16999
- const {aPosition: e, aAltitude: t, aColor: i, aPickingId: r} = n.data, s = new Int16Array([ -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1 ]), o = new g.Geometry({
17000
- pointPosition: s
17001
+ const {aPosition: e, aAltitude: t, aColor: i, aPickingId: r, aTerrainAltitude: s} = n.data, o = new Int16Array([ -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1 ]), c = new g.Geometry({
17002
+ pointPosition: o
17001
17003
  }, 6, 0, {
17002
17004
  positionSize: 2,
17003
17005
  positionAttribute: "pointPosition"
17004
17006
  });
17005
- Be(o.properties, n.properties), o.generateBuffers(this.regl), h = new g.InstancedMesh({
17007
+ Be(c.properties, n.properties), c.generateBuffers(this.regl);
17008
+ const u = {
17006
17009
  instancePosition: e,
17007
17010
  instanceAltitude: t,
17008
17011
  aColor: i,
17009
17012
  aPickingId: r
17010
- }, n.getVertexCount(), o, a, l), h.generateInstancedBuffers(this.regl);
17013
+ };
17014
+ s && (u.aTerrainAltitude = s), h = new g.InstancedMesh(u, n.getVertexCount(), c, a, l),
17015
+ h.generateInstancedBuffers(this.regl);
17011
17016
  } else h = new g.Mesh(n, a, l);
17012
17017
  const c = {};
17013
17018
  return h.geometry.data.aAltitude && (c.HAS_ALTITUDE = 1), n.data.aColor && (c.HAS_COLOR = 1),
@@ -21660,5 +21665,5 @@ if (p.transcoders) {
21660
21665
 
21661
21666
  export { ma as BillBoardPainter, Ea as BillBoardPlugin, Fh as ExtrudePolygonLayer, ii as FillPainter, va as FillPlugin, Hh as FilterUtil, ka as GLTFPhongPlugin, Fa as GLTFStandardPlugin, za as GeoJSONVectorTileLayer, Oa as HeatmapPlugin, ns as IconPainter, Ta as IconPlugin, Aa as LineGradientPlugin, ai as LinePainter, ba as LinePlugin, ml as LineStringLayer, Ia as LitPlugin, La as MapboxVectorTileLayer, to as NativeLinePainter, Sa as NativeLinePlugin, Ks as NativePointPainter, Lh as PackUtil, xo as PhongPainter, Ma as PhongPlugin, dl as PointLayer, pl as PointLayerRenderer, vl as PolygonLayer, Nh as SYMBOLS_NEED_REBUILD_IN_VECTOR, zh as SYMBOLS_NEED_REBUILD_IN_VT, _a as TerrainFlatMaskPainter, Da as TerrainFlatMaskPlugin, Ys as TextPainter, wa as TextPlugin, Ca as TubePlugin, Et as Vector3DLayer, Mt as VectorTileLayer, dt as VectorTileLayerRenderer, Ra as WaterPlugin, vo as WireframePainter, Pa as WireframePlugin, q as getVectorPacker };
21662
21667
 
21663
- "undefined" != typeof console && console.log("@maptalks/vt v0.124.3");
21668
+ "undefined" != typeof console && console.log("@maptalks/vt v0.124.4");
21664
21669
  //# sourceMappingURL=maptalks.vt.es.js.map