Closed maxammann closed 1 year ago
Would it be better to draw the line and the tile separately, don't change the width of the line until the tile refreshes? This can avoid recalculation on the line during zooming.
The lines exist in "world space" that means that lines need to be scaled actually so they take the same amount of pixels independent of zoom.
This task is actually quite simple. We only need to multiply the line width a zoom_fraction which is already calculated in the code.
Currently the width of the debug lines depends on the zoom.
🤔 Expected Behavior
Lines should always have the same pixel-width on the screen.
😯 Current Behavior
The width changes.
💁 Possible Solution
Multiply the line width in the debug shader with a scaling factor: https://github.com/maxammann/maplibre-rs/blob/07bddd2a8c42f0cb906586f01eaaefb94dc34f7a/maplibre/src/render/shaders/tile.vertex.wgsl#L31