mapbox / mapbox/mapbox-gl-js

Toggling 3d terrain causes render order issues

Open
#10,997 1 comment 0 reactions 1 assignee View on GitHub

@karimnaaji is already working on this.

Since Nov 19, 2021.

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.1

**browser**: Chrome 93 / Firefox 92

### Steps to Trigger Behavior

1. Open provided jsbin
2. Wait for 10 seconds while the script disables & re-enables terrain
3. Scroll in / out & move around an observe flashing / render issues. It is possible to get permanent render order issues as per linked screenshot but can be tricky.

### Link to Demonstration

https://output.jsbin.com/jiticep

### Expected Behavior

I should be able to toggle the terrain layer as many times as I wish and the behaviour should not change.

### Actual Behavior

After the terrain layer has been enabled once, disabling it then enabling it again causes render order issues. In the linked example there is a incomplete raster tileset (with lots of partial tiles) which seems to make this issues much more likely to occur. But I have reproduced it with just the satellite layer so I it doesn't seem that is the only reason it occurs.

In our actual application we are updating the map a lot more so we get a consist flicker of the tiles:

![Kapture 2021-09-08 at 08 58 23](https://user-images.githubusercontent.com/641520/132410044-9168d91c-e7bc-44d4-ba6e-623286d4209b.gif)

Screenshot from jsbin showing ordering issues which don't go away:

![image](https://user-images.githubusercontent.com/641520/132409015-c875f09d-b7c2-42c3-90e5-fff196f34d76.png)

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.