Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker opacity changes before it's behind the mountain #2870

Closed
jashanbhullar opened this issue Jul 16, 2023 · 5 comments · Fixed by #3431
Closed

Marker opacity changes before it's behind the mountain #2870

jashanbhullar opened this issue Jul 16, 2023 · 5 comments · Fixed by #3431
Assignees
Labels
💰 bounty S Small Bounty, USD 100 bug Something isn't working PR is more than welcomed Extra attention is needed Terrain 3D

Comments

@jashanbhullar
Copy link

maplibre-gl-js version: latest/main branch

browser: Mozilla Firefox 114.0 20230605223242 20230605223242

Steps to Trigger Behavior

1.On your local branch npm start
2.Open 3d-Terrain.html
3.Add the following marker

        const marker = new maplibregl.Marker()
            .setLngLat([11.39067, 47.305513])
            .addTo(map);
  1. Change the angle so are somewhat looking at horizon, move close the mountain
  2. The opacity of the marker changes even before it's behind the mountains

Link to Demonstration

https://output.jsbin.com/vatekax#11.9/47.28354/11.40553/0/52
https://jsbin.com/vatekax/2/edit?html,output

Expected Behavior

The marker visibility should only change when completely behind the mountain

Actual Behavior

The opacity of the marker changes even before it's behind the mountains

Screencast.from.16-07-23.04.37.27.PM.IST.webm

Found when working on this: #1134
Might be related

@HarelM HarelM added bug Something isn't working PR is more than welcomed Extra attention is needed Terrain 3D 💰 bounty S Small Bounty, USD 100 labels Jul 16, 2023
@jashanbhullar jashanbhullar removed their assignment Aug 29, 2023
@SnailBones
Copy link
Contributor

@HarelM I'm interested in this

@HarelM
Copy link
Collaborator

HarelM commented Nov 29, 2023

Good luck!

@prozessor13
Copy link
Collaborator

Hi, i think the depthbuffer-check instead of coords-match-check will not solve this issue. This issue is caused, because only the marker-anchor is checked for visibility. There has to be done more visibility checks inside the Marker-Icon, and then decide if it is needed to hide the marker.
Same issue is at shader code for the symbol visibility check. I first checked the anchor, and if not visible, another check some pixels above:

float calculate_visibility(vec4 pos) {

@SnailBones
Copy link
Contributor

Thanks @prozessor13! I've implemented a second visibility check as you suggest in #3431.

@SnailBones
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💰 bounty S Small Bounty, USD 100 bug Something isn't working PR is more than welcomed Extra attention is needed Terrain 3D
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants