Open larsmaxfield opened 2 months ago
This is also a visual issue with hillshading, because the sharp discontinuities are shaded very heavily as they are essentially steep cliffs.
One solution is to have a new hillshade layer — "raking light" — which adopts the hillshade approach but additionally checks for NaNs (zeros) to determine how to shade. For example, when determining slope, it could checking the elevation. If zero (NaN), then the slope should be set to zero so that it doesn't get shaded.
Stretching/smearing occurs where NaNs (zeros) interface with real values:![image](https://github.com/larsmaxfield/maplibre-gl-js/assets/83759569/c6f3b6e8-5d31-476c-a5de-1858a66bd184)
This is annoying and should be improved at least from a visual appearance.
One possible route could be to check for non-zero neighbors to determine if extreme stretching occurs at the shader fragment, and then coloring it differently if true. This could be transparent, black, or even coloring it with the neighboring value color, based on the colormap.