diff --git a/maplibre/src/render/shaders/mod.rs b/maplibre/src/render/shaders/mod.rs index 1e8c1b1c2..b9db2a654 100644 --- a/maplibre/src/render/shaders/mod.rs +++ b/maplibre/src/render/shaders/mod.rs @@ -64,6 +64,12 @@ impl Shader for TileMaskShader { format: wgpu::VertexFormat::Float32x4, shader_location: 7, }, + // zoom factor + wgpu::VertexAttribute { + offset: 4 * wgpu::VertexFormat::Float32x4.size(), + format: wgpu::VertexFormat::Float32, + shader_location: 9, + }, ], }], } diff --git a/maplibre/src/render/shaders/tile_debug.vertex.wgsl b/maplibre/src/render/shaders/tile_debug.vertex.wgsl index 5eb27e8c5..92cebd20f 100644 --- a/maplibre/src/render/shaders/tile_debug.vertex.wgsl +++ b/maplibre/src/render/shaders/tile_debug.vertex.wgsl @@ -12,6 +12,7 @@ fn main( @location(5) translate2: vec4, @location(6) translate3: vec4, @location(7) translate4: vec4, + @location(9) zoom_factor: f32, @builtin(vertex_index) vertex_idx: u32, @builtin(instance_index) instance_idx: u32 // instance_index is used when we have multiple instances of the same "object" ) -> VertexOutput { @@ -20,7 +21,7 @@ fn main( let target_width = 1.0; let target_height = 1.0; - let WIDTH = EXTENT / 1024.0; + let WIDTH = EXTENT * zoom_factor / 1024.0; var VERTICES: array, 24> = array, 24>( // Debug lines vertices