Issue when using stencil buffer inside CustomLayer
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**: v1.11.0
### Question
I am trying to use STENCIL_TEST inside CustomLayer and I have some weird rendering issues.
Not sure if I am doing something wrong or if it is a bug.
Here is the jsfiddle:
https://jsfiddle.net/k2bL34qd/11/
If I comment the line 71 (gl.enable(gl.STENCIL_TEST)), my layer is drawn on top of the map,
however if I uncomment the line, I start to see squares randomly appearing/disappearing.
Here is the screen recording that demonstrates the issue.
https://recordit.co/0DDjIndzkU

Any help or hint how to resolve it would be great!
### Links to related documentation
I adapted slightly this example:
https://docs.mapbox.com/mapbox-gl-js/example/custom-style-layer/
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 JSFiddle and the custom style layer example, reproducing the rendering difference with line 71 enabled and disabled. Compare the CustomLayer stencil behavior against the documented example and WebGL setup; done means the cause of the intermittent squares is identified and a concrete resolution or documentation update is established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100