4 ms·
Great work, runs very smoothly! Where do you do the shadow calculation? Do you have precomputed tilesets or do you do it on the client?
by pheelicks 5y ago
Great work, runs very smoothly! Where do you do the shadow calculation? Do you have precomputed tilesets or do you do it on the client?
- tppiotrowski 5y agoOn 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.
- pheelicks 5y agoImpressive performance, I remember trying this technique a while back a the number of steps required made the frame rate drop. Is the code public? By the way, you might like https://felixpalmer.github.io/volcanoes-of-japan/ https://felixpalmer.github.io/volcanoes-of-japan/
- tppiotrowski 5y agoSorry, code is not public. My initial business model was to offer the shade layer as a drop in for any Leaflet, Mapbox, Google Map so companies like AllTrails, Strava, Gaia GPS could use it in their apps but selling's hard. Now I'm leaning a bit towards just releasing an app with offline mode. Great link, thanks. Horizontal scrollbar tripped me out a little bit though...