Modern Apps git

← Modern-Apps.git

map: globe depth-off, edge subdivision, globe widths, building/halo fixes

Commit
e185700301ecf1fe6a68efeede7573e276c3136f
Author
vayun-mathur <[email protected]>
When
2026-10-24 21:57 UTC (1 month ago)
Parents
524a2a7

Diff

library/map/src/main/rust/shaders/building.vert
diff --git a/library/map/src/main/rust/shaders/building.vert b/library/map/src/main/rust/shaders/building.vertindex 71a90611e1..221a1548cd 100644--- a/library/map/src/main/rust/shaders/building.vert+++ b/library/map/src/main/rust/shaders/building.vert@@ -36,10 +36,10 @@ void main() {     // -cos(pitch) once tilted. That distinguishes the two, and they need different z inputs.     if (abs(push.tileToClip[2][3]) < 1e-6) {         // Pitch 0: the ortho matrix copies z straight to clip depth and never lets height touch-        // x/y, so the building already reads as its flat footprint. Feed the small tile-normalised-        // height (clamped into range) instead of the world-px one, which would fall outside the-        // [0, w] depth range and clip the whole building away.-        gl_Position = push.tileToClip * vec4(inPosition.xy, clamp(inPosition.z, 0.0, 0.99), 1.0);+        // x/y, so the building already reads as its flat footprint. Feed a depth that falls as the+        // tile-normalised height rises, so where roofs overlap (a tower part inside its podium's+        // outline) the taller one wins LESS. Kept in [0, 0.99], in front of the terrain's 0.9995.+        gl_Position = push.tileToClip * vec4(inPosition.xy, 0.99 - clamp(inPosition.z, 0.0, 0.99), 1.0);     } else {         // Tilted: the full perspective maps a real world-px height to both the projected rise and a         // depth inside the near/far range, so buildings extrude and occlude correctly.
library/map/src/main/rust/shaders/fill_globe.vert
diff --git a/library/map/src/main/rust/shaders/fill_globe.vert b/library/map/src/main/rust/shaders/fill_globe.vertindex 42388199a7..db14f2a604 100644--- a/library/map/src/main/rust/shaders/fill_globe.vert+++ b/library/map/src/main/rust/shaders/fill_globe.vert@@ -17,9 +17,9 @@ // the only fragment difference from `fill.frag`, so opacity, fade and coverage // match the flat map exactly. Far-side vertices (z < 0) are emitted at the far // plane and the fragment stage discards wherever the interpolated z is negative,-// so straddling triangles cut cleanly at the limb. Depth is `1 - z`: the-// sub-camera point is nearest (0), the limb farthest (1). Screen y follows the-// CPU anchor convention (`halfH - y`, north up).+// so straddling triangles cut cleanly at the limb. The pipeline is depth-off+// (layer order composites, as on the flat map), so the depth written below is+// inert. Screen y follows the CPU anchor convention (`halfH - y`, north up).  layout(location = 0) in vec3 inPosition; 
library/map/src/main/rust/shaders/line_globe.vert
diff --git a/library/map/src/main/rust/shaders/line_globe.vert b/library/map/src/main/rust/shaders/line_globe.vertindex b434708e44..62663eceee 100644--- a/library/map/src/main/rust/shaders/line_globe.vert+++ b/library/map/src/main/rust/shaders/line_globe.vert@@ -33,9 +33,17 @@ const float MIN_HALF_WIDTH_PX = 0.5; const float PI = 3.141592653589793;  void main() {+    float ox = push.tileToClip[0][2];+    float oy = push.tileToClip[1][2];+    float span = push.tileToClip[2][2];+    // `misc.x` is the flat tile's px span. On the ball (radius = half the flat world width)+    // Mercator's conformal scale makes one tile unit pi * cos(lat) times longer, in both+    // directions, so widths and dash lengths convert through the globe's own span.+    // cos(lat) = 1 / cosh(n) for the Mercator n of this vertex's unbent position.+    float n0 = PI - 2.0 * PI * (oy + inPosition.y * span);+    float tilePx = max(push.misc.x, 1.0) * PI * max(1.0 / cosh(n0), 0.05);     float wantHalfPx = push.line.x;     float gapHalfPx = push.line.y;-    float tilePx = max(push.misc.x, 1.0);     float lateralPx = push.misc.z;     float halfWidthPx = max(wantHalfPx, MIN_HALF_WIDTH_PX);     float offsetPx = inExtrude.x * gapHalfPx + inExtrude.y * halfWidthPx + lateralPx;@@ -44,9 +52,6 @@ void main() {     vec2 offsetTile = inNormal * (offsetPx / tilePx);     vec2 bent = inPosition + offsetTile; -    float ox = push.tileToClip[0][2];-    float oy = push.tileToClip[1][2];-    float span = push.tileToClip[2][2];     float wx = ox + bent.x * span;     float wy = oy + bent.y * span;     float lon = wx * 360.0 - 180.0;
library/map/src/main/rust/shaders/road_surface_globe.vert
diff --git a/library/map/src/main/rust/shaders/road_surface_globe.vert b/library/map/src/main/rust/shaders/road_surface_globe.vertindex c47d6de1da..585fe91813 100644--- a/library/map/src/main/rust/shaders/road_surface_globe.vert+++ b/library/map/src/main/rust/shaders/road_surface_globe.vert@@ -29,15 +29,17 @@ const float MIN_HALF_WIDTH_PX = 0.5; const float PI = 3.141592653589793;  void main() {+    float ox = push.tileToClip[0][2];+    float oy = push.tileToClip[1][2];+    float span = push.tileToClip[2][2];+    // The globe's own px per tile unit: see `line_globe.vert`.+    float n0 = PI - 2.0 * PI * (oy + inPosition.y * span);+    float tilePx = max(push.misc.x, 1.0) * PI * max(1.0 / cosh(n0), 0.05);     float wantHalfPx = push.line.x;-    float tilePx = max(push.misc.x, 1.0);     float halfWidthPx = max(wantHalfPx, MIN_HALF_WIDTH_PX);     vec2 offsetTile = inNormal * (inT * halfWidthPx / tilePx);     vec2 bent = inPosition + offsetTile; -    float ox = push.tileToClip[0][2];-    float oy = push.tileToClip[1][2];-    float span = push.tileToClip[2][2];     float wx = ox + bent.x * span;     float wy = oy + bent.y * span;     float lon = wx * 360.0 - 180.0;
library/map/src/main/rust/shaders/symbol.frag
diff --git a/library/map/src/main/rust/shaders/symbol.frag b/library/map/src/main/rust/shaders/symbol.fragindex 6e7fceb62e..9d4c9abf33 100644--- a/library/map/src/main/rust/shaders/symbol.frag+++ b/library/map/src/main/rust/shaders/symbol.frag@@ -38,7 +38,8 @@ void main() {     float haloSdf = push.line.y / max(push.line.x, 1.0) * push.line.z;     float halo = smoothstep(0.5 - haloSdf - aa, 0.5 - haloSdf + aa, dist);     vec3 haloRgb = push.misc.yzw;-    vec3 rgb = mix(haloRgb, push.color.rgb, face);+    // Without a halo the face's own antialiased edge must not pick up the halo colour.+    vec3 rgb = haloSdf > 0.0 ? mix(haloRgb, push.color.rgb, face) : push.color.rgb;     float alpha = max(halo * push.color.a, face * push.color.a);     if (alpha <= 0.001) discard;     outColor = vec4(rgb, alpha);
library/map/src/main/rust/src/tess/mod.rs
diff --git a/library/map/src/main/rust/src/tess/mod.rs b/library/map/src/main/rust/src/tess/mod.rsindex 80017c9fb2..09495dfda2 100644--- a/library/map/src/main/rust/src/tess/mod.rs+++ b/library/map/src/main/rust/src/tess/mod.rs@@ -9,5 +9,6 @@ pub mod fill; pub mod ribbon; pub mod roof; pub mod stroke;+pub mod subdivide; pub mod terrain; pub mod text;
library/map/src/main/rust/src/tess/subdivide.rs
diff --git a/library/map/src/main/rust/src/tess/subdivide.rs b/library/map/src/main/rust/src/tess/subdivide.rsnew file mode 100644index 0000000000..6391e7a18b--- /dev/null+++ b/library/map/src/main/rust/src/tess/subdivide.rs@@ -0,0 +1,210 @@+//! Midpoint subdivision of long triangle edges, for geometry the globe shaders bend.+//!+//! The `*_globe.vert` shaders move only vertices onto the sphere; the rasteriser fills+//! between them in straight lines. A z0–z7 tile edge spans many degrees, so without+//! extra vertices it cuts a chord through the ball, the planet reads as faceted, and a+//! triangle straddling the limb folds its far corner back over the disc.+//!+//! On the flat map a split is exact for fills (every attribute is used linearly) and+//! near-exact for strokes: the only product of two varying attributes is the miter+//! normal times the extrude multiplier, and a split diagonal follows that bilinear+//! form at its midpoint rather than the straight line between the corners. The+//! difference is confined to the join ends of a segment and to globe-zoom tiles.+use std::collections::HashMap;++/// The longest edge, in tile-local units, kept for a tile at zoom `z`.+///+/// Chord sag on a ball of radius `r` across an angle `a` is `r * a^2 / 8`. With the+/// globe radius `128 * 2^zoom` Dp, a camera at most half a level past the tile's zoom,+/// and an edge of `e` tile units spanning `2 * pi * e / 2^z` radians, sag stays under+/// half a Dp when `e <= sqrt(2^z / 2524)` — about 1/50 of a tile at z0, a third at z8.+pub fn globe_max_edge(z: u8) -> f32 {+    (2f32.powi(i32::from(z)) / 2524.0).sqrt().min(1.0)+}++/// Split every edge longer than `max_edge` at its midpoint, recursively, until none is.+///+/// Length is measured on each vertex's first two floats (tile-local x/y); every float of+/// a new vertex is the average of its edge's endpoints. Whether an edge splits, and where+/// its midpoint lands, depend only on its two endpoints, so neighbouring triangles split+/// a shared edge identically and no crack opens between them — whether they share the+/// vertex indices or only the positions.+pub fn subdivide(vertices: &mut Vec<f32>, indices: &mut Vec<u32>, fpv: usize, max_edge: f32) {+    let limit = max_edge * max_edge;+    let long = |v: &[f32], a: u32, b: u32| {+        let (a, b) = (a as usize * fpv, b as usize * fpv);+        let (dx, dy) = (v[a] - v[b], v[a + 1] - v[b + 1]);+        dx * dx + dy * dy > limit+    };+    let any_long = indices.chunks_exact(3).any(|t| {+        long(vertices, t[0], t[1]) || long(vertices, t[1], t[2]) || long(vertices, t[2], t[0])+    });+    if !any_long {+        return;+    }++    let mut midpoints: HashMap<(u32, u32), u32> = HashMap::new();+    let mut midpoint = |v: &mut Vec<f32>, a: u32, b: u32| -> u32 {+        *midpoints.entry((a.min(b), a.max(b))).or_insert_with(|| {+            let (pa, pb) = (a as usize * fpv, b as usize * fpv);+            for k in 0..fpv {+                let m = (v[pa + k] + v[pb + k]) * 0.5;+                v.push(m);+            }+            (v.len() / fpv - 1) as u32+        })+    };++    let mut stack: Vec<[u32; 3]> = indices.chunks_exact(3).map(|t| [t[0], t[1], t[2]]).collect();+    stack.reverse();+    let mut out = Vec::with_capacity(indices.len());+    while let Some(mut t) = stack.pop() {+        let mut split =+            [long(vertices, t[0], t[1]), long(vertices, t[1], t[2]), long(vertices, t[2], t[0])];+        let count = split.iter().filter(|&&s| s).count();+        // Rotate so one split edge is first (count 1) or the unsplit edge last (count 2).+        // Rotation keeps the winding.+        for _ in 0..3 {+            let canonical = match count {+                1 => split[0],+                2 => !split[2],+                _ => true,+            };+            if canonical {+                break;+            }+            t = [t[1], t[2], t[0]];+            split = [split[1], split[2], split[0]];+        }+        let [a, b, c] = t;+        match count {+            0 => out.extend_from_slice(&t),+            1 => {+                let ab = midpoint(vertices, a, b);+                stack.push([a, ab, c]);+                stack.push([ab, b, c]);+            }+            2 => {+                let ab = midpoint(vertices, a, b);+                let bc = midpoint(vertices, b, c);+                stack.push([ab, b, bc]);+                stack.push([a, ab, bc]);+                stack.push([a, bc, c]);+            }+            _ => {+                let ab = midpoint(vertices, a, b);+                let bc = midpoint(vertices, b, c);+                let ca = midpoint(vertices, c, a);+                stack.push([a, ab, ca]);+                stack.push([ab, b, bc]);+                stack.push([ca, bc, c]);+                stack.push([ab, bc, ca]);+            }+        }+    }+    *indices = out;+}++#[cfg(test)]+mod tests {+    use super::*;++    fn area(v: &[f32], fpv: usize, idx: &[u32]) -> f32 {+        idx.chunks_exact(3)+            .map(|t| {+                let p = |i: u32| (v[i as usize * fpv], v[i as usize * fpv + 1]);+                let (a, b, c) = (p(t[0]), p(t[1]), p(t[2]));+                ((b.0 - a.0) * (c.1 - a.1) - (c.0 - a.0) * (b.1 - a.1)) * 0.5+            })+            .sum()+    }++    fn max_edge(v: &[f32], fpv: usize, idx: &[u32]) -> f32 {+        let len = |a: u32, b: u32| {+            let (a, b) = (a as usize * fpv, b as usize * fpv);+            ((v[a] - v[b]).powi(2) + (v[a + 1] - v[b + 1]).powi(2)).sqrt()+        };+        idx.chunks_exact(3)+            .flat_map(|t| [len(t[0], t[1]), len(t[1], t[2]), len(t[2], t[0])])+            .fold(0.0, f32::max)+    }++    #[test]+    fn short_geometry_is_left_untouched() {+        let mut v = vec![0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.1, 0.0];+        let mut i = vec![0, 1, 2];+        subdivide(&mut v, &mut i, 3, 0.25);+        assert_eq!(v.len(), 9);+        assert_eq!(i, vec![0, 1, 2]);+    }++    #[test]+    fn a_full_tile_quad_splits_to_the_limit_and_keeps_its_area_and_winding() {+        let mut v = vec![0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0];+        let mut i = vec![0, 1, 2, 0, 2, 3];+        let before = area(&v, 3, &i);+        subdivide(&mut v, &mut i, 3, 0.1);+        assert!(max_edge(&v, 3, &i) <= 0.1);+        assert!((area(&v, 3, &i) - before).abs() < 1e-5);+        // Every triangle keeps the original (positive) winding.+        for t in i.chunks_exact(3) {+            assert!(area(&v, 3, t) > 0.0);+        }+    }++    #[test]+    fn attributes_are_interpolated_linearly() {+        // Third float = 2x + 3y + 1 at every corner, so every new vertex must carry it too.+        let f = |x: f32, y: f32| 2.0 * x + 3.0 * y + 1.0;+        let mut v = vec![0.0, 0.0, f(0.0, 0.0), 1.0, 0.0, f(1.0, 0.0), 0.0, 1.0, f(0.0, 1.0)];+        let mut i = vec![0, 1, 2];+        subdivide(&mut v, &mut i, 3, 0.2);+        for p in v.chunks_exact(3) {+            assert!((p[2] - f(p[0], p[1])).abs() < 1e-5);+        }+    }++    #[test]+    fn neighbours_with_separate_vertices_split_a_shared_edge_identically() {+        // Two triangles sharing the diagonal (1,0)-(0,1) by position only, with different+        // third corners so their other edges split differently.+        let mut v = vec![+            0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, // A: 0 1 2+            1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 3.0, 3.0, 0.0, // B: 3 4 5+        ];+        let mut i = vec![0, 1, 2, 3, 4, 5];+        subdivide(&mut v, &mut i, 3, 0.3);+        let on_diagonal = |tri: &[u32]| -> Vec<(i64, i64)> {+            let mut pts: Vec<(i64, i64)> = tri+                .iter()+                .map(|&k| (v[k as usize * 3], v[k as usize * 3 + 1]))+                .filter(|(x, y)| (x + y - 1.0).abs() < 1e-6)+                .map(|(x, y)| ((x * 1e6).round() as i64, (y * 1e6).round() as i64))+                .collect();+            pts.sort_unstable();+            pts.dedup();+            pts+        };+        // Triangles from A have their centroid below the diagonal; B's lie above it.+        let side = |t: &[u32]| {+            let s: f32 = t.iter().map(|&k| v[k as usize * 3] + v[k as usize * 3 + 1]).sum();+            s / 3.0 < 1.0+        };+        let collect = |from_a: bool| {+            let mut pts: Vec<(i64, i64)> =+                i.chunks_exact(3).filter(|t| side(t) == from_a).flat_map(on_diagonal).collect();+            pts.sort_unstable();+            pts.dedup();+            pts+        };+        assert_eq!(collect(true), collect(false));+        assert!(collect(true).len() > 2);+    }++    #[test]+    fn the_edge_limit_loosens_with_zoom() {+        assert!(globe_max_edge(0) < 0.03);+        assert!(globe_max_edge(8) > globe_max_edge(0) * 10.0);+        assert!(globe_max_edge(8) <= 1.0);+    }+}
library/map/src/main/rust/src/tile/geometry/build.rs
diff --git a/library/map/src/main/rust/src/tile/geometry/build.rs b/library/map/src/main/rust/src/tile/geometry/build.rsindex 131e3ea19a..e5d7afcc12 100644--- a/library/map/src/main/rust/src/tile/geometry/build.rs+++ b/library/map/src/main/rust/src/tile/geometry/build.rs@@ -8,7 +8,7 @@ use super::split::split_t; use super::terrain::{drape_vertices, terrain_mesh, tile_ground_width_m}; use super::traffic::{traffic_meshes, traffic_present}; use crate::style::{GatedSummary, KindFilter, Layer, LayerKind, LayerToggles, Toggle, ToggleStamp};-use crate::tess::{fill, ribbon, stroke};+use crate::tess::{fill, ribbon, stroke, subdivide}; use crate::tile::select::ANCESTOR_DEPTH; use crate::tile::symbol; use crate::tile::taper;@@ -384,6 +384,31 @@ pub fn build_toggled(             }         } +        // Globe zooms: the globe shaders bend only vertices, so long edges must be split or+        // they cut chords through the ball. Before draping, so new vertices get their own height.+        if z <= crate::camera::GLOBE_FLAT_THRESHOLD as u8 {+            let max_edge = subdivide::globe_max_edge(z);+            match layer.kind {+                LayerKind::Fill => subdivide::subdivide(+                    &mut vertices,+                    &mut indices,+                    fill::FLOATS_PER_VERTEX,+                    max_edge,+                ),+                LayerKind::Line => {+                    subdivide::subdivide(+                        &mut vertices,+                        &mut indices,+                        stroke::FLOATS_PER_VERTEX,+                        max_edge,+                    );+                    for (_, v, i) in coloured.iter_mut() {+                        subdivide::subdivide(v, i, stroke::FLOATS_PER_VERTEX, max_edge);+                    }+                }+                LayerKind::Symbol => {}+            }+        }         // Drape the layer's flat geometry onto the relief where the tile carries a         // heightmap; without one the tessellators' z=0 stands and output is unchanged.         // Done once per mesh, not per feature, so accumulated vertices are walked once.
library/map/src/main/rust/src/vulkan/pipeline/pipelines.rs
diff --git a/library/map/src/main/rust/src/vulkan/pipeline/pipelines.rs b/library/map/src/main/rust/src/vulkan/pipeline/pipelines.rsindex 142adc81e3..d645631b25 100644--- a/library/map/src/main/rust/src/vulkan/pipeline/pipelines.rs+++ b/library/map/src/main/rust/src/vulkan/pipeline/pipelines.rs@@ -249,7 +249,7 @@ impl Pipelines {         );         // Globe labels + icons: the globe vertex shader on the billboard format,         // paired with the glyph and sprite fragment shaders respectively, through-        // the atlas layout. Depth-tested so far-side labels lose to the ball.+        // the atlas layout. Depth off, like the flat symbols.         let (symbol_globe, icon_globe) = super::pipelines_symbols::globe_symbol_pipelines(             device,             symbol_layout,@@ -262,12 +262,10 @@ impl Pipelines {             cache,         ); -        // Globe variants: same vertex formats as their flat twins, depth-tested-        // (TestWrite, LESS) so the near hemisphere occludes the far side and-        // coarser ancestors lose to finer descendants drawn later. The globe-        // shaders bend tile-local geometry onto the ball and write depth =-        // 1 - z (limb 0, sub-camera point ~1); with the pass cleared to 1.0,-        // nearer (larger z) wins the LESS test.+        // Globe variants: same vertex formats and depth-off state as their flat+        // twins. The shaders bend tile-local geometry onto the ball and discard+        // the far side, so layer order composites exactly as on the flat map+        // (see `pipelines_globe`).         let (fill_globe, line_globe, ribbon_globe) = super::pipelines_globe::globe_pipelines(             device,             layout,
library/map/src/main/rust/src/vulkan/pipeline/pipelines_extra.rs
diff --git a/library/map/src/main/rust/src/vulkan/pipeline/pipelines_extra.rs b/library/map/src/main/rust/src/vulkan/pipeline/pipelines_extra.rsindex 70c9844e1f..66a31316ce 100644--- a/library/map/src/main/rust/src/vulkan/pipeline/pipelines_extra.rs+++ b/library/map/src/main/rust/src/vulkan/pipeline/pipelines_extra.rs@@ -46,20 +46,20 @@ pub struct Pipelines {     /// vertex shader collapses the grid to the flat footprint, so the overhead map is unchanged.     pub terrain: vk::Pipeline,     /// Globe fill: `fill_globe.vert`/`fill_globe.frag` on the fill vertex format,-    /// depth-tested so the near hemisphere wins over the far side and coarser-    /// ancestors lose to finer descendants. Drawn instead of [`fill`](Self::fill)-    /// while the globe is active; the flat pipeline is never bound then.+    /// depth off like [`fill`](Self::fill) (the fragment stage discards the far+    /// side). Drawn instead of [`fill`](Self::fill) while the globe is active; the+    /// flat pipeline is never bound then.     pub fill_globe: vk::Pipeline,     /// Globe line: `line_globe.vert`/`line_globe.frag` on the stroke vertex format,-    /// depth-tested like [`fill_globe`](Self::fill_globe). Drawn instead of+    /// depth off like [`fill_globe`](Self::fill_globe). Drawn instead of     /// [`line`](Self::line) while the globe is active.     pub line_globe: vk::Pipeline,     /// Globe ribbon: `road_surface_globe.vert`/`.frag` on the ribbon vertex format,-    /// depth-tested like [`fill_globe`](Self::fill_globe). Drawn instead of+    /// depth off like [`fill_globe`](Self::fill_globe). Drawn instead of     /// [`ribbon`](Self::ribbon) while the globe is active.     pub ribbon_globe: vk::Pipeline,     /// Globe symbols + icons: `symbol_globe.vert` with the glyph and sprite fragment-    /// shaders, on the billboard vertex format, depth-tested so far-side labels lose.+    /// shaders, on the billboard vertex format, depth off like the flat symbols.     /// Drawn instead of [`symbol`](Self::symbol)/[`icon`](Self::icon) on the globe.     pub symbol_globe: vk::Pipeline,     pub icon_globe: vk::Pipeline,
library/map/src/main/rust/src/vulkan/pipeline/pipelines_globe.rs
diff --git a/library/map/src/main/rust/src/vulkan/pipeline/pipelines_globe.rs b/library/map/src/main/rust/src/vulkan/pipeline/pipelines_globe.rsindex eb76958d9b..9232573e51 100644--- a/library/map/src/main/rust/src/vulkan/pipeline/pipelines_globe.rs+++ b/library/map/src/main/rust/src/vulkan/pipeline/pipelines_globe.rs@@ -1,9 +1,12 @@-//! Globe pipelines: the depth-tested fill/line/ribbon variants that bend-//! tile-local geometry onto the orthographic sphere.+//! Globe pipelines: the fill/line/ribbon variants that bend tile-local geometry+//! onto the orthographic sphere. //!-//! Split from `pipelines.rs` (file-length limit). Same vertex formats as the-//! flat twins; depth 1 - z (sub-camera point 0, limb 1) with the pass cleared-//! to 1.0, so nearer (larger z) wins the LESS test.+//! Split from `pipelines.rs` (file-length limit). Same vertex formats and the+//! same depth-off state as the flat twins: the visible hemisphere of an+//! orthographic sphere never overlaps itself on screen and the fragment stages+//! discard the far side, so layer order composites exactly as on the flat map.+//! A depth test would only make coplanar layers fight, because each triangle's+//! interpolated depth is a chord whose sag depends on how it was tessellated. use super::assemble::build; use super::state::{Depth, Stencil}; use crate::tess::{fill, stroke};@@ -49,7 +52,7 @@ pub(super) fn globe_pipelines(                 (fill::FLOATS_PER_VERTEX * 4) as u32,                 fill_attributes,                 Stencil::Ignore,-                Depth::TestWrite,+                Depth::Off,                 cache,             ),             build(@@ -62,7 +65,7 @@ pub(super) fn globe_pipelines(                 (stroke::FLOATS_PER_VERTEX * 4) as u32,                 line_attributes,                 Stencil::Ignore,-                Depth::TestWrite,+                Depth::Off,                 cache,             ),             build(@@ -75,7 +78,7 @@ pub(super) fn globe_pipelines(                 (crate::tess::ribbon::FLOATS_PER_VERTEX * 4) as u32,                 ribbon_attributes,                 Stencil::Ignore,-                Depth::TestWrite,+                Depth::Off,                 cache,             ),         )
library/map/src/main/rust/src/vulkan/pipeline/pipelines_symbols.rs
diff --git a/library/map/src/main/rust/src/vulkan/pipeline/pipelines_symbols.rs b/library/map/src/main/rust/src/vulkan/pipeline/pipelines_symbols.rsindex aeed38fd86..405d9c1cf4 100644--- a/library/map/src/main/rust/src/vulkan/pipeline/pipelines_symbols.rs+++ b/library/map/src/main/rust/src/vulkan/pipeline/pipelines_symbols.rs@@ -80,8 +80,9 @@ pub(super) fn symbol_pipelines(  /// Build the (symbol_globe, icon_globe) pair: the globe vertex shader on the /// billboard format, paired with the glyph and sprite fragment shaders-/// respectively, through the atlas layout. Depth-tested so far-side labels-/// lose to the ball.+/// respectively, through the atlas layout. Depth off like the flat symbols: a+/// far-side anchor collapses its quad to a point, and a depth test would clip+/// overlapping glyph edges and the label beside an icon, which share a depth. #[allow(clippy::too_many_arguments)] pub(super) fn globe_symbol_pipelines(     device: &ash::Device,@@ -107,7 +108,7 @@ pub(super) fn globe_symbol_pipelines(                 (symbol::FLOATS_PER_VERTEX * 4) as u32,                 symbol_billboard_attributes,                 Stencil::Ignore,-                Depth::TestWrite,+                Depth::Off,                 cache,             ),             build(@@ -120,7 +121,7 @@ pub(super) fn globe_symbol_pipelines(                 (symbol::ICON_FLOATS_PER_VERTEX * 4) as u32,                 symbol_billboard_attributes,                 Stencil::Ignore,-                Depth::TestWrite,+                Depth::Off,                 cache,             ),         )