You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Small-radius heatmap flickers when moving the map #5563
@mourner the effect sort of reminds me of something I ran into in fill-extrusion layers in gl-native, where sometimes the depth buffer resolution was too low (mapbox/mapbox-gl-native#8431 (comment)), causing jagged edges on the sides of extrusions; we fixed this by setting the near clip plan in the fill-extrusion layer projection matrix to 100 so as not to waste a lot of precision on shapes extremely close to the camera (mapbox/mapbox-gl-native@72278bf). Not sure if this is relevant to what's going on here, but 🤷♀️
I don't think this is as much a "further distances" problem as much as a "small radius" problem. Radii above 5 seems to behave well. Radii 3 and under seem to flicker.
Agree with @wysisoft, there is no need to pitch a heatmap to trigger the bug. This GIF is just the official example zoomed out so that heatmap-radius = 2.
I can confirm that this is reproducible in our debug heatmap page as well, if you lower the heatmap-radius to <= 2. I'm not very familiar with the heatmap code though. @mourner does this new information point to a potential cause? could it be related to texture filtering a la #8738?
This is an aliasing issue caused by too low texture resolution in heatmap rendering. Information is lost when the heatmap is rendered to an offscreen texture that has 1/16 size of the viewport. Here's an another example of the bug:
A quick and dirty fix would be to increase the texture resolution to 1:1, but I think the issue is deeper in the heatmap implementation. Here's a heatmap with 1:1 resolution:
Related pull request: #8975
changed the title [-]Further distances on pitched heatmaps "flicker" on every frame[/-][+]Small-radius heatmap flickers when moving the map[/+]on Aug 25, 2020
Activity
mourner commentedon Oct 31, 2017
Wow, not sure what's going on there....
lbud commentedon Oct 31, 2017
@mourner the effect sort of reminds me of something I ran into in fill-extrusion layers in gl-native, where sometimes the depth buffer resolution was too low (mapbox/mapbox-gl-native#8431 (comment)), causing jagged edges on the sides of extrusions; we fixed this by setting the near clip plan in the fill-extrusion layer projection matrix to 100 so as not to waste a lot of precision on shapes extremely close to the camera (mapbox/mapbox-gl-native@72278bf). Not sure if this is relevant to what's going on here, but 🤷♀️
wysisoft commentedon Feb 23, 2019
I don't think this is as much a "further distances" problem as much as a "small radius" problem. Radii above 5 seems to behave well. Radii 3 and under seem to flicker.
pathmapper commentedon Nov 9, 2019
Agree with @wysisoft, there is no need to pitch a heatmap to trigger the bug. This GIF is just the official example zoomed out so that
heatmap-radius = 2.ryanhamley commentedon Nov 11, 2019
Thanks for pointing out what's going on here @pathmapper and @wysisoft
I can confirm that this is reproducible in our debug heatmap page as well, if you lower the
heatmap-radiusto <= 2. I'm not very familiar with the heatmap code though. @mourner does this new information point to a potential cause? could it be related to texture filtering a la #8738?mpulkki-mapbox commentedon Nov 15, 2019
This is an aliasing issue caused by too low texture resolution in heatmap rendering. Information is lost when the heatmap is rendered to an offscreen texture that has 1/16 size of the viewport. Here's an another example of the bug:


A quick and dirty fix would be to increase the texture resolution to 1:1, but I think the issue is deeper in the heatmap implementation. Here's a heatmap with 1:1 resolution:
Related pull request: #8975
[-]Further distances on pitched heatmaps "flicker" on every frame[/-][+]Small-radius heatmap flickers when moving the map[/+]