Opaque pass layers do not render correctly over heatmap + fill-extrusion layers
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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