mapbox / mapbox/mapbox-maps-ios

Flickering occlusion of Metal CustomLayer by terrain

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

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Xcode version: 16.3
- iOS version:
- Devices affected: iPhones, iPad, Macs
- Maps SDK Version: 11.11.0+ and 11.12.beta.1

## Observed behavior and steps to reproduce

Occlusion by terrain does product a flickering issue with metal custom layer with `depthCompareFunction = .less`

## Expected behavior

Terrain should occlude the metal layer like any other layer when the metal layer depth stencil descriptor is set to .less.

## Notes / preliminary analysis

We have a flickering correct/wrong display of the intersection of our Metal CustomLayer with the terrain like shown on the video below. We tried the same example with only 2 triangles forming a rectangle with the same effect. (depth map and

An interesting note maybe, as it could very well be connected to the same source problem: occlusion by near or far mountains does also flickers between correct (mountains correctly occluding the part of the track being hidden by them) and wrong (track visible in totality).

## Additional links and references

https://github.com/user-attachments/assets/353d528a-24a2-4afb-a1c3-da3a814258db

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

Start by reproducing the reported terrain occlusion flicker with a Metal CustomLayer using depthCompareFunction = .less on the listed Maps SDK versions, referring to the attached video. Compare the custom layer and terrain intersection, including near and far mountains; done means terrain consistently occludes the layer without alternating between correct and incorrect display.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
computer-graphics, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.