mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

Pixelated icons #16564

Open garfberg opened 3 years ago

garfberg commented 3 years ago

Hi,

Mapbox-gl-native version: 5.0.2 Platform: Debian Buster AMD64 Kernel: Linux map3 4.19.0-11-cloud-amd64 #1 SMP Debian 4.19.146-1 (2020-09-17) x86_64 GNU/Linux xvfb: 2:1.20.4-1+deb10u1 GPU: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1) with driver NVIDIA-Linux-x86_64-440.64

I am facing a problem with symbols which are randomly pixelated when generating tiles as png rasters. I tested it under Linux with software frame buffer (xvfb) or GPU (nvidia gtx 1070) via Xorg. This is more visible when using software rendering than the gpu card.

It looks like the problem described here: Fix pixelated icons #7302

Here is a screenshot of rendering done with xvfb: symbol_pixelated

On the first map, 256x256 with scale set to 1, the symbols are pixelated. On the second map, 256x256 with scale set to 2, the symbols are ok (but blurred as use the same sprite for both 1x and 2x)
On the third map, 512x512 with scale set to 1, the symbols are pixelated.

The sprite altas contains only integer offsets with pixel ratio to 1. Example: "museum": { "width": 23, "height": 32, "x": 457, "y": 32, "pixelRatio": 1, "visible": true }

I also checked the coordinates of the symbols and it looks good. Example: "coordinates":[2.34634,48.85602]

Is there something I missed ? Thanks.