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
In order to compute slope, you use the surrounding 8 pixels. Mapbox GL JS assembles this by backfilling from neighboring tiles. This is annoying and tricky, so instead I'll just handle exporting 260px/516px tiles from dem-mosaic-tiler
See kylebarron/serverless-slope#6 for a working pure-numpy implementation. See also the Mapbox GL JS hillshading shader code.
Latitude correction
Don't forget you need the pixel size (meters per pixel). In the linked issue I got that from rasterio, but you need to compute it based solely on the zoom level. Look to Mapbox's code.
Mipmaps?
Mipmaps don't work for non-power-of-2 textures I think. So
Do you need mipmaps for rendering? Not sure exactly what mipmaps do... just make it faster to render?
If so, it might be ideal to pass the 260x260px texture to the initial framebuffer pass, and then copy (blit?) the inner 256x256px to the next texture for rendering. Ref Explore using Framebuffers #20.
The text was updated successfully, but these errors were encountered:
Handle 260px input
In order to compute slope, you use the surrounding 8 pixels. Mapbox GL JS assembles this by backfilling from neighboring tiles. This is annoying and tricky, so instead I'll just handle exporting 260px/516px tiles from dem-mosaic-tiler
https://github.com/mapbox/mapbox-gl-js/blob/cfeff87b2f16fdd8480d7b760d9c19f4accb7485/src/shaders/hillshade_prepare.vertex.glsl#L9-L15
Algorithm
See kylebarron/serverless-slope#6 for a working pure-numpy implementation. See also the Mapbox GL JS hillshading shader code.
Mipmaps?
Mipmaps don't work for non-power-of-2 textures I think. So
The text was updated successfully, but these errors were encountered: