mapbox / mapbox/mapbox-gl-js

Opaque pass layers do not render correctly over heatmap + fill-extrusion layers

Open
#5,831 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Layers drawn during the opaque pass (opaque background + opaque fill layers) cannot render correctly above offscreen texture-based layers (heatmap + fill-extrusion layers): they expect layers "under" them in the layer stack, drawn after them, to use depth testing. When rendering heatmap and fill-extrusion textures back to the map, depth testing is turned off, but it's not as simple as turning depth testing on because projections are done in the offscreen pass, so in the translucent pass the texture copies use a very simple viewport matrix, not the same projection matrices as the rest of the layers, so their depth comparison values wouldn't be relevant anyway. As in https://github.com/mapbox/mapbox-gl-js/issues/2074, a workaround is to set the opaque layers' opacity to 0.99 so as to render them in the translucent pass, but the better fix would be to eliminate the opaque pass (https://github.com/mapbox/mapbox-gl-js/issues/2074#issuecomment-293433951).

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

No files or tests are named in the issue. Start by tracing the opaque and translucent passes, the offscreen heatmap and fill-extrusion texture rendering, and their depth-testing behavior, then review issues #2074 and its linked comment; done means these layers render correctly without relying on the 0.99 opacity workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.