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

some hillshade rendering issues #506

Open
farfromrefug opened this issue Jun 27, 2022 · 6 comments
Open

some hillshade rendering issues #506

farfromrefug opened this issue Jun 27, 2022 · 6 comments

Comments

@farfromrefug
Copy link
Contributor

Hi,
I am working again on hillshading. The reasoning is to make smaller hillshade mbtiles with a better rendering.
For reference the technique used is this https://medium.com/@frederic.rodrigo/optimization-of-rgb-dem-tiles-for-dynamic-hill-shading-with-mapbox-gl-or-maplibre-gl-55bef8eb3d86

Now in the process of working on this i discovered rendering issues with hillshading in carto. It does not only happen with optimised mbtiles.
So until maxzoom it draws fine.
But when i start to overzoom i start to see some errors in some areas. And when i zoom a lot it goes into "line" mode.
What bugs me the most is the artifacts appearing in some regions.
As a comparaison in the last screenshots, it works just fine in mabpox.

I wondering if it comes from the fact that carto creates a "normal" image before rendering it with a shader. I think mapbox does it all in a shader.
TBH i am a bit lost with the whole tile(image) processing in carto for now. Wondering, while overzooming, is the normal map created on a scaled image or on the original image?

Screenshot 2022-06-27 at 11 02 58

Screenshot 2022-06-27 at 11 03 08

Screenshot 2022-06-27 at 11 03 20

Screenshot 2022-06-27 at 11 03 28

Screenshot 2022-06-27 at 11 03 37

Screenshot 2022-06-27 at 11 03 43

@mtehver
Copy link
Contributor

mtehver commented Jun 28, 2022

@farfromrefug I think I may know the reason here - SDK automatically upscales bitmaps after 'maxzoom' is reached. In case of hillshading, this may cause artifacts and should be likely implemented differently. I need to think about this a bit more, though.

@farfromrefug
Copy link
Contributor Author

farfromrefug commented Jul 1, 2022

@mtehver i tested your changes and it works perfectly.
I had to make a quick fix on exageration though.On overzoom exageration was "increasing"
Akylas@b07c869
I did not create a PR cause my code there is different. Let me know if you want me to create one

Thanks!!!!!

EDIT: i am not sure if it a regression. But i see my app hanging when i quickly zoom in/out. Not happening without hillshade. Will try to run some test with older versions. Do you have any idea?
PS: i can share hillshade mbtiles if you need

@farfromrefug
Copy link
Contributor Author

@mtehver i can confirm your last changes on hillshade made the app much slower. It keeps on hanging. I rollback to a build before and it is smooth again. Haven´t looked at the code yet to see what might be happening

@mtehver
Copy link
Contributor

mtehver commented Aug 2, 2022

@farfromrefug Is this noticeable at all zoom levels? Processing became more expensive at 'overzoomed' tiles, for other tiles should be roughly the same. I will see if this can be optimized.

@farfromrefug
Copy link
Contributor Author

@mtehver i would say all but I need to test further.

@farfromrefug
Copy link
Contributor Author

@mtehver i compared with all framework and the difference is obvious. It is much slower whatever the zoom level, even not overzoomed

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