Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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.



Impressive 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/


Sorry, 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...




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: