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

Issue with raster mbtiles with transparency #1605

Open
serhii-londar opened this issue Feb 16, 2024 · 8 comments
Open

Issue with raster mbtiles with transparency #1605

serhii-londar opened this issue Feb 16, 2024 · 8 comments

Comments

@serhii-londar
Copy link
Contributor

On latest version of WhirlyGlobe iOS SDK v 3.5 we found issue with raster tiles with transparency. The color looks very different from how it should be, comparing to other mbtiles viewers.
Here is example of what we have in the app vs MapTiler viewer:
IMG_3815
Screenshot 2024-02-16 at 02 17 30

The code is from GeographyClassTestCase.
What could be the reasons of that?
Thanks in advance.

@sjg-wdw
Copy link
Collaborator

sjg-wdw commented Feb 16, 2024

Looks like there's lighting involved in the WhirlyGlobe case. You could try turning that off.
Alpha can also be interpreted differently, depending on how it's being used.

@serhii-londar
Copy link
Contributor Author

serhii-londar commented Feb 16, 2024

@sjg-wdw How I can turn lighting off?
I've tried globeViewController?.clearLights() - but it doesn't help.

@sjg-wdw
Copy link
Collaborator

sjg-wdw commented Feb 16, 2024

clearLights should do it, yes. If you're in globe mode it should look different if it's working.

@serhii-londar
Copy link
Contributor Author

@sjg-wdw The result is the same.

@sjg-wdw
Copy link
Collaborator

sjg-wdw commented Feb 16, 2024

Strange, that looks like lighting to me.
In any case, I'd try a non-transparent overlay next to see if it matches what you expect. If it does, then the way the transparency is being processed is likely the problem. You might look at the shader (in the .metal file) to see if it's being multiplied through or not.

@serhii-londar
Copy link
Contributor Author

serhii-londar commented May 10, 2024

@sjg-wdw One more question. I found weird behavior when draw motiles with drawpriority > 1000.
Here is example with draw priority <= 400:
Simulator Screenshot - iPad (10th generation) - 2024-05-10 at 18 44 36

Here is with drawpriority > 400:
Simulator Screenshot - iPad (10th generation) - 2024-05-10 at 18 45 06

What can be the reason of black shadow around the images?

Also, it could be fixed by forceMinLevel = false.

@serhii-londar
Copy link
Contributor Author

@sjg-wdw Any thoughts?

@sjg-wdw
Copy link
Collaborator

sjg-wdw commented Jun 3, 2024

If you have a layer with transparency, then you can only display one level at once and you want to not force the min level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants