[Question] 3D models rendered behind buildings when changing camera pitch or bearing
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**: 3.12.0
### Question
Hi, and thank you for maintaining Mapbox GL JS.
Before writing this, I looked through the documentation and Stack Overflow, but I couldn't find a solution related to the problem I'm experiencing.
It may be that I used the wrong search terms, but I still wanted to ask here because the issue seems related to how Mapbox GL JS works internally.
---


The problem is that depending on the camera's pitch or bearing, the same model is sometimes rendered **behind** nearby buildings,
even though the model should appear **above** them.
From one angle, the model appears correctly floating in the air.
But from another angle, it becomes hidden or overlaps incorrectly with surrounding geometry.
---
Is there a known workaround or best practice to prevent this?
Any advice would be appreciated!
### Links to related documentation
- https://docs.mapbox.com/mapbox-gl-js/example/add-3d-model/
- https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#model
- https://docs.mapbox.com/help/tutorials/custom-markers-gl-js/
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 with the linked add-3d-model example and the model layer style specification, then reproduce the behavior while changing camera pitch and bearing. Compare the model and building rendering from multiple angles; done means identifying a supported workaround or clearly documenting the remaining rendering limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- computer-graphics, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100