You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hillshade and similar raster operations need neighboring pixels to compute each output pixel. Current examples are mostly per-pixel transforms so handling tile edges are not a major issue. Hillshading is different since slope/aspect at tile edges requires elevation values from adjacent tiles. Without "padded reads" or some form of neighbor backfilling visible grid lines will appear at the internal COG tile boundaries.
Small note on the Tangram/Mapzen link, they seem useful mostly for terrain styling ideas but not necessarily for runtime tile-boundary handling. In the post there's a description on computing normals from heightmaps but also a note that the normal maps can be precomputed offline and served as separate tiles (which moves the neighborhood/edge handling/problem into the tile-generation pipeline).
Summary from chat with @kylebarron:
Hillshade and similar raster operations need neighboring pixels to compute each output pixel. Current examples are mostly per-pixel transforms so handling tile edges are not a major issue. Hillshading is different since slope/aspect at tile edges requires elevation values from adjacent tiles. Without "padded reads" or some form of neighbor backfilling visible grid lines will appear at the internal COG tile boundaries.
Example with visible grid lines:
hillshade-example-2.mp4
Example branch: https://github.com/developmentseed/deck.gl-raster/tree/feat-hillshade-example
Useful sources from MapLibre:
maplibre-gl-js/src/data/dem_data.ts#L24-L27
maplibre-gl-js/src/data/dem_data.ts#L75-L92
maplibre-gl-js/src/data/dem_data.ts#L124-L151
Other useful resources:
Small note on the Tangram/Mapzen link, they seem useful mostly for terrain styling ideas but not necessarily for runtime tile-boundary handling. In the post there's a description on computing normals from heightmaps but also a note that the normal maps can be precomputed offline and served as separate tiles (which moves the neighborhood/edge handling/problem into the tile-generation pipeline).