Show HN: 3D map of shade around the world
shademap.app
Show HN: 3D map of shade around the world
1–10 of 72 posts
Re: Show HN: 3D map of shade around the world
#2Re: Show HN: 3D map of shade around the world
#3Hi HN. I've been learning WebGL and working on this project for about a year. I posted it previously when it worked in 2D and wanted to share it again because the 3D really makes the shade come to life. Most of the credit for the update due to migrating from Leaflet to Mapbox GL JS.
Re: Show HN: 3D map of shade around the world
#4Hi HN. I've been learning WebGL and working on this project for about a year. I posted it previously when it worked in 2D and wanted to share it again because the 3D really makes the shade come to life. Most of the credit for the update due to migrating from Leaflet to Mapbox GL JS.
How do the calculations go so smoothly? I mean for each pixel that is potentially in the shade there can be a many 'upstream' pixels in the direction that the light is coming from that could cause it to be shady if there was something high there. Doing that calculation for each pixel seems very intensive, or is it achieved in some other way?
Re: Show HN: 3D map of shade around the world
#5Re: Show HN: 3D map of shade around the world
#6Great work, runs very smoothly! Where do you do the shadow calculation? Do you have precomputed tilesets or do you do it on the client?
It also takes into account the Earth's curvature, so you can zoom out to planet level and it still works.
Re: Show HN: 3D map of shade around the world
#7Hi HN. I've been learning WebGL and working on this project for about a year. I posted it previously when it worked in 2D and wanted to share it again because the 3D really makes the shade come to life. Most of the credit for the update due to migrating from Leaflet to Mapbox GL JS.
Looks great, congrats. Dragging a very zoomed out view back and forth is also quite mesmerizing e.g. https://shademap.app/#39.70557,-113.85396,4.52593z,164148075... How do the calculations go so smoothly? I mean for each pixel that is potentially in the shade there can be a many 'upstream' pixels in the direction that the light is coming from that could cause it to be shady if there was something high there. Doing th…
Re: Show HN: 3D map of shade around the world
#8Great work, runs very smoothly! Where do you do the shadow calculation? Do you have precomputed tilesets or do you do it on the client?
On the client. A WebGL shader that ray traces each pixel towards the sun. If the ray hits terrain on the way, the pixel will be in the shade. It also takes into account the Earth's curvature, so you can zoom out to planet level and it still works.
By the way, you might like https://felixpalmer.github.io/volcanoes-of-japan/
Re: Show HN: 3D map of shade around the world
#9Hi HN. I've been learning WebGL and working on this project for about a year. I posted it previously when it worked in 2D and wanted to share it again because the 3D really makes the shade come to life. Most of the credit for the update due to migrating from Leaflet to Mapbox GL JS.
Re: Show HN: 3D map of shade around the world
#10Also (bug report) it seems to be a little buggy on Safari on MacOS when you zoom out, it gets quite glitchy.