Prevent terrain hole when DEM tiles are loading
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: 2.0.0 and above
With terrain on, the background layer is draped and always rendering on 3d extruded geometry. This may lead to visual artifacts and see through holes when terrain is pending to load DEM data for a few frames. When the horizon is visible, this leads to seeing the face of the skybox below, and when the horizon is not visible, we are not rendering the skybox and potentially leaving those pixels transparent ([default clear color](https://github.com/mapbox/mapbox-gl-js/blob/c7ed000f6d628531e0620df9d141dd6e2237477e/src/render/painter.js#L464)).
A few things that would help with this issue:
- When terrain is on, use the background color as the clear color to prevent transparent pixels (background with patterns would not be rendered but this would prevent leaving those pixels blank)
- Render the skybox face below ground with a constant background color to account for background color when the horizon is visible
- Extend skirt up to MSL until neighboring tile is loaded
References for this issue:
https://user-images.githubusercontent.com/7061573/106061572-629b8c00-60aa-11eb-97a8-a39a367b8cbc.mov
https://user-images.githubusercontent.com/7061573/106061658-924a9400-60aa-11eb-9c97-8cb68b4c1e98.mov
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
Start by reproducing the terrain-loading case described in the issue, then inspect the referenced src/render/painter.js clear-color logic alongside the terrain and skybox rendering paths. Done means no visible terrain holes or transparent pixels while DEM tiles load, including with and without a visible horizon.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100