Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background is not properly tiled and blurry #1650

Open
Nekzuris opened this issue Dec 20, 2024 · 1 comment
Open

Background is not properly tiled and blurry #1650

Nekzuris opened this issue Dec 20, 2024 · 1 comment
Labels
feature-renderer Issue or request related to the renderer / WebGL

Comments

@Nekzuris
Copy link

Description

I noticed that the tiles are very blurry and not properly tiled, not a big deal with real imagery, but quite noticeable with text like Mapnik Carto.

With canary the blur is almost gone but still not properly tiled.

I haven’t yet looked at the renderer code, but you probably just need to remove a small scale factor applied on every tiles.
This scale factor is typically used to hide gaps between tiles on Chrome due to this bug but might no longer be necessary and is definitely not needed on Firefox.

For reference I've done this for iD openstreetmap/iD#10594

Screenshots

Blurry and visible tiles on rapid
rapid line
Sharp and properly tiled with leaflet
osm
https://www.openstreetmap.org/#map=18/48.272140/7.052858

Version

2.4.3

What browser are you seeing the problem on? What version are you running?

Firefox v133.0

The OS you're using

win

Steps to reproduce

Open the editor and look closely (hide data layer).

The browser URL at the time you encountered the bug

https://rapideditor.org/edit#map=18.00/48.27224/7.05398&background=MAPNIK&datasets=fbRoads,msBuildings&disable_features=boundaries

The auto-detected useragent string for your browser (leave blank if you're manually filling this form out)

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0

@bhousel
Copy link
Contributor

bhousel commented Dec 20, 2024

Thanks for reporting @Nekzuris - we can look into it.
The way Rapid renders tiles is very different than how iD and Leaflet renders them, so there might not be much that we can do.

iD and Leaflet create a slippy map of img elements, and as you found Chrome sometimes rounds the dimensions of these incorrectly, that's why I added that small epsilon to close the seams a long time ago.

Rapid actually packs the image data into an atlas texture and uploads these images to the GPU. We can render the tiles at exactly the correct size, however we offset the texture coordinates by half a pixel so that the texture doesn't bleed into neighboring images in the atlas - this is probably what is causing the blurriness. It will always be a very tiny bit blurry, but there should never be seams from neighboring textures or empty parts of the atlas.

@bhousel bhousel added the feature-renderer Issue or request related to the renderer / WebGL label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-renderer Issue or request related to the renderer / WebGL
Projects
None yet
Development

No branches or pull requests

2 participants