mapbox / mapbox/mapbox-gl-js

Inconsistent display of fill-extrusion features on flat, custom terrain

Open
#10,950 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3d :triangular_ruler: bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

mapbox-gl-js version: 2.4.0

browser: Chrome

Steps to Trigger Behavior
  1. Set up custom terrain tiles with some flat, elevated area. Create a fill-extrusion layer with a stack of features to produce a building.
  2. Zoom in and out
  3. Observe that the floor heights glitch in and out.

If you look at my custom topo tiles, I've generated them for zoom levels 12, 13 and 14 and the area under this building should be perfectly flat (though elevated) in all of them:

Link to Demonstration

Here's a codepen: https://codepen.io/danvk/pen/vYmomJz

Expected Behavior

The building stays the same shape as you zoom in and out.

Actual Behavior

As I zoom in and out, the floors change height:

inconsistent-height

I can also sometimes trigger the same glitch by pitching the map, rather than zooming in and out:

glitch-pitch

Possibly related to #10536 and #10355.

I understand why this might happen if the building is placed on a hillside, but in this case the terrain is flat. So I'm not sure why Mapbox would be making different decisions about elevations or roofs depending on the zoom level.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report from the linked CodePen using the custom terrain tiles and stacked fill-extrusion features; vary zoom and pitch while comparing the flat elevated area across terrain zoom levels 12–14. Read related issues #10536 and #10355 first, and consider the report complete when the building’s floors retain the same shape while zooming or pitching.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.