Orthographic mode: 3D content is clipped at high zoom levels
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
v3.18.1
### Browser and version
Chrome 143.0.7499.193
### Expected behavior
When using orthographic projection (camera-projection: "orthographic"), the internal camera altitude decreases as zoom increases. This causes the near clipping plane to move down with the camera, clipping 3D objects that end up "behind" the camera's position.
In orthographic projection, the camera's altitude shouldn't affect the visible scene—zoom is controlled by frustum width/height. However, the current implementation moves the camera closer to terrain as you zoom in, and objects above the camera's altitude get clipped by the near plane.
In orthographic mode, objects at any altitude should remain visible regardless of zoom level.
### Actual behavior
- At low zoom: 3D objects at various altitudes render correctly
- At high zoom: The camera descends toward terrain level, and objects above the camera get clipped by the near plane
Please note that this issue affects not only Mapbox's native layers but also any custom layer that shares Mapbox's WebGL context and depth buffer (e.g., Three.js, regl, or raw WebGL).
### Link to the demonstration
https://www.loom.com/share/27c7ee0d16884670a371950f063ca31c
### Steps to trigger the unexpected behavior
- go to mapbox studio
- create a style with a fill-extrusion layer
- zoom into the layer and see how it disappears at high zoom levels
### Relevant log output
```shell
```
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
Reproduce the issue in Mapbox Studio with an orthographic projection and a fill-extrusion layer, then trace how zoom changes camera altitude and the near clipping plane. The fix is done when 3D objects at any altitude remain visible at high zoom, including objects from custom layers sharing Mapbox's WebGL context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100