mapbox / mapbox/mapbox-gl-js

Issue when using stencil buffer inside CustomLayer

Open
#9,851 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle: needs investigation :mag:
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

![image](https://user-images.githubusercontent.com/158421/86795665-16392200-c06e-11ea-867b-7029cfc27589.png)

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.